Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldev071 committed Jun 30, 2023
0 parents commit 5892d2d
Show file tree
Hide file tree
Showing 5 changed files with 578 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# custom-imc-calculator
253 changes: 253 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Lato", sans-serif;
}

:root {
--electric-violet-50: #faf4ff;
--electric-violet-100: #f3e6ff;
--electric-violet-200: #ead1ff;
--electric-violet-300: #d9aeff;
--electric-violet-400: #c27aff;
--electric-violet-500: #ab47ff;
--electric-violet-600: #9724f9;
--electric-violet-700: #8514e1;
--electric-violet-800: #6f16b3;
--electric-violet-900: #5b1390;
--electric-violet-950: #3e006c;
/* #8514e1 */

}

body {
background-color: var(--electric-violet-950);
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
min-height: 100vh;
color: #fff;
}

/* .hide {
display: none !important;
} */

.container {
width: 90vw;
min-height: 400px;
padding: 2rem;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
gap: 2rem;

}

/* IMC Form */
#container__calc {
flex-grow: .3;
padding: 1rem;
background-color: var(--electric-violet-900);
border-radius: 5px;
}

#container__calc h2 {
text-align: center;
margin-bottom: 2rem;


}

.form-inputs {
display: flex;
flex-direction: column;
justify-content: space-between;
}

.form-control {
display: flex;
flex: 1;
flex-direction: column;
margin-bottom: 1rem;
}

.form-control label {
font-weight: bold;
margin-bottom: 0.6rem;
color: #ccc;
}

.form-control input {
padding: 1rem 0.5rem;
}

.action-control {
display: flex;
justify-content: space-between;
margin-top: 2rem;
gap: 1rem;
}

button {
text-transform: uppercase;
padding: 1rem 1.5rem;
background-image: linear-gradient(135deg, rgb(155, 69, 230) 0%, rgb(151, 36, 249) 100%);
border: none;
color: #fff;
cursor: pointer;
opacity: 0.9;
flex: 1;
border-radius: 5px;
}

button:hover {
opacity: 1;
}

/* Table */

#result__container {
text-align: center;
background-color: var(--electric-violet-900);
padding: 1rem;
flex-grow: 0.5;
border-radius: 5px;

}

#imc-number {
font-size: 2.4rem;
margin-bottom: 0.6rem;
}

#imc-info {
font-size: 1.4rem;
color: #ccc;
}

#result__container h3 {
margin-top: 1rem;
color: #dfdfdf;
}

#result__container {
display: flex;
flex-direction: column;
}

#imc-table {
margin: 1.5rem 0;
font-size: 0.8rem;
padding: 0.5rem;
}

.table-header {
font-weight: bold;
color: #ccc;
}

.table-header,
.table-data {
display: flex;
justify-content: space-between;
margin-bottom: 0.5rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--electric-violet-100);
text-align: center;
}

.table-header h4,
.table-data p {
flex: 1;
}


.back__btn {
max-width: 100%;
text-align: center;
}
#back--btn {
text-align: center;
width: 45%;
}

.good {
color: #12db34;
}

.low {
color: #dbce12;
}

.medium {
color: #db6212;
}

.high {
color: #db1912;
}

.container__footer {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 3rem;
}

.container--link {
text-decoration: none;
position: relative;
font-weight: 600;
font-size: 0.875rem;
line-height: 1rem;
color: var(--electric-violet-400);
}

.container--link:after {
content: " ";
width: 0%;
height: 2px;
background-color: var(--electric-violet-400);
position: absolute;
bottom: 0;
left: 0;
transition: 0.5s ease-in-out;
}

.container--link:hover::after {
width: 100%;
}

.container--link:link {
color: var(--electric-violet-100);
}

.container--link:visited {
color: var(--electric-violet-400);
}


i {
color: var(--electric-violet-400);
padding: 3px;
}

@media screen and (max-width: 600px) {
.container__footer {
width: 80vw;
flex-direction: row;
justify-content: center;
align-items: center;
flex-wrap: wrap;
margin-top: 1rem;
padding: 4%;
}

.table-header h4:nth-child(3),
.table-data p:nth-child(3) {
max-width: 80px;
}
}
Binary file added img/calculadora-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calculadora de IMC</title>
<!-- CSS style -->
<link rel="stylesheet" href="css/style.css" />

<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap"
rel="stylesheet"
/>
<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/78f50e1103.js" crossorigin="anonymous"></script>
<!-- script -->
<script src="js/main.js" defer></script>
</head>
<body>
<div class="container">
<main id="container__calc">
<h2>Calculadora de IMC</h2>
<form id="imc-form">
<div class="form-inputs">
<div class="form-control">
<label for="name">Nome:</label>
<input
type="text"
name="name"
id="name"
placeholder="Exemplo: Gabriel Souza"
required
/>
</div>

<div class="form-inputs">
<div class="form-control">
<label for="height">Altura:</label>
<input
type="text"
name="height"
id="height"
placeholder="Exemplo: 1,70"
required
/>
</div>
<div class="form-control">
<label for="weight">Peso:</label>
<input
type="text"
name="weight"
id="weight"
placeholder="Exemplo: 70,5"
/>
</div>
</div>
<div class="action-control">
<button id="calc-btn">Calcular</button>
<button id="clear-btn">Limpar</button>
</div>
</form>
</main>

<section id="result__container" class="">
<p id="imc-number">Seu IMC: <span></span></p>
<p id="imc-info">Situação atual: <span></span></p>
<h3 id="name_class">Confira as classificações:</h3>
<div id="imc-table">
<div class="table-header">
<h4>IMC</h4>
<h4>Classificação</h4>
<h4>Obesidade</h4>
</div>
</div>
<div class="back__btn">
<button id="back--btn">Limpar Informações</button>
</div>
</section>
</div>
<footer class="container__footer">
<p>Desenvolvido por <a class="container--link" href="https://www.linkedin.com/in/gabriel-albuquerque-souza-desenvolvedor/" target="_blank"
rel="noopener noreferrer"> Gabriel Souza</a> - Copyright 2023 ©. Todos os direitos reservados.
</a>
</p>
<p style="text-align: center;">Repositório Github:
<a href="#" class="container_footer--github" target="_blank" rel="noopener noreferrer">
<i class="fa-brands fa-github"></i>
</p>
</footer>
</body>
</html>
Loading

0 comments on commit 5892d2d

Please sign in to comment.