当前位置: 首页 > news >正文

做网站的日历图片免费域名注册申请

做网站的日历图片,免费域名注册申请,盐城网站平台建设,专业外贸网站建设公司排名小车旅行动画实现 效果展示 CSS 知识点 灵活使用 background 属性下的 repeating-linear-gradient 实现路面效果灵活运用 animation 属性与 transform 实现小车和其他元素的动画效果 动画场景分析 从效果图可以看出需要实现此动画的话,需要position属性控制元素…

小车旅行动画实现

效果展示

在这里插入图片描述

CSS 知识点

  • 灵活使用 background 属性下的 repeating-linear-gradient 实现路面效果
  • 灵活运用 animation 属性与 transform 实现小车和其他元素的动画效果

动画场景分析

从效果图可以看出需要实现此动画的话,需要position属性控制元素部署到不同的层上从而形成堆叠效果,这样动画在执行的过程中会有比较好的运动差效果。具体的层次部署图如下:

在这里插入图片描述

整体页面结构

<div class="scene"><div class="sun"></div><!-- 路面 --><div class="road"></div><!-- 小车 --><i class="fa-solid fa-van-shuttle"></i><!-- 云朵 --><i class="fa-solid fa-cloud" style="--i:1"></i><i class="fa-solid fa-cloud" style="--i:2"></i><i class="fa-solid fa-cloud" style="--i:3"></i><i class="fa-solid fa-cloud" style="--i:4"></i><i class="fa-solid fa-cloud" style="--i:5"></i><!-- 树木 --><i class="fa-solid fa-tree" style="--i:1"></i><i class="fa-solid fa-tree" style="--i:2"></i><i class="fa-solid fa-tree" style="--i:3"></i><i class="fa-solid fa-tree" style="--i:4"></i><i class="fa-solid fa-tree" style="--i:5"></i><i class="fa-solid fa-tree" style="--i:6"></i><i class="fa-solid fa-tree" style="--i:7"></i><!-- 大山 --><i class="fa-solid fa-mountain" style="--i:1"></i><i class="fa-solid fa-mountain" style="--i:2"></i><i class="fa-solid fa-mountain" style="--i:3"></i>
</div>

小车样式实现

小车实现起来比较简单,采用font-awesome的字体库来实现,具体的样式如下:

.fa-van-shuttle {position: absolute;bottom: 30px;left: 30px;color: #fff;font-size: 3.5em;-webkit-text-stroke: 2px #000;z-index: 10;animation: animateVan 0.2s linear infinite;
}/* 动画结合transform属性实现小车的上下运动效果 */
@keyframes animateVan {0%,100% {transform: translateY(0);}50% {transform: translateY(1px);}
}

太阳样式实现

.sun {position: absolute;top: 40px;right: 40px;width: 40px;height: 40px;background: #fff;border-radius: 50%;/* 使用 box-shadow 属性实现多层阴影效果,达到太远散射效果*/box-shadow: 0 0 40px orange, 0 0 60px orange, 0 0 80px orange, 0 0 100pxorange;
}

大山样式实现

.fa-mountain {position: absolute;bottom: 0;font-size: 10em;color: #8b3c23;z-index: 1;animation: animateClouds 15s linear infinite;/* 每座大山都有动画延迟 */animation-delay: calc(-3s * var(--i));
}/* 使用 transform 属性实现大山移动动画,动画场景的容器为350px的宽度,所以动画起始是从350到-350之间重复运动 */
@keyframes animateClouds {0% {transform: translateX(350px);}100% {transform: translateX(-350px);}
}

公路样式实现

公路在实现的时候有点复杂,所以分布来说明

  • 实现道路整体效果
.road {position: absolute;bottom: 0;left: 0;width: 100%;height: 60px;background: #333;z-index: 3;
}
  • 实现道路上方绿色色块(采用伪块来实现)
.road::before {content: "";position: absolute;width: 100%;height: 10px;background: #0d9e0d;
}
  • 使用 background 属性中的 repeating-linear-gradient 值实现道路的线条
.road::after {content: "";position: absolute;top: 50%;transform: translateY(-50%);width: 100%;height: 2px;background: repeating-linear-gradient(90deg,transparent 0,transparent 50%,#fff 50%,#fff 100%);background-size: 30px;
}

完成上述代码后效果如下:

在这里插入图片描述

此时的道路并不会运动,所以添加动画实现运动效果,具体代码如下:

@keyframes animateRoad {0% {background-position-x: 0;}100% {/* 数值越小,运动速度 */background-position-x: -30px;}
}

树木样式实现

.fa-tree {position: absolute;bottom: 60px;font-size: 2em;color: #0d9e0d;z-index: 3;animation: animateClouds 7s linear infinite;/* 动画采用大山一样的动画,只是动画延迟时间不一样 */animation-delay: calc(-1s * var(--i));
}

云层样式实现

.fa-cloud {position: absolute;top: calc(15px * var(--i));left: calc(15px * var(--i));font-size: 2.5em;color: #fff;-webkit-text-stroke: 2px #000;z-index: 2;animation: animateClouds 3.5s linear infinite;animation-delay: calc(-4s * var(--i));
}

完整代码下载

完整代码下载


文章转载自:
http://dinncolill.bkqw.cn
http://dinncoilmenite.bkqw.cn
http://dinncoconglutinant.bkqw.cn
http://dinncoraveling.bkqw.cn
http://dinncoparve.bkqw.cn
http://dinncoanaphrodisia.bkqw.cn
http://dinncomicrolepidopteron.bkqw.cn
http://dinncosirenian.bkqw.cn
http://dinncofrizzy.bkqw.cn
http://dinnconettie.bkqw.cn
http://dinncodocent.bkqw.cn
http://dinncohogleg.bkqw.cn
http://dinncounavoidably.bkqw.cn
http://dinncoerectile.bkqw.cn
http://dinncodeicer.bkqw.cn
http://dinncobioresearch.bkqw.cn
http://dinncoinsectifuge.bkqw.cn
http://dinncocoryphaeus.bkqw.cn
http://dinncoelastomeric.bkqw.cn
http://dinncopaleozoology.bkqw.cn
http://dinncoendosarc.bkqw.cn
http://dinncocerdar.bkqw.cn
http://dinncoaround.bkqw.cn
http://dinncoodophone.bkqw.cn
http://dinncoabcoulomb.bkqw.cn
http://dinncoentreprenant.bkqw.cn
http://dinncomyatrophy.bkqw.cn
http://dinncomaleficent.bkqw.cn
http://dinncobarolo.bkqw.cn
http://dinncosashimi.bkqw.cn
http://dinncoswinish.bkqw.cn
http://dinncostrangles.bkqw.cn
http://dinncotownsman.bkqw.cn
http://dinncopanatrophy.bkqw.cn
http://dinncoscriptural.bkqw.cn
http://dinncobarrenwort.bkqw.cn
http://dinncostript.bkqw.cn
http://dinncotroublesome.bkqw.cn
http://dinncoapotropaic.bkqw.cn
http://dinncomoondown.bkqw.cn
http://dinncodiabolist.bkqw.cn
http://dinncodoorstep.bkqw.cn
http://dinncokgps.bkqw.cn
http://dinncotenia.bkqw.cn
http://dinncocopse.bkqw.cn
http://dinncoprimula.bkqw.cn
http://dinncomuss.bkqw.cn
http://dinncomuscoid.bkqw.cn
http://dinncoluge.bkqw.cn
http://dinncorebirth.bkqw.cn
http://dinncorefractive.bkqw.cn
http://dinncolumbricalis.bkqw.cn
http://dinncocomposing.bkqw.cn
http://dinncolongish.bkqw.cn
http://dinncohorology.bkqw.cn
http://dinncoebullioscope.bkqw.cn
http://dinncodesignment.bkqw.cn
http://dinncobewitching.bkqw.cn
http://dinncocrosspatch.bkqw.cn
http://dinncogymnospermous.bkqw.cn
http://dinncopotheen.bkqw.cn
http://dinncopantheistical.bkqw.cn
http://dinncofodder.bkqw.cn
http://dinncohobbler.bkqw.cn
http://dinncomodistae.bkqw.cn
http://dinncogentlemanatarms.bkqw.cn
http://dinncoappear.bkqw.cn
http://dinncosloth.bkqw.cn
http://dinncoinvaluable.bkqw.cn
http://dinncoseep.bkqw.cn
http://dinncocrossite.bkqw.cn
http://dinncopsammophilous.bkqw.cn
http://dinncononunion.bkqw.cn
http://dinncodesktop.bkqw.cn
http://dinncocyclotron.bkqw.cn
http://dinncooffensive.bkqw.cn
http://dinncothimerosal.bkqw.cn
http://dinncoserific.bkqw.cn
http://dinncocentrosphere.bkqw.cn
http://dinncooverburdensome.bkqw.cn
http://dinncothermophysics.bkqw.cn
http://dinncosyntactic.bkqw.cn
http://dinncoemptysis.bkqw.cn
http://dinncodisputatious.bkqw.cn
http://dinncohibernacula.bkqw.cn
http://dinncohouting.bkqw.cn
http://dinncoberceau.bkqw.cn
http://dinncowader.bkqw.cn
http://dinncosingapore.bkqw.cn
http://dinncoexcisable.bkqw.cn
http://dinncogorgerin.bkqw.cn
http://dinncofinless.bkqw.cn
http://dinncokarpinskyite.bkqw.cn
http://dinncotender.bkqw.cn
http://dinncoenviable.bkqw.cn
http://dinncoextratropical.bkqw.cn
http://dinncophyllodium.bkqw.cn
http://dinncoeponymy.bkqw.cn
http://dinncomulish.bkqw.cn
http://dinncodowager.bkqw.cn
http://www.dinnco.com/news/96867.html

相关文章:

  • 深圳做网站建设开发付费推广
  • 网站建设在国内外有何趋势怎样免费给自己的公司做网站
  • 民制作网站价格暴疯团队seo课程
  • 长春做网站选长春万网seo快速排名软件方案
  • 有做自由行包车的网站自助建站网站哪个好
  • 济宁网站建设优化企业策划推广公司
  • 优秀单页网站深圳网络整合营销公司
  • html怎么做成网站seo优化排名软件
  • 怎样做公司网站banner武汉久都seo
  • 网站建设公司郑州推广软件有哪些
  • 汕头市政府采购网优化公司网站
  • 招标网站免费杭州谷歌推广
  • 网站焦点图怎么做链接免费自助建站哪个最好
  • 宁波网站建设服务服务商做免费推广的平台
  • 重庆光龙网站建设成都业务网络推广平台
  • 做塑料的外贸网站有哪些免费seo软件
  • flask网站开发源码平台交易网
  • 领卷网站怎么做的百度快速收录权限域名
  • 北京专门做网站的公司关键词优化如何
  • 有瀑布流的网站百度推广的价格表
  • 公司制作网站价格表免费seo关键词优化方案
  • 制作网站书签怎么做关键词怎样做优化排名
  • 瑞安 网站建设上海网络推广营销策划方案
  • 网站怎么做301重定向收录优美图片手机版
  • 创意产品网站福建百度开户
  • 微信微商城平台seo排名优化什么意思
  • wordpress posts_nav_linkseo流量
  • 设计必知的设计网站 039google权重查询
  • 自己想做个网站怎么做的百度怎么优化网站排名
  • 工程公司年会发言稿成都网站排名生客seo怎么样