feat: cria a prateleira de produtos

This commit is contained in:
Nicolly Vieira Santos Costa 2022-12-07 13:57:52 -03:00
parent c8f679aa7f
commit c42ef44da4
16 changed files with 307 additions and 467 deletions

View File

@ -122,119 +122,20 @@ module.exports = {
], ],
}, },
//==================== //====================
// MOSAICO // PRATELEIRA
//==================== //====================
{ {
id: "banner-01", id: "prateleira-01",
objects: [ objects: [
{ {
type: "banner", type: "Produtos Relacionados",
name: "banner 01", name: "CONFIRA NOSSAS NOVIDADES",
contents: [ properties: {
{ layout: "prateleira-padrao",
name: "banner 01 content", type: "QuemViuViuTambem",
active: true, "number-of-columns": 12,
type: "image", "number-of-items": 12,
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,
},
],
}, },
], ],
}, },

View File

@ -20,6 +20,7 @@ import Promocao from "./partials/Promocao";
import MenuContents from "./partials/MenuContents"; import MenuContents from "./partials/MenuContents";
import Login from "./partials/Login"; import Login from "./partials/Login";
import Prateleira from "./components/Prateleira/Prateleira"; import Prateleira from "./components/Prateleira/Prateleira";
import Shelf from "./partials/Shelf";
import PrateleiraService from "./components/Prateleira/PrateleiraService"; import PrateleiraService from "./components/Prateleira/PrateleiraService";
@ -38,6 +39,7 @@ const app = new Container({
ScrollToTop, ScrollToTop,
AutoComplete, AutoComplete,
Prateleira, Prateleira,
Shelf,
], ],
services: [PrateleiraService], services: [PrateleiraService],
pages: [ pages: [

View File

@ -96,7 +96,7 @@ export default class Prateleira {
//ex atualziar //ex atualziar
atualizar() { atualizar() {
this.flagDeDesconto(); this.flagDeDesconto();
this.precoParcelado(); // this.precoParcelado();
this.precoBoleto(); this.precoBoleto();
} }

View File

@ -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)
}
}

View File

@ -59,7 +59,7 @@ export default {
productShelf: { productShelf: {
defaultShelf: { defaultShelf: {
lazyLoad: "ondemand", lazyLoad: "ondemand",
dots: true, dots: false,
arrows: true, arrows: true,
infinite: true, infinite: true,
slidesToShow: 4, slidesToShow: 4,
@ -69,17 +69,13 @@ export default {
{ {
breakpoint: 1200, breakpoint: 1200,
settings: { settings: {
lazyLoad: "ondemand",
slidesToShow: 3, slidesToShow: 3,
slidesToScroll: 3, slidesToScroll: 3,
infinite: true,
}, },
}, },
{ {
breakpoint: 800, breakpoint: 800,
settings: { settings: {
arrows: true,
lazyLoad: "ondemand",
slidesToShow: 2, slidesToShow: 2,
slidesToScroll: 2, slidesToScroll: 2,
}, },
@ -87,9 +83,8 @@ export default {
{ {
breakpoint: 576, breakpoint: 576,
settings: { settings: {
arrows: false, slidesToShow: 1,
slidesToShow: 2, slidesToScroll: 1,
slidesToScroll: 2,
}, },
}, },
], ],

View File

@ -5,17 +5,6 @@
@import "./utils/all"; @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/header"; @import "./partials/header";
@import "./partials/menu"; @import "./partials/menu";
@import "./partials/barraDeVantagens"; @import "./partials/barraDeVantagens";
@ -24,4 +13,19 @@
@import "./partials/prateleira"; @import "./partials/prateleira";
@import "./partials/ajustes"; @import "./partials/ajustes";
@import "./partials/flags"; @import "./partials/flags";
@import "./partials/search" @import "./partials/search";
@import "./partials/slider";
@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";

View File

@ -18,16 +18,8 @@
} }
.slick-arrow { .slick-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 5;
padding: 0;
border: 0;
font-size: 0;
background-color: transparent;
outline: 0;
cursor: pointer;
@extend .sprite; @extend .sprite;
@include mq(md, max) { @include mq(md, max) {
@ -59,13 +51,10 @@
} }
.slick-dots { .slick-dots {
display: flex !important;
align-items: center;
justify-content: center;
position: absolute; position: absolute;
z-index: 5; z-index: 5;
margin: 0;
width: 100%; width: 100%;
bottom: 14px; bottom: 14px;
left: 0; left: 0;
@ -75,26 +64,17 @@
} }
li { li {
display: flex; &.slick-active {
margin: 0 4px; button {
.slick-active {
width: 16px; width: 16px;
height: 16px; height: 16px;
border: 11ps solid $white-500;
background: transparent; background: transparent;
border: 11ps solid $white-500;
}
} }
} }
button {
padding: 0;
border: 0;
outline: 0;
background: $white-500;
width: 10px;
height: 10px;
}
} }
} }
@ -141,4 +121,8 @@
white-space: nowrap; white-space: nowrap;
} }
} }
.shelf {
margin-bottom: 172px;
}
} }

View File

@ -1,43 +1,38 @@
.flags-product { .flags-product {
display: block;
pointer-events: none;
position: absolute; position: absolute;
width: 100%; top: 0;
z-index: 5; left: 0;
z-index: 10;
padding: 8px;
p { .flag {
background-repeat: no-repeat;
color: $color-white;
display: none; display: none;
font-size: 11px;
float: right; font-size: 10px;
font-weight: 700; line-height: 12px;
text-transform: uppercase;
margin: 0 0 8px;
min-width: 54px; min-width: 54px;
margin: 7px 100% 0 7px; max-width: max-content;
overflow: hidden; height: 20px;
padding: 2.5px 4px; &.novo,
text-indent: -9999px;
&.produto-off { &.produto-off {
background: $color-black2; display: flex;
display: table; align-items: center;
float: left; justify-content: center;
text-indent: 0;
width: 50px;
&:after {
content: "OFF";
display: inline-block;
}
} }
&.novo { &.novo {
background-color: $color-pink; font-weight: bold;
border-radius: 5px; background: $blue-500;
display: table; color: $white-500;
float: left; }
text-indent: 0;
text-transform: uppercase; &.produto-off {
font-weight: 900;
color: $white-500;
background-color: $black-500;
} }
} }
} }

View File

@ -1,263 +1,189 @@
/***************************************************************/ .shelf {
/**-- 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: $color-black2;
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: $color-pink;
height: 16px;
width: 16px;
}
}
}
h2 { h2 {
color: $color-pink; margin: 0;
font-size: 24px; line-height: 19px;
margin: 0 0 24px; font-size: 16px;
margin: 0 0 16px 0;
text-align: center; text-align: center;
text-transform: lowercase;
} }
ul { ul {
max-width: 95%; margin: 0;
margin: auto; @include mq(md, max) {
padding: 0 32px;
}
}
.slick-track {
display: flex;
}
.slick-slide {
height: auto;
& > div, li {
height: 100%;
}
}
.slick-arrow {
@extend .sprite;
@include mq(md, max) { @include mq(md, max) {
max-width: 300px; transform: translateY(-50%) scale(0.7);
} }
} }
li { .slick-prev {
display: inline-block; right: 100%;
vertical-align: top;
padding: 0 2.5px; @include mq(md, max) {
left: 0;
right: auto;
transform-origin: left;
} }
@extend .sprite-arrow-left-prateleira;
}
.slick-next {
left: 100%;
@include mq(md, max) {
right: 0;
left: auto;
transform-origin: right;
}
@extend .sprite-arrow-right-prateleira;
} }
.produto-na-prateleira { .produto-na-prateleira {
padding: 0 5px;
position: relative; position: relative;
text-align: center; margin: 0 15px;
display: flex;
flex-direction: column;
height: 100%;
.product-image { .product-image {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
padding-top: 100%;
margin-bottom: 16px;
.lazyload__sibling { &:hover {
padding-bottom: 100%; .foto-secundaria {
opacity: 1;
+ div { pointer-events: all;
top: 0;
left: 0;
position: absolute;
width: 100%;
} }
} }
.lazyload__sibling img {
left: 50%;
max-width: initial;
position: relative;
transform: translateX(-50%);
width: 100%;
}
.foto-principal, .foto-principal,
.foto-secundaria { .foto-secundaria {
transition: all 0.25s linear; position: absolute;
} width: 100%;
height: 100%;
&:hover .foto-secundaria, top: 0;
.foto-principal { left: 0;
visibility: visible; z-index: 5;
opacity: 1;
z-index: 1;
} }
.foto-secundaria { .foto-secundaria {
position: absolute;
width: 100%;
top: 0;
z-index: -1;
visibility: hidden;
opacity: 0; opacity: 0;
pointer-events: none;
transition: all 0.2s ease-in-out;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
} }
} }
.informacoes .nome { .indisponivel, .disponivel {
font-size: 14px; flex: 1;
line-height: 16px; display: flex;
margin-top: 16px; flex-direction: column;
min-height: 34px; }
text-transform: capitalize;
.nome {
text-align: center;
text-transform: uppercase;
line-height: 12px;
font-size: 10px;
font-weight: 500;
margin-bottom: 17px;
} }
.price { .price {
margin: 8px 0 17px; text-align: center;
text-transform: uppercase;
margin-bottom: 17px;
> div {
line-height: 1.3;
}
.antigo { .antigo {
color: $color-gray2; margin-bottom: 4px;
font-size: 14px; color: $gray-300;
min-height: 18px; line-height: 12px;
font-size: 10px;
text-decoration: line-through; text-decoration: line-through;
} }
.principal { .principal {
font-size: 18px; font-weight: 900;
font-weight: 700; margin-bottom: 4px;
line-height: 16px;
font-size: 13px;
} }
.parcelado { .parcelado {
color: $color-gray2; line-height: 12px;
font-size: 12px; font-size: 10px;
color: $gray-300;
strong {
font-weight: normal;
} }
} }
.boleto {
display: none;
}
}
.compra {
.btn-compra { .btn-compra {
margin: 0;
display: block;
transition: all 0.25s linear 0.25s;
@include mq(md, min) {
visibility: hidden;
opacity: 0;
}
a { a {
background-color: $color-green; background-color: $black-500;
color: $color-white; display: flex;
display: block; align-items: center;
font-size: 14px; justify-content: center;
letter-spacing: 1px; height: 50px;
padding: 15px 0; line-height: 12px;
font-size: 10px;
font-weight: bold;
color: $white-500;
text-transform: uppercase; text-transform: uppercase;
transition: all 0.15s linear;
@include mq(lg) { transition: background-color 0.2s linear;
&:hover {
background-color: $color-green2;
}
@include mq(md, max) {
&:active { &:active {
background-color: $color-green3; background: lighten($black-500, 10);
} }
} }
} }
&:hover {
background: lighten($black-500, 10);
} }
} }
@include mq(lg) {
&:hover .compra .btn-compra {
visibility: visible;
opacity: 1;
z-index: 1;
}
}
.indisponivel { .indisponivel {
color: $color-pink; display: none;
.erro {
display: flex;
justify-content: center;
align-items: center;
height: 50px;
line-height: 12px;
font-size: 10px;
font-weight: bold; font-weight: bold;
margin: 5px 0; color: $red-300;
}
}
} }
} }

View File

@ -0,0 +1,33 @@
.slick-arrow {
position: absolute;
top: 50%;
transform: rotateY(-50%);
z-index: 5;
padding: 0;
border: 0;
font-size: 0;
background-color: transparent;
outline: 0;
cursor: pointer;
}
.slick-dots {
display: flex !important;
align-items: center;
justify-content: center;
margin: 0;
li {
display: flex;
margin: 0 4px;
}
button {
padding: 0;
border: 0;
outline: 0;
background: $white-500;
width: 10px;
height: 10px;
}
}

View File

@ -1,5 +1,5 @@
// fonts // 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-family: "Inter", sans-serif;
$font-weight-light: 300; $font-weight-light: 300;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -56,6 +56,12 @@
</li> </li>
</ul> </ul>
</section> </section>
<section class="shelf">
<div class="container">
<vtex:contentPlaceHolder id="prateleira-01" />
</div>
</section>
</main> </main>
<footer> <footer>

View File

@ -66,13 +66,11 @@
<div class="parcelado"> <div class="parcelado">
<span class="desconto-parcelado"> <span class="desconto-parcelado">
ou ou
<strong>
<span class="numero-de-parcelas">1</span>X de <span class="numero-de-parcelas">1</span>X de
<span class="value"> <span class="value">
R$ 2,50 R$ 2,50
<!-- $product.BestPrice --> <!-- $product.BestPrice -->
</span> </span>
</strong>
no cartão no cartão
</span> </span>
</div> </div>

View File

@ -1,70 +1,50 @@
#set($id = $product.Id) #set($id = $product.Id) #set($idSku = $product.productVariantId) #set($uri =
#set($idSku = $product.productVariantId) $product.Uri) #set($escapedName = $product.HtmlEscapedName)
#set($uri = $product.Uri)
#set($escapedName = $product.HtmlEscapedName)
<div class="produto-na-prateleira" data-sku-id="$id"> <div class="produto-na-prateleira" data-sku-id="$id">
<div class="flags-product"> <div class="flags-product">
<span class="HightLight"> <span class="HightLight"> $product.HightLight </span>
$product.HightLight <span class="DiscountHightLight"> $product.DiscountHightLight </span>
</span>
<span class="DiscountHightLight">
$product.DiscountHightLight
</span>
</div> </div>
<div class="product-image"> <div class="product-image">
<a href="$uri" title=$escapedName> <a href="$uri" title="$escapedName">
<div class="foto-principal"> <div class="foto-principal">
<div class="lazyload__sibling"></div> <div class="lazyload__sibling"></div>
<div class="lazyload" data-noscript=""> <div class="lazyload" data-noscript="">
<noscript> <noscript> $product.GetImageTag(2) </noscript>
$product.GetImageTag(2)
</noscript>
</div> </div>
</div> </div>
<div class="foto-secundaria"> <div class="foto-secundaria">
<div class="lazyload__sibling"></div> <div class="lazyload__sibling"></div>
<div class="lazyload" data-noscript=""> <div class="lazyload" data-noscript="">
<noscript> <noscript> $product.GetImageTag(2,"ultima") </noscript>
$product.GetImageTag(2,"ultima")
</noscript>
</div> </div>
</div> </div>
</a> </a>
</div> </div>
<div class="informacoes"> <div class="informacoes">
<div class="avaliacao"></div> <div class="avaliacao"></div>
<div class="nome"> <div class="nome">$escapedName</div>
$escapedName
</div>
</div> </div>
#if ($product.IsInStock) #if ($product.IsInStock)
<div class="disponivel"> <div class="disponivel">
<div class="price"> <div class="price">
<div class="antigo"> <div class="antigo">
#if ($product.HasBestPrice) #if ($product.HasBestPrice)
<span class="value"> <span class="value"> $product.ListPrice </span>
$product.ListPrice
</span>
#end #end
</div> </div>
<div class="principal"> <div class="principal">
<span class="value"> <span class="value"> $product.BestPrice </span>
$product.BestPrice
</span>
</div> </div>
#if($product.NumbersOfInstallment > 1) #if($product.NumbersOfInstallment > 1)
<div class="parcelado"> <div class="parcelado">
<span class="desconto-parcelado"> <span class="desconto-parcelado">
ou ou
<strong> <span class="numero-de-parcelas"
<span class="numero-de-parcelas">$product.NumbersOfInstallment</span>X de >$product.NumbersOfInstallment</span
<span class="value"> >X de
$product.InstallmentValue <span class="value"> $product.InstallmentValue </span>
</span>
</strong>
no cartão no cartão
</span> </span>
</div> </div>