css布局实现一个手动计数器交互效果
代码语言:html
所属分类:布局界面
代码描述:css布局实现一个手动计数器交互效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=B612+Mono&display=swap'>
<style>
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--transDur: 0.2s;
font-size: calc(16px + (32 - 16)*(100vw - 320px)/(2560 - 320));
}
body, button {
font: 1em/1.5 "B612 Mono", monospace;
}
body, .counter__digit-window {
display: flex;
}
body {
background: #e3e4e8;
display: flex;
height: 100vh;
}
.counter {
margin: auto;
position: relative;
width: 16em;
height: 18.5em;
}
.counter button {
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-tap-highlight-color: transparent;
}
.counter button:focus {
outline: transparent;
}
.counter button::-moz-focus-inner {
border: 0;
}
.counter__clip, .counter__clip:before, .counter__clip:after,
.counter__body, .counter__body:before, .counter__body:after,
.counter__clicker-hole,
.counter__clicker, .counter__clicker:before, .counter__clicker:after,
.counter__digit-frame, .counter__digit-frame:before,
.counter__digit-window:before,
.counter__knob, .counter__knob:before {
position: absolute;
}
.counter__clip:before, .counter__clip:after,
.counte.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0