Neumorphism新拟态设计时钟走动效果代码
代码语言:html
所属分类:布局界面
代码描述:Neumorphism新拟态设计时钟走动效果代码
代码标签: Neumorphism 新拟态 设计 时钟 走动
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { background: #f2f2f2; } ul { list-style:none; margin:0; padding:0 } #clock { font-size:1em; position:relative } #clock .frame-face { position:relative; width:30em; height:30em; margin:2em auto; border-radius: 23px; background: #f2f2f2; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } #watch .frame-face:before { content:''; width:29.4em; height:29.4em; border-radius:14.7em; position:absolute; top:.3em; left:.3em; border-radius: 23px; background: #f2f2f2; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } #watch .frame-face:after { content:''; width:28em; height:28em; border-radius:14.2em; position:absolute; top:.9em; left:.9em; border-radius: 23px; background: #f2f2f2; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } #watch .minute-marks li { display:block; width:.2em; height:.6em; background:#929394; position:absolute; top:50%; left:50%; margin:-.4em 0 0 -.1em; border-radius: 23px; background: #f2f2f2; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } #clock .digits { width:30em; height:30em; border-radius:15em; position:absolute; top:0; left:50%; margin-left:-15em; } #clock .digits li { font-size:1.6em; display:block; width:1.6em; height:1.6em; position:absolute; top:50%; left:50%; line-height:1.6em; text-align:center; margin:-.8em 0 0 -.8em; font-weight:bold; } #clock .digits li:nth-child(1) { transform:translate(3.9em, -6.9em) } #clock .digits li:nth-child(2) { transform:translate(6.9em, -4em) } #clock .digits li:nth-child(3) { transform:translate(8em, 0) } #clock .digits li:nth-child(4) { transform:translate(6.8em, 4em) } #clock .digits li:nth-child(5) { transform:translate(3.9em, 6.9em) } #clock .digits li:nth-child(6) { transform:translate(0, 8em) } #clock .digits li:nth-child(7) { transform:translate(-3.9em, 6.9em) } #clock .digits li:nth-child(8) { transform:translate(-6.8em, 4em) } #clock .digits li:nth-child(9) { transform:translate(-8em, 0) } #clock .digits li:nth-child(10) { transform:translate(-6.9em, -4em) } #clock .digits li:nth-child(11) { transform:translate(-3.9em, -6.9em) } #clock .digits li:nth-child(12) { transform:translate(0, -8em) } #clock .digits:before { content:''; width:1.6em; height:1.6em; border-radius:.8em; position:absolute; top:50%; left:50%; margin:-.8em 0 0 -.8em; background:#121314; } #clock .digits:after { content:''; width:4em; height:4em; border-radius:2.2em; position:absolute; top:50%; left:50%; margin:-2.1em 0 0 -2.1em; border-radius: 23px; background: #f2f2f2; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } @keyframes hours { to {transform:rotate(335deg)} } #clock .hours-hand { width:.8em; height:7em; border-radius:0 0 .9em .9em; background:#232425; position:absolute; bottom:50%; left:50%; margin:0 0 -.8em -.4em; box-shadow:#232425 0 0 2px; transform-origin:0.4em 6.2em; transform:rotate(-25deg); animation:hours 43200s linear 0s infinite; } #clock .hours-hand:before { content:''; background:inherit; width:1.8em; height:.8em; border-radius:0 0 .8em .8em; box-shadow:#232425 0 0 1px; position:absolute; top:-.7em; left:-.5em; } #clock .hours-hand:after { content:''; width:0; height:0; border:.9em solid #232425; border-width:0 .9em 2.4em .9em; border-left-color:transparent; border-right-color:transparent; position:absolute; top:-3.1em; left:-.5em; } @keyframes minutes { to {transform:rotate(422deg)} } #clock .minutes-hand { width:.8em; height:12.5em; border-radius:.5em; background:#343536; position:absolute; bottom:50%; left:50%; margin:0 0 -1.5em -.4em; box-shadow:#343536 0 0 2px; transform-origin:0.4em 11em; transform:rotate(62deg); animation:minutes 3600s linear 0s infinite; } @keyframes seconds { to {transform:rotate(480deg)} } #clock .seconds-hand { width:.2em; height:14em; border-radius:.1em .1em 0 0/10em 10em 0 0; background:#c00; position:absolute; bottom:50%; left:50%; margin:0 0 -2em -.1em; box-shadow:rgba(0,0,0,.8) 0 0 .2em; transform-origin:0.1em 12em; transform:rotate(120deg); animation:seconds 60s steps(60, end) 0s infinite; } #clock .seconds-hand:after { content:''; width:1.4em; height:1.4em; border-radius:.7em; background:inherit; position:absolute; left:-.65em; bottom:1.35em; } #clock .seconds-hand:before { content:''; width:.8em; height:3em; border-radius:.2em .2em .4em .4em/.2em .2em 2em 2em; box-shadow:rgba(0,0,0,.8) 0 0 .2em; background:inherit; position:absolute; left:-.35em; bottom:-3em; } #clock .digital-wrap { width:9em; height:3em; position:absolute; top:50%; left:50%; margin:3em 0 0 -4.5em; overflow:hidden; border-radius: 15px; background: #000; box-shadow: 5px 5px 7px #d0d0d0, -5px -5px 7px #ffffff; } #clock .digital-wrap ul { float:left; width:2.85em; height:3em; border-right:.1em solid #000; color:#ddd; font-family:Consolas, monaco, monospace; } #clock .digital-wrap ul:last-child { border:none } #clock .digital-wrap li { font-size:1.5em; line-height:2; letter-spacing:2px; text-align:center; position:relative; left:1px; } #clock .digit-minutes li { animation:dsm 3600s steps(60, end) 0s infinite; } #clock .digit-seconds li { animation:dsm 60s steps(60, end) 0s infinite; } @keyframes dsm { to { transform:translateY(-120em) } } </style> </head> <body> <div id="clock"> <div class="frame-face"></div> <ul class="minute-marks"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0