js+css实现表情评分滑竿拖拽效果代码
代码语言:html
所属分类:拖放
代码描述:js+css实现表情评分滑竿拖拽效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <style> :root { --bgColor: #ebf4ff; --badColor: #ff5722; --okColor: #ff9800; --goodColor: #36d896; --greatColor: #3f51b5 } * { padding: 0; margin: 0; box-sizing: border-box } body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: var(--bgColor) } .container { width: 530px; height: 160px; padding: 30px; border-radius: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.08) } .container h1 { font-size: 18px; color: var(--greatColor) } .container .appraise { display: flex; justify-content: space-between; align-items: center; height: 40px; margin-top: 30px } .container .appraise .icon { overflow: hidden; width: 40px; height: 40px } .container .appraise .icon .icon-list { list-style: none; transition: all .5s } .container .appraise .icon .icon-list li { overflow: hidden; position: relative; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 10px; border: 4px solid var(--badColor) } .container .appraise .icon .icon-list li::before,.container .appraise .icon .icon-list li::after { content: ""; position: absolute } .container .appraise .icon .icon-list li .mouth { position: absolute; left: 6px; width: 20px; height: 16px; border-radius: 50% } .container .appraise .icon .icon-list li .mouth::before { content: ""; position: absolute; width: 20px; height: 8px; background-color: #fff } .container .appraise .icon .icon-list .icon-bad .eyebrow,.container .appraise .icon .icon-list .icon-bad .eyebrow::before { position: absolute; top: 6px; left: 5px; width: 8px; height: 3px; border-radius: 3px; background-color: var(--badColor); transform: rotate(-12deg) } .container .appraise .icon .icon-list .icon-bad .eyebrow::before { content: ""; top: 0; left: 14px; transform: rotate(20deg) } .container .appraise .icon .icon-list .icon-bad::before { top: 10px; left: 8px; border-radius: 50%; border: 2px solid var(--badColor); box-shadow: 12px 0 0 var(--badColor) } .container .appraise .icon .icon-list .icon-bad .mouth { bottom: -4px; border: 2px solid var(--badColor) } .container .appraise .icon .icon-list .icon-bad .mouth::before { left: -2px; bottom: -2px } .container .appraise .icon .icon-list .icon-ok { border-color: var(--okColor) } .container .appraise .icon .icon-list .icon-ok::before { top: 6px; left: 6px; border-radius: 50%; border: 3px solid var(--okColor); box-shadow: 14px 0 0 var(--okColor) } .container .appraise .icon .icon-list .icon-ok::after { bottom: 6px; right: 6px; width: 12px; height: 3px; border-radius: 3px; background-color: var(--okColor) } .container .appraise .icon .icon-list .icon-good { border-color: var(--goodColor) } .container .appraise .icon .icon-list .icon-good::before { top: 8px; left: 6px; border-radius: 50%.........完整代码请登录后点击上方下载按钮下载查看
网友评论0