css+js实现拖动滑条改变温度颜色效果代码

代码语言:html

所属分类:拖放

代码描述:css+js实现拖动滑条改变温度颜色效果代码

代码标签: css js 拖动 滑条 改变 温度 颜色

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

 
<meta charset="UTF-8">
 

 
 
 
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Quicksand:wght@700&amp;display=swap'>
 
<style>
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");

body {
        height: 100vh;
        margin: 0;
        display: grid;
        place-items: center;
        background-color: #1d1d1d;
}

#container {
        width: 450px;
        height: 250px;
        background: rgb(255, 255, 255);
        border-radius: 20px;
        /*box-shadow: 0px 0px 10px 20px black;*/
        padding: 20px;

        display: grid;
        place-items: center;
}

#value {
        font-size: 50px;
        font-family: "Roboto", sans-serif;
        text-align: center;
        color: white;
}

.slider {
        -webkit-appearance: none;
        width: 100%;
        height: 25px;
        background: white;
        outline: none;
        -webkit-transition: 0.2s;
        transition: opacity 0.2s;
        border-radius: 20px;
        padding: 2px;
}

.slider:hover {
        /* ... */
}

.slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;

        border-radius: 25px;
        width: 25px;
        height: 25px;
        background: #1d1d1d;
        cursor: pointer;
}

.slider::-moz-range-thumb {
        border-radius: 25px;
        width: 25px;
        height: 25px;
        background: #1d1d1d;
        cursor: pointer;
}

.note {
        position: absolute;
        left: 25%;

        color: white;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0