This commit is contained in:
parent
4aca2a7720
commit
b260c88345
|
@ -1,4 +1,4 @@
|
||||||
import Nano, { Component, Fragment, Suspense } from "nano-jsx"
|
import Nano, { Component } from "nano-jsx"
|
||||||
import { BlogPage } from "./blog_page";
|
import { BlogPage } from "./blog_page";
|
||||||
import { Giscus } from "./giscus";
|
import { Giscus } from "./giscus";
|
||||||
import { useState } from "nano-jsx/esm/hooks/useState.js";
|
import { useState } from "nano-jsx/esm/hooks/useState.js";
|
||||||
|
|
|
@ -30,9 +30,14 @@ class Particle {
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.id = Math.random();
|
this.id = Math.random();
|
||||||
this.angle = 2 * Math.PI * this.id;
|
this.angle = 2 * Math.PI * this.id;
|
||||||
this.color = "hsl(" + 360 * Math.random() + ',' +
|
this.color =
|
||||||
(25 + 70 * Math.random()) + '%,' +
|
"hsl(" +
|
||||||
(85 + 10 * Math.random()) + '%)';
|
360 * Math.random() +
|
||||||
|
"," +
|
||||||
|
(25 + 70 * Math.random()) +
|
||||||
|
"%," +
|
||||||
|
(85 + 10 * Math.random()) +
|
||||||
|
"%)";
|
||||||
this.style = Math.random() < 0.5 ? "-" : Math.random() > 0.5 ? "+" : "*";
|
this.style = Math.random() < 0.5 ? "-" : Math.random() > 0.5 ? "+" : "*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +56,7 @@ class Particle {
|
||||||
renderSurfaceContext.restore();
|
renderSurfaceContext.restore();
|
||||||
|
|
||||||
if (renderSurface.height < this.y) {
|
if (renderSurface.height < this.y) {
|
||||||
particles = particles.filter(z=>z.id !== this.id)
|
particles = particles.filter((z) => z.id !== this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ interface LatestStatus {
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const doc = parser.parseFromString(await req.text(), "text/xml");
|
const doc = parser.parseFromString(await req.text(), "text/xml");
|
||||||
const latestEntryRaw = doc.querySelector("feed > entry");
|
const latestEntryRaw = doc.querySelector("feed > entry");
|
||||||
if (!latestEntryRaw) throw new Error("Missing latest entry!");;
|
if (!latestEntryRaw) throw new Error("Missing latest entry!");
|
||||||
|
|
||||||
const latestEntry: LatestStatus = {
|
const latestEntry: LatestStatus = {
|
||||||
username: doc.querySelector("feed > author > name")?.textContent!,
|
username: doc.querySelector("feed > author > name")?.textContent!,
|
||||||
|
|
Loading…
Reference in a new issue