Skip to content
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

DEAD-3: implement card component #3

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open

DEAD-3: implement card component #3

wants to merge 13 commits into from

Conversation

AlexNov03
Copy link
Collaborator

No description provided.

@AlexNov03 AlexNov03 changed the base branch from dev to DEAD-1 September 23, 2024 14:13
@AlexNov03 AlexNov03 changed the title Dead 3: implement card component DEAD-3: implement card component Sep 23, 2024
@darleet darleet self-requested a review September 23, 2024 17:19
public/components/Cards/cards.css Outdated Show resolved Hide resolved
public/components/Cards/cards.hbs Outdated Show resolved Hide resolved
@darleet darleet changed the base branch from DEAD-1 to dev September 23, 2024 19:29
Comment on lines 1 to 10
:root {
--background-color: #edeef0;
--accent-color: #9950f6;
--main-color: #ffffff;
--hover-color: #551aa0;
--active-color: #b47cfb;
--disabled-color: #dbbfff;
--text-color: #000000;
--text-font: 'Poppins', sans-serif;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно обновить, на фигме изменения

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все еще нужно обновить

@darleet darleet removed the request for review from VladislavKirpichov September 23, 2024 21:18
public/components/Cards/cards.precompiled.js Outdated Show resolved Hide resolved
public/images/1.jpg Outdated Show resolved Hide resolved
public/components/Cards/cards.css Outdated Show resolved Hide resolved
public/components/Cards/cards.css Outdated Show resolved Hide resolved
public/index.css Outdated Show resolved Hide resolved
public/components/Cards/cards.hbs Outdated Show resolved Hide resolved
public/components/Cards/cards.css Outdated Show resolved Hide resolved
Comment on lines 1 to 31
:root {
--background-color: #edeef0;
--accent-color: #9950f6;
--main-color: #ffffff;
--hover-color: #551aa0;
--active-color: #b47cfb;
--disabled-color: #dbbfff;
--text-color: #000000;
--text-font: 'Play', sans-serif;
--card-min-height: 120px;
--card-max-height: 150px;
--card-gap: 10px;
--card-padding: 10px;
--card-border-radius: 10px;
--card-img-min-width: 150px;
--card-img-max-width: 150px;
--card-img-height: 150px;
--card-img-border-radius: 10px;
--card-content-padding-bottom: 10px;
--card-content-p-line-height: 1.4;
--card-content-p-margin-top: 0;
--card-content-header-font-weight: 600;
--card-content-header-font-size: 20px;
--card-content-header-margin-bottom: 20px;
--card-content-text-font-weight: 300;
--card-content-text-font-size: 16px;
--main-content-feed-margin: 20px;
--main-content-feed-gap: 10px;
--main-content-feed-margin-left: 30vw;
--main-content-feed-margin-right: 30vw;
--main-content-feed-max-width: 500px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется это уже перебор... Прям все в переменные не надо выносить, а то непонятно, как теперь это переиспользовать, а самое главное менять

Переменные круто можно так использовать, например:

.button {
  --unit: 1rem;
  padding: var(--unit);
}

.button--small {
  --unit: 0.5rem;
}

.button--large {
  --unit: 1.5rem;
}

Comment on lines +38 to +42
--card-min-height: 120px;
--card-max-height: 150px;
--card-img-min-width: 150px;
--card-img-max-width: 150px;
--card-img-height: 150px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно ли это выносить отдельно?

у @VladislavKirpichov нужно это уточнить


render() {
const template = Handlebars.templates['cards.hbs'];
this.parent.innerHTML = template({ items: this.items });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innerHTML лучше заменить на один из аналогов, так как он уязвим к XSS атакам

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут его нечем заменить, это же темплейт хендлбарса. XSS опасен когда есть какие-то пользовательские данные, в данном случае контент карточки. Если его отсанитайзить то проблемы с xss быть не должно


render() {
const template = Handlebars.templates['cards.hbs'];
this.parent.innerHTML = template({ items: this.items });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут его нечем заменить, это же темплейт хендлбарса. XSS опасен когда есть какие-то пользовательские данные, в данном случае контент карточки. Если его отсанитайзить то проблемы с xss быть не должно

Comment on lines +9 to +10
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

шрифты лучше положить как статику и не использовать ссылки на гугл фонтс

font-size: var(--text-size);
white-space: nowrap;
text-overflow: ellipsis;
width: 95%;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width 95% довольно странное значение, текст должен по всей ширине блока разъезжаться до паддингов. Просто задай паддинги корректные чтобы текст норм смотрелся

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants