added random cybersigilism generation
This commit is contained in:
@@ -21,12 +21,27 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import { buildCybersigil } from '../lib/cybersigil';
|
||||
|
||||
function initCyberFx() {
|
||||
const root = document.documentElement;
|
||||
if (!root.classList.contains('cybersigil')) return;
|
||||
|
||||
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
/* ─── Generated sigil growths in the four corners ─── */
|
||||
/* One sigil per page load; the four corner transforms in global.css
|
||||
* (scaleX / scaleY / scale) splay it into each corner. */
|
||||
const corners = document.querySelectorAll<HTMLElement>('.cs-fx-corner');
|
||||
if (corners.length) {
|
||||
const svg = buildCybersigil();
|
||||
corners.forEach((c) => {
|
||||
if (c.classList.contains('cs-fx-corner--sig')) return;
|
||||
c.innerHTML = svg;
|
||||
c.classList.add('cs-fx-corner--sig');
|
||||
});
|
||||
}
|
||||
|
||||
/* ─── Scroll-entry databend on images ─── */
|
||||
if (!reduced && 'IntersectionObserver' in window) {
|
||||
const targets = document.querySelectorAll<HTMLElement>(
|
||||
|
||||
Reference in New Issue
Block a user