JSFiddle - React, Tailwind, and code Playground
by Nicoledm12
HTML
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Farbänderung mit Slider und Checkbox</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
background: #151515;
padding: 2rem;
color: #909090;
font-family: "Segoe UI", Tahoma, sans-serif;
}
.header-row {
width: 400px;
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 0.5rem;
}
.header-label {
font-size: 13px;
color: #909090;
font-weight: 400;
margin-bottom: 0px;
display: block;
}
.slider-wrapper {
width: 400px;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.slider-container {
position: relative;
width: 100%;
height: 50px;
margin-bottom: -10px; /* kleiner Abstand zu Farbwählern */
}
.range {
width: 100%;
height: 15px;
-webkit-appearance: none;
background: #111;
outline: none;
border-radius: 15px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 1);
}
.range::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border-radius: 50%;
background: #36f9c7;
cursor: pointer;
border: 4px solid #333;
position: relative;
z-index: 2;
transition: width 0.1s, height 0.1s;
}
.range:hover::-webkit-slider-thumb {
width: 18px;
height: 18px;
margin-top: -2px;
}
.thumb-value {
font-weight: 400;
text-align: center;
position: absolute;
top: -30px;
left: 50%;
transform:...