【HTML+css】动态齿轮 (齿轮 动图)

9 篇文章 0 订阅
8 篇文章 0 订阅

效果图

动态齿轮图

html代码块

<!DOCTYPE html>
<html lang="en">
<head>
	<!-- name:myw -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/chilun.css">
</head>
<body>
    <div id="aaaa"></div>
    <div id="luntai">
        <div class="shixin">
            <div class="hua"></div>
        </div>
    </div>
    <div id="yingjing">
        <div class="yingjing"></div>
    </div>
    <div id="yingjingshang">
        <div class="yingjingshang"></div>
    </div>
    <div id="yingjingxia">
        <div class="yingjingxia"></div>
    </div>
    <div id="xia">
        <div class="xia1">
            <div class="xia2"></div>
        </div>
    </div>
    <div id="xuan">
        <div class="xuan1">
            <div class="xuan2"></div>
        </div>
    </div>
    <div id="cun"></div>
    <div id="xuxian"></div>
</body>
<!-- name:myw -->
</html>

css代码块

/* 初始化 */
body{
    /* name:myw */
    height:0;
    width: 0;
    background-color:#015962 ;
}
/* 背景静态齿轮 */
#aaaa{
    /* 设置图片大小 */
    height: 650px;
    width: 350px;
    /* 导入图盘 */
	background-image:url('../img/tu.png');
    /* 显示不重复 */
	background-repeat:no-repeat;
    /* 定位图片参数 */
	background-position:-350px -870px; 
    /* 透明度 */
    opacity:0.5; 
    /* 悬浮 */
    position: absolute;
    left: 500px;
    /* top: 100px; */
}
#luntai{
    height: 320px;
    width: 320px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -993px;
    border-radius: 50%;
    position: absolute;
    left: 400px;
    top: 180px;
    animation: rotate 10s linear infinite;
}
.shixin{
    height: 87px;
    width: 87px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -857px;
    border-radius: 50%;
    position: absolute;
    left: 116.5px;
    top: 116.5px;
}
.hua{
    height: 60px;
    width: 60px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -745px;
    border-radius: 50%;
    position: absolute;
    left: 13.5px;
    top: 13.5px;
    animation: rotatea 5s linear infinite;
}
#yingjing{
    height: 235px;
    width: 235px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -370px -280px;
    border-radius: 50%;
    position: absolute;
    left: 560px;
    top: 90px;
    animation: rotate 10s linear infinite;
}
.yingjing{
    height: 110px;
    width: 110px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -370px -0px;
    border-radius: 50%;
    position: absolute;
    left: 57.5px;
    top: 57.5px;
    animation: rotatea 5s linear infinite;
}
#yingjingshang{
    height: 120px;
    width: 120px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -185px;
    border-radius: 50%;
    position: absolute;
    left: 495px;
    top: 30px;
    animation: rotatea 6.65s linear infinite;
}
.yingjingshang{
    height: 85px;
    width: 85px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -1490px;
    border-radius: 50%;
    position: absolute;
    left: 17.5px;
    top: 17.5px;
    animation: rotate 4s linear infinite;
}
#yingjingxia{
    height: 135px;
    width: 135px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -1930px;
    border-radius: 50%;
    position: absolute;
    left: 680px;
    top: 300px;
    animation: rotatea 7.6s linear infinite;
}
.yingjingxia{
    height: 70px;
    width: 70px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -1620px;
    border-radius: 50%;
    position: absolute;
    left: 30px;
    top: 30px;
}
#xia{
    height: 165px;
    width: 165px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -530px;
    border-radius: 50%;
    position: absolute;
    left: 580px;
    top: 400px;
    animation: rotate 6.5s linear infinite;
}
.xia1{
    height: 125px;
    width: 125px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -355px;
    border-radius: 50%;
    position: absolute;
    left: 20px;
    top: 20px;
    animation: rotatea 4s linear infinite;
}
.xia2{
    height: 80px;
    width: 80px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: 0px -1365px;
    border-radius: 50%;
    position: absolute;
    left: 22.5px;
    top: 22.5px;
    animation: rotate 3.25s linear infinite;
}
#xuan{
    height: 150px;
    width: 150px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -370px -705px;
    border-radius: 50%;
    position: absolute;
    left: 350px;
    top: 120px;
    animation: rotatee 20s linear infinite;
}
.xuan1{
    height: 135px;
    width: 135px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -0px -1745px;
    border-radius: 50%;
    position: absolute;
    left: 7.5px;
    top: 7.5px;
    animation: rotatee 20s linear infinite;
}
.xuan2{
    height: 75px;
    width: 75px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -370px -155px;
    border-radius: 50%; 
    position: absolute;
    left: 30px;
    top: 30px;
    animation: rotatee 20s linear infinite;
}
#cun{
    height: 90px;
    width: 35px;
    background-image: url(../img/tu.png);
    background-repeat: no-repeat;
    background-position: -370px -560px;
    position: absolute;
    left: 334px;
    top: 265px;
    animation: shaking 20s linear infinite;
}
#xuxian{
    border-style:dotted;
    height: 70px;
    color: #C8D94A;
    border-width:1px;
    position: absolute;
    left: 350px;
    top: 200px;
    animation: shakinga 20s linear infinite;
}
@keyframes shakinga {
    0% {
        height:70px;
    }
    50% {
       height:270px;
    }
    100% {
        height:70px;
    }
}
/* 下滑动画 */
@keyframes shaking {

    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(200px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* 旋转方法
    animation: rotate 7s linear infinite;
*/
/* 正转 */
@keyframes rotate {
    0% {
        transform: rotate(0);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* 一正一反转 */
@keyframes rotatee {
    0% {
        transform: rotate(0);
    }

    50% {
        transform: rotate(-360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}
/*name:myw */
/* 倒转 */
@keyframes rotatea {
    0% {
        transform: rotate(0);
    }

    50% {
        transform: rotate(-180deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
网页设计期末大作业是一个非常重要的任务,它要求我们将所学的HTMLCSS知识应用于实践,并且要加入动态效果以使网页更加生动有趣。 在设计网页的过程,首先我会提前计划整个页面的布局和结构。考虑到用户体验和页面的可视性,我会选择合适的颜色搭配和字体,并合理分配页面的空间。在编写HTML代码时,我会使用语义化的标签来定义不同的内容,以便搜索引擎更好地理解网页的结构。 接下来,我会运用CSS技术对网页进行美化和样式设置。通过使用CSS选择器,我可以对不同的元素进行指定样式的设置,例如背景颜色、文字大小和边框样式等。我也会运用CSS的盒模型和浮动布局来进行网页元素的排列和定位,以创建一个美观、整齐的页面。 为了增加网页的动态效果,我会运用CSS的过渡和动画属性来实现元素的平滑过渡和动画效果。例如,当鼠标悬停在按钮上时,可以使用CSS3的过渡属性来实现按钮颜色的渐变效果。另外,我还可以使用CSS的动画属性来创建一些更为复杂的动态效果,如元素的旋转、缩放和淡入淡出等。 在制作动态网页时,我还可以使用JavaScript来实现一些更复杂的交互效果。例如,通过JavaScript的事件监听功能,可以实现当用户点击按钮时弹出一个提示框或切换页面的内容等。 综上所述,我将综合运用HTMLCSS和JavaScript等技术,设计一个既有美观外观又具有动态效果的网页。通过这个期末大作业的完成,我相信我能够更加熟练地掌握网页设计的技巧和方法,并将其应用在日后的实践

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值