HWT-1: скелет приложения (index.html, styles.css, app.js)
This commit is contained in:
parent
9d6f340356
commit
5f95bfd198
7
app.js
Normal file
7
app.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const board = document.getElementById('board');
|
||||||
|
|
||||||
|
function render() {
|
||||||
|
board.innerHTML = '<p class="empty-hint">Доска пока пуста.</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
render();
|
||||||
20
index.html
Normal file
20
index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>HelloWorldTrello</title>
|
||||||
|
<link rel="stylesheet" href="styles.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header class="app-header">
|
||||||
|
<h1>HelloWorldTrello</h1>
|
||||||
|
<form id="add-column-form" class="add-column-form">
|
||||||
|
<input type="text" id="new-column-title" placeholder="Название столбца" autocomplete="off">
|
||||||
|
<button type="submit">+ Столбец</button>
|
||||||
|
</form>
|
||||||
|
</header>
|
||||||
|
<main id="board" class="board"></main>
|
||||||
|
<script type="module" src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 1. Setup
|
## 1. Setup
|
||||||
|
|
||||||
- [ ] 1.1 Создать скелет приложения `index.html`, `styles.css`, `app.js` (ES-модуль,
|
- [x] 1.1 Создать скелет приложения `index.html`, `styles.css`, `app.js` (ES-модуль,
|
||||||
без сборки) с пустой разметкой доски; проверить: страница открывается в браузере
|
без сборки) с пустой разметкой доски; проверить: страница открывается в браузере
|
||||||
без ошибок в консоли.
|
без ошибок в консоли.
|
||||||
|
|
||||||
|
|||||||
181
styles.css
Normal file
181
styles.css
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
:root {
|
||||||
|
color-scheme: light;
|
||||||
|
--bg: #f4f5f7;
|
||||||
|
--header-bg: #ffffff;
|
||||||
|
--column-bg: #ebecf0;
|
||||||
|
--card-bg: #ffffff;
|
||||||
|
--text: #172b4d;
|
||||||
|
--muted: #5e6c84;
|
||||||
|
--accent: #0079bf;
|
||||||
|
--accent-contrast: #ffffff;
|
||||||
|
--danger: #b04632;
|
||||||
|
--border: #dfe1e6;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 24px;
|
||||||
|
padding: 12px 20px;
|
||||||
|
background: var(--header-bg);
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-header h1 {
|
||||||
|
font-size: 18px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-column-form {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-column-form input {
|
||||||
|
padding: 6px 10px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
background: var(--accent);
|
||||||
|
color: var(--accent-contrast);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.board {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
padding: 20px;
|
||||||
|
align-items: flex-start;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-hint {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
background: var(--column-bg);
|
||||||
|
border-radius: 6px;
|
||||||
|
width: 260px;
|
||||||
|
flex: 0 0 260px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 15px;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text);
|
||||||
|
width: 100%;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column-title:hover,
|
||||||
|
.column-title:focus {
|
||||||
|
background: #ffffff80;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
min-height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-list.drag-over {
|
||||||
|
background: #0079bf22;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
box-shadow: 0 1px 0 #091e4240;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.dragging {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-text {
|
||||||
|
flex: 1;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 2px;
|
||||||
|
resize: none;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-text:focus {
|
||||||
|
outline: 1px solid var(--accent);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-delete {
|
||||||
|
background: transparent;
|
||||||
|
color: var(--muted);
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-delete:hover {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-card-form {
|
||||||
|
display: flex;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-card-form input {
|
||||||
|
flex: 1;
|
||||||
|
padding: 6px 8px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user