feat: cria formulario newsletter desktop e mobile

This commit is contained in:
Cainã Milech 2022-12-07 20:53:37 -03:00
parent f571f637d1
commit 91d9f2c58a
5 changed files with 98 additions and 177 deletions

View File

@ -66,8 +66,8 @@ const app = new Container({
app.bind(Minicart.name, ".minicart__drawer"); app.bind(Minicart.name, ".minicart__drawer");
app.bind(Newsletter.name, { app.bind(Newsletter.name, {
elemento: ".news-form", elemento: ".footer-newsletter__form",
textButtom: "Cadastre-se", textButtom: "CADASTRE-SE",
}); });
export default app; export default app;

View File

@ -1,196 +1,118 @@
/***************************************************************/ .footer-newsletter {
/**-- Newslettter --------------------------********************/ background: linear-gradient(180deg, $blue-500 0%, $blue-600 100%);
/*-------------------------------------------------------------*/ padding: 24px 15px;
.captacao-emails-newsletter { &__wrapper {
background-color: #f71963; max-width: 698px;
background-image: url("/arquivos/template-background-newsletter.png"); margin: 0 auto;
margin-top: 104px;
padding: 12px 15px 24px;
@include mq(md, max) {
background-image: url("/arquivos/template-mobile-background-newsletter.png");
background-size: cover;
padding: 52px 15px 42px;
} }
.row { &__title {
align-items: center; font-size: 14px;
} line-height: 17px;
color: $white-500;
margin: 0 0 10px;
> .row > div { @include mq(lg max) {
max-width: 960px; margin-bottom: 8px;
margin: auto; max-width: 224px;
padding: 0 3.5%;
}
h3 {
color: #fff;
font-size: 18px;
font-weight: normal;
line-height: 26px;
margin: 0 0 8px;
@include mq(md, max) {
margin-bottom: 24px;
}
span {
display: block;
font-size: 26px;
} }
} }
p { .m3-custom-newsletter-form {
font-size: 15px; display: flex;
margin: 0; position: relative;
}
}
.m3-custom-newsletter-form { @include mq(lg, max) {
position: relative; flex-direction: column;
}
label { @include mq(lg, min) {
display: none; align-items: center;
}
} }
fieldset { fieldset {
display: inline-block; flex: 1;
margin: 0;
padding: 0; padding: 0;
margin-right: 16px;
max-width: 270px;
width: 36%;
@include mq(md, max) { @include mq(lg, max) {
margin-bottom: 8px; margin-bottom: 8px;
max-width: 100%; }
width: 100%;
@include mq(lg, min) {
margin-right: 16px;
}
&:last-of-type {
/*o ultimo nao pega a margin r*/
margin: 0;
} }
&.m3-cn-button-ok-container { &.m3-cn-button-ok-container {
max-width: 126px; @include mq(lg, min) {
margin: 0; max-width: 126px;
}
}
label {
display: none;
}
input {
width: 100%; width: 100%;
line-height: 12px;
font-size: 10px;
height: 41px;
padding: 0 16px;
background: $white-500;
border: 0;
outline: 0;
@include mq(md, max) { &::placeholder {
max-width: 100%; text-transform: uppercase;
} color: $gray-200;
}
}
input {
border: none;
font-size: 14px;
outline: none;
padding: 9px 16px;
width: 100%;
@include mq(md, max) {
font-size: 24px;
padding: 18.5px 24px;
}
&::placeholder {
color: #142032;
}
&#m3-cn-button-ok {
background-color: #142032;
color: #fff;
cursor: pointer;
font-weight: 700;
font-size: 14px;
text-transform: lowercase;
transition: all 0.15s linear;
@include mq(md, max) {
font-size: 24px;
margin-top: 8px;
} }
&:hover { &.m3-cn-button-ok {
background-color: lighten(#142032, 5); font-weight: 900;
} color: $white-500;
background: $black-500;
cursor: pointer;
&:active { @include mq(lg, max) {
background-color: darken(#142032, 5); &:active {
background: lighten($black-500, 10);
}
}
@include mq(lg, min) {
&:hover {
background: lighten($black-500, 10);
}
&:active {
background: $black-500;
}
}
} }
} }
} }
.m3-cn-msg { .m3-cn-msg {
width: fit-content; /*pra nao quebrar no mobile, do tamanho do conteudo interno*/
position: absolute;
top: calc(100% + 8px);
left: 50%;
transform: translateX(
-50%
); /*puxar metade do texto pra esquerda, pra conseguir alinhar ele a 50% left do pai*/
line-height: 1;
font-weight: 700; font-weight: 700;
text-align: center;
.m3-cn-error { .m3-cn-error {
background-color: #fff; color: $red-300;
border-radius: 2px;
bottom: -28px;
color: #f719633;
display: table;
left: 40%;
margin: auto;
padding: 3px 6px;
position: absolute;
right: 0;
}
.m3-cn-success {
color: #fff;
display: inline-block;
font-size: 16px;
margin-right: 20px;
text-transform: lowercase;
}
.btn-voltar {
background-color: #fff;
border-radius: 2px;
color: #f71963;
display: inline-block;
font-size: 14px;
line-height: 1;
padding: 4px 8px;
text-transform: lowercase;
} }
} }
} }
/* pop-up-newsletter */
.pop-up-newsletter {
display: none;
position: fixed;
z-index: 10;
width: 100%;
top: 20%;
.newsletter {
text-align: center;
background-color: #fff;
padding: 20px;
display: table;
margin: 0 auto;
position: relative;
.close-popup {
font-size: 35px;
color: #000;
padding: 5px;
cursor: pointer;
position: absolute;
top: 0;
right: 0;
line-height: 0.5;
}
input {
border-bottom: solid 1px #333;
}
}
.m3-custom-newsletter-form .btn-voltar {
color: #333;
border-color: #333;
}
}

View File

@ -26,7 +26,7 @@
&__text { &__text {
display: flex; display: flex;
align-items: center; align-items: center;
color: $gray-200; color: $gray-300;
font-size: 12px; font-size: 12px;
line-height: 15px; line-height: 15px;

View File

@ -1,6 +1,6 @@
// fonts // fonts
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap");
$font-family: "Inter", sans-serif; $font-family: "Inter", sans-serif;
$font-height: 1.5; $font-height: 1.5;
@ -9,9 +9,13 @@ $font-height: 1.5;
$black-500: #000; $black-500: #000;
$white-500: #fff; $white-500: #fff;
$blue-500: #00c8ff; $blue-500: #00c8ff;
$blue-600: #03addc;
$red-300: #db4c4c;
$gray-100: #e0e0e0; $gray-100: #e0e0e0;
$gray-200: #828282; $gray-200: #bdbdbd;
$gray-300: #828282;
$gray-500: #333; $gray-500: #333;
// universal // universal

View File

@ -1,12 +1,7 @@
<section class="captacao-emails-newsletter container-fluid"> <section class="footer-newsletter">
<div class="row"> <div class="footer-newsletter__wrapper">
<div class="col-12 col-lg-10 offset-lg-1 col-xl-8 offset-xl-2 row"> <h3 class="footer-newsletter__title">RECEBA NOVIDADES E DESCONTOS EXCLUSIVOS</h3>
<div class="col-12">
<h3>Receba novidades e <span>descontos <strong>exclusivos</strong></span></h3> <div class="footer-newsletter__form"></div>
</div>
<div class="col-12">
<div class="news-form"></div>
</div>
</div>
</div> </div>
</section> </section>