css实现圆形日历时钟效果代码
代码语言:html
所属分类:布局界面
代码描述:css实现圆形日历时钟效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
:root {
--bg-clr: radial-gradient(circle, white 40%, #bbb);
/* --bg-clr: rgba(255,255,255,.4); */
--accent-clr: red;
--time: '';
}
html {
min-height: 100vh;
display: grid;
place-items: center;
font-family: system-ui, sans-serif;
overflow: hidden;
background: #333;
box-shadow: inset 0 0 200px black;
}
#calendar {
width: min(80vh, 90vw);
height: min(80vh, 90vw);
border-radius: 50%;
position: relative;
transition: 1.5s;
box-shadow: 0 0 25px black;
background: var(--bg-clr);
}
#month {
width: 50%;
height: 50%;
background: var(--bg-clr);
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
z-index: 1000;
display: grid;
place-items: center;
text-align: center;
font-size: 2rem;
line-height: 2.25rem;
filter: drop-shadow(0 0 25px rgba(0,0,0,.5));
transition: .75s;
text-transform: uppercase;
user-select: none;
font-weight: 100;
}
#month strong {
font-weight: 500;
font-size: 3rem;
display: block;
}
#month hr {
width: 80%;
margin: 2rem auto 1.5rem auto;
border: 0;
border-bottom: 1px solid var(--accent-clr);
}
#month span {
width: 100%;
height: 36px;
text-align: center;
letter-spacing: 3px;
display: block;
position: relative;
margin-bottom: .5rem;
}
#month span:after {
content: var(--time);
position: absolute;
left: 0;
top: 0;
}
#month i {
display: block;
font-size: 1rem;
line-height: 100%;
font-style: normal;
}
.slice {
background: rgba(0,0,0,.05);
width: 10vh;
height: 50%;
position: absolute;
left: 50%;
top: 0;
transform-origin: 50% 100%;
transform: translate(-50%,0%);
clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
transitio.........完整代码请登录后点击上方下载按钮下载查看
网友评论0