border 流光高光
2024-10-11 20:33:49
<template>
<div>
<div class="conic"></div>
<div class="conic conic-demo"></div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss">
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #000;
}
*, *::before, *::after {
box-sizing: border-box;
}
@keyframes rotate {
100% {
transform: rotate(1turn);
}
}
.conic {
position: relative;
z-index: 0;
width: 400px;
height: 300px;
margin: 20px;
border-radius: 10px;
overflow: hidden;
padding: 2rem;
&::before {
content: '';
position: absolute;
z-index: -2;
left: -50%;
top: -50%;
width: 200%;
height: 200%;
background-color: #1a232a;
background-repeat: no-repeat;
background-position: 0 0;
background-image: conic-gradient(transparent, rgba(168, 239, 255, 1), transparent 30%);
animation: rotate 4s linear infinite;
}
&::after {
content: '';
position: absolute;
z-index: -1;
left: 6px;
top: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
background: #000;
border-radius: 5px;
}
}
.conic-demo::after {
animation: opacityChange 5s infinite linear;
}
@keyframes opacityChange {
50% {
opacity:.5;
}
100% {
opacity: 1;
}
}
</style>
转自: https://csscoco.com/inspiration/#/./background/bg-conic-border-light-effect.md
最新文章
- 使用fiddler的autoResponder及设置手机端代理实现远程调试,出现的问题及解决办法
- zookeeper 故障重连机制
- SQL Server日期与字符串之间的转换
- phpstorm webstorm安装主题 sublime样 还有都可以用的注册码
- Unity3d 查找所选的是否引用过某资源
- Tautology 分类: POJ 2015-06-28 18:40 10人阅读 评论(0) 收藏
- Python爬虫学习笔记——防豆瓣反爬虫
- ruby编程语言-学习笔记3(第4章 表达式和操作符)
- oracle pl/sql 包
- sklearn交叉验证3-【老鱼学sklearn】
- Redis(2)---数据持久化
- mybatis中的foreach方法
- [Vue]createElement参数
- 【RAY TRACING THE REST OF YOUR LIFE 超详解】 光线追踪 3-7 混合概率密度
- 【T10】记住,TCP__IP不是轮询的
- layui数据表格的td模板
- Vagrant (3) —— 复制/备份Vagrant Box
- 本地管理表空间和字典管理表空间的特点,ASSM有什么特点
- linux下两台服务器文件实时同步方案实现-乾颐堂
- windows安装logstash-input-jdbc并使用其导入MMSQL数据