PLEASE HELP - Debut Theme - CURRENT CAROUSEL CANNOT CENTRE THEME

vitamentltd
Tourist
17 0 1

Hi

I have coded a featured collections carousel into my website. See screen shot attached. 

My Current code for this is below. www.vitament.co.uk 

I want to turn this into the kenwheeler Centered carousel (screen shot attached). I cannot figure out how to change my current code to read style like this. 

KENWHEELER CENTER CODE:

$('.center').slick({ centerMode: true, centerPadding: '60px', slidesToShow: 3, responsive: [ { breakpoint: 768, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 3 } }, { breakpoint: 480, settings: { arrows: false, centerMode: true, centerPadding: '40px', slidesToShow: 1 } } ] });

I have also uploaded all the assets but unsure how to get them to work on my current carousel.

Vitament current carousel code:

(NEW) Collection-slider.liquid

<div class="page-width">
{% if section.settings.title != blank %}
<div class="section-header text-center">
<h2>{{ section.settings.title | escape }}</h2>
</div>
{% endif %}

{%- assign collection = collections[section.settings.collection] -%}

{% case section.settings.grid %}
{% when 2 %}
{%- assign max_height = 530 -%}
{%- assign grid_item_width = 'medium-up--one-half' -%}
{% when 3 %}
{%- assign max_height = 345 -%}
{%- assign grid_item_width = 'small--one-half medium-up--one-third' -%}
{% when 4 %}
{%- assign max_height = 250 -%}
{%- assign grid_item_width = 'small--one-half medium-up--one-quarter' -%}
{% when 5 %}
{%- assign max_height = 195 -%}
{%- assign grid_item_width = 'small--one-half medium-up--one-fifth' -%}
{% endcase %}

{%- assign product_limit = 12 %}

<ul data-slides="{{section.settings.grid}}" class="grid grid--uniform grid--view-items collection-slider">
{% for product in collection.products limit: product_limit %}
<li class="grid__item grid__item--{{section.id}} {{ grid_item_width }}">

{% include 'product-card-grid', max_height: max_height, product: product, show_vendor: section.settings.show_vendor %}
</li>
{% else %}

{% for i in (1..product_limit) %}
<li class="grid__item grid__item--{{section.id}} {{ grid_item_width }}">
<div class="grid-view-item product-card">
<a class="grid-view-item__link grid-view-item__image-container full-width-link" href="#">
<span class="visually-hidden">{{ 'homepage.onboarding.product_title' | t }}</span>
</a>
<div class="grid-view-item__image-wrapper">
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
</div>
<div class="h4 grid-view-item__title" aria-hidden="true">{{ 'homepage.onboarding.product_title' | t }}</div>
{% include 'product-price' %}
</div>
</li>
{% endfor %}
{% endfor %}
</ul>

{% if section.settings.show_view_all %}
<hr class="hr--invisible" aria-hidden="true" />
<div class="text-center">
<a href="{{ collection.url }}" class="btn" aria-label="{{ 'collections.general.view_all_label' | t: collection_name: collection.title }}">
{{ 'collections.general.view_all' | t }}
</a>
</div>
{% endif %}

</div>

 

{% schema %}
{
"name": {
"da": "Udvalgt kollektion",
"de": "Vorgestellte Kategorie",
"en": "Featured collection",
"es": "Colección destacada",
"fi": "Esittelyssä oleva kokoelma",
"fr": "Collection en vedette",
"hi": "फ़ीचर्ड कलेक्शन",
"it": "Collezione in evidenza",
"ja": "特集コレクション",
"ko": "추천 컬렉션",
"nb": "Utvalgt samling",
"nl": "Uitgelichte collectie",
"pt-BR": "Coleção em destaque",
"pt-PT": "Coleção em destaque",
"sv": "Utvald kollektion",
"th": "คอลเลกชันแนะนำ",
"zh-CN": "特色产品系列",
"zh-TW": "精選商品系列"
},
"class": "index-section",
"settings": [
{
"type": "text",
"id": "title",
"label": {
"da": "Overskrift",
"de": "Titel",
"en": "Heading",
"es": "Título",
"fi": "Otsake",
"fr": "En-tête",
"hi": "शीर्षक",
"it": "Heading",
"ja": "見出し",
"ko": "제목",
"nb": "Overskrift",
"nl": "Kop",
"pt-BR": "Título",
"pt-PT": "Título",
"sv": "Rubrik",
"th": "ส่วนหัว",
"zh-CN": "标题",
"zh-TW": "標題"
},
"default": {
"da": "Udvalgt kollektion",
"de": "Vorgestellte Kategorie",
"en": "Featured collection",
"es": "Colección destacada",
"fi": "Esittelyssä oleva kokoelma",
"fr": "Collection en vedette",
"hi": "फ़ीचर्ड कलेक्शन",
"it": "Collezione in evidenza",
"ja": "特集コレクション",
"ko": "추천 컬렉션",
"nb": "Fremhevet samling",
"nl": "Uitgelichte collectie",
"pt-BR": "Coleção em destaque",
"pt-PT": "Coleção em destaque",
"sv": "Utvald kollektion",
"th": "คอลเลกชันแนะนำ",
"zh-CN": "特色产品系列",
"zh-TW": "精選商品系列"
}
},
{
"id": "collection",
"type": "collection",
"label": {
"da": "Kollektion",
"de": "Kategorie",
"en": "Collection",
"es": "Colección",
"fi": "Kokoelma",
"fr": "Collection",
"hi": "कलेक्शन",
"it": "Collezione",
"ja": "コレクション",
"ko": "컬렉션",
"nb": "Samling",
"nl": "Collectie",
"pt-BR": "Coleção",
"pt-PT": "Coleção",
"sv": "Produktserie",
"th": "คอลเลกชัน",
"zh-CN": "收藏",
"zh-TW": "商品系列"
}
},
{
"type": "range",
"id": "grid",
"label": {
"da": "Produkter pr. række",
"de": "Produkte per Reihe",
"en": "Products per row",
"es": "Productos por fila",
"fi": "Tuotteita per rivi",
"fr": "Produits par rangée",
"hi": "प्रति पंक्ति उत्पाद",
"it": "Prodotti per riga",
"ja": "行あたりの商品数",
"ko": "열 별 제품",
"nb": "Produkter per rad",
"nl": "Producten per rij",
"pt-BR": "Produtos por linha",
"pt-PT": "Produtos por linha",
"sv": "Produkter per rad",
"th": "สินค้าต่อแถว",
"zh-CN": "每行产品数",
"zh-TW": "每列產品數"
},
"min": 2,
"max": 5,
"step": 1,
"default": 3
},

{
"type": "checkbox",
"id": "show_vendor",
"label": {
"da": "Vis produktleverandører",
"de": "Produkt-Lieferanten anzeigen",
"en": "Show product vendors",
"es": "Mostrar proveedores del producto",
"fi": "Näytä tuotteen myyjät",
"fr": "Afficher les vendeurs",
"hi": "उत्पाद विक्रेताओं को दिखाएं",
"it": "Mostra fornitori prodotto",
"ja": "商品の販売元を表示する",
"ko": "제품 공급 업체 표시",
"nb": "Vis produktleverandører",
"nl": "Productleveranciers weergeven",
"pt-BR": "Exibir fornecedores do produto",
"pt-PT": "Mostrar fornecedores do produto",
"sv": "Visa produktleverantörer",
"th": "แสดงผู้ขายสินค้า",
"zh-CN": "显示产品厂商",
"zh-TW": "顯示產品廠商"
},
"default": false
},
{
"type": "checkbox",
"id": "show_view_all",
"label": {
"da": "Vis knappen \"Se flere\"",
"de": "'Alle anzeigen' Button anzeigen",
"en": "Show 'View all' button",
"es": "Mostrar el botón 'Ver todo'",
"fi": "Näytä \"Näytä kaikki\" -painike",
"fr": "Afficher le bouton “Tout voir”",
"hi": "'सभी देखें' बटन दिखाएं",
"it": "Mostra il pulsante \"Visualizza tutto\"",
"ja": "「すべて表示」ボタンを表示する",
"ko": "'모두 보기' 버튼 표시",
"nb": "Vis «Se alle»-knapp",
"nl": "Knop 'Alles weergeven' weergeven",
"pt-BR": "Exibir botão 'Visualizar tudo'",
"pt-PT": "Mostrar botão 'Ver tudo'",
"sv": "Visa \"Visa alla\"-knappen",
"th": "แสดงปุ่ม 'ดูทั้งหมด'",
"zh-CN": "显示“查看全部”按钮",
"zh-TW": "顯示「檢視全部」按鈕"
},
"default": false
}
],
"presets": [
{
"name": {
"da": "Udvalgt kollektion",
"de": "Vorgestellte Kategorie",
"en": "Featured collection Slider",
"es": "Colección destacada",
"fi": "Esittelyssä oleva kokoelma",
"fr": "Collection en vedette",
"hi": "फ़ीचर्ड कलेक्शन",
"it": "Collezione in evidenza",
"ja": "特集コレクション",
"ko": "추천 컬렉션",
"nb": "Utvalgt samling",
"nl": "Uitgelichte collectie",
"pt-BR": "Coleção em destaque",
"pt-PT": "Coleção em destaque",
"sv": "Utvald kollektion",
"th": "คอลเลกชันแนะนำ",
"zh-CN": "特色产品系列",
"zh-TW": "精選商品系列"
},
"category": {
"da": "Kollektion",
"de": "Kategorie",
"en": "Collection",
"es": "Colección",
"fi": "Kokoelma",
"fr": "Collection",
"hi": "कलेक्शन",
"it": "Collezione",
"ja": "コレクション",
"ko": "컬렉션",
"nb": "Samling",
"nl": "Collectie",
"pt-BR": "Coleção",
"pt-PT": "Coleção",
"sv": "Produktserie",
"th": "คอลเลกชัน",
"zh-CN": "收藏",
"zh-TW": "商品系列"
}
}
]
}
{% endschema %}

 

THEME.SCSS

 

.collection-slider

{

  .slick-track{

    display:flex;

  }

  .product-card{width:100%;

}

  .slick-prev{

    left:0;

    z-index:999;

  }

  .slick-next{

    right:0;

    z-index:999;

  }

  padding-right:25px;

  overflow:hidden;

}

JAVASCRIPT

Screenshot 2021-02-20 at 10.57.23.pngScreenshot 2021-02-20 at 11.07.41.png

0 Likes