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

Создаём нормальный range #5441

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions recipes/input-range-style/demos/input-range-1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Слайдер input range 1</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
/>
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
color-scheme: dark;
}

body {
min-height: 100vh;
padding: 50px;
display: flex;
align-items: center;
justify-content: center;
background-color: #18191c;
color: #ffffff;
font-family: "Roboto", sans-serif;
}

@media (max-width: 768px) {
body {
padding: 30px;
}
}

.range {
display: grid;
gap: 10px;
}

.range-input {
accent-color: #c56fff;
}
</style>
</head>
<body>
<div class="range">
<label class="range-label" for="tailmetr">Хвост-о-метр (cм)</label>
<input
class="range-input"
id="tailmetr"
type="range"
min="0"
max="100"
value="50"
step="1"
aria-valuemin="0"
aria-valuemax="100"
aria-orientation="horizontal"
/>
</div>
</body>
</html>
98 changes: 98 additions & 0 deletions recipes/input-range-style/demos/input-range-2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Слайдер input range 2</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
/>
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
color-scheme: dark;
}

body {
min-height: 100vh;
padding: 50px;
display: flex;
align-items: center;
justify-content: center;
background-color: #18191c;
color: #ffffff;
font-family: "Roboto", sans-serif;
}

@media (max-width: 768px) {
body {
padding: 30px;
}
}

.range {
display: grid;
gap: 10px;
}

.range-input {
appearance: none;
}

.range-input::-webkit-slider-thumb,
.range-input::-moz-range-thumb {
width: 30px;
height: 30px;
border: none;
border-radius: 50%;
background-color: white;
box-shadow: 0 0 0 5px inset #c56fff;
transition: 300ms;
}

.range-input:hover::-webkit-slider-thumb,
.range-input:hover::-moz-range-thumb {
box-shadow: 0 0 0 10px inset #c56fff;
transition: 300ms;
}

.range-input:active::-webkit-slider-thumb,
.range-input:active::-moz-range-thumb {
box-shadow: 0 0 0 30px inset #c56fff;
transition: 300ms;
}

.range-input:disabled::-webkit-slider-thumb,
.range-input:disabled::-moz-range-thumb {
box-shadow: 0 0 0 30px inset gray;
}
</style>
</head>
<body>
<div class="range">
<label class="range-label" for="tailmetr">Хвост-о-метр (cм)</label>
<input
class="range-input"
id="tailmetr"
type="range"
min="0"
max="100"
value="50"
step="1"
aria-valuemin="0"
aria-valuemax="100"
aria-orientation="horizontal"
/>
</div>
</body>
</html>
114 changes: 114 additions & 0 deletions recipes/input-range-style/demos/input-range-3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<title>Слайдер input range 3</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
/>
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
color-scheme: dark;
}

body {
min-height: 100vh;
padding: 50px;
display: flex;
align-items: center;
justify-content: center;
background-color: #18191c;
color: #ffffff;
font-family: "Roboto", sans-serif;
}

@media (max-width: 768px) {
body {
padding: 30px;
}
}

.range {
display: grid;
gap: 10px;
}

.range-input {
width: 100%;
height: 30px;
appearance: none;
background: none;
}

.range-input::-webkit-slider-thumb,
.range-input::-moz-range-thumb {
width: 30px;
height: 30px;
border: none;
border-radius: 50%;
background-color: white;
box-shadow: 0 0 0 5px inset #c56fff;
transition: 300ms;
}

.range-input:hover::-webkit-slider-thumb,
.range-input:hover::-moz-range-thumb {
box-shadow: 0 0 0 10px inset #c56fff;
transition: 300ms;
}

.range-input:focus-visible::-webkit-slider-thumb,
.range-input:focus-visible::-moz-range-thumb {
box-shadow: 0 0 0 10px inset #c56fff;
transition: 300ms;
}

.range-input:active::-webkit-slider-thumb,
.range-input:active::-moz-range-thumb {
box-shadow: 0 0 0 30px inset #c56fff;
transition: 300ms;
}

.range-input:disabled::-webkit-slider-thumb,
.range-input:disabled::-moz-range-thumb {
box-shadow: 0 0 0 30px inset gray;
}

.range-input::-webkit-slider-runnable-track,
.range-input::-moz-range-track {
height: 8px;
background-color: #ababab;
border-radius: 10px;
}
</style>
</head>
<body>
<div class="range">
<label class="range-label" for="tailmetr">Хвост-о-метр (cм)</label>
<input
class="range-input"
id="tailmetr"
type="range"
min="0"
max="100"
value="50"
step="1"
aria-valuemin="0"
aria-valuemax="100"
aria-orientation="horizontal"
/>
</div>
</body>
</html>
Loading
Loading