js+css实现中性简洁时钟指针走动显示时间代码
代码语言:html
所属分类:布局界面
代码描述:js+css实现中性简洁时钟指针走动显示时间代码
代码标签: js css 中性 简洁 时钟 指针 走动 显示 时间 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--hue: 223;
--bg: hsl(var(--hue),10%,90%);
--fg: hsl(var(--hue),10%,10%);
--primary: hsl(var(--hue),90%,50%);
--shadow1: hsl(var(--hue),10%,80%);
--shadow2: hsl(var(--hue),10%,100%);
--trans-dur: 0.3s;
font-size: calc(16px + (24 - 16) * (100vw - 320px) / (2560 - 320));
}
body {
background-color: var(--bg);
color: var(--fg);
display: flex;
font: 1em/1.5 sans-serif;
height: 100vh;
}
.clock,
.clock:before,
.clock__tick:before {
animation-duration: 0.6s;
animation-timing-function: ease-in-out;
animation-fill-mode: forwards;
}
.clock {
animation-name: clockOuter;
background-color: var(--bg);
border-radius: 50%;
box-shadow:
0 0 0 var(--shadow1),
0 0 0 var(--shadow2);
margin: auto;
position: relative;
width: 16em;
height: 16em;
}
.clock:before,
.clock__hand,
.clock__hand:before,
.clock__tick,
.clock__tick:before {
position: absolute;
}
.clock:before,
.clock__hand:before,
.clock__tick:before {
content: &quo.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0