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 = {
contentPlaceHolders: [
{
// Registra o contentPlaceholder
id: "htmlSeo",
objects: [
// Registra os objetos vtex
{
type: "html",
name: "Html SEO",
contents: [],
},
],
},
{
id: "slide-principal",
id: "banners-principal-desktop",
objects: [
{
type: "banner",
@ -23,33 +11,59 @@ module.exports = {
name: "banner principal content",
active: true,
type: "image",
file: "slide-principal.png",
width: 1920,
height: 500,
// "category": "*",
// "brand": "*"
// "period": ""
file: "banner-desktop.png",
width: 1440,
height: 532,
},
],
},
{
type: "banner",
name: "banner principal-2",
name: "banner principal",
contents: [
{
name: "banner principal content",
active: true,
type: "image",
file: "slide-principal.png",
width: 1920,
height: 500,
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,
},
],
},
{
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: [
{
type: "banner",
@ -59,23 +73,49 @@ module.exports = {
name: "banner principal mobile content",
active: true,
type: "image",
file: "slide-principal-mobile.png",
width: 500,
height: 500,
file: "banner-mobile.png",
width: 375,
height: 342,
},
],
},
{
type: "banner",
name: "banner principal mobile 2",
name: "banner principal mobile",
contents: [
{
name: "banner principal mobile 2 content",
name: "banner principal mobile content",
active: true,
type: "image",
file: "slide-principal-mobile.png",
width: 500,
height: 500,
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,
},
],
},{
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 {
bannerHome,
barraDeVantagens,
naveguePorCategorias,
} from "App/functions/slide";
import InstagramGallery from "../components/InstagramGallery";
import slickConfig from 'Config/slick';
export default class Home {
constructor() {
bannerHome(".main-gallery");
barraDeVantagens(".tipbar ul");
naveguePorCategorias(".categorias-home .categorias");
new InstagramGallery({
gallery: ".instagramGallery__photos",
account: "agenciam3",
limit: 6,
});
this.selectors();
this.createSliders();
}
naveguePorCategorias() {
// preencher titulos
var $container = $(".home-categories .categorias");
$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);
selectors() {
this.desktopMainBanners = $(".main-banners__desktop");
this.mobileMainBanners = $(".main-banners__mobile");
}
createSliders() {
this.desktopMainBanners.slick(slickConfig.home.bannerDesktop);
this.mobileMainBanners.slick(slickConfig.home.bannerMobile);
}
}

View File

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

View File

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

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 name="viewport" content="width=device-width, initial-scale=1.0" />
<vtex:metaTags />
<vtex:contentPlaceHolder id="htmlSeo" />
<title>Nicolly</title>
<vtex:template id="template-loads-header" />
@ -20,7 +19,16 @@
<body>
<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>
<vtex:template id="template-footer-newsletter" />