css+js实现滑块手绘五角星星际评分拖拽点击动画效果代码

代码语言:html

所属分类:星级评分

代码描述:css+js实现滑块手绘五角星星际评分拖拽点击动画效果代码

代码标签: css js 滑块 手绘 五角星 星际 评分 拖拽 点击 动画

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

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

<head>
  <meta charset="UTF-8">
  


  
<style>
body {
	background: #0047AB;
}
.instructions {
	font-family: 'Roboto', sans-serif;
	position: absolute;
	top: calc(50% - 70px);
	left: 50%;
	transform: translate(-50%,-50%);
	text-align: center;
	color: #aaa;
	font-size: 0.9em;
}
.stars {
	transition: 450ms;
}
.cont {
	position: absolute;
	top:50%;
	left: 50%;
	transform: translate(-50%,-50%);
	width: 200px;
	height: 50px;
	border: 2px solid goldenrod;
	border-radius: 999px;
	overflow: hidden;
}
.rating {
	width: 200px;
	position:absolute;
	top:50%;
	left:50%;
	transform:translate(-50%,-50%);
}
#slider {
	width: 200px;
	height: 100%;
	position:absolute;
	top:50%;
	left:50%;
	transform:translate(-50%,-50%);
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 200px;
}
/***** Chrome, Safari, Opera, and Edge Chromium *****/
input[type="range"]::-webkit-slider-runnable-track {
  background: none;
  height: 100%;
}

/******** Firefox ********/
input[type="range"]::-moz-range-track {
  background: none;
  height: 100%;
}

/***** Chrome, Safari, Opera, and Edge Chromium *****/
input[type="range"]::-webkit-slider-thumb {
   -webkit-appearance: none; /* Override default look */
   appearance: none;
   margin-top: 10px; /* Centers thumb on the track */
   background-color: none;
   height: 2rem;
   width: 1rem;    
}

/***** Firefox *****/
input[type="range"]::-moz-range-thumb {
    border: none; /*Removes extra border that FF applies*/
    border-radius: 0; /*Removes default border-radius that FF applies*/
    background-color: none;
    height: 2rem;
    width: 1rem;
}
</style>

  
</head>

<body >
  <div class="instructions">Slide me. I'm a slider
	<br />
	<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1">
		<line x1="12" y1="5" x2="12" y2="19"></line>
	.........完整代码请登录后点击上方下载按钮下载查看

网友评论0