html5语音闹钟代码,HTML5+CSS3闹钟动画特效源码

a4c26d1e5885305701be709a3d33442f.png

效果图

各位朋友大家好,今天给大家带来的是

《HTML5+CSS3闹钟动画特效源码》

可以添加在网站里面作为一个炫酷的小装饰

代码过长需要文档版源码来我的前端群581549454,已上传到群文件

废话不多说,上源码

body {

background: #8fd5d5;

}

.contain-clock {

position: relative;

margin: -100px auto;

width: 155px;

height: 200px;

-webkit-animation: alarm-2 1ms infinite;

animation: alarm-2 1ms infinite;

}

.face-1 {

position: absolute;

top: 23px;

left: 23px;

z-index: 3;

background: white;

border-radius: 50%;

width: 109px;

height: 109px;

}

.face-2 {

position: relative;

margin: 200px auto;

z-index: 2;

background: white;

border: 15px solid #ed6e46;

border-radius: 50%;

width: 125px;

height: 125px;

}

.line {

position: absolute;

left: 50%;

margin-left: -3px;

background: gray;

width: 6px;

height: 126px;

}

.line-2 {

left: 63px;

transform: rotate(90deg);

-webkit-transform: rotate(90deg) translate3d(0, 0, 0);

}

.line-3 {

margin-left: -1px;

transform: rotate(30deg);

-webkit-transform: rotate(30deg) translate3d(0, 0, 0);

width: 2px;

}

.line-4 {

margin-left: -1px;

transform: rotate(-30deg);

-webkit-transform: rotate(-30deg) translate3d(0, 0, 0);

width: 2px;

}

.line-5 {

margin-left: -1px;

transform: rotate(60deg);

-webkit-transform: rotate(60deg) translate3d(0, 0, 0);

width: 2px;

}

.line-6 {

margin-left: -1px;

transform: rotate(-60deg);

-webkit-transform: rotate(-60deg) translate3d(0, 0, 0);

width: 2px;

}

.hour {

position: absolute;

top: 50%;

left: 50%;

z-index: 5;

margin-left: -4px;

background: #f8b65b;

transform-origin: top;

-webkit-transform-origin: top;

transform: rotate(90deg);

-webkit-transform: rotate(90deg);

border-radius: 50px;

width: 8px;

height: 35px;

}

.minute {

position: absolute;

top: 5px;

left: 55px;

z-index: 3;

margin-left: -4px;

background: #f8b65b;

border-radius: 50px;

transform-origin: bottom;

-webkit-transform-origin: bottom;

width: 8px;

height: 50px;

animation: tick-tock 3600s steps(60, end) infinite;

-webkit-animation: tick-tock 3600s steps(60, end) infinite;

}

.second {

position: absolute;

top: 5px;

left: 56px;

z-index: 5;

margin-left: -2px;

background: #333333;

border-radius: 50px;

transform-origin: bottom;

-webkit-transform-origin: bottom;

width: 2px;

height: 50px;

animation: tick-tock 60s steps(60, end) infinite;

-webkit-animation: tick-tock 60s steps(60, end) infinite;

}

.center {

position: absolute;

top: 62px;

z-index: 20;

margin-top: -15px;

left: 55px;

margin-left: -8px;

border-radius: 50%;

background: #ed6e46;

width: 16px;

height: 16px;

}

.arm {

position: absolute;

top: -50px;

left: 73px;

z-index: 1;

background: gray;

transform: rotate(-30deg);

-webkit-transform: rotate(-30deg);

border-radius: 50px;

width: 10px;

height: 230px;

}

.arm-2 {

left: 71px;

transform: rotate(30deg);

-webkit-transform: rotate(30deg);

}

.bell {

position: absolute;

top: -30px;

z-index: 2;

background: #ed6e46;

border-radius: 50% 50% 10% 10%;

transform: rotate(-30deg);

-webkit-transform: rotate(-30deg);

width: 65px;

height: 35px;

}

.bell-2 {

left: 90px;

transform: rotate(30deg);

-webkit-transform: rotate(30deg);

}

.hammer {

position: absolute;

top: -25px;

left: 76px;

z-index: 1;

background: gray;

width: 3px;

height: 30px;

-webkit-animation: alarm 8ms infinite;

animation: alarm 8ms infinite;

}

.hammer:before {

content: '';

display: block;

position: absolute;

left: -6px;

background: gray;

border-radius: 50px;

width: 15px;

height: 5px;

}

.handle {

position: absolute;

top: -68px;

left: 32px;

border: 8px solid gray;

border-radius: 50px 50px 0 0;

width: 75px;

height: 30px;

}

.handle:after {

content: '';

display: block;

position: absolute;

top: 26px;

background: #8fd5d5;

width: 75px;

height: 15px;

}

@keyframes tick-tock {

to {

transform: rotate(360deg);

}

}

@-webkit-keyframes tick-tock {

to {

-webkit-transform: rotate(360deg) translate3d(0, 0, 0);

}

}

@-webkit-keyframes alarm {

from {

-webkit-transform-origin: bottom right;

-webkit-transform: rotate(15deg);

}

to {

-webkit-transform-origin: bottom left;

-webkit-transform: rotate(-15deg);

}

}

@keyframes alarm {

from {

transform-origin: bottom right;

transform: rotate(15deg);

}

to {

transform-origin: bottom left;

transform: rotate(-15deg);

}

}

@-webkit-keyframes alarm-2 {

from {

-webkit-transform: rotate(1deg);

}

to {

-webkit-transform: rotate(-1deg);

}

}

@keyframes alarm-2 {

from {

transform: rotate(1deg);

}

to {

transform: rotate(-1deg);

}

}

a4c26d1e5885305701be709a3d33442f.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
***************************************************** 电脑闹钟3.0新特性: 因为本版本改动实在太大,所以直接定为3.0版; 1、界面重做,并增加了换肤功能;(真诚感谢非鱼朋友为此软件量身定做背景图案,在他工作繁忙之中,能够给予本人如此热忱的帮助,在此深深感谢!非鱼:有的皮肤完全是我用ps一点一点画出来,痛苦啊~~~~) 2、可以设定三个时间点让闹钟响(本人用于早上起床一个,中午起床一个,晚上提醒休息一个),每个时间点都可以设定单独的声音。应该是够用了; 3、增加了自动整点报时功能; 4、随时可以真人发声报时(在右键菜单中选“报时”)。 说明: 在此谢谢叶孤城、Xbobo等朋友对本人开发期间提出的建议和各位网友对本人作品的肯定,也谢谢各位对本人作品的使用。 再附一点3.0的说明: 1、如果你不想设置这么多的时间点,你可以设置时把后两个时间点清空。程序默认第一个时间点是必须要设置的。 2、由于本人这儿的录音条件实在有限,所以语音报时所用的语音资源文件来自米老鼠朋友的提供,在此表示深深的谢意! 3、本人编译环境为Win2000和Delphi6,可能在98和me下面运行存在问题,对此本人表示遗憾。谁有兴趣可以修改一下,我是真的没有时间了:) 祝 各位朋友愚人节快乐! 风之铃 2003.3.31 ************************************************* 电脑闹钟1.2新特性: 1、最小化为隐藏窗体; 2、修正了设置为 自动开机运行 时有时不能正确自动运行的问题; 3、增加了一个About窗口(做广告?); 4、重写了播放器代码,现在可以支持更多的格式:wav,wma,mid,rmi,mp3……等。如果在你的机器上出现某种声音格式不能播放的情景(有的机器对于MP3文件会出现这种情况),请打开你的Windows Media Player,设置与相应的文件格式关联(其实就是更改一下注册表中的文件关联),然后就可以在闹钟中使用该格式的文件了; 5、加入了测试播放的功能; 6、从本版本开始公布源代码,所以加入了GNU的GPL许可证,并改写了源代码架构,增加了更多的注释,以方便大家理解
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值