feat: Cria a area de banners principais

This commit is contained in:
Nicolly Vieira Santos Costa 2022-12-07 12:42:07 -03:00
parent 5769535cf7
commit 24a18e47c5
9 changed files with 171 additions and 218 deletions

View File

@ -1,19 +1,7 @@
module.exports = { module.exports = {
contentPlaceHolders: [ contentPlaceHolders: [
{ {
// Registra o contentPlaceholder id: "banners-principal-desktop",
id: "htmlSeo",
objects: [
// Registra os objetos vtex
{
type: "html",
name: "Html SEO",
contents: [],
},
],
},
{
id: "slide-principal",
objects: [ objects: [
{ {
type: "banner", type: "banner",
@ -23,33 +11,59 @@ module.exports = {
name: "banner principal content", name: "banner principal content",
active: true, active: true,
type: "image", type: "image",
file: "slide-principal.png", file: "banner-desktop.png",
width: 1920, width: 1440,
height: 500, height: 532,
// "category": "*",
// "brand": "*"
// "period": ""
}, },
], ],
}, },
{ {
type: "banner", type: "banner",
name: "banner principal-2", name: "banner principal",
contents: [ contents: [
{ {
name: "banner principal content", name: "banner principal content",
active: true, active: true,
type: "image", type: "image",
file: "slide-principal.png", file: "banner-desktop.png",
width: 1920, width: 1440,
height: 500, height: 532,
}, },
], ],
}, },
{
type: "banner",
name: "banner principal",
contents: [
{
name: "banner principal content",
active: true,
type: "image",
file: "banner-desktop.png",
width: 1440,
height: 532,
},
],
},
{
type: "banner",
name: "banner principal",
contents: [
{
name: "banner principal content",
active: true,
type: "image",
file: "banner-desktop.png",
width: 1440,
height: 532,
},
],
},
], ],
}, },
{ {
id: "slide-principal-mobile", id: "banners-principal-mobile",
objects: [ objects: [
{ {
type: "banner", type: "banner",
@ -59,23 +73,49 @@ module.exports = {
name: "banner principal mobile content", name: "banner principal mobile content",
active: true, active: true,
type: "image", type: "image",
file: "slide-principal-mobile.png", file: "banner-mobile.png",
width: 500, width: 375,
height: 500, height: 342,
}, },
], ],
}, },
{ {
type: "banner", type: "banner",
name: "banner principal mobile 2", name: "banner principal mobile",
contents: [ contents: [
{ {
name: "banner principal mobile 2 content", name: "banner principal mobile content",
active: true, active: true,
type: "image", type: "image",
file: "slide-principal-mobile.png", file: "banner-mobile.png",
width: 500, width: 375,
height: 500, height: 342,
},
],
},{
type: "banner",
name: "banner principal mobile",
contents: [
{
name: "banner principal mobile content",
active: true,
type: "image",
file: "banner-mobile.png",
width: 375,
height: 342,
},
],
},{
type: "banner",
name: "banner principal mobile",
contents: [
{
name: "banner principal mobile content",
active: true,
type: "image",
file: "banner-mobile.png",
width: 375,
height: 342,
}, },
], ],
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -1,38 +1,21 @@
import { import slickConfig from 'Config/slick';
bannerHome,
barraDeVantagens,
naveguePorCategorias,
} from "App/functions/slide";
import InstagramGallery from "../components/InstagramGallery";
export default class Home { export default class Home {
constructor() { constructor() {
bannerHome(".main-gallery"); this.selectors();
barraDeVantagens(".tipbar ul"); this.createSliders();
naveguePorCategorias(".categorias-home .categorias");
new InstagramGallery({
gallery: ".instagramGallery__photos",
account: "agenciam3",
limit: 6,
});
} }
naveguePorCategorias() { selectors() {
// preencher titulos this.desktopMainBanners = $(".main-banners__desktop");
var $container = $(".home-categories .categorias"); this.mobileMainBanners = $(".main-banners__mobile");
$container.find(".box-banner").each(function (i, el) {
const $banner = $(el);
let name;
name = $banner.find("img").prop("alt");
let $titulo = $("<span />", {
text: name,
class: "nome-categoria",
});
$banner.find("img").after($titulo);
});
slide.naveguePorCategorias($container);
} }
createSliders() {
this.desktopMainBanners.slick(slickConfig.home.bannerDesktop);
this.mobileMainBanners.slick(slickConfig.home.bannerMobile);
}
} }

View File

@ -2,14 +2,14 @@ export default {
home: { home: {
bannerDesktop: { bannerDesktop: {
dots: true, dots: true,
arrows: false, arrows: true,
pauseOnHover: false, pauseOnHover: true,
autoplay: true, autoplay: true,
autoplaySpeed: 6000, autoplaySpeed: 6000,
}, },
bannerMobile: { bannerMobile: {
dots: true, dots: true,
arrows: false, arrows: true,
pauseOnHover: false, pauseOnHover: false,
autoplay: true, autoplay: true,
autoplaySpeed: 6000, autoplaySpeed: 6000,

View File

@ -1,177 +1,99 @@
/***************************************************************/
/**-- Home ---------------------------------********************/
/*-------------------------------------------------------------*/
.home { .home {
.main-gallery { .main-banners {
> div {
&:not(.slick-initialized) {
.box-banner {
&:not(:first-child) {
display: none;
}
}
}
&.desktop {
@include mq(md, max) {
display: none;
}
}
&.mobile {
@include mq(md, min) {
display: none;
}
}
}
img { img {
width: 100%; width: 100%;
} }
.slick-next, &__desktop {
.slick-prev { @include mq(md, max) {
@extend .sprite; display: none;
background-color: transparent; }
border: none; }
cursor: pointer;
font-size: 0; &__mobile {
outline: none; @include mq(md, min) {
padding: 0; display: none;
}
}
.slick-arrow {
position: absolute; position: absolute;
top: 40%; top: 50%;
transform: scale(0.7); transform: translateY(-50%);
z-index: 1; z-index: 5;
padding: 0;
border: 0;
font-size: 0;
background-color: transparent;
outline: 0;
cursor: pointer;
@extend .sprite;
@include mq(md, max) {
transform: translateY(-50%) scale(0.7);
}
}
.slick-prev {
left: 24px;
@extend .sprite-arrow-left-slide;
@include mq(md, max) {
left: 16px;
transform-origin: left;
}
} }
.slick-next { .slick-next {
@extend .sprite; right: 24px;
@extend .sprite-circled-arrow-right; @extend .sprite-arrow-right-slide;
left: auto;
right: 8px;
}
.slick-prev { @include mq(md, max) {
@extend .sprite; right: 16px;
@extend .sprite-circled-arrow-left; transform-origin: right;
right: auto; }
left: 8px;
} }
.slick-dots { .slick-dots {
bottom: 20px; display: flex !important;
align-items: center;
justify-content: center;
position: absolute; position: absolute;
pointer-events: none; z-index: 5;
text-align: center;
width: 100%;
&, margin: 0;
li { width: 100%;
align-items: center; bottom: 14px;
display: flex !important; left: 0;
justify-content: center;
@include mq(md, max ) {
bottom: 9px;
} }
li { li {
display: inline-block; display: flex;
margin: 0 4px; margin: 0 4px;
.slick-active {
width: 16px;
height: 16px;
border: 11ps solid $white-500;
background: transparent;
}
} }
button { button {
background-color: $color-black2;
border: none;
cursor: pointer;
height: 10px;
outline: none;
padding: 0; padding: 0;
pointer-events: all; border: 0;
transition: all 0.15s ease-in-out; outline: 0;
background: $white-500;
width: 10px; width: 10px;
} height: 10px;
.slick-active {
button {
background-color: $color-pink;
height: 16px;
width: 16px;
}
}
}
}
.banner {
&.desktop {
@include mq(md, max) {
display: none;
}
}
&.mobile {
@include mq(md, min) {
display: none;
}
}
img {
width: 100%;
}
}
.mosaico-home,
.mosaico-home-footer {
@include mq(md, max) {
padding: 0;
}
@include mq_range(md, xl) {
max-width: 100%;
}
.row {
@include mq(md, max) {
margin: 0;
}
}
}
.mosaico-home {
> .row {
@include mq(md, min) {
margin-left: 0;
}
}
.banner {
padding: 0 0 40px;
@include mq(md, min) {
padding: 0 10px;
}
img {
width: 100%;
}
}
.banners-left {
@include mq(md, min) {
padding-left: 0px;
padding-right: 12px;
}
}
.banners-right {
padding: 0;
.banner {
padding-right: 0;
&:nth-child(2) {
@include mq(md, min) {
padding-left: 8px;
}
}
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -11,7 +11,6 @@
<meta http-equiv="x-ua-compatible" content="ie=edge" /> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<vtex:metaTags /> <vtex:metaTags />
<vtex:contentPlaceHolder id="htmlSeo" />
<title>Nicolly</title> <title>Nicolly</title>
<vtex:template id="template-loads-header" /> <vtex:template id="template-loads-header" />
@ -20,7 +19,16 @@
<body> <body>
<vtex:template id="template-header" /> <vtex:template id="template-header" />
<main class="home" style="height: 300px;"></main> <main class="home">
<section class="main-banners">
<div class="main-banners__desktop">
<vtex:contentPlaceHolder id="banners-principal-desktop" />
</div>
<div class="main-banners__mobile">
<vtex:contentPlaceHolder id="banners-principal-mobile" />
</div>
</section>
</main>
<footer> <footer>
<vtex:template id="template-footer-newsletter" /> <vtex:template id="template-footer-newsletter" />