仿Apple Watch时钟

这篇博客展示了如何设计并实现一个模仿Apple Watch的时钟界面。文章包含详细的代码实现,通过这段代码,读者可以了解到图形界面设计和时间显示的技术细节。
摘要由CSDN通过智能技术生成

效果图:
效果图
代码:

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>时钟</title>
<style type="text/css">
 body{
    background:#000}.clock{
    position:absolute;opacity:1}.fill .clock{
    left:50%;top:50%}.centre{
    position:absolute;top:50%;left:50%;width:0;height:0}.expand{
    position:absolute;top:0;left:0;transform:translate(-50%,-50%)}.anchor{
    position:absolute;top:0;left:0;width:0;height:0}.element{
    position:absolute;top:0;left:0}.round{
    border-radius:296px}.circle-1{
    background:#fff;width:12px;height:12px}.circle-2{
    background:#fa9f22;width:8px;height:8px}.circle-3{
    background:#000;width:4px;height:4px}.second{
    transform:rotate(180deg)}.minute{
    transform:rotate(54deg)}.second-hand{
    width:2px;height:164px;background:#fa9f22;transform:translate(-50%,-100%) translateY(24px)}.hour{
    transform:rotate(304.5deg)}.thin-hand{
    width:4px;height:50px;background:#fff;transform:translate(-50%,-100%)}.fat-hand{
    width:10px;height:57px;border-radius:10px;background:#fff;transform:translate(-50%,-100%) translateY(-18px)}.minute-hand{
    height:112px}.hour-text{
    position:absolute;font:40px Hei,Helvetica,Arial,sans-serif;color:#fff;transform:translate(-50%,-50%)}.hour-10{
    padding-left:.4ex}.hour-11{
    padding-left:.25ex}.minute-text{
    position:absolute;font:12px Avenir Next,Helvetica,Arial,sans-serif;color:#fff;transform:translate(-50%,-50%)}.minute-line{
    background:#fff;width:1px;height:9px;transform:translate(-50%,-100%) translateY(-131px);opacity:1}


</style>
<script> 
 function stop(){
     
  return false; 
 } 
 document.oncontextmenu=stop; 
</script>
</head>
<body>
<div class="fill">
<div class="reference"></div>
<div class="clock" id="utility-clock" style="transform: scale(1.939);">
<div class="centre">
<div class="dynamic">
<div class="anchor" style="transform: rotate(6deg);">
<div class="element minute-line"></div>
</div>
<div class="anchor" style="transform: rotate(12deg);">
<div class="element minute-line"></div>
</div>
<div class="anchor" style="transform: rotate(18deg);">
<div class="element minute-line"></div>
</div>
<div class="anchor" style="transform: rotate(24deg);">
<div class="element minute-line"></div>
</div>
<div class="minute-text" style="top: -116.9px; left: 67.5px;">05</div>
<div class="anchor" style="transform: rotate(36deg);">
<div class="element minute-line"></div>
</div> 
<div class="anchor" style="transform: rotate(42deg);">
<div class="element minute-line"></div>
</div>
<div class="anchor" style="transform: rotate
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值