43.纯 CSS 绘制一个充满动感的 Vue logo
2024-09-15 07:34:00
原文地址: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);
}
}
最新文章
- 七天学会ASP.NET MVC (三)——ASP.Net MVC 数据处理
- JS性能方面--内存管理及ECMAScript5 Object的新属性方法
- floyd算法 poj2253
- 经典Bug 修改方法
- JS中 window.location 与window.location.href的区别
- Python 练习 31
- SVN和Maven及Jenkins(转)
- HDU 5417 Victor and Machine
- java学习笔记----数据类型,变量,常量
- storm从入门到放弃(二),任务分配过程-核心机密
- 对[UIApplication sharedApplication]理解
- oracle报表功能
- Hadoop-Yarn-框架原理及运作机制
- SH2018笔试题之成长值问题
- [C++ Primer Plus] 第8章、函数探幽(二)课后习题
- 关于cisco日志的配置
- BeanFactory和ApplicationContext的简单介绍
- JS进阶之---作用域,作用域链,闭包
- topcoder srm 714 div1
- Activiti 5.18启动流程到完成所有任务之间的数据库变化(转)