-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dz 02 html #2
base: master
Are you sure you want to change the base?
Dz 02 html #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
*.iml |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,51 +3,94 @@ | |
<head> | ||
<meta charset="UTF8"> | ||
<title>TODOS</title> | ||
<link href="./styles/default.css" rel="stylesheet"/> | ||
</head> | ||
<body> | ||
<div class="todos-header"> | ||
<h1>TODOS</h1> | ||
</div> | ||
<div class="todos-wrapper"> | ||
<div class="todos-input"> | ||
<button class="todos-input_select-all" aria-label="Mark all activities as done"></button> | ||
<input placeholder="What needs to be done?" aria-label="Field for input your activities"/> | ||
<div class="main-wrapper"> | ||
<div class="todos-header"> | ||
todos | ||
</div> | ||
<div class="todos-items-list"> | ||
<div class="todos-item"> | ||
<input class="todos-item_done_mark" type="checkbox" aria-label="Mark item as done"/> | ||
<textarea class="todos-item_text" aria-label="Mark item"> HTML </textarea> | ||
<button class="todos-item_delete" aria-label="Delete item"></button> | ||
</div> | ||
<div class="todos-item __done"> | ||
<input class="todos-item_done_mark" checked= "checked" type="checkbox" aria-label="Mark item as done"/> | ||
<textarea class="todos-item_text" aria-label="Mark item"> CSS </textarea> | ||
<button class="todos-item_delete" aria-label="Delete item"></button> | ||
</div> | ||
<div class="todos-item"> | ||
<input class="todos-item_done_mark" type="checkbox" aria-label="Mark item as done"/> | ||
<textarea class="todos-item_text" aria-label="Mark item"> JavaScript </textarea> | ||
<button class="todos-item_delete" aria-label="Delete item"></button> | ||
<div class="todos-wrapper"> | ||
<div class="todos-input"> | ||
<button class="todos-input_select-all" aria-label="Mark all activities as done"> | ||
<div class="todos-input_select-all_icon"></div> | ||
</button> | ||
<div class="todos-input_input-text-wrap"> | ||
<input class="todos-input_input-text" placeholder="What needs to be done?" | ||
aria-label="Field for input your activities"/> | ||
</div> | ||
</div> | ||
<div class="todos-item"> | ||
<input class="todos-item_done_mark" type="checkbox" aria-label="Mark item as done"/> | ||
<textarea class="todos-item_text" aria-label="Mark item"> JSCode </textarea> | ||
<button class="todos-item_delete" aria-label="Delete item"></button> | ||
</div> | ||
</div> | ||
<div class="todos-items-list"> | ||
<div class="todos-item"> | ||
<div class="todos-item_done-mark-wrap"> | ||
<input class="todos-item_done-mark" type="checkbox" aria-label="Mark item as done"/> | ||
|
||
<div class="todos-status-bar"> | ||
<div class="todos-status-bar_counter" aria-label="Number of undone tasks"> | ||
4 tasks to do | ||
<div class="todos-item_done-mark_visible"></div> | ||
</div> | ||
<button class="todos-item_delete" aria-label="Delete item"> | ||
<div class="todos-item_delete_icon"></div> | ||
</button> | ||
<div class="todos-item_text-wrap" > | ||
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. зачем обёртка? 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. Подумал, что логично распределить пространство с помощью оберток, а в них уже добавлять элементы. на случай, если придется к тексту добавить что-то еще 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. Лучше избегать обёрток, пока они не понадобились |
||
<div class="todos-item_text" contenteditable="true">HTML</div> | ||
</div> | ||
</div> | ||
<div class="todos-item __done"> | ||
<button class="todos-item_delete" aria-label="Delete item"> | ||
<div class="todos-item_delete_icon"></div> | ||
</button> | ||
<div class="todos-item_done-mark-wrap"> | ||
<input class="todos-item_done-mark" type="checkbox" checked="checked" aria-label="Mark item as done"/> | ||
<div class="todos-item_done-mark_visible"></div> | ||
</div> | ||
<div class="todos-item_text-wrap" > | ||
<div class="todos-item_text" contenteditable="true">CSS</div> | ||
</div> | ||
</div> | ||
<div class="todos-item"> | ||
<button class="todos-item_delete" aria-label="Delete item"> | ||
<div class="todos-item_delete_icon"></div> | ||
</button> | ||
<div class="todos-item_done-mark-wrap"> | ||
<input class="todos-item_done-mark" type="checkbox" aria-label="Mark item as done"/> | ||
<div class="todos-item_done-mark_visible"></div> | ||
</div> | ||
<div class="todos-item_text-wrap" > | ||
<div class="todos-item_text" contenteditable="true">JS</div> | ||
</div> | ||
</div> | ||
<div class="todos-item"> | ||
<button class="todos-item_delete" aria-label="Delete item"> | ||
<div class="todos-item_delete_icon"></div> | ||
</button> | ||
<div class="todos-item_done-mark-wrap"> | ||
<input class="todos-item_done-mark" type="checkbox" aria-label="Mark item as done"/> | ||
<div class="todos-item_done-mark_visible"></div> | ||
</div> | ||
<div class="todos-item_text-wrap" > | ||
<div class="todos-item_text" contenteditable="true">JSCode</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="todos-status-bar_filters"> | ||
<button class="todos-filter __marked" aria-label="Show all items" data-filter="all">All</button> | ||
<button class="todos-filter" aria-label="Show done items" data-filter="all">Done</button> | ||
<button class="todos-filter" aria-label="Show undone items" data-filter="all">Undone</button> | ||
|
||
<div class="todos-status-bar"> | ||
<button class="todos-status-bar_delete-completed" aria-label="Delete completed items"> | ||
Delete completed | ||
</button> | ||
<div class="todos-status-bar_counter" aria-label="Number of undone tasks"> | ||
4 tasks to do | ||
</div> | ||
<div class="todos-status-bar_filters"> | ||
<button class="todos-status-bar_filters_filter __active" aria-label="Show all items" data-filter="all"> | ||
<div class="button-text">All</div> | ||
</button> | ||
<button class="todos-status-bar_filters_filter __active" aria-label="Show done items" data-filter="all"> | ||
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.
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. по поводу первого пункта - если я его вынесу за пределы 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. 1 пункт про нейминг и отлеьный файл стилей 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. «каким образом мне тогда все эти три div'a расположить на одном уровне?» |
||
<div class="button-text">Active</div> | ||
</button> | ||
<button class="todos-status-bar_filters_filter" aria-label="Show undone items" data-filter="all"> | ||
<div class="button-text">Completed</div> | ||
</button> | ||
</div> | ||
</div> | ||
<button class="todos-status-bar_delete-completed" aria-label="Delete completed items"> | ||
Delete completed | ||
</button> | ||
</div> | ||
</div> | ||
</body> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
body, input, button, textarea { | ||
font-family: Helvetica Neue, Arial, sans-serif; | ||
font-size: 24px; | ||
} | ||
|
||
body { | ||
background: #f5f5f5; | ||
} | ||
|
||
.main-wrapper { | ||
max-width: 560px; | ||
min-width: 280px; | ||
margin: 0 auto; | ||
padding: 0 10px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import "reset.css"; | ||
@import "base.css"; | ||
@import "./project/todos-wrapper/todos-wrapper.css"; | ||
@import "./project/todos-header/todos-header.css"; | ||
@import "./project/todos-input/todos-input.css"; | ||
@import "./project/todos-item.css"; | ||
@import "./project/todos-status-bar.css"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.todos-header { | ||
font-size: 100px; | ||
font-weight: 100; | ||
color : rgba(175,47,47,0.15); | ||
text-align: center; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.todos-input { | ||
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. наверное это не просто инпут, а больше похоже на добавление, к тому же при таком нейминге получается боль с |
||
border-bottom : 1px solid #e6e6e6; | ||
} | ||
.todos-input:after { | ||
content: ''; | ||
display: block; | ||
clear: both; | ||
width: 100%; | ||
} | ||
.todos-input_select-all { | ||
width: 60px; | ||
height: 64px; | ||
background: none; | ||
border: none; | ||
padding: 0; | ||
margin: 0; | ||
position: relative; | ||
float: left; | ||
outline: none; | ||
} | ||
.todos-input_select-all_icon { | ||
width: 24px; | ||
height: 12px; | ||
background: url('../../../img/icons/select-all.png') no-repeat 0 0; | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
margin: -6px -12px; | ||
} | ||
.todos-input_input-text-wrap { | ||
overflow: hidden; | ||
} | ||
.todos-input_input-text { | ||
width: 100%; | ||
border: 0; | ||
background: none; | ||
color: #666; | ||
font-size: 19px; | ||
font-weight: 200; | ||
margin: 19px 0 0 0; | ||
padding-right: 10px; | ||
outline: none; | ||
box-sizing: border-box; | ||
} | ||
.todos-input_input-text::placeholder { | ||
color : #ccc; | ||
font-style: italic; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.todos-item { | ||
border-bottom: 1px solid #e6e6e6; | ||
min-height: 60px; | ||
display: flex; | ||
overflow: hidden; | ||
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. Зачем оверфлоу? |
||
} | ||
|
||
.todos-item_done-mark-wrap { | ||
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. Зачем здесь обёртка? 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. с помощью нее определяю положение элементов внутри. чтобы и невидимый, и видимый чекбоксы располагать относительно нее 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. Чекбокс не бывает невидимым. Калочка бывает скрыта. Надо просто показывать и скрывать её по по псевдоклассу |
||
width: 60px; | ||
height: 60px; | ||
background: none; | ||
float:left; | ||
box-sizing: border-box; | ||
position: relative; | ||
overflow: hidden; | ||
align-self: center; | ||
order: 1; | ||
} | ||
.todos-item_done-mark { | ||
opacity: 0; | ||
width: 50%; | ||
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. Очень странно: элемент в 50% ширины обёртки 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. Я подумал, что тогда изменяя размер обертки, например, при изменении размеров всех элементов, за счет того, что они автоматически подстроятся будет проще. 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. А, кажется понял. Имеется в виду, что он должен быть полностью во всю обертку? 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. Картинка же не резиновая. Поэтому и не может быть в данном чекбоксе резиновых элементов |
||
height: 50%; | ||
margin: 25%; | ||
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. не должно быть ни каких процентных марджинов |
||
} | ||
|
||
.todos-item_done-mark_visible { | ||
position: absolute; | ||
box-sizing: border-box; | ||
width: 60%; | ||
height: 60%; | ||
margin: 20%; | ||
top: 0; | ||
padding: 10%; | ||
background: none; | ||
border: 1px solid #ccc; | ||
border-radius: 50%; | ||
} | ||
.todos-item.__done .todos-item_done-mark_visible { | ||
background: url("../../img/icons/completed.png") no-repeat center; | ||
/*content: url("../../img/icons/completed.png");*/ | ||
border-color: #5dc2af; | ||
|
||
} | ||
|
||
.todos-item_text-wrap { | ||
overflow: hidden; | ||
position: relative; | ||
align-self: flex-start; | ||
flex: 1 0; | ||
order: 59; | ||
} | ||
|
||
.todos-item_text { | ||
resize: none; | ||
width: 100%; | ||
border: 0; | ||
background: none; | ||
color: #666; | ||
font-size: 20px; | ||
font-weight: 200; | ||
padding: 20px 10px 20px 0; | ||
outline: none; | ||
box-sizing: border-box; | ||
} | ||
.todos-item.__done .todos-item_text { | ||
text-decoration:line-through; | ||
color: #ccc; | ||
} | ||
.todos-item_delete { | ||
width: 60px; | ||
height: 60px; | ||
background: none; | ||
border: none; | ||
padding: 0; | ||
margin: 0; | ||
position: relative; | ||
float: right; | ||
align-self: flex-end; | ||
order: 60; | ||
outline: none; | ||
} | ||
.todos-item:hover{ | ||
background: #fafafa; | ||
} | ||
.todos-item:hover .todos-item_delete_icon { | ||
opacity: 100; | ||
width: 16px; | ||
height: 16px; | ||
background: url('../../img/icons/close.png') no-repeat 0 0; | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
margin: -8px -8px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.todos-status-bar { | ||
position: relative; | ||
bottom: 0; | ||
min-height: 40px; | ||
} | ||
|
||
.todos-status-bar_counter { | ||
|
||
float: left; | ||
font-size: 12px; | ||
height: 20px; | ||
color: #888; | ||
margin: 10px; | ||
box-sizing: border-box; | ||
line-height: 20px; | ||
} | ||
|
||
.todos-status-bar_delete-completed { | ||
float: right; | ||
background: none; | ||
height: 20px; | ||
width: auto; | ||
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. Зачем? 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. Игрался с шириной, пытался понять логику работы. почищу |
||
border: none; | ||
padding: 0; | ||
margin: 10px; | ||
outline: none; | ||
font-size: 12px; | ||
color: #888; | ||
vertical-align: middle; | ||
} | ||
|
||
.todos-status-bar_filters { | ||
width: 100%; | ||
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. Зачем? |
||
text-align: center; | ||
} | ||
|
||
.todos-status-bar_filters_filter { | ||
color: #888; | ||
font-size: 12px; | ||
background: none; | ||
height: 20px; | ||
border: none; | ||
padding: 0; | ||
margin: 10px; | ||
outline: none; | ||
vertical-align: middle; | ||
} | ||
|
||
.button-text { | ||
margin: 0 7px; | ||
} | ||
|
||
.todos-status-bar_filters_filter.__active { | ||
border: 1px solid #ebdfdf; | ||
border-radius: 3px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.todos-wrapper { | ||
background: #fff; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, .2); | ||
position: relative; | ||
} | ||
|
||
.todos-wrapper:after, .todos-wrapper:before { | ||
content: ''; | ||
position: absolute; | ||
top: 100%; | ||
background: #fff; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, .2); | ||
z-index: -1; | ||
} | ||
|
||
.todos-wrapper:before { | ||
height: 10px; | ||
left: 4px; | ||
right: 4px; | ||
} | ||
|
||
.todos-wrapper:after { | ||
height: 5px; | ||
left: 2px; | ||
right: 2px; | ||
} |
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.
Чекбокс должен быть вынесен в отдельные базовые компоненты и иметь класс элемента блока
todos-item
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.
А в чем минус моего подхода? Сложнее потом до него добираться?
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.
Нужно научиться работать с базовыми компонентами и понять принцип их реиспользования