一个纯CSS3写的播放器,大家可以看看

HTML5动画与交互实例
本文通过一个具体的HTML5页面示例介绍了如何使用CSS动画实现图片旋转效果,并结合JavaScript实现播放与暂停功能。同时展示了如何利用HTML标签和样式属性创建简单的用户交互界面。
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            background: url("../Chapter 10素材/akn.png") no-repeat;
            width: 600px;
            height: 600px;
        }
        body{
            padding: 0;
            margin: 0;
        }
        .box img{
            width: 200px;
            height: 200px;
            border-radius: 50% ;
            position: absolute;
            left: 155px;
            top: 160px;
        }
        .guner{
            width: 200px;
            height: 5px;
            background-color: white;
            position: absolute;
            left: 150px;
            border-radius: 2px 0 0 2px ;
        }
        .box img{
            animation: zhuan 10s linear infinite;
        }
        @keyframes  zhuan {
            0%{transform: rotate(0deg)}
            100%{transform: rotate(360deg)}
        }
        label{
        color: white;
            width: 60px;
            height: 30px;
            border: 1px solid red;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            display: block;
            text-align: center;
            line-height: 30px;
            background-color: #ff8d8d;
            float:left ;
        }
        [name="btn"]{
            display: none;
        }
        .box img{
            animation: zhuan 10s linear infinite;
            animation-play-state: paused;
        }
        .guner{
            background-color: black;
        }
        .guner{
            transform-origin: left;
            transition: all 300ms linear;
        }
        #ok:checked~.guner{
            transform: rotate(45deg);
        }
        #ok:checked~img{
            animation-play-state:running ;
         }
    </style>
</head>
<body>
<div class="box">
    <!--播放,暂停-->
    <label for="ok" id="paly">播放</label>
    <input type="radio" id="ok" name="btn">
    <label for="no" id="pause">暂停</label>
    <input type="radio" id="no" name="btn">

    <img src="../../Chapter09/images/delicious.png" />
    <div class="guner">
    </div>
    <div class="btn-box">
    </div>
</div>
</body>
</html>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值