CSS3简易表盘时钟
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css3时钟</title>
<style>
.box{
width: 300px;
height: 300px;
border-radius: 50%;
border: 5px solid #ccc;
margin: 100px auto;
position: relative;
}
.kedu{
width: 300px;
height: 300px;
border-radius: 50%;
position: relative;
overflow: hidden;
}
.kedu div{
height: 300px;
position: absolute;
left: 50%;
}
.kedu div:nth-child(1){
width: 6px;
background: #333;
margin-left: -3px;
}
.kedu div:nth-child(2){
width: 2px;
background: #666;
margin-left: -3px;
transform: rotate(30deg);
}
.kedu div:nth-child(3){
width: 2px;
background: #666;
margin-left: -3px;
transform: rotate(60deg);
}
.kedu div:nth-child(4){
width: 6px;
background: #333;
margin-left: -3px;
transform: rotate(90deg);
}
.kedu div:nth-child(5){
width: 2px;
background: #666;
margin-left: -3px;
transform: rotate(120deg);
}
.kedu div:nth-child(6){
width: 2px;
background: #666;
margin-left: -3px;
transform: rotate(150deg);
}
.disc{
width: 20px;
height: 20px;
border-radius: 50%;
background: #000;
position: absolute;
top: 50%;
left: 50%;
margin-left: -10px;
margin-top: -10px;
z-index: 2;
}
.middisc{
width: 260px;
height: 260px;
border-radius: 50%;
background: #fff;
position: absolute;
top: 50%;
left: 50%;
margin-left: -130px;
margin-top: -130px;
}
.hour{
width: 6px;
height: 60px;
background: #000;
position: absolute;
top: -50px;
left: 50%;
margin-left: -3px;
transform-origin: bottom center;
animation: move 43200s steps(60) 0s infinite;
}
.minu{
width: 4px;
height: 80px;
background: green;
position: absolute;
top: -70px;
left: 50%;
margin-left: -2px;
transform-origin: bottom center;
animation: move 3600s steps(60) 0s infinite;
}
.second{
width: 2px;
height: 100px;
background: #f00;
position: absolute;
top: -90px;
left: 50%;
margin-left: -1px;
transform-origin: bottom center;
-webkit-animation: move 60s steps(60) infinite;
}
.cover{
width: 20px;
height: 20px;
border-radius: 50%;
background: #000;
position: absolute;
}
@keyframes move{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="box">
<div class="kedu">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="disc">
<div class="hour"></div>
<div class="minu"></div>
<div class="second"></div>
<div class="cover"></div>
</div>
<div class="middisc">
</div>
</div>
</body>
</html>
有大量web前端开发工具及学习资料,可以搜群【 web前端学习部落22群 】进行下载,遇到学习问题也可以问群内专家以及课程老师哟
CSS3简易表盘时钟的更多相关文章
- 使用jQuery和CSS3制作数字时钟(jQuery篇) 附源码下载
HTML 和上一篇文章:使用jQuery和CSS3制作数字时钟(CSS3篇)一样的HTML结构,只是多了个>date用来展示日期和星期的. <div id="clock" ...
- iOS 绘制一个表盘时钟,秒针效果可以“扫秒/游走”
最近自己 也尝试写了一个表盘时钟,初衷源于等车时候一个老奶奶问时间,我打开手机,时间数字对我来说相对敏感,但是老奶奶是看不清的,我想识别 还是看表盘 老远 看时针分针角度就可以识别当前时间. 于是我想 ...
- 网页计算器 && 简易网页时钟 && 倒计时时钟
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- css3 简易时钟
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- html+css3实现网页时钟
在网页上实现时钟功能,效果如右图所示: 运用到的关键技术有:css3中的旋转.旋转基点设置 旋转:transform:rotate(*deg) 旋转基点:transform-origin: x轴偏移 ...
- canvas绘制表盘时钟
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- QT绘制简易表盘
1.简介 最近学习了一下QT,熟悉了一段时间后发现它的功能还是挺强大的,同时也比较方便用户上手去使用.现在就基于最近学习的内容,实现一个简易的带指针旋转功能的表盘.文中表盘的实现是基于QT的QPain ...
- css3简易实现图标动画由小到大逐个显现
在制作网站时避免图片太平淡经常会用到动画效果:由小到大跳跃出现.这种效果很有视觉冲击力,显著提高关注度~ 原理:利用css3的动画属性@keyframes@-moz-keyframes@-webkit ...
- 基于FPGA的简易数字时钟
基于FPGA的可显示数字时钟,设计思路为自底向上,包含三个子模块:时钟模块,进制转换模块.led显示模块.所用到的FPGA晶振频率为50Mhz,首先利用它得到1hz的时钟然后然后得到时钟模块.把时钟模 ...
随机推荐
- Leetcode 45. Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the arra ...
- java 枚举的简单应用。
枚举,就是保存着原始的<key,value> 在代码中会经常用到.为了不坑自己,记录一下笔记 package com.fortunedr.common.constant; public e ...
- react native 环境配置
1. 安装Homebrew Homebrew主要用于安装后面需要安装的watchman.flow 打开MAC的终端,输入如下命令: ruby -e "$(curl -fsSL https:/ ...
- Python_猜大小
# 需要在python3上执行 import random def game (capital = 1000): point1 = random.randrange(1,7) point2 = ran ...
- Oracle 环境变量NLS_LANG
NLS_LANG是一个环境变量,用于定义语言,地域以及字符集属性.对于非英语的字符集,NLS_LANG的设置就非常重要.NLS:'National Language Support (NLS)' 当我 ...
- 浅谈ScrollView嵌套ListView及ListView嵌套的高度计算
引言 在Android开发中,我们有时会需要使用ScrollView中嵌套ListView的需求.例如:在展示信息的ListView上还有一部分信息展示区域,并且要求这部分信息展示区域在ListVie ...
- saltstack 把数据返回到mysql服务器
环境:http://www.cnblogs.com/zzzhfo/p/5790918.html master端需要安装MySQL-python和mysql-server mysql-server用于存 ...
- MongoDB安装配置示例
参考 http://www.runoob.com/mongodb/mongodb-window-install.html http://www.cnblogs.com/lecaf/archive/20 ...
- linux学习第一天,常用命令一
linux系统基本原则:1.由自由的单一的小程序组成,组合小程序完成负责的任务.2.一切皆文件,3.尽量避免捕获用户接口,也就是说用户输入命令后就能直接返回结果.4.配置文件保存为纯文本格式. GUI ...
- HTML5 中的 canvas 画布(一)
---恢复内容开始--- 在HTML5中新添加的元素,canvas 现在支持 IE9+的版本 注意:HTML5 <canvas> 元素用于图形的绘制,通过脚本 (通常是JavaScript ...