feat(main-page): redesign using new components#24
Conversation
oostap1985
commented
Jun 1, 2026
- add redesigned base layout and includes
- add new navigation and external links data
- add art slider script
- update arts JSON and templates (exploding-head, mushroom)
- add new icons and fonts
- update global styles
- add redesigned base layout and includes - add new navigation and external links data - add art slider script - update arts JSON and templates (exploding-head, mushroom) - add new icons and fonts - update global styles
e7e4a2e to
b81a3ff
Compare
There was a problem hiding this comment.
Нет смысла создавать подобные отдельный файлы на редизайн, может только в некоторых местах. Тут просто ссылки: их набор никак не влияет
| contentContainer: "D-f Jc-c Ai-c" | ||
| } | ||
|
|
||
| href=`href=${it.url}` |
There was a problem hiding this comment.
Тут что-то странное: переменная без let/const
| --ml-blueGray:rgb(236, 240, 246,0.5); | ||
| --ml-gray200:#d1d5db; | ||
| --ml-gray350:#cacacaa0; | ||
| // redesign |
There was a problem hiding this comment.
В таких переменных нет смысла - меняем существующией
There was a problem hiding this comment.
Пока не понял, зачем новый базовый шаблон
There was a problem hiding this comment.
Отдельный базовый шаблон не нужен. Можно просто пока часть старых переменных оставить, чтобы другие страницы совсем не сломались
There was a problem hiding this comment.
Шрифты лучше с google fonts подключать, по крайне мере пока
| } | ||
| %> | ||
| <div class="Ctnt-s M7u;a;0 H100p Apcr1 Plci-c;c Plcc-c D-f -ExplodingOrangeA#ee980d -ExplodingOrangeB#f8c829 -ExplodingBrownA#662800 -ExplodingBrownB#6f2810 -ExplodingBrownC#9c2a00 -ExplodingBrownD#934800 -ExplodingBrownE#9b3c18 -ExplodingBrownF#a24b0b -ExplodingBrownG#f7ae48 -ExplodingBrownH#d2a55a -ExplodingBrownI#efd3ac"> | ||
| <!-- изменил у первого div M7u;a;0 --> |
There was a problem hiding this comment.
Комменты для ревьювера надо тут писать, а не в коде)
| @@ -0,0 +1,28 @@ | |||
| <% | |||
| const css = { | |||
| buttonShape:"-Sz100p D-f Jc-c Ai-c P10 Fns16 Bdrd8 Ts-$shortTs Bd1;s;$brand", | |||
There was a problem hiding this comment.
Pixel perfect нам не нужен, поэтому в большинстве мест лучше u использовать для размеров
| <% | ||
| const css = { | ||
| buttonShape:"-Sz100p D-f Jc-c Ai-c P10 Fns16 Bdrd8 Ts-$shortTs Bd1;s;$brand", | ||
| contentContainer: "D-f Jc-c Ai-c" |
| %> | ||
| <<%= it.tag %> <%= href %> | ||
| class="btn <%= css.buttonShape %> <%= css.buttonColors %>"> | ||
| <span class="<%= css.span %>"> |
|
|
||
| <a | ||
| href="<%= it.link %>" | ||
| alt="Link to <%= it.name %>" |
| :c:+_Bgc-$brand :c:+_Bdc-$brand :c:+_Bgc-$reAccent900_af,b :c:+_Bxsd0;1.5u;0;0;$reAccent900_af :c:+_Bdc-n"> | ||
| </label> | ||
|
|
||
| <label id="overlay" for="menu-toggle" |
There was a problem hiding this comment.
2 лейбла на 1 инпут - это что-то странное
There was a problem hiding this comment.
Меняем основной хедер, отдельный шаблон не нужен
There was a problem hiding this comment.
На мобильном не соответствует макету + логотип надо чуть побольше: 64px хотя бы
| <header class=" D-f Jc-sb Ai-c P15u;4u;2u md_P0;5.5p Bgc-$core950 Bcf -Blr0.4 Ps-f H-$headerH W100p C-$headerC Zi20"> | ||
|
|
||
| <%# Logo %> | ||
| <div class="W40 H16 md_W83 md_H34"> |
There was a problem hiding this comment.
Это наоборот делается: указываем размеры изображения, от которых зависит контейнер
There was a problem hiding this comment.
Ширину логотипа сделать 116, высоту: auto
| <%# Logo %> | ||
| <div class="W40 H16 md_W83 md_H34"> | ||
| <a href="/" id="header-logo" class="D-f Jc-c Ai-c -Sz100p <%= it.cssHeaderLogoVisibility %> Ts-O;$shortTs"> | ||
| <svg class="-Sz100p" alt="mlut logo"> |
There was a problem hiding this comment.
Если логотип не перекрашивается, то его лучше просто img делать. И посмотри как сейчас href у лого реализован - надо так же
| %> | ||
|
|
||
| <header class=" D-f Jc-sb Ai-c P15u;4u;2u md_P0;5.5p Bgc-$core950 Bcf -Blr0.4 Ps-f H-$headerH W100p C-$headerC Zi20"> | ||
|
|
There was a problem hiding this comment.
Много пустых строк - не надо так. Пусть будут только между крупными блоками
| </li> | ||
| <% }%> | ||
| </ul> | ||
| <script type="module"> |
| document.head.appendChild(link); | ||
| } | ||
|
|
||
| class ArtsSliderComponent extends HTMLElement { |
| <div class="D-f Fld-c Ai-c Gap4u W100p md_W80p md_Mxw350 lg_Mxw504"> | ||
| <div class="<%= heroCSS.gradient %> md_D-n"></div> | ||
|
|
||
| <h1 class="D Fnf-SNPro Fns6u Fnw-b Lnh100p Lts0 M3.5u;0 Txt C-$brand Ps Zi2 md_D-n">Make CSS exciting again!</h1> |
There was a problem hiding this comment.
Это не h1. Посмотри, какая сейчас разметка в hero секции
There was a problem hiding this comment.
И отступы (margin) по дефолту только с 1 стороны делаем: низ или верх
| <use href="/assets/img/icons.svg#twoTriangle"></use> | ||
| </svg> | ||
| <div class="D-n md_D-f md_Fld-c Gap8"> | ||
| <h1 class="Fnf-SNPro Fns48 M17;0 Fnw-b Lnh100p Lts0 Txt C-$brand">Make CSS exciting again!</h1> |
There was a problem hiding this comment.
Надо попробовать сверстать без дублирования контента. Такое только в крайнем случае делается
| <div class="D-n Ps-a W80p H150p T-195 L50p Tf -Tr-50p;0 <%= heroCSS.dradientDescTop %> <%= heroCSS.dradientDescBot %> md_D-f"> | ||
| <div class="Ps-a W80p Apcr1 T0 L10p Bdrd100p -Gdl180d,$reCore400;0,$reCore450;100p Ft -Blr100"></div> | ||
| </div> | ||
| <div class="D-f Fld-c Ai-c Gap4u W100p md_W80p md_Mxw350 lg_Mxw504"> |
There was a problem hiding this comment.
Кажется, что тут часть декора можно псевдоэлементами сделать
| <arts-slider class="D-f Ai-fs Fl1 W100p"> | ||
| <button class="prev W48 Apcr1 Mr40 As-c Bgc-tp Bd-n P0 Cs lg_Mr80"> | ||
| <svg class="Tf -Rt180d C-$brand C-$reBrand500_h C-$reBrand600_a Ts-$shortTs" width="17" height="29"> | ||
| <use href="/assets/img/icons.svg#arrow-slider"></use> |
There was a problem hiding this comment.
Для декоративных svg лучше отдельный спрайт сделать
| </svg> | ||
| </button> | ||
| </arts-slider> | ||
| <span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is CSS</span> |
There was a problem hiding this comment.
| <span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is CSS</span> | |
| <span class="Fns16 Fnw-l Lnh150p Lts0 C-$reAccent850 md_Ps-a md_L50p md_B-43 md_Tf md_-Tr-50p;0">Yes, this is pure CSS</span> |
|
|
||
| <h1 class="D Fnf-SNPro Fns6u Fnw-b Lnh100p Lts0 M3.5u;0 Txt C-$brand Ps Zi2 md_D-n">Make CSS exciting again!</h1> | ||
| <div class="D-f Fld-c Ai-c Gap2u Bgc-tp W100p Ps Zi2"> | ||
| <arts-slider class="D-f Ai-fs Fl1 W100p"> |
There was a problem hiding this comment.
Декоративные элементы лучше не в сам art-slider, а в контейнер выше
mr150
left a comment
There was a problem hiding this comment.
Чуть позже будут еще комменты
|
|
||
| <%- include('./burger.ejs') %> | ||
|
|
||
| <div class="Bgc-$core950 Ps-a R0 T-$headerH Ts-$longTs Tf -Trx101p Bd1;s;$brand Bdr-n Bdtlr3u Bdblr3u Mxw50u ^burger:c:~_-Trx0 W50vw P10u;0 md_All-ust @:h<420_P3u;0"> |
There was a problem hiding this comment.
@:h<420 странное решение, при чем тут высота?
There was a problem hiding this comment.
md_All-ust тоже выглядит сомнительно
| </div> | ||
| </div> | ||
| <button class="next W48 Apcr1 Ml40 As-c Bgc-tp Bd-n P0 Cs lg_Ml80"> | ||
| <svg class="C-$brand C-$reBrand500_h C-$reBrand600_a Ts-$shortTs" width="17" height="29"> |
There was a problem hiding this comment.
Кнопки надо чуть покрупнее на десктопе, а то они местами сливаются с декором
| <% for (let decor of Object.values(decorCSSArts)) { %> | ||
| <div class="D-n md_D <%= decor %>"></div> | ||
| <% } %> | ||
| <div class="W100p P0 Bxz-bb md_P16 md_Bdrd1u md_Bgc-$artFrameColorSmall md_Bxsd0;0;0;0.5u;$artFrameBorderSmall"> |
There was a problem hiding this comment.
Почему тут рамка через box-shadow, а не border?
There was a problem hiding this comment.
Bxz-bb - нет смысла, он уже у всех стоит. border-radius тут у рамки не нужен. padding пусть 2u будет, больше не надо
There was a problem hiding this comment.
Border "толстый" и забирал много пространства внутри блока, поэтому сделал через box-shadow.
There was a problem hiding this comment.
Еще раз: отдельные файлы с данными для редизайна не нужны
|
Привет. Со следующим коммитом конфликт исправлю. |
|
некоторые прошлые комменты по header и "бургер" меню (несколько label): |
| <% } %> | ||
| </<%= it.tag %>> | ||
|
|
||
| <<%= it.tag %> class="btn <%= css.buttonShape %> <%= css.buttonColors %> <%= css.textColor %>" href="<%= it.url %>"> |
There was a problem hiding this comment.
В текущем варианте у кнопки всегда будет href, хотя и ссылка и button могут быть без href
| <%# Menu %> | ||
| <div class="D-f Fld-r Jc-fe Ai-c md_D-f md_Jc-e md_Gap8u md_Fns-$headerFns"> | ||
| <%- include('./burger.ejs') %> | ||
| <div class="Ps-a R0 T-$headerH W100p H91vh Ov-h P6u;4u Bgc-$core820 Ts-$longTs Tf -Trx101p Mxw420 ^burger:c:~_-Trx0 md_All-ust"> |
There was a problem hiding this comment.
Зачем Ts-$longTs? Это кастомное свойство даже нигде не объявляется
There was a problem hiding this comment.
оно объявлялось в базовом шаблоне в class для html.
Убрал.
|
|
||
| <% | ||
| const card = it.item; | ||
| let styles; |
There was a problem hiding this comment.
Эти стили должны быть в data части карточек
| </div> | ||
| <p class="M0 Fns4u Fnst-n Fnw300 Lnh150p Lts0 C-$accent900 lg_P0;2.5u"><%= card.text %></p> | ||
| </div> | ||
| <% if (card.title === "Rich syntax") { %> |
There was a problem hiding this comment.
Так не делается. Более грамотный вариант: в data карточки можно сделать поле, типа "дополнительный контент", где id шаблона указываем. Если поле с доп контентом есть, то загружаем шаблон с этим id
There was a problem hiding this comment.
Исправил. Сделал отдельный шаблон
| <span class="Fns4u Fnst-n Fnw600 Lnh140p Lts0 C-$tertiary800">Standard CSS </span> | ||
| </div> | ||
| <code class="P0;2.5u Fnf-Fira;Code Fns3u Fnst-n Fnw400 Lnh150p Lts0 C-$tertiary750 Gc1"> | ||
| <span class=""><span class="C#00ac4d">@:ah</span>_<span class="C#f04">0</span>1_<span class="P0;0.5u Bgc-$tertiary700 Bdrd0.75u C#9e54ff">h</span></span> |
There was a problem hiding this comment.
Выделять кусок, прямо как на исходном скрине - ненужно
| <use href="/assets/img/icons.svg#arrow-code"></use> | ||
| </svg> | ||
| </div> | ||
| <code class="P0;2.5u D-f Fld-c Fnf-Fira;Code Fns3u Fnst-n Fnw400 Lnh150p Lts0 C-$tertiary750 Gc3"> |
There was a problem hiding this comment.
Эту часть надо сверстать, примерно как блоки кода с highlight.js, но чтобы раскраска наша кастомная осталась. Можно даже попробовать растянуть блок кода на оставшуюся часть ширины, а то сейчас там пусто
There was a problem hiding this comment.
Исправил, если правильно тебя понял (единственное, фон блоков кода меняется). Посмотри, если что, переделаю.
| <div class="P10;12 xl_P10;20"> | ||
| <span>Community:</span> | ||
| </div> | ||
| <div class="D-f Ai-c Gap32"> |
There was a problem hiding this comment.
Это тоже лучше списком сделать
There was a problem hiding this comment.
Исправил. И в header тоже заодно
| <% }%> | ||
| </ul> | ||
| <theme-switcher class="md_Od3"> | ||
| <div class="P5;12 D-f Ai-c Gap8u xl_P10;20" role="group" aria-label="Select theme"> |
There was a problem hiding this comment.
Вместо aira атрибутов, лучше просто сделать список с невидимой (-D-vh) подписью. И по дефолту: такая невидимая подпись лучше aria
There was a problem hiding this comment.
И кнопка не хватает hover состояния
|
|
||
| button.addEventListener("click", async () => { | ||
| const text = codeSlot.textContent.trim(); | ||
| try { |
There was a problem hiding this comment.
Лучше использовать вместо try ... catch, синтаксис с промисами для обработки ошибок: .catch()
There was a problem hiding this comment.
Почему 2 компонента в 1 модуле? Пусть каждый в отдельном будет
|
|
||
| connectedCallback() { | ||
| const button = this.querySelector(".copy-btn"); | ||
| const codeSlot = this.querySelector("code"); |
There was a problem hiding this comment.
Тут лучше по pre искать - надежнее
| tabs.forEach((tab) => { | ||
| tab.addEventListener("click", () => { | ||
|
|
||
| tabs.forEach((t) => t.classList.remove("Bdbc#394EB6")); |
There was a problem hiding this comment.
Стили выделения активности сюда не зашиваем - передаем в атрибутах из разметки
| constructor() { | ||
| super(); | ||
|
|
||
| const theme = localStorage.getItem('theme'); |
There was a problem hiding this comment.
Лучше более уникальное имя сделать, типа mlut-theme
| localStorage.setItem('theme', theme); | ||
| } | ||
|
|
||
| getCurrentTheme() { |
There was a problem hiding this comment.
Состояние лучше хранить в самом классе, а не в разметке. Разметка - его отражение
| return 'auto'; | ||
| } | ||
|
|
||
| setActiveButton(buttons, theme) { |
There was a problem hiding this comment.
Тут много лишних действий делается
- зачем каждый раз передавать кнопки, если их можно записать (сразу как массив) в поле инстанса
- цвет svg должно получать сверху (через
currentColor, например), чтобы нам не лезть внутрь и не назначать руками - зачем 2 раза ходить по коллекции кнопок, если можно все сделать за 1 проход
- и опять же: стилизующие классы сверху передаем
There was a problem hiding this comment.
Полностью переписал компонент.
| --ml-artFunnyCake: #6295e3; | ||
| --ml-artCat: #dea3e3; | ||
| } | ||
| // Базовая светлая тема |
| } | ||
| // Базовая светлая тема | ||
| html { | ||
| @include light-theme; |
There was a problem hiding this comment.
При таком подходе в лоб слишком много кода дублируется. Надо множественные селекторые использовать. Ну и нет смысла compound с html делать - у класса специфичность все равно больше
|
|
||
| <% | ||
| const comparisonCss = { | ||
| marker: "Ps-a_b Ct_b L0_b T0.25u_b -Sz16_b Msi-url('/assets/img/marker.svg')_b Mss8_b Msr-nr_b Msp-c_b", |
There was a problem hiding this comment.
А зачем маркер у списков делается маской? Есть же много способов проще
There was a problem hiding this comment.
Мне нужно было менять цвет у маркера, почему-то решил попробовать svg и маской. Переделал просто - псевдоэлемент с фоном, без использования svg (пока старый маркер не удалял)
| <%# Strong naming %> | ||
|
|
||
| <h3 class="M9u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c Ps Zi1">Strong naming</h3> | ||
| <div class="D-f Fld-c Ai-c Gap16 M4.5u;0;0 P4u;3u W100p Bdrd8 Bgc-$core810 -Gdl90d,$brand50;0p,$brand100;100p md_Fld-r md_Ai-str xl_P24 xl_Gap32 xl_M26;0;0 Ps Zi1"> |
There was a problem hiding this comment.
Тут тоже карточки являются списком
| <h3 class="D-n xl_D M11u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c">Shorter class names and convenient syntax</h3> | ||
|
|
||
| <div class="D-f Fld-c W100p xl_Gap32 xl_Fld-r xl_Jc-sb xl_M26;0;0"> | ||
|
|
| <div class="P4u;3u W100p Bdrd8 Bgc-$core830 Mnw0 Mxw-mc xl_P16"> | ||
| <h4 class="M0 Txa-c Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$tertiary800">Tailwind CSS</h4> | ||
| <div class="Mt3u P2.5u;0"> | ||
| <%- include('./_includes/components/code-block.ejs',{ |
There was a problem hiding this comment.
Тут блоки кода должны быть не в 1 строку, а переносится без выхода за границу, чтобы визуально было видно, насколько с mlut меньше кода
| <h3 class="D xl_D-n M8u;0;0 Fns4u Fnw600 Fnst-n Lnh100p Lts0 C-$accent900 Txa-c">Convenient syntax</h3> | ||
| <div class="D-f Fld-c Ai-c Gap16 M4.5u;0;0 P4u;3u W100p Bdrd8 Bgc-$core810 -Gdl90d,$brand50;0p,$brand100;100p md_Fld-r md_Ai-str md_Jc-sb md_Gap20 lg_Fx1 lg_Mnw0 xl_M0 xl_P24"> | ||
|
|
||
| <%# Tachyons card %> |
There was a problem hiding this comment.
Это тоже tailwind - в макете опечатка
| </div> | ||
| </div> | ||
|
|
||
| <%# decor %> |
There was a problem hiding this comment.
Тут декор должен быть на десктопе ощутимо больше, чем сейчас - смотри макет
|
|
||
| <h2 class="M3u;0;0 Fnf-SN;Pro Fns6u Fnw700 Fnst-n Lnh100p Lts0 Txt C-$brand Txa-c Zi1">Installation</h2> | ||
|
|
||
| <toggle-tab class="W100p M5.5u;0;0 Zi1 xl_M50;0;0"> |
There was a problem hiding this comment.
Табам не хватает состояния при наведении. Если нет в макете - спроси у дизайнера
|
В адаптиве тоже не все исправленно |