2024-09-24 08:13:46 +07:00

94 lines
4.0 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="stylesheet" href="css/style.css">
<title>Библиотека UI компонентов</title>
</head>
<body>
<div style="display: grid; grid-template-columns: 1fr 1fr">
<div class="input-fields">
<h1>Поля ввода</h1>
<h2>Строка</h2>
<form class="inputs">
<div class="c-labeled-input">
<label for="username" class="c-label">Логин</label>
<input type="text" placeholder="Имя пользователя" class="c-input" id="username" autocomplete="username">
</div>
<div class="c-labeled-input">
<label for="password" class="c-label">Пароль</label>
<input type="password" placeholder="Пароль" class="c-input" id="password"
autocomplete="current-password">
<label for="password" class="c-label passwordVisibilityToggle">Показать пароль</label>
</div>
</form>
<h2>Число</h2>
<form class="inputs">
<div class="c-labeled-input">
<label for="num" class="c-label">Число</label>
<input type="number" placeholder="Введите число" class="c-input" id="num">
</div>
</form>
<h2>Дата</h2>
<form class="inputs">
<div class="c-labeled-input input-with-icon">
<label for="date-picker" class="c-label">Дата</label>
<input type="text" placeholder="Дата" class="c-input date-picker" id="date-picker" autocomplete="date">
<span class="calendar-icon">
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19 4.5H5C3.89543 4.5 3 5.39543 3 6.5V20.5C3 21.6046 3.89543 22.5 5 22.5H19C20.1046 22.5 21 21.6046 21 20.5V6.5C21 5.39543 20.1046 4.5 19 4.5Z"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16 2.5V6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"/>
<path d="M8 2.5V6.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"/>
<path d="M3 10.5H21" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
</span>
</div>
</form>
</div>
<div class="buttons">
<h1>Кнопки & ссылки</h1>
<div style="width: 300px">
<button type="button">Войти</button>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/l10n/ru.js"></script>
<script>
flatpickr(".date-picker", {
locale: "ru",
dateFormat: "Y-m-d",
monthSelectorType: "dropdown",
disableMobile: true,
onReady: function(selectedDates, dateStr, instance) {
styleDropdowns(instance);
}
});
function styleDropdowns(instance) {
const yearDropdown = instance.yearElements[0];
const monthDropdown = instance.monthElements[0];
yearDropdown.classList.add('styled-year-dropdown');
monthDropdown.classList.add('styled-month-dropdown');
}
</script>
<script src="js/script.js"></script>
<script src="js/showPassword.js"></script>
</body>
</html>