diff --git a/meta/pages/home.js b/meta/pages/home.js index b3ca2d6..089f853 100644 --- a/meta/pages/home.js +++ b/meta/pages/home.js @@ -122,120 +122,18 @@ module.exports = { }, ], }, - //==================== - // MOSAICO - //==================== { - id: "banner-01", + id: "prateleira-01", objects: [ { - type: "banner", - name: "banner 01", - contents: [ - { - name: "banner 01 content", - active: true, - type: "image", - file: "banner-01.png", - width: 500, - height: 500, - }, - ], - }, - ], - }, - { - id: "banner-02", - objects: [ - { - type: "banner", - name: "banner 02", - contents: [ - { - name: "banner 02 content", - active: true, - type: "image", - file: "banner-02.png", - width: 500, - height: 500, - }, - ], - }, - ], - }, - { - id: "banner-03", - objects: [ - { - type: "banner", - name: "banner 03", - contents: [ - { - name: "banner 03 content", - active: true, - type: "image", - file: "banner-03.png", - width: 500, - height: 500, - }, - ], - }, - ], - }, - { - id: "banner-04", - objects: [ - { - type: "banner", - name: "banner 04", - contents: [ - { - name: "banner 04 content", - active: true, - type: "image", - file: "banner-04.png", - width: 500, - height: 500, - }, - ], - }, - ], - }, - { - id: "banner-05", - objects: [ - { - type: "banner", - name: "banner 05", - contents: [ - { - name: "banner 05 content", - active: true, - type: "image", - file: "banner-05.png", - width: 500, - height: 500, - }, - ], - }, - ], - }, - { - id: "mobile-banner-05", - objects: [ - { - type: "banner", - name: "banner 05 mobile", - contents: [ - { - name: "banner 05 mobile content", - active: true, - type: "image", - file: "banner-05.png", - width: 500, - height: 500, - }, - ], + type: "Produtos Relacionados", + name: "CONFIRA NOSSAS NOVIDADES", + properties: { + layout: "caina-prateleira-padrao", + type: "QuemViuViuTambem", + "number-of-columns": 12, + "number-of-items": 12, + }, }, ], }, diff --git a/src/arquivos/js/app/app.js b/src/arquivos/js/app/app.js index a386bdd..f0564ba 100644 --- a/src/arquivos/js/app/app.js +++ b/src/arquivos/js/app/app.js @@ -20,6 +20,7 @@ import Promocao from "./partials/Promocao"; import MenuContents from "./partials/MenuContents"; import Login from "./partials/Login"; import Prateleira from "./components/Prateleira/Prateleira"; +import Shelf from "./partials/Shelf"; import PrateleiraService from "./components/Prateleira/PrateleiraService"; @@ -38,6 +39,7 @@ const app = new Container({ ScrollToTop, AutoComplete, Prateleira, + Shelf, ], services: [PrateleiraService], pages: [ diff --git a/src/arquivos/js/app/components/Prateleira/Prateleira.js b/src/arquivos/js/app/components/Prateleira/Prateleira.js index 8218c4d..1d8fb5e 100644 --- a/src/arquivos/js/app/components/Prateleira/Prateleira.js +++ b/src/arquivos/js/app/components/Prateleira/Prateleira.js @@ -96,8 +96,8 @@ export default class Prateleira { //ex atualziar atualizar() { this.flagDeDesconto(); - this.precoParcelado(); - this.precoBoleto(); + //this.precoParcelado(); + //this.precoBoleto(); } criarHtmlPrecoBoleto(valor) { @@ -123,7 +123,7 @@ export default class Prateleira { createFlagDesconto($elemento, percentualDeDesconto) { var $flag = $("

") .addClass("flag produto-off") - .text(percentualDeDesconto + "%"); + .text(percentualDeDesconto + "%OFF"); $elemento.find(".flags-product .DiscountHightLight").append($flag); } diff --git a/src/arquivos/js/app/partials/Shelf.js b/src/arquivos/js/app/partials/Shelf.js new file mode 100644 index 0000000..4e87df8 --- /dev/null +++ b/src/arquivos/js/app/partials/Shelf.js @@ -0,0 +1,16 @@ +import slickConfig from "Config/slick"; + +export default class Shelf { + constructor() { + this.selectors(); + this.createSlider(); + } + + selectors() { + this.shelf = $(".shelf ul"); + } + + createSlider() { + this.shelf.slick(slickConfig.productShelf.defaultShelf); + } +} diff --git a/src/arquivos/js/config/slick.js b/src/arquivos/js/config/slick.js index af35dae..c4f890b 100644 --- a/src/arquivos/js/config/slick.js +++ b/src/arquivos/js/config/slick.js @@ -58,7 +58,7 @@ export default { productShelf: { defaultShelf: { lazyLoad: "ondemand", - dots: true, + dots: false, arrows: true, infinite: true, slidesToShow: 4, @@ -68,17 +68,13 @@ export default { { breakpoint: 1200, settings: { - lazyLoad: "ondemand", slidesToShow: 3, slidesToScroll: 3, - infinite: true, }, }, { breakpoint: 800, settings: { - arrows: true, - lazyLoad: "ondemand", slidesToShow: 2, slidesToScroll: 2, }, @@ -86,9 +82,8 @@ export default { { breakpoint: 576, settings: { - arrows: false, - slidesToShow: 2, - slidesToScroll: 2, + slidesToShow: 1, + slidesToScroll: 1, }, }, ], diff --git a/src/arquivos/sass/main.scss b/src/arquivos/sass/main.scss index 4275639..d53de5b 100644 --- a/src/arquivos/sass/main.scss +++ b/src/arquivos/sass/main.scss @@ -5,17 +5,7 @@ @import "./utils/all"; -@import "./pages/home"; -@import "./pages/categoria"; -@import "./pages/produto"; -@import "./pages/institucional"; -@import "./pages/erro"; -@import "./pages/login"; - -@import "./components/mini-cart"; -@import "./components/newsletter"; -@import "./components/instagram-gallery"; - +@import "./partials/slider"; @import "./partials/header"; @import "./partials/menu"; @import "./partials/search"; @@ -25,3 +15,14 @@ @import "./partials/prateleira"; @import "./partials/ajustes"; @import "./partials/flags"; + +@import "./components/mini-cart"; +@import "./components/newsletter"; +@import "./components/instagram-gallery"; + +@import "./pages/home"; +@import "./pages/categoria"; +@import "./pages/produto"; +@import "./pages/institucional"; +@import "./pages/erro"; +@import "./pages/login"; diff --git a/src/arquivos/sass/pages/_home.scss b/src/arquivos/sass/pages/_home.scss index cd7106a..f230779 100644 --- a/src/arquivos/sass/pages/_home.scss +++ b/src/arquivos/sass/pages/_home.scss @@ -2,6 +2,10 @@ .main-banners { margin-bottom: 38px; + @include mq(md, max) { + margin-bottom: 32px; + } + img { width: 100%; } @@ -18,17 +22,6 @@ } .slick-arrow { - position: absolute; - top: 50%; - transform: translateY(-50%); - z-index: map-get($z-index, level-1); - padding: 0; - border: 0; - outline: 0; - font-size: 0; - background-color: transparent; - cursor: pointer; - @extend .sprite; @include mq(md, max) { @@ -59,13 +52,10 @@ } .slick-dots { - display: flex !important; - align-items: center; - justify-content: center; position: absolute; left: 0; bottom: 14px; - margin: 0; + z-index: map-get($z-index, level-1); width: 100%; @@ -73,9 +63,6 @@ } li { - display: flex; - margin: 0 4px; - &.slick-active { button { width: 16px; @@ -85,21 +72,16 @@ } } } - - button { - width: 10px; - height: 10px; - padding: 0; - border: 0; - outline: 0; - background: $white-500; - } } } .advantages { margin-bottom: 117px; + @include mq(md, max) { + margin-bottom: 89px; + } + &__list { margin: 0; display: flex; @@ -142,4 +124,12 @@ font-size: 10px; } } + + .shelf { + margin-bottom: 172px; + + @include mq(md, max) { + margin-bottom: 80px; + } + } } diff --git a/src/arquivos/sass/partials/_flags.scss b/src/arquivos/sass/partials/_flags.scss index 2a609fc..6746390 100644 --- a/src/arquivos/sass/partials/_flags.scss +++ b/src/arquivos/sass/partials/_flags.scss @@ -1,43 +1,37 @@ .flags-product { - display: block; - pointer-events: none; position: absolute; - width: 100%; - z-index: 5; + top: 0; + left: 0; + z-index: map-get($z-index, level-2); + padding: 8px; - p { - background-repeat: no-repeat; - color: #fff; + .flag { display: none; - font-size: 11px; - float: right; - font-weight: 700; + line-height: 12px; + font-size: 10px; + text-transform: uppercase; + margin: 0 0 8px; min-width: 54px; - margin: 7px 100% 0 7px; - overflow: hidden; - padding: 2.5px 4px; - text-indent: -9999px; + max-width: max-content; + height: 20px; + &.novo, &.produto-off { - background: #142032; - display: table; - float: left; - text-indent: 0; - width: 50px; - - &:after { - content: "OFF"; - display: inline-block; - } + display: flex; + align-items: center; + justify-content: center; } &.novo { - background-color: #f71963; - border-radius: 5px; - display: table; - float: left; - text-indent: 0; - text-transform: uppercase; + font-weight: 700; + color: $white-500; + background: $blue-500; + } + + &.produto-off { + font-weight: 900; + color: $white-500; + background: $black-500; } } } diff --git a/src/arquivos/sass/partials/_prateleira.scss b/src/arquivos/sass/partials/_prateleira.scss index 8938be6..9f535c0 100644 --- a/src/arquivos/sass/partials/_prateleira.scss +++ b/src/arquivos/sass/partials/_prateleira.scss @@ -1,263 +1,200 @@ -/***************************************************************/ -/**-- Prateleiras --------------------------********************/ -/*-------------------------------------------------------------*/ - -.prateleira-de-produtos { - position: relative; - - .slick-next, - .slick-prev { - @extend .sprite; - background-color: transparent; - border: none; - cursor: pointer; - font-size: 0; - outline: none; - padding: 0; - position: absolute; - top: 30%; - z-index: 1; - - @include mq(md, max) { - transform: scale(0.8); - } - } - - .slick-next { - @extend .sprite; - @extend .sprite-circled-arrow-right; - left: auto; - right: -60px; - - @include mq(md, max) { - right: -35px; - } - - @include mq_range(md, xl) { - right: -45px; - } - } - - .slick-prev { - @extend .sprite; - @extend .sprite-circled-arrow-left; - right: auto; - left: -60px; - - @include mq(md, max) { - left: -35px; - } - - @include mq_range(md, xl) { - left: -45px; - } - } - - .slick-dots { - bottom: 20px; - height: 17px; - position: absolute; - pointer-events: none; - text-align: center; - width: 100%; - - @include mq(md, max) { - margin-top: 16px; - position: initial; - } - - &, - li { - align-items: center; - display: flex !important; - justify-content: center; - } - - li { - display: inline-block; - margin: 0 4px; - } - - button { - background-color: #142032; - border: none; - cursor: pointer; - height: 10px; - outline: none; - padding: 0; - pointer-events: all; - transition: all 0.15s ease-in-out; - width: 10px; - } - - .slick-active { - button { - background-color: #f71963; - height: 16px; - width: 16px; - } - } - } +.shelf { + border: 1px solid blue; h2 { - color: #f71963; - font-size: 24px; - margin: 0 0 24px; + margin: 0 0 16px; + line-height: 19px; + font-size: 16px; text-align: center; - text-transform: lowercase; } ul { - max-width: 95%; - margin: auto; + border: 1px solid green; + margin: 0; - @include mq(md, max) { - max-width: 300px; + @include mq(lg, max) { + padding: 0 32px; } } - li { - display: inline-block; - vertical-align: top; - padding: 0 2.5px; + /*PRA QUANDO TIVER PRODUTO INDISPONIVEL, PRECISA TER O MESMO HEIGHT DE UM PRODUTO NORMAL NA PRATELEIRA*/ + .slick-track { + display: flex; } -} -.produto-na-prateleira { - padding: 0 5px; - position: relative; - text-align: center; + .slick-slide { + height: auto; + border: 1px solid yellow; - .product-image { - overflow: hidden; + & > div, + li { + height: 100%; + } + } + + .slick-arrow { + @extend .sprite; + + @include mq(lg, max) { + transform: translateY(-50%) scale(0.7); + } + } + + .slick-prev { + right: 100%; + border: 1px solid red; + + @include mq(lg, max) { + left: 0; + right: auto; + transform-origin: left; + } + + @extend .sprite-left-gray-arrow; + } + + .slick-next { + left: 100%; + + @include mq(lg, max) { + right: 0; + left: auto; + transform-origin: right; + } + + @extend .sprite-right-gray-arrow; + } + + .produto-na-prateleira { position: relative; + display: flex; + flex-direction: column; + border: 1px solid red; + height: 100%; + margin: 0 15px; - .lazyload__sibling { - padding-bottom: 100%; + .product-image { + position: relative; + padding-top: 100%; + overflow: hidden; + margin-bottom: 16px; - + div { - top: 0; - left: 0; + &:hover { + .foto-secundaria { + opacity: 1; + pointer-events: all; + } + } + .foto-principal, + .foto-secundaria { position: absolute; width: 100%; + top: 0; + bottom: 0; + height: 100%; + z-index: map-get($z-index, level-1); } - } - .lazyload__sibling img { - left: 50%; - max-width: initial; - position: relative; - transform: translateX(-50%); - width: 100%; - } - - .foto-principal, - .foto-secundaria { - transition: all 0.25s linear; - } - - &:hover .foto-secundaria, - .foto-principal { - visibility: visible; - opacity: 1; - z-index: 1; - } - - .foto-secundaria { - position: absolute; - width: 100%; - top: 0; - z-index: -1; - visibility: hidden; - opacity: 0; - } - } - - .informacoes .nome { - font-size: 14px; - line-height: 16px; - margin-top: 16px; - min-height: 34px; - text-transform: capitalize; - } - - .price { - margin: 8px 0 17px; - - > div { - line-height: 1.3; - } - .antigo { - color: hsla(220, 1%, 43%, 1); - font-size: 14px; - min-height: 18px; - text-decoration: line-through; - } - - .principal { - font-size: 18px; - font-weight: 700; - } - - .parcelado { - color: hsla(220, 1%, 43%, 1); - font-size: 12px; - - strong { - font-weight: normal; - } - } - - .boleto { - display: none; - } - } - - .compra { - .btn-compra { - margin: 0; - display: block; - transition: all 0.25s linear 0.25s; - - @include mq(md, min) { - visibility: hidden; + .foto-secundaria { opacity: 0; + pointer-events: none; + transition: all 0.2s ease-in-out; } - a { - background-color: #2fab61; - color: #fff; - display: block; - font-size: 14px; - letter-spacing: 1px; - padding: 15px 0; - text-transform: uppercase; - transition: all 0.15s linear; + img { + width: 100%; + height: 100%; + object-fit: cover; + } + } - @include mq(lg) { + .disponivel, + .indisponivel { + flex: 1; + display: flex; + flex-direction: column; + justify-content: flex-end; + } + + .nome { + line-height: 12px; + font-size: 10px; + font-weight: 500; + text-transform: uppercase; + text-align: center; + margin-bottom: 17px; + } + + .price { + text-align: center; + text-transform: uppercase; + margin-bottom: 17px; + + .antigo { + margin-bottom: 4px; + color: $gray-300; + text-decoration: line-through; + font-size: 10px; + line-height: 12px; + } + + .principal { + margin-bottom: 4px; + font-weight: 900; + font-size: 13px; + line-height: 16px; + } + + .parcelado { + font-size: 10px; + line-height: 12px; + color: $gray-400; + } + } + + .btn-compra { + a { + display: flex; + align-items: center; + background: $black-500; + justify-content: center; + height: 50px; + line-height: 12px; + font-weight: bold; + font-size: 10px; + color: $white-500; + transition: background-color 0.2s linear; + + @include mq(lg, max) { + &:active { + background: lighten($black-500, 10); + } + } + + @include mq(lg, min) { &:hover { - background-color: hsla(138, 66%, 41%, 1); + background: lighten($black-500, 10); } &:active { - background-color: hsla(138, 50%, 41%, 1); + background: $black-500; } } } } - } - @include mq(lg) { - &:hover .compra .btn-compra { - visibility: visible; - opacity: 1; - z-index: 1; + .indisponivel { + display: none; + .erro { + display: flex; + align-items: center; + justify-content: center; + height: 50px; + font-size: 10px; + line-height: 12px; + font-weight: bold; + color: $red-300; + } } } - - .indisponivel { - color: #f71963; - font-weight: bold; - margin: 5px 0; - } } diff --git a/src/arquivos/sass/partials/_slider.scss b/src/arquivos/sass/partials/_slider.scss new file mode 100644 index 0000000..5ab44a6 --- /dev/null +++ b/src/arquivos/sass/partials/_slider.scss @@ -0,0 +1,32 @@ +.slick-arrow { + position: absolute; + top: 50%; + transform: translateY(-50%); + padding: 0; + border: 0; + outline: 0; + font-size: 0; + background-color: transparent; + cursor: pointer; +} + +.slick-dots { + display: flex !important; + align-items: center; + justify-content: center; + margin: 0; + + li { + display: flex; + margin: 0 4px; + } + + button { + width: 10px; + height: 10px; + padding: 0; + border: 0; + outline: 0; + background: $white-500; + } +} diff --git a/src/arquivos/sass/utils/_variaveis.scss b/src/arquivos/sass/utils/_variaveis.scss index 042d8fe..5bc1844 100644 --- a/src/arquivos/sass/utils/_variaveis.scss +++ b/src/arquivos/sass/utils/_variaveis.scss @@ -1,6 +1,6 @@ // fonts -@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap"); +@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap"); $font-family: "Inter", sans-serif; $font-height: 1.5; @@ -16,6 +16,7 @@ $red-300: #db4c4c; $gray-100: #e0e0e0; $gray-200: #bdbdbd; $gray-300: #828282; +$gray-400: #6d6e70; $gray-500: #333; // universal diff --git a/src/arquivos/sprite/left-gray-arrow.png b/src/arquivos/sprite/left-gray-arrow.png new file mode 100644 index 0000000..d5273a5 Binary files /dev/null and b/src/arquivos/sprite/left-gray-arrow.png differ diff --git a/src/arquivos/sprite/right-gray-arrow.png b/src/arquivos/sprite/right-gray-arrow.png new file mode 100644 index 0000000..b8f5fba Binary files /dev/null and b/src/arquivos/sprite/right-gray-arrow.png differ diff --git a/src/template-pagina/caina-home.html b/src/template-pagina/caina-home.html index 05d660b..f35bea0 100644 --- a/src/template-pagina/caina-home.html +++ b/src/template-pagina/caina-home.html @@ -65,6 +65,12 @@ + +

+
+ +
+