Skip to content

Commit

Permalink
Versão 0.0.5 Add pages and css bugs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-salmito committed Apr 13, 2020
1 parent b166aae commit 5bfc00c
Show file tree
Hide file tree
Showing 10 changed files with 724 additions and 101 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ function animeScroll() {
Basta clonar ou fazer o download do repositório e mexer a vontade.

## Histórico de lançamentos
* 0.0.5
* MUDANÇA: Correção do css (dashboar)
* ADIÇÃO: Adicionado as páginas de cadastro e edição de usuários
* 0.0.4
* ADIÇÃO: Adicionado o main do dashboard(Não finalizado)
* 0.0.3
Expand Down
203 changes: 201 additions & 2 deletions painel/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ html {
width: 25%;
}

.w10 {
width: 10%;
}

.left {
float: left;
}
Expand Down Expand Up @@ -258,8 +262,9 @@ header .logout a:hover {

.asside .assideMenu ul li {
font-size: 1.4rem;
padding: 1.0rem 2.0rem;
padding: .5rem 2.0rem;
transition: .3s ease-in;
text-transform: uppercase;
}

.asside .assideMenu ul li:hover {
Expand Down Expand Up @@ -306,6 +311,55 @@ header .logout a:hover {
padding: .5rem 1.0rem;
}

.content .msgError {
width: 250px;
height: 2.0rem;
line-height: 2.0rem;
background-color: #ccc;
position: absolute;
right: 0;
text-align: center;
background-color: rgba(255, 0, 0, 0.548);
}

.content .msgError i {
font-size: 1.4rem;
padding: .3rem 1.0rem;
float: left;
background-color: red;
color: white;
}

.content .msgError span {
color: white;
font-size: 1.4rem;
}

.content .msgSuccess {
width: 250px;
height: 2.0rem;
line-height: 2.0rem;
background-color: #ccc;
position: absolute;
right: 0;
text-align: center;
background-color: rgba(0, 128, 0, 0.548);
}

.content .msgSuccess i {
font-size: 1.4rem;
padding: .3rem 1.0rem;
float: left;
background-color: green;
color: white;
}

.content .msgSuccess span {
color: white;
font-size: 1.4rem;
}


.content .information {
margin: 1.5rem 0 2.0rem;
width: 100%;
Expand All @@ -321,7 +375,7 @@ header .logout a:hover {
}

.content .contentBox {
margin: 1.0rem 0;
margin: 1.0rem 0 0 0;
}

.content .contentBox .singleMetric {
Expand Down Expand Up @@ -391,7 +445,152 @@ header .logout a:hover {
cursor: pointer;
}

.content .contentBox .callBox {
text-align: left;
color: #343A40;
margin: 2.4rem 0 .3rem 2.0rem;
}


.content .contentBox .callBox i {
font-size: 2.4rem;
padding: .8rem 1.5rem;
transition: .5s ease;
}

.content .contentBox .callBox span {
font-size: 1.8rem;
}

.content .contentBox .tableBox {
width: 100%;
color: #343A40;
padding: 1.0rem;
}

.content .contentBox .tableBox .row {
width: 100%;
height: 2.0rem;
font-size: 1.2rem;
}

.content .contentBox .tableBox .row .col span a img {
width: 1.8rem;
}

.content .contentBox .tableBox .row:nth-of-type(1) {
line-height: 2.0rem;
border-bottom: 1px solid rgb(119, 133, 148);
font-size: 1.8rem;
margin-bottom: .5rem;
background-color: #17A2B8;
}

.content .contentBox .tableBox .row:nth-of-type(2n + 2) {
background-color: rgb(209, 209, 209);
}

.content .contentBox .tableBox .row i {
cursor: pointer;
transition: .5s ease;
}

.content .contentBox .callBox:hover i {
transform: scale(1.2);
}

.content .contentBox .tableBox .row i:hover {
transform: rotate(45deg);
}

.content .contentBox .cadUser {
text-align: left;
padding: 1.0rem;
color: #343A40;
}

.content .contentBox .cadUser .inputBox {
padding: 1.0rem;
}

.content .contentBox .cadUser .inputBox label {
display: block;
font-size: 1.8rem;
margin-bottom: .3rem;
}

.content .contentBox .cadUser .inputBox input {
width: 100%;
height: 4.0rem;
padding-left: 1.0rem;
line-height: 4.0rem;
border-radius: .3rem;
outline: none;
border: 1px solid #ccc;
font-size: 1.2rem;
}

.content .contentBox .cadUser .inputBox input:focus {
background-color: rgba(71, 76, 80, 0.363);
}

.content .contentBox .cadUser .inputBox input[type=submit] {
background-color: #343A40;
color: rgb(201, 205, 209);
font-size: 1.8rem;
transition: .8s ease;
}

.content .contentBox .cadUser .inputBox input[type=submit]:hover {
background-color: rgb(156, 159, 161);
color: #343A40;
}

.content .contentBox .cadUser .photoUserNow {
position: absolute;
right: 10%;
top: 40%;
transform: translateY(-50%);
}

.content .contentBox .cadUser .photoUserNow img {
width: 250px;
height: 250px;
border: 1px solid #343A40;
border-radius: 50%;
}

.content.on {
width: 100%;
left: 0;
}

[data-anime] {
opacity: 0;
transition: .8s ease;
}

[data-anime="warning"] {
transform: translate3d(250px, -50px, 0);
}

[data-anime="left"] {
transform: translate3d(-50px, 0, 0);
}

[data-anime="right"] {
transform: translate3d(50px, 0, 0);
}

[data-anime="top"] {
transform: translate3d(0, -50px, 0);
}

[data-anime="bottom"] {
transform: translate3d(0, 50px, 0);
}

[data-anime].animateContent {
transform: translate3d(0, 0, 0);
opacity: 1;
}
Binary file added painel/img/whatsapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions painel/js/animate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Script que contrala as animações da página principal
* Para utilizar basta adicionar na tag html o attr
* data-anime.
* Autor: Bruno Salmito Filizola
* Versão: 0.1
*/

/**
* Função para otimizar as animações
* @param {*} func (Passar a função para o debounce)
* @param {*} wait (O tempo que irá aguardar para executar novamente)
* @param {*} immediate
*/

function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this,
args = arguments;
var later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};

/**
* Função animeScroll
*/


/**
* Quando o usuário declarar o attributo data-anime ativa o scroll
* quando fizer o scroll executa as animações com o atributo
*/
const target = document.querySelectorAll('[data-anime]');

function animeScroll() {
const windowTop = window.pageYOffset + ((window.innerHeight * 3) / 4);
target.forEach(function (element) {
if ((windowTop) > element.offsetTop) {
//Adiciona a classe que controla a animação
element.classList.add('animateContent');
} else {
//Remove a classe que controla a animação
element.classList.remove('animateContent');
}
})
} //Fim da function animeScroll

animeScroll();
/**
* Verifica se existem as targets e se existir
* fica ouvindo o scrool otimizado com o debounce
*/
if (target.length) {
window.addEventListener('scroll', debounce(function () {
animeScroll();
}, 200));
}
56 changes: 56 additions & 0 deletions painel/js/mask.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Script para adicionar mascará nos formulários
* Para utilizar basta adicionar na tag html o attr
* data-input="NOME do Controle".
* Autor: Bruno Salmito Filizola
* Versão: 0.1
*/

//Objeto mask para adicionar maskara aos campos do formulário
const mask = {
cpf(value) {
return value
.replace(/\D/g, '')
//D somente números
//d somente letras
//g global
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d{1,2})/, '$1-$2')
.replace(/(-\d{2})\d+?$/, '$1')
},
cnpj(value) {
return value
//nao aceita nada além de número
.replace(/\D/g, '')
.replace(/(\d{2})(\d)/, '$1.$2')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d)/, '$1/$2')
.replace(/(\d{3})(\d{1,2})/, '$1-$2')
.replace(/(-\d{2})\d+?$/, '$1')
},
telefone(value) {
return value
.replace(/\D/g, '')
.replace(/(\d{2})(\d)/, '($1) $2')
.replace(/(\d{4})(\d)/, '$1-$2')
.replace(/(\d{4})-(\d)(\d{4})/, '$1$2-$3')
.replace(/(-\d{4,5})\d+?$/, '$1')

},
cep(value) {
return value
.replace(/\D/g, '')
.replace(/(\d{5})(\d)/, '$1-$2')
.replace(/(-\d{3})\d+?$/, '$1')
}
}

// Pega todos os inputs com data-input e chama o objeto
document.querySelectorAll('input').forEach(($input) => {
const field = $input.dataset.input;

$input.addEventListener('input', (e) => {
e.target.value = mask[field](e.target.value);
}, false)
})
16 changes: 16 additions & 0 deletions painel/js/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let show = true;
let menuShow = true;

const menuToggle = document.querySelector('.menu-toggle');

function menu(element) {
document.querySelector(element).classList.toggle('on', show);
}

menuToggle.addEventListener('click', () => {
menu('.asside');
menu('header');
menu('.content');
menu('.menu-section');
show = !show;
})
Loading

0 comments on commit 5bfc00c

Please sign in to comment.