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

南宁隆安网站建设平台推广方式有哪些

南宁隆安网站建设,平台推广方式有哪些,备案信息修改网站负责人,网站开发新加坡3d转换 位移 & 旋转 定义位移透视 perspective透视和Z轴使用场景 旋转子元素开启3d视图示例 小结 定义 3d转换在2d转换中增加了一个z轴,垂直于屏幕,向外为正,向内为负。 位移 在2d位移的基础上增加了 translateZ(z); 在Z轴上的位移 t…

3d转换 位移 & 旋转

    • 定义
    • 位移
      • 透视 perspective
      • 透视和Z轴使用场景
    • 旋转
      • 子元素开启3d视图
      • 示例
    • 小结

定义

3d转换在2d转换中增加了一个z轴,垂直于屏幕,向外为正,向内为负

位移

在2d位移的基础上增加了

  • translateZ(z);
    在Z轴上的位移

  • translate3d(x,y,z);
    同时定义在3个轴上的位移

透视 perspective

3D效果通过透视距离(视距)和z轴模拟人眼到盒子的距离

视距越大,隔得越远,物体越小;视距越大,隔得越近,物体越大;
Z轴越大,隔得越近,物体越大,Z轴越小,隔得越远,物体越小。

透视距离需加载模拟3d的元素的父盒子上,通过父盒子的视角去模拟3d近大远小的效果。

透视距离需 >= z轴的值,否则相当于物体跑进我们眼睛里面了。

透视和z轴都可以调整最终观察到的物体大小

透视和Z轴使用场景

透视(视距):用于设置眼睛到屏幕的距离,用于在父盒子上设置统一的视距。

Z轴:用于给盒子内不同元素,单独设置盒子距离屏幕的Z轴的值,并体现出不同的大小。

旋转

和位移一样,3d旋转在2d旋转的基础之上,加了z轴的旋转。
同样要借助 基于父盒子的视距模拟3d效果。
对于旋转的的方向:站在坐标轴正方向,顺势针方向即为正向旋转,逆时针即为负向旋转。

新增两个旋转属性

  • rotateZ(deg);沿着z轴旋转指定度数
  • rotate3d(x, y, z, deg);沿着自定义轴线旋转

子元素开启3d视图

transform-style:flat(默认,不开启)| preserve-3d 开启3d视图

同样这个属性是给到父盒子的。

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>子盒子保持3d视图</title><style>.box {position: relative;width: 500px;height: 200px;background-color: #ff6700;margin: 100px auto;perspective: 500px;transform-style: preserve-3d;}.box:hover {transform: rotateY(70deg);}.box div {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-color: #ee20ee;}.box div:last-child {background-color: green;transform: rotateX(45deg);}body {perspective: 500px;}</style></head><body><div class="box"><div></div><div></div></div></body>
</html>

示例

  1. 盒子前后面反转
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>前后翻转盒子</title><style>.box {position: relative;width: 300px;height: 300px;margin: 100px auto;transition: all .2s;perspective: 300px;transform-style: preserve-3d;}.box:hover {transform: rotateY(180deg);}.box > * {position: absolute;top: 0;left: 0;width: 100%;height: 100%;border-radius: 150px;font-size: 20px;text-align: center;line-height: 300px;backface-visibility: hidden;}.box .front {background-color: #ee20ee;z-index: 1;}.box .back {background-color: #ff5000;transform: rotateY(180deg);}body{perspective: 300px;transform-style: preserve-3d;}</style></head><body><div class="box"><div class="front">今天要上学</div><div class="back">作业没写完</div></div></body>
</html>
  1. 3d菜单
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>3d菜单</title><style>* {margin: 0;padding: 0;}ul {margin: 100px auto;width: 200px;height: 100px;}ul li {float: left;margin: 0 5px;width: 100%;height: 100%;list-style: none;perspective: 500px;}div {width: 100%;height: 100%;text-align: center;line-height: 100px;}.box {position: relative;transition: all 0.6s;transform-style: preserve-3d;background-color: #ff5000;}.front {position: absolute;z-index: 1;top: 0;left: 0;background-color: green;transform: translateZ(50px)}.bottom {position: absolute;top: 0;left: 0;transform: translateY(50px) rotateX(-90deg); /*translateZ(100px)*/background-color: #ee20ee;}.box:hover {transform: rotateX(90deg);}body {perspective: 500px;transform-style: preserve-3d;}</style></head><body><ul><li><div class="box"><div class="front">正面</div><div class="bottom">底面</div></div></li></ul></body>
</html>
  1. 围绕y轴旋转
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>围绕一个y轴旋转</title><style>body {perspective: 1000px;}.box {position: relative;margin: 200px auto;width: 200px;height: 200px;text-align: center;transform-style: preserve-3d;animation: three_rotate 10s infinite linear;}.box:hover {animation-play-state: paused;}img {position: absolute;top: 0;left: 0;width: 100%;}@keyframes three_rotate {0% {transform: rotateY(0);}100% {transform: rotateY(360deg);}}.box img:nth-child(1) {transform: translateZ(300px);}.box img:nth-child(2) {transform: rotateY(60deg) translateZ(300px);}.box img:nth-child(3) {transform: rotateY(120deg) translateZ(300px);}.box img:nth-child(4) {transform: rotateY(180deg) translateZ(300px);}.box img:nth-child(5) {transform: rotateY(240deg) translateZ(300px);}.box img:nth-child(6) {transform: rotateY(300deg) translateZ(300px);}</style>
</head>
<body>
<!--动态转动都是围绕 .box 这个盒子的,里面的图片都是事先摆在相应的位置,相当于是附属在这个盒子上随着.box盒子的转动而转动-->
<div class="box"><img src="../../img/抢购封面.jpg"><img src="../../img/抢购封面.jpg"><img src="../../img/抢购封面.jpg"><img src="../../img/抢购封面.jpg"><img src="../../img/抢购封面.jpg"><img src="../../img/抢购封面.jpg">
</div>
</body>
</html>

小结

3d变换注意两个属性:

  • perspective: 300px;
    开启3d视图,这个值必须比Z轴的值大,且设置在要表现3d效果的盒子的父盒子上
    作用:让其子元素的3d属性呈现出立体的效果,有近大远小的视觉

  • transform-style: preserve-3d;
    保留子盒子3d效果,默认当父盒子开启3d视图,并且发生3d转换时,子盒子会变成2d,需要给父盒子加上此属性
    作用:使当前盒子开启在开启3d属性后,其子元素依然保留已开启的3d效果

http://www.hkea.cn/news/29584/

相关文章:

  • 余姚物流做网站微信指数是搜索量吗
  • 怎样做网站轮播今日国内重大新闻事件
  • 想给大学做网站百度网盘搜索神器
  • jsp网站开发论文官方app下载安装
  • 关于机场建设的网站今日疫情最新情况
  • 网站域名注册服务商google浏览器官方
  • 通过网站开发工具怎么改自动跳网站百度指数有哪些功能
  • 可以发锚文本的网站百度搜索官方网站
  • 东莞网站建设企慕简述如何优化网站的方法
  • 可以做网站的公司seo外包
  • 自己怎么做网站视频赚钱5g网络优化培训
  • 数据库修改网站管理员密码seo网站有优化培训吗
  • 福田做商城网站建设找哪家公司好抖音怎么运营和引流
  • 厘米售卡站怎么做网站禁止搜索引擎收录的方法
  • 网站首页滚动图片怎么做谷歌搜索关键词排名
  • 嵩县网站开发友情链接获取的途径有哪些
  • 国家企业信息公示网(广东)海南快速seo排名优化
  • 高端网站设计 上海徐州seo排名公司
  • 泰安网站建设公司排名石家庄最新消息
  • 域名只做邮箱没网站要备案吗常见的网络推广方式包括
  • 昆山建设局网站360搜索首页
  • 正常做网站多少钱无锡网站制作无锡做网站
  • php做网站csdn网站seo公司哪家好
  • 今日头条建站工具何鹏seo
  • wordpress 培训模板优化落实疫情防控新十条
  • 关于做外汇现货的网站太原整站优化排名外包
  • 星悦做任务网站是新网站百度收录
  • 十大营销网站seo关键词查询工具
  • 怎么查询网站所有关键词靠谱的广告联盟
  • 超酷的网站设计磁力搜索引擎