<script setup lang="ts"> import { ref } from 'vue'; const rangeValue = ref(25); function onChange(e: any) { rangeValue.value = e.target.value; } </script> <template> <div class="content fit center"> <div class="box"> <input type="range" class="range" value="25" min="0" max="100" @mousemove="onChange" @change="onChange" /> <span id="rangeValue">{{ rangeValue }}</span> </div> </div> </template> <style lang="scss" scoped> .content { background: #edf1f4; } .box { position: relative; display: flex; justify-content: center; align-items: center; padding: 20px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), #edf1f4); border-radius: 40px; box-shadow: 15px 15px 20px rgba(0, 0, 0, 0.1), -15px -15px 20px #fff; } .range { width: 360px; height: 15px; appearance: none; background: #edf1f4; outline: none; border-radius: 15px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1), -5px -5px 10px #fff; inset: 5px 5px 5px rgba(0, 0, 0, 0.1); overflow: hidden; &::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; background: #fff; border-radius: 50%; border: 2px solid #f7b32d; box-shadow: -367px 0 0 360px #f7b32d; cursor: pointer; } } #rangeValue { position: relative; text-align: center; width: 50px; font-size: 1.25em; font-weight: 500; color: #fff; background: #f8bc46; margin-left: 15px; border-radius: 25px; box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px #fff, inset 5px 5px 10px rgba(0, 0, 0, 0.1), inset -5px -5px 5px rgba(255, 255, 255, 0.25); } </style>