Skip to content

TASK-2 create pie-chart#3

Open
pollyv wants to merge 2 commits intomainfrom
TASK-2
Open

TASK-2 create pie-chart#3
pollyv wants to merge 2 commits intomainfrom
TASK-2

Conversation

@pollyv
Copy link
Copy Markdown
Owner

@pollyv pollyv commented May 29, 2024

This project is a web page displaying a pie chart of violations and their categorization. The page uses HTML to structure the content, including a list of violations with the number and percentage for each category. CSS styling provides an attractive design, including color-coded categories and interactive elements such as text highlighting on hover. The main goal of the project is to visually present data on violations in an easy-to-understand format, ensuring simplicity and ease of code support.

Copy link
Copy Markdown

@L1s-is L1s-is left a comment

Choose a reason for hiding this comment

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

Все хорошо, но опять же стоило проверить верстку на планшетном/мобильном разрешениях, чтобы убедиться, что ничего никуда не уехало.
Так же немного непохожи стили с макетом в части размера шрифтов(о них я указала) и внутренних паддингов самого виджета, они на макете побольше.
Не забывай правильно расставлять заголовки и вешать transition для плавных переходов между состояниями элементов

Comment thread pie-chart/index.html
<link rel="stylesheet" href="/pie-chart/styles.css" />
</head>
<body>
<div class="container">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

По внешнему виду это единая сущность виджета, я бы сделала это тегом article и дала бы общий класс(например chart или что-то похожее, а далее по методологии БЭМ шли бы уже chart__header, chart__content итд
Ну и конечно в таком случае нужно было бы перенести виджет полностью в main :)

Comment thread pie-chart/index.html
<header class="header">
<h3 class="header__title">Нарушения</h3>
<ul class="header__tabs">
<li class="header__tabs-item">Час</li>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

У тебя табы должны быть интерактивными элементами, в данном случае следовало бы добавить внутрь элементов списка button`ы(по клику на которые в теории у нас бы табы переключались и менялось бы содержимое вкладок)

Comment thread pie-chart/index.html
<body>
<div class="container">
<header class="header">
<h3 class="header__title">Нарушения</h3>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

По семантике на каждой странице у нас должен быть один заголовок первого уровня(h1). Поскольку этот виджет с графиком - единственный контент, то данный заголовок "Нарушения" должен быть заголовком первого уровня

Comment thread pie-chart/index.html
<main>
<section class="chart">
<div class="chart__circle">
<h3 class="chart__circle-total">24774</h3>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В данном случае это не должно быть заголовком. Заголовок должен нам говорить о том, что находится в текущей секции, а тут просто цифры, сами по себе они ни о чем не говорят
По хорошему, если взять все заголовки страницы - у тебя должна выстроиться структура документа, о чем он итд, так можно себя проверять.

Comment thread pie-chart/index.html
</ul>
</header>
<main>
<section class="chart">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Семантически, это не секция. По хорошему, секция должна иметь заголовок и контент, в данном случае тут график, даже без описания, т.к. описание помещено в другую секцию, что тоже не очень хорошо)

Comment thread pie-chart/index.html
</section>
<section class="violations">
<ul class="violations__list">
<li class="violations__list-item">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Верстка у элементов едет в зависимости от количества процентов https://imgur.com/zoeJfS9
У тебя больше 100% по логике быть не может, поэтому стоило задать ширину элемента с процентами фиксировано, тогда все будет выглядеть аккуратно

Comment thread pie-chart/index.html
</div>
<div class="violations__list-item_count unauthorized-access">
<span class="amount">7937</span>
<span class="percent">32%</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут также возникают вопросы к именованию. Можно назвать violations__list-itemAmount, violations__list-itemPercent итд Для глубоковложенных элементов не обязательно соблюдать всю иерархию в названии, главное, чтобы название это было уникально

Comment thread pie-chart/styles.css
gap: 25px;
}

.header__tabs-item {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

https://imgur.com/mXKjaLx Как будто бы шрифт слишком большой по сравнению с макетом
Так же не хватает transition для плавного перехода между состояниями

Comment thread pie-chart/styles.css
z-index: 1;
margin-top: 20px;
top: 45%;
transform: translateY(-50%);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Думаю лучше объединить chart__circle-total и chart__circle-text в общий родитель, и уже этому родителю задавать стили белого фона и все то, что задано для chart__circle::before. Тогда не пришлось бы городить кучу одинаковых стилей абсолютного позиционирования итд

Comment thread pie-chart/index.html
</div>
</li>
<li class="violations__list-item">
<div class="violations__list-item_name license-plate">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

license-plate и все подобные стили можно было сделать через модификатор к li.violations__list-item и не пришлось бы дублироваться

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.

2 participants