Skip to content

Commit

Permalink
feat: Creating all the necessary stylization
Browse files Browse the repository at this point in the history
  • Loading branch information
NyctibiusVII committed Dec 15, 2023
1 parent af1adac commit ed6ad24
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md, markdown, txt}]
[*.{md, markdown, txt, html}]
indent_size = 4
insert_final_newline = false

[./src/**]
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = false
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

# local files
trash-code.txt
.temp
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,15 @@ Check [Keep a Changelog](https://keepachangelog.com/pt-BR/1.0.0/) for recommenda
- `src/index.html`
### Added
- Content not changed `index.html`

## [0.3.4] - 2023-12-15
### Added
- Background `public/assets/background.svg`
- Full white logo `public/assets/logo-icon-full-white.svg`
### Changed
- Logo colored `public/assets/logo-icon.svg`
- Adapting interactions with the layout `src/script.js`
- Creating all the necessary stylization `src/styles.css`
- Add `.temp` in `.gitignore`
- Add `.html` in `.editorconfig`
- Restructuring the logo image in `index.html`
12 changes: 7 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</head>

<body>
<image src="public/assets/logo-icon.svg" alt="" width="80" height="80" />

<main>
<image id="logo-icon" src="public/assets/logo-icon.svg" alt="" width="80" height="80" />

<section id="section-login-default">
<h1>Login</h1>

Expand All @@ -24,8 +24,10 @@ <h1>Login</h1>
</div>
<div class="password-container">
<label for="password-input">Senha</label>
<input type="password" name="password-input" id="password-input" placeholder="**********" required>
<span onclick="togglePasswordVisibility()" class="password-eye">👁</span>
<div class="password-eye-container">
<input type="password" name="password-input" id="password-input" placeholder="••••••••••••••••" required>
<span onclick="togglePasswordVisibility()" class="password-eye">👁</span>
</div>
</div>

<button type="submit">Continuar</button>
Expand All @@ -34,7 +36,7 @@ <h1>Login</h1>

<button id="toggle-login-type" class="type-login-default" type="button" onclick="toggleLogin()">
Área de visitantes
<image src="public/assets/arrow.svg" alt="" width="20" height="20" />
<image id="arrow-icon" src="public/assets/arrow.svg" alt="" width="22" height="22" />
</button>

<section id="section-login-voucher">
Expand Down
Binary file added public/assets/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/assets/logo-icon-full-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions public/assets/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions src/script.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
function toggleLogin() {
const toggleLoginType = document.getElementById('toggle-login-type')
const iconToggleLoginType = document.getElementById('arrow-icon')
const logoIcon = document.getElementById('logo-icon')

const sectionLoginDefault = document.getElementById('section-login-default')
const sectionLoginVoucher = document.getElementById('section-login-voucher')

logoIcon.classList.toggle('slide-left')

toggleLoginType.className =
toggleLoginType.className === 'type-login-voucher'
? 'type-login-default'
: 'type-login-voucher'

if(toggleLoginType.className === 'type-login-voucher') {
toggleLoginType.textContent = 'Área de colaboradores'
toggleLoginType.appendChild(iconToggleLoginType)

sectionLoginDefault.style.height = '0'
sectionLoginVoucher.style.height = '100%'
sectionLoginVoucher.style.height = '10.625em'

return
}

toggleLoginType.textContent = 'Área de visitantes'
toggleLoginType.appendChild(iconToggleLoginType)

sectionLoginDefault.style.height = '100%'
sectionLoginDefault.style.height = '16.563em'
sectionLoginVoucher.style.height = '0'
}

Expand All @@ -36,4 +43,4 @@ function togglePasswordVisibility() {
}

passwordInput.type = 'password'
}
}
211 changes: 191 additions & 20 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1,44 +1,215 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');

* {
border: 1px solid #00f;
margin: 0;
padding: 0;
border: 0;

box-sizing: border-box;
}
:root {
--black: #000;
--white: #FFF;

--gray-50: #FEFEFE;
--cian-100: #76C7F3;
--green-100: #A3FE47;
--yellow-100: #FCCB38;
--purple-100: #6746A4;

--background: var(--purple-100);
--text: var(--gray-50);

--black-50p: rgb(0 0 0 / 50%);
--white-50p: rgb(255 255 255 / 50%);
--gray-50-10p: rgb(254 254 254 / 10%);
--gray-50-20p: rgb(254 254 254 / 20%);
--gray-50-70p: rgb(254 254 254 / 70%);

--green-100-80p: #A3FE47CC;
}

/* ------- Body -------- */
body {
width: calc(100vw - 2px);
height: calc(100vh - 2px);
background-color: #242424;
color: #fff;
font-family: 'Roboto', sans-serif;
width: 100vw;
height: 100vh;

background-image: url("/public/assets/background.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
background-color: var(--background);
color: var(--text);
font-family: 'Montserrat', sans-serif;
font-weight: 400;
font-size: 1rem;
text-rendering: optimizeLegibility;

display: flex;
/* flex-direction: column; */
align-items: center;
justify-content: center;
}
::selection {
background-color: var(--cian-100);
color: var(--black);
}

/* ------- Text -------- */
h1, h2 {
text-align: center;
text-transform: uppercase;
font-weight: 600;
margin: 1em 0;
}
h1 { letter-spacing: 0.419em; }
h2 { font-size: 1em; }

/* ------- Main -------- */
main {
width: 20em;
background-color: #f00;
width: 18em;

background: linear-gradient(114deg, rgb(255 255 255 / 40%) 0%, rgb(103 70 164 / 10%) 70.86%);
box-shadow: -0.313em 0.313em 1.5em 0.313em rgb(0 0 0 / 20%);
border: 1px solid rgb(255 255 255 / 50%);
border-radius: 1em;

position: relative;

display: flex;
flex-direction: column;

backdrop-filter: blur(0.625em);
}
main img#logo-icon {
position: absolute;
top: -2.5em;
right: -2em;

transition: 0.5s ease;
}
main img#logo-icon.slide-left {
top: -2.8em;
right: 15.5em;
}
section {
width: 100%;
height: 100%;
background-color: #0f0;
margin: 1em;
height: 16.563em;

display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;

transition: 0.3s height ease;

overflow: hidden;
}
section#section-login-voucher { height: 0; }

/* ------- Form -------- */
form {
padding: 0em 1em;

display: flex;
flex-direction: column;
align-self: stretch;
align-items: center;
justify-content: center;
gap: 1em;
}
section#section-login-voucher {
height: 0;
.email-container,
.password-container,
.voucher-container {
width: 100%;

display: flex;
flex-direction: column;
}
label, input { letter-spacing: -0.0175rem; }
input {
width: 100%;

background: var(--gray-50-10p);
color: var(--gray-50-70p);
border-radius: 0.5em;
font-family: Montserrat;
font-size: 0.875rem;
font-weight: 500;

padding: 0.5rem 1rem;
}
input#password-input { padding-right: 3rem; }
input:hover,
input:valid { box-shadow: inset 0 0 0 0.125rem var(--gray-50-20p); }
input::placeholder { color: var(--gray-50-20p); }
input:-webkit-autofill {
-webkit-text-fill-color: var(--gray-50-70p) !important;
-webkit-box-shadow: 0 0 0 0.125rem rgb(255 255 255 / 20%) inset, 0 0 0 2rem var(--black-50p) inset;
}
input:-webkit-autofill::selection{ -webkit-text-fill-color: var(--black) !important; }
.password-eye-container { position: relative; }
.password-eye {
width: 1em;
height: 1em;
background-color: #00f;
padding: 0.2em;
position: relative;
top: 0.5em;
width: 2em;
height: 2em;

color: var(--gray-50-20p);

position: absolute;
top: 0;
right: 0.5em;

display: flex;
align-items: center;
justify-content: center;

cursor: pointer;
}
.password-eye.hidden { color: var(--gray-50-70p); }

/* ------- Button -------- */
button {
font-family: Montserrat;
font-size: 0.875em;

display: flex;
align-self: stretch;
align-items: center;
justify-content: center;

cursor: pointer;
}
}
button[type='submit'] {
background-color: var(--green-100);
border-radius: 0.5em;
color: var(--black-50p);
font-weight: 500;

padding: 0.5rem 1rem;
margin-bottom: 1rem;

transition: background-color 0.2s ease-in-out
}
button[type='submit']:hover { background-color: var(--green-100-80p); }
button[type='submit']:active { box-shadow: inset 0 0 0 0.125rem rgb(0 0 0 / 20%); }

button#toggle-login-type {
height: 3rem;

background-color: var(--purple-100);
color: var(--gray-50-70p);
border: 0.125rem dashed var(--purple-100);
border-radius: 0 0 1em 1em;
font-weight: 600;
letter-spacing: 0.04375rem;

padding: 0.5rem 1.25rem;

justify-content: space-between;

transition: border-radius 0.3s ease;
}
button#toggle-login-type:hover,
button#toggle-login-type:active { border-color: var(--gray-50-70p); }
button#toggle-login-type.type-login-voucher { border-radius: 1em 1em 0 0; }
button#toggle-login-type.type-login-voucher img { transform: rotate(180deg); }

0 comments on commit ed6ad24

Please sign in to comment.