-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/62386070 showcase page #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oostap1985
wants to merge
7
commits into
mlutcss:main
Choose a base branch
from
oostap1985:feat/62386070_showcase-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9ea8613
feat(showcase): add showcase page
94cda24
fix(showcase): integrate hover-slider and update data
66e3b2d
fix(showcase)
f09f8fd
fix(showcase)
b16fce8
fix(showcase): fix slider-component
5fc7973
fix(showcase): fix mlut util and SliderComponent
6c497ac
fix(Showcase): fix mlut util
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| [ | ||
| { | ||
| "title": "John Smith", | ||
| "images": ["/assets/img/imagesCases/Emily_Blunt-new.jpg", "/assets/img/сases/Koshak_Koteevich.jpg"], | ||
| "description": "Все, что человеческий разум способен понять и во что он способен поверить, достижимо.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Emily Blunt", | ||
| "images": ["/assets/img/imagesCases/John_Smith-new.jpg", "/assets/img/сases/Emily_Blunt-new.jpg", "/assets/img/imagesCases/Koshak_Koteevich.jpg"], | ||
| "description": "Сложнее всего начать действовать, все остальное зависит только от упорства.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Koshak Koteevich", | ||
| "images": ["/assets/img/imagesCases/Tigra_Leopardovich.jpg", "/assets/img/сases/Emily_Blunt-new.jpg", "/assets/img/imagesCases/Koshak_Koteevich.jpg"], | ||
| "description": "Неудача — это возможность начать заново, но уже более мудро.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Luna Lovegood", | ||
| "images": ["/assets/img/imagesCases/orange-wood-table.jpg", "/assets/img/сases/Koshak_Koteevich.jpg"], | ||
| "description": "Если проблему можно решить, не стоит о ней беспокоиться.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Milana Clark", | ||
| "images": ["/assets/img/imagesCases/Panda_Padlovna.jpg", "/assets/img/сases/orange-wood-table.jpg", "/assets/img/imagesCases/Emily_Blunt-new.jpg", "/assets/img/imagesCases/Koshak_Koteevich.jpg"], | ||
| "description": "Обстоятельства часто можно изменить, изменив свое отношение к ним.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Leopardovskiy Orange Apelsinovich", | ||
| "images": ["/assets/img/imagesCases/Koshak_Koteevich.jpg", "/assets/img/сases/Emily_Blunt-new.jpg"], | ||
| "description": "Обстоятельства часто можно изменить, изменив свое отношение к ним.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Panda Padlovna", | ||
| "images": ["/assets/img/imagesCases/Milana_Clark-new.jpg", "/assets/img/сases/Koshak_Koteevich.jpg"], | ||
| "description": "Вдохновение приходит только во время работы. Обстоятельства часто можно изменить, изменив свое отношение к ним.", | ||
| "link": "/" | ||
| }, | ||
| { | ||
| "title": "Tigra Leopardovich", | ||
| "images": ["/assets/img/imagesCases/Luna_Lovegood-new.jpg", "/assets/img/сases/Emily_Blunt-new.jpg", "/assets/img/imagesCases/Koshak_Koteevich.jpg", "/assets/img/imagesCases/Panda_Padlovna.jpg"], | ||
| "description": "Если проблему можно решить, не стоит о ней беспокоиться.", | ||
| "link": "/" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,9 @@ | |
| { | ||
| "link":"https://play.mlut.style/", | ||
| "text":"Sandbox" | ||
| }, | ||
| { | ||
| "link":"/showcase", | ||
| "text":"Showcase" | ||
| } | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| <% | ||
| const item = it.item; | ||
| const images = item.images && Array.isArray(item.images) ? item.images : []; | ||
| %> | ||
|
|
||
| <li> | ||
| <a class="Txd-n C-ih -Sz100p D-f Fld-c -Bdy -Bdyc-$accent750 -Bdyc-$brand_h Ts-bd,0.3s,e Cs" href="<%= item.link %>"> | ||
| <slider-component> | ||
| <div class="P2.5u"> | ||
| <div class="swiper"> | ||
| <div class="swiper-wrapper"> | ||
| <% if (images.length) { %> | ||
| <% images.forEach(img => { %> | ||
| <div class="swiper-slide"> | ||
| <div class="W100p H244"> | ||
| <img src="<%= img %>" alt="<%= item.title %>" class="-Sz100p Ojf-cv Ojp-c Bdrd8"> | ||
| </div> | ||
| </div> | ||
| <% }); %> | ||
| <% } else { %> | ||
| <div class="swiper-slide">Sorry, but there are no images</div> | ||
| <% } %> | ||
| </div> | ||
| <div class="swiper-pagination"></div> | ||
| <div class="D-f Jc-sb -Sz100p Ps-a T0 Zi1 O0 O1_h -Ts md_O0_h"> | ||
| <button class="prev P1u Bg-n Bd-n Bdrd8"> | ||
| <svg class="Fi-$gray200 Fi-$brand_a -Ts Tf -Rt180d Cs" width="26" height="26"> | ||
| <use href="/assets/img/icons.svg#arrow-swiper"></use> | ||
| </svg> | ||
| </button> | ||
| <button class="next P1u Bg-n Bd-n Bdrd8"> | ||
| <svg class="Fi-$gray200 Fi-$brand_a -Ts Cs" width="26" height="26"> | ||
| <use href="/assets/img/icons.svg#arrow-swiper"></use> | ||
| </svg> | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </slider-component> | ||
| <div class="D-f Fld-c P2.5u Bdt1;s;$accent750"> | ||
| <span class="Mb3u Fns4u"><%= item.title ?? '' %></span> | ||
| <span class="Fns3u C-$gray350"><%= item.description ?? '' %></span> | ||
| </div> | ||
| </a> | ||
| </li> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import Swiper from 'https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.mjs'; | ||
|
|
||
| const swiperCss = "https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.css"; | ||
| if (!document.querySelector(`link[href*="swiper-bundle.min.css"]`)) { | ||
| const link = document.createElement('link'); | ||
| link.rel = 'stylesheet'; | ||
| link.href = swiperCss; | ||
| document.head.appendChild(link); | ||
| } | ||
|
|
||
| class SliderComponent extends HTMLElement { | ||
| constructor() { | ||
| super(); | ||
| } | ||
|
|
||
| connectedCallback() { | ||
| const swiperContainer = this.querySelector('.swiper'); | ||
| if (!swiperContainer) return; | ||
|
|
||
| this.swiper = new Swiper(swiperContainer, { | ||
| pagination: { | ||
| el: this.querySelector('.swiper-pagination'), | ||
| clickable: false, | ||
| dynamicBullets: true | ||
| }, | ||
| navigation: { | ||
| nextEl: '.next', | ||
| prevEl: '.prev' | ||
| }, | ||
| loop: true, | ||
| speed: 300, | ||
| effect: 'fade', | ||
| fadeEffect: { crossFade: true }, | ||
| simulateTouch: false, | ||
| allowTouchMove: true, | ||
| autoplay: false, | ||
| grabCursor: false | ||
| }); | ||
|
|
||
| const totalSlides = this.querySelectorAll('.swiper-slide').length; | ||
| if (totalSlides <= 1) return; | ||
|
|
||
| swiperContainer.addEventListener('mousemove', (e) => { | ||
| const rect = swiperContainer.getBoundingClientRect(); | ||
| const x = e.clientX - rect.left; | ||
| const percentage = x / rect.width; | ||
| let slideIndex = Math.floor(percentage * totalSlides); | ||
| if (slideIndex >= totalSlides) slideIndex = totalSlides - 1; | ||
| if (slideIndex < 0) slideIndex = 0; | ||
| this.swiper.slideTo(slideIndex, 300, false); | ||
| }); | ||
|
|
||
| swiperContainer.addEventListener('mouseleave', () => { | ||
| this.swiper.slideTo(0, 800, false); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| customElements.define('slider-component', SliderComponent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| title: Showcase | ||
| layout: base.ejs | ||
| --- | ||
|
|
||
| <% | ||
| const bdX = "-Bdx -Bdxc-$accent750"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Зачем тут 2 утилиты если можно цвет сразу в |
||
| const bdY = "-Bdy -Bdyc-$accent750"; | ||
| %> | ||
|
|
||
| <div class="P-$headerH;5;0 D-f C-$accent900 md_P-$headerH;100;0"> | ||
| <div class="D-n W8u <%= bdX %> md_D-f"></div> | ||
| <div class="Pb40 W100p"> | ||
| <div class="M40;0;60 P0;20 W100p <%= bdY %> md_W-$bleedWidth md_M40;-140;80 md_P0;160"> | ||
| <h1 class="Txa-c M10;0">Showcase</h1> | ||
| </div> | ||
| <div class="D-n H8u W-$bleedWidth Ml-140 <%= bdY %> md_D-f"></div> | ||
| <ul class="Lss-n P0 M8u;5u D-g Gtc-t1 Gap8u sm_Gtc-t2 xl_Gtc-t3 xxl_Gtc-t4"> | ||
| <% for (let elem of it.cases) { %> | ||
| <%- include('_includes/components/show-card-swiper.ejs', { item: elem }) %> | ||
| <% } %> | ||
| </ul> | ||
| <div class="D-n H8u W-$bleedWidth Ml-140 <%= bdY %> md_D-f"></div> | ||
| </div> | ||
| <div class="D-n W8u <%= bdX %> md_D-f"></div> | ||
| </div> | ||
|
|
||
| <script src="/assets/script/swiper.js" type="module"></script> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем в названии каталога
images, если по верхнему каталогу и так понятно, что тут изображения?