Web: promienie rdzenia jako trojkatne stozki z animowanymi impulsami promieniowania

This commit is contained in:
tisachi
2026-10-20 03:42:23 +02:00
parent 7ae226dd0c
commit a220ef6223
2 changed files with 60 additions and 10 deletions

View File

@@ -57,6 +57,8 @@ interface Wire {
const HUB_RADIUS = 78;
const SPREAD_PX = 52;
// impulsy promieniowania: cykl animacji zdefiniowany w CSS (.ray-flow)
const RAY_DELAYS = ['0s', '-1.6s'];
/**
* Diagram rdzenia (lg+): kafelki uczestników z naturalną wysokością (nic się nie
@@ -102,7 +104,7 @@ function HubDiagram() {
x2: (((t.side === 'left' ? r.right : r.left) - cr.left) / cr.width) * 100,
y2: (midY / cr.height) * 100,
// połowa podstawy trójkąta jako % wysokości kontenera
spread: SPREAD_PX / cr.height,
spread: (SPREAD_PX / cr.height) * 100,
id: t.id,
});
}
@@ -145,18 +147,45 @@ function HubDiagram() {
x2={w.x2}
y2={w.y2}
>
<stop offset="0" stopColor="var(--accent)" stopOpacity="0.6" />
<stop offset="1" stopColor="var(--accent)" stopOpacity="0.05" />
<stop offset="0" stopColor="var(--accent)" stopOpacity="0.55" />
<stop offset="1" stopColor="var(--accent)" stopOpacity="0.04" />
</linearGradient>
))}
<radialGradient id="ray-glow" gradientUnits="userSpaceOnUse" cx="50" cy="50" r="50">
<stop offset="0" stopColor="#fff" stopOpacity="1" />
<stop offset="1" stopColor="#fff" stopOpacity="0" />
</radialGradient>
<mask id="ray-soft">
<rect x="0" y="0" width="100" height="100" fill="url(#ray-glow)" />
</mask>
</defs>
{wires.map((w) => (
<polygon
key={w.id}
points={`${w.x1},${w.y1} ${w.x2},${w.y2 - w.spread} ${w.x2},${w.y2 + w.spread}`}
fill={`url(#ray-${w.id})`}
/>
))}
<g mask="url(#ray-soft)">
{wires.map((w) => (
<g key={w.id}>
<polygon
points={`${w.x1},${w.y1} ${w.x2},${w.y2 - w.spread} ${w.x2},${w.y2 + w.spread}`}
fill={`url(#ray-${w.id})`}
/>
{RAY_DELAYS.map((d) => (
<line
key={d}
className="ray-flow"
style={{ animationDelay: d }}
x1={w.x1}
y1={w.y1}
x2={w.x2}
y2={w.y2}
pathLength={100}
vectorEffect="non-scaling-stroke"
stroke="var(--accent)"
strokeOpacity="0.8"
strokeWidth="2.5"
strokeLinecap="round"
/>
))}
</g>
))}
</g>
</svg>
<div className="window-glow absolute left-1/2 top-1/2 z-10 grid size-40 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full border border-line bg-(image:--card-grad) shadow-glow">

View File

@@ -154,6 +154,21 @@
animation: streak-ignite 260ms var(--ease-out-quart) backwards;
}
/* Rdzeń ekosystemu — impulsy promieniowania lecące od rdzenia do kafelków */
@keyframes ray-flow {
from {
stroke-dashoffset: 12;
}
to {
stroke-dashoffset: -100;
}
}
.ray-flow {
stroke-dasharray: 12 88;
animation: ray-flow 3.2s linear infinite;
}
/* Wejścia sekcji na scroll (IntersectionObserver dodaje .revealed) */
.reveal {
opacity: 0;
@@ -264,6 +279,12 @@
animation: none;
}
.ray-flow {
animation: none;
stroke-dasharray: 10 90;
stroke-dashoffset: -30;
}
.reveal {
opacity: 1;
transform: none;