蜂窝扩散动画效果
代码语言:html
所属分类:动画
代码描述:蜂窝扩散动画效果
代码标签: 效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
width: 100%;
height: 100vh;
display: flex;
}
.hero__background {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
margin: auto;
font-size: 1.75vw;
background: #310E08;
}
.hex {
position: absolute;
height: 24.8px;
width: 28px;
transition: all 0.3s;
top: 50%;
left: 50%;
margin-left: -16px;
margin-top: -16px;
}
</style>
</head>
<body translate="no">
<div class="hero__background" tabindex="-1"></div>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/gsap.3.3.1.js"></script>
<script >
window.onload = (() => {
const grid = {};
const ringCount = 33;
// Hex SVG
const svg = `
<svg class="hex-svg" fill="#310E08" viewbox="0 0 200 174">
<path class="hex-border" d="M0 86.60254037844386L50 0L150 0L200 86.60254037844386L150 173.20508075688772L50 173.20508075688772Z">
</path>
</svg>
`;
function createHex({ className = "hex-not-yet", ring, ...style }) {
const hexNode = document.createElement("div");
hexNode.classList.add("hex");
hexNode.classList.add(className);
hexNode.classList.add(`hex-ring-${ring}`);
he.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0