<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
:root {
font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem);
--clr-bg: #020617;
color-scheme: dark light;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: var(--clr-bg);
display: grid;
place-items: center;
height: 100svh;
padding: 1em;
}
[defs] {
position: absolute;
pointer-events: none;
opacity: 0;
}
[⚡] {
width: min(40rem, 100%);
height: 100%;
display: grid;
place-items: center;
filter: url(#electricity);
isolation: isolate;
mix-blend-mode: screen;
}
@property --a {
inherits: true;
syntax: "<angle>";
initial-value: 0deg;
}
@property --i {
inherits: true;
syntax: "<percentage>";
initial-value: 50%;
}
@keyframes speen {
from {
--a: 0turn;
}
to {
--a: 1turn;
}
}
[⬜] {
animation: speen 10s infinite linear;
filter: blur(3px);
background: repeating-conic-gradient(from var(--a), #000 var(--i), #000 .7turn,
cyan, hotpink, white);
display: block;
cursor: pointer;
border-radius: 2em;
width: min(10rem, 100%);
aspect-ratio: 2/3;
opacity: 0.6;
transition: opacity 0.3s, --i 3s;
transition-timing-function: cubic-bezier(0.44, 0, 0.56, 1);
will-change: opacity;
&:hover {
opacity: 0.8;
--i: 80%;
}
&:active {
opacity: 1;
}
}
</style>
</head>
<body>
<main ⚡>
<i ⬜></i>
</main>
<svg defs height="0" width="0" viewBox="0 0 1 1" color-interpolation-filters="sRGB">
<defs>
<filter x="-50%" y="-50%" width="200%" height="200%" id="electricity" style="">
<feTurbulence result="turbulence-0" baseFrequency="0.03" numOctaves="3" type="fractalNoise" />
<feColorMatrix result="color-matrix-1" in="turbulence-0" type="hueRotate" values="0">
</feColorMatrix>
<feComponentTransfer result="component-transfer-0" in="SourceGraphic">
<feFuncA type="table" tableValues="0 1 1" />
</feComponentTransfer>
<feColorMatrix result="color-matrix-0" in="component-transfer-0" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0" />
<feMorphology result="morphology-0" in="color-matrix-0" radius="8" />
<feComposite result="composite-1" in="color-matrix-0" in2="morphology-0" operator="out" />
<feFlood result="flood-0" style="flood-color: rgb(128, 128, 0);" />
<feComposite result="composite-0" in="flood-0" in2="none" operator="in" />
<feComponentTransfer result="component-transfer-1" in="SourceGraphic">
<feFuncA type="table" tableValues="0 0 1" />
<feFuncR />
</feComponentTransfer>
<feMorphology result="morphology-1" in="component-transfer-1" radius="10" operator="dilate" />
<feSpecularLighting xmlns="http://www.w3.org/2000/svg" result="specular-lighting-0" in="turbulence-0" lighting-color="#ffffff" specularConstant="2" specularExponent="29" surfaceScale="4">
<feDistantLight xmlns="http://www.w3.org/2000/svg" azimuth="0" elevation="45">
<animate attributeName="azimuth" from="0" to="360" dur=".8s" repeatCount="indefinite" />
</feDistantLight>
</feSpecularLighting>
<feComposite result="composite-2" in="specular-lighting-0" in2="morphology-1" operator="in" />
<feMerge result="merge-0">
<feMergeNode in="composite-0" />
<feMergeNode in="composite-2" />
</feMerge>
<feDisplacementMap result="displacement-map-0" in="composite-1" in2="merge-0" scale="42" xChannelSelector="R" yChannelSelector="G" />
<feComposite result="composite-3" in="none" in2="merge-0" operator="arithmetic" k2="1" />
</filter>
</defs>
</svg>
</body>
</html>
index.html
md
项目介绍.md
index.html