howler实现带刻度音效鸡蛋闹钟倒计时拖拽设置摇摆提醒代码
代码语言:html
所属分类:其他
代码描述:howler实现带刻度音效鸡蛋闹钟倒计时拖拽设置摇摆提醒代码,先拖拽刻度设置倒计时时间,然后闹钟就会倒计时,并发出秒针走动声音,一旦时间到了就会发出闹钟声音。
代码标签: howler 刻度 音效 鸡蛋 闹钟 倒计时 拖拽 设置 摇摆 提醒 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 1em;
min-height: 100vh;
font-family: 'Helvetica', sans-serif;
font-weight: 500;
font-feature-settings: 'tnum';
font-variant-numeric: tabular-nums;
}
.egg-container {
transform: scale(0.25);
transition: transform .2s;
}
.egg-container.active {
transform: scale(1);
}
.egg {
--shadow-opacity: 1;
border-radius: 100% 100% 76% 76% / 118% 118% 80% 80%;
filter: drop-shadow(0 0px 2px Rgb(0 0 0/var(--shadow-opacity)));
cursor: pointer;
}
.egg-container.active .egg {
--shadow-opacity: 0;
cursor: initial;
}
.egg.ringing {
animation: ring .12s infinite;
}
@keyframes ring {
0%,
50%,
100% {
transform: rotate(0);
}
25% {
transform: rotate(5deg);
}
75% {
transform: rotate(-5deg);
}
}
.egg-top {
background-color: #f4f4f4;
background-image: url("//repo.bfw.wiki/bfwrepo/icon/64dd70cc30755.png"), linear-gradient(to right, #e6e6e6, #ffffff, #e6e6e6);
background-size: 60px 60px, auto auto;
background-blend-mode: multiply, normal;
--background-translation: 0px;
position: relative;
z-index: 1;
border-radius: 50% 50% 50% 50%/100% 100% 0% 0%;
width: 274px;
height: 210px;
clip-path: inset(0 0 0 0 round 50% 50% 50% 50%/100% 100% 0% 0%);
background-position-x: var(--background-translation), 0%;
box-shadow: inset 0 4px 8px Rgb(0 0 0/0.05), inset 20px 0 16px Rgb(0 0 0/0.05), inset -20px 0 16px Rgb(0 0 0/0.05), inset 0 1px 1px Rgb(0 0 0/0.05), inset 1px 0 1px Rgb(0 0 0/0.05), inset -1px 0 1px Rgb(0 0 0/0.05);
transition: background-position-x .2s;
touch-action: none;
}
.egg-top.dragged {
transition-duration: 0s;
transition-timing-function: ease-out;
}
.egg-container.active .egg:not(.ringing) .egg-top {
cursor: ew-resize;
}
.time-ruler-faces-container {
--initial-rotation: calc(180deg + (360deg / var(--face-count) / 2));
--rotation: 0deg;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
bottom: 6px;
transform: rotateY(calc(var(--rotation) + var(--initial-rotation)));
transform-style: preserve-3d;
aspect-ratio: 553.8592 / 76;
width: 100%;
transition: transform .4s;
}
.egg-top.dragged .time-ruler-faces-container {
transition-duration: 0s;
transition-timing-function: ease-out;
}
.time-ruler-face-wrapper {
--angle: calc(360deg / var(--face-count) * var(--i));
position: absolute;
transform: rotateY(calc(var(--angle) - 90deg)) translateX(calc(100% / (2 * 0.06554) - 3px)) rotateY(90deg);
backface-visibility: hidden;
width: calc(100% * 0.0654);
height: 100%;
overflow: hidden;
}
.time-ruler-face {
position: absolute;
top: 0;
left: calc(-100% * var(--i));
height: 100%;
fill: #484848;
will-change: transform;
}
.egg-center {
margin: 0 auto;
height: 6px;
width: calc(100% - 24px);
background-color: #f4f4f4;
box-shadow: inset 0 6px 2px Rgb(0 0 0/0.2), inset 0 2px 2px Rgb(0 0 0/0.2);
}
.egg-bottom {
background-color: #f4f4f4;
background-image: url("https://assets.codepen.io/4175254/final-2.png"), linear-gradient(to right, #e6e6e6, #ffffff, #e6e6e6);
background-size: 60px 60px, auto au.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0