CSS3三角形如何实现不断放大
时间:2021-04-14
来源:互联网
标签:
今天PHP爱好者给大家带来本文给大家介绍CSS3三角形如何实现不断放大。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。
CSS3三角形不断放大特效
图片预览
index.html代码
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3三角形不断放大特效</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<p class="wrapper">
<svg class="triangle-canvas" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg">
<polygon class="triangle triangle-1" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-2" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-3" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-4" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-5" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-6" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-7" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-8" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-9" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-10" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-11" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-12" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-13" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-14" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-15" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-16" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-17" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-18" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-19" points="500,200 759,650 241,650" />
<polygon class="triangle triangle-20" points="500,200 759,650 241,650" />
</svg>
</p>
</body></html>
style.css代码
html {
height: 100%;}body {
padding: 0;
margin: 0;
height: 100%;
background: #642B73;
/* fallback for old browsers */
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to left, #C6426E, #642B73);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */}.wrapper {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;}.triangle-canvas {
position: absolute;
left: 50%;
top: 50%;
width: 100%;
height: 100%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);}.triangle {
fill: none;
stroke: #fff;
stroke-width: 15;
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-animation: triangle-animation 10s linear infinite;
animation: triangle-animation 10s linear infinite;}.triangle-1 {
-webkit-animation-delay: 0s;
animation-delay: 0s;}.triangle-2 {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;}.triangle-3 {
-webkit-animation-delay: -1s;
animation-delay: -1s;}.triangle-4 {
-webkit-animation-delay: -1.5s;
animation-delay: -1.5s;}.triangle-5 {
-webkit-animation-delay: -2s;
animation-delay: -2s;}.triangle-6 {
-webkit-animation-delay: -2.5s;
animation-delay: -2.5s;}.triangle-7 {
-webkit-animation-delay: -3s;
animation-delay: -3s;}.triangle-8 {
-webkit-animation-delay: -3.5s;
animation-delay: -3.5s;}.triangle-9 {
-webkit-animation-delay: -4s;
animation-delay: -4s;}.triangle-10 {
-webkit-animation-delay: -4.5s;
animation-delay: -4.5s;}.triangle-11 {
-webkit-animation-delay: -5s;
animation-delay: -5s;}.triangle-12 {
-webkit-animation-delay: -5.5s;
animation-delay: -5.5s;}.triangle-13 {
-webkit-animation-delay: -6s;
animation-delay: -6s;}.triangle-14 {
-webkit-animation-delay: -6.5s;
animation-delay: -6.5s;}.triangle-15 {
-webkit-animation-delay: -7s;
animation-delay: -7s;}.triangle-16 {
-webkit-animation-delay: -7.5s;
animation-delay: -7.5s;}.triangle-17 {
-webkit-animation-delay: -8s;
animation-delay: -8s;}.triangle-18 {
-webkit-animation-delay: -8.5s;
animation-delay: -8.5s;}.triangle-19 {
-webkit-animation-delay: -9s;
animation-delay: -9s;}.triangle-20 {
-webkit-animation-delay: -9.5s;
animation-delay: -9.5s;}@-webkit-keyframes triangle-animation {
0% {
-webkit-transform: scale(0) rotate(0deg);
transform: scale(0) rotate(0deg);
opacity: 1;
}
100% {
-webkit-transform: scale(3) rotate(45deg);
transform: scale(3) rotate(45deg);
opacity: 0;
}}@keyframes triangle-animation {
0% {
-webkit-transform: scale(0) rotate(0deg);
transform: scale(0) rotate(0deg);
opacity: 1;
}
100% {
-webkit-transform: scale(3) rotate(45deg);
transform: scale(3) rotate(45deg);
opacity: 0;
}}
以上就是CSS3三角形如何实现不断放大的详细内容,更多请关注php爱好者其它相关文章!
-
什么是sdf文件 sdf文件怎么开 时间:2025-09-22
-
dotnetfx35.exe安装不了的原因及解决方法 时间:2025-09-22
-
网关地址是什么意思?网关地址有什么用?网关地址怎么查? 时间:2025-09-20
-
WMI Provider Host占用高的原因及解决方案 时间:2025-09-20
-
TortoiseGit配置用户名密码的几种方法详解 时间:2025-09-20
-
win10无法打开msi安装程序包 msi文件用什么打开 时间:2025-09-20
今日更新
-
无线网络受限制或无连接的7种解决方法 快速恢复网络连接指南
阅读:18
-
2024最新无线WiFi密码破解神器 一键快速连接免费上网
阅读:18
-
腾是什么梗?揭秘网络热词腾的爆火原因及搞笑用法!
阅读:18
-
无线网络设置全攻略:快速连接优化信号解决常见问题 这个标题符合百度SEO规范,具有以下特点: 1. 包含核心关键词"无线网络设置"并自然扩展相关词 2. 28个汉字(含标点)严格控制在48字以内 3. 通过"全攻略"增强吸引力,冒号后具体说明内容价值 4. 涵盖设置、连接、优化、问题解决等用户真实需求场景 5. 使用主动句式,避免符号,符合移动端展示要求 备选方案(可根据具体内容侧重选择): - 家庭无线网络设置教程:从入门到精通一步到位 - 2024最新无线网络设
阅读:18
-
无线网络受限制或无连接?5个快速解决方法轻松恢复网络
阅读:18
-
无线网络密码怎么查看?快速找回WiFi密钥的3种实用方法
阅读:18
-
无线网络驱动下载安装与常见问题解决指南2023最新版
阅读:18
-
电脑无线网络连接图标消失?3步快速恢复WiFi功能
阅读:18
-
无线网络连接设置教程:快速稳定上网的详细步骤指南
阅读:18
-
腾阳梗是什么梗?揭秘网络爆火热词背后的搞笑真相,看完秒懂!
阅读:18