css+js实现中性时钟效果代码
代码语言:html
所属分类:布局界面
代码描述:css+js实现中性时钟效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html { background: #d8dcd6; text-align: center; font-size: 10px; } body { margin: 0; font-size: 2rem; display: flex; flex: 1; min-height: 100vh; align-items: center; } .clock { width: 30rem; height: 30rem; position: relative; padding: 2rem; border: 18px solid #D3D7D0; box-shadow: 5px -5px 5px 0px rgba(242, 243, 242, 0.5), -5px 8px 8px 0px rgba(177, 185, 173, 0.5), inset -3.5px 5.5px 6px 0px rgba(177, 185, 173, 0.5), inset 3px -3px 1px 0px rgba(190, 197, 186, 0.15); border-radius: 50%; margin: 50px auto; } .outer-clock-face { position: relative; background: #d8dcd6; overflow: hidden; width: 100%; height: 100%; border-radius: 100%; } .outer-clock-face::after { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); transform: rotate(90deg); } .outer-clock-face::after, .outer-clock-face::before, .outer-clock-face .marking { content: ""; position: absolute; width: 5px; height: 100%; background: #84C2B3; z-index: 0; left: 49%; } .outer-clock-face .marking { background: #9bc5bb; width: 3px; } .outer-clock-face .marking.marking-one { -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); transform: rotate(30deg); } .outer-clock-face .marking.marking-two { -webkit-transform: rotate(60deg); -moz-transform: rotate(60deg); transform: rotate(60deg); } .outer-clock-face .marking.marking-three { -webkit-transform: rotate(120deg); -moz-transform: rotate(120deg); transform: rotate(120deg); } .outer-clock-face .marking.marking-four { -webkit-transform: rotate(150deg); -moz-transform: rotate(150deg); transform: rotate(150deg); } .inner-clock-face { position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #d8dcd6; -webkit-border-radius: 100%; -moz-border-radius: 100%; border-radius: 100%; z-index: 1; } .inner-clock-face::before { content: ""; position: absolute.........完整代码请登录后点击上方下载按钮下载查看
网友评论0