原文地址:https://segmentfault.com/a/1190000015177284

感想: 又有点回到boder的三角形

HTML code:

<div class="vue">
<span class="outer"></span>
<span class="middle"></span>
<span class="inner"></span>
</div>

CSS code:

/* 系统默认font-size: 12px; 此值只能调大,不能再小 */
html,body{
margin:;
padding:;
}
body{
font-size: 6px;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: radial-gradient(circle at center, lightgreen, white);
}
/* 定义3层三角形的尺寸 */
:root{
--outer-w: 49em;
--outer-h: 40em;
--middle-w: 32em;
--middle-h: 26em;
--inner-w: 16em;
--inner-h: 13em;
}
.vue{
font-size: 6px;
width: var(--outer-w);
height: var(--outer-h);
position: relative;
display: flex;
justify-content: center;
align-items: flex-start;/* 这是默认的 */
overflow: hidden;
}
.outer{
--w: var(--outer-w);
--h: var(--outer-h);
--c: #42b883;
}
.vue .outer,
.vue .middle,
.vue .inner{
position: absolute;
border-style: solid;
border-color: transparent;
border-top-width: var(--h);
border-top-color: var(--c);
border-left-width: calc(var(--w ) / 2);
border-right-width: calc(var(--w) / 2);
animation: in-and-out 3s linear infinite;
}
.vue .middle{
--w: var(--middle-w);
--h: var(--middle-h);
--c: #35495e;
animation-delay: 0.1s;
}
.vue .inner{
--w: var(--inner-w);
--h: var(--inner-h);
--c: white;
animation-delay: 0.2s;
}
@keyframes in-and-out{
0%, 5%{
top: -100%;
}
15%, 80%{
top:;
filter: opacity(1);
transform: scale(1);
}
90%, 100%{
top: 100%;
filter: opacity(0);
transform: scale(0);
}
}

最新文章

  1. 七天学会ASP.NET MVC (三)——ASP.Net MVC 数据处理
  2. JS性能方面--内存管理及ECMAScript5 Object的新属性方法
  3. floyd算法 poj2253
  4. 经典Bug 修改方法
  5. JS中 window.location 与window.location.href的区别
  6. Python 练习 31
  7. SVN和Maven及Jenkins(转)
  8. HDU 5417 Victor and Machine
  9. java学习笔记----数据类型,变量,常量
  10. storm从入门到放弃(二),任务分配过程-核心机密
  11. 对[UIApplication sharedApplication]理解
  12. oracle报表功能
  13. Hadoop-Yarn-框架原理及运作机制
  14. SH2018笔试题之成长值问题
  15. [C++ Primer Plus] 第8章、函数探幽(二)课后习题
  16. 关于cisco日志的配置
  17. BeanFactory和ApplicationContext的简单介绍
  18. JS进阶之---作用域,作用域链,闭包
  19. topcoder srm 714 div1
  20. Activiti 5.18启动流程到完成所有任务之间的数据库变化(转)

热门文章

  1. Android app内存限制OOM
  2. WPF Demo13 GridSplitter
  3. Windows 10 的有趣快捷键
  4. wxPython 入门开发示例
  5. Vue--基本语法
  6. RTB业务知识之2-Impression概念和关键属性
  7. MySQL中int(M)和tinyint(M)数值类型中M值的意义
  8. windows编程之窗口抖动
  9. Spring Boot下Druid连接池+mybatis
  10. HTML和SEO基础知识:H标签全透视