一个基于vue的钟表demo

前两天写了一个基于vue的小钟表,给大家分享一下。

其中时针和分针使用的是图片,结合transform制作;表盘刻度是通过transform和transformOrigin配合画的;外面的弧形框框,啊哈哈,也是用的图片。具体的看里面的注释就好了,感觉写的还算清楚,啊哈哈~

能帮到你的话,点个赞呗?

预览图:
clockPreview.png

效果的话,可以看这里
https://jhcan333.github.io/can-Share/demos-tips/clockDemo.html

github 地址在这里
https://github.com/JHCan333/can-Share/blob/master/demos-tips/clockDemo.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>一个基于vue的时钟小demo</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        .jhc-hour-needle {
            z-index: 5;
            width: 6%;
            height: 25%;
            position: absolute;
            left: 49%;
            bottom: 47%;
            transform-origin: center bottom;
            background: url(https://jhcan333.github.io/can-Share//image/clock/hourPoint.png) no-repeat;
            background-size: 100% 100%;
        }

        .jhc-min-needle {
            z-index: 2;
            width: 6%;
            height: 30%;
            position: absolute;
            left: 49%;
            bottom: 47%;
            transform-origin: center bottom;
            background: url(https://jhcan333.github.io/can-Share//image/clock/minPoint.png) no-repeat;
            background-size: 100% 100%;
        }

        .jhc-clock-area {
            width: 400px;
            height: 400px;
            position: relative;
            background: #050842;
        }

        .jhc-clock-back {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0px;
            left: 0px;
            back
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值