Extreme optimize + bug fixes + prerendering fix + more deprecation
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 1s

This commit is contained in:
BOTAlex 2025-10-02 07:36:41 +02:00
parent 28eea2d035
commit 4e2fe3700d
53 changed files with 324 additions and 1775 deletions

View file

@ -1,9 +1,9 @@
<!-- If url contains "hideOnPrint" param, then detect if start printing then hide elements -->
<script lang="ts">
import "../app.css";
import { fly } from "svelte/transition";
import fly from "@e/fly";
import MediaQuery from "svelte-media-queries";
import { Dices } from "@lucide/svelte";
import Dices from "@lucide/svelte/icons/dices";
let hideOnPrint: boolean = $state(false);
let { children } = $props();
@ -29,7 +29,7 @@
// console.log(hideOnPrint);
});
import { onMount } from "svelte";
import onMount from "@e/onMount";
import Zooter from "./comps/Zooter.svelte";
import CustomScrollBar from "./comps/CustomScrollBar.svelte";
@ -110,7 +110,7 @@
{@render SwitchThemeButton()}
<a
href="/zhen/cv/rev3?hideOnPrint=1"
href="/cv?hideOnPrint=1"
target="_blank"
style="width: 7.5rem;"
class="text-center justify-center">Zhen CV</a
@ -150,10 +150,8 @@
href="https://botalex.itch.io/"
target="_blank">Games</a
>
<a
href="/zhen/cv/rev3?hideOnPrint=1"
target="_blank"
class="justify-center">Zhen's CV</a
<a href="/cv?hideOnPrint=1" target="_blank" class="justify-center"
>Zhen's CV</a
>
<!-- <a onclick={resetNavBar} href="/posts">Blog</a>
<a onclick={resetNavBar} href="/about">About</a> -->

View file

@ -1,7 +1,8 @@
<script lang="ts">
import ProfileSpacer from "./comps/ProfileSpacer.svelte";
// import ProfileSpacer from "./comps/ProfileSpacer.svelte";
import MediaQuery from "svelte-media-queries";
import { onMount, tick } from "svelte";
import onMount from "@e/onMount";
// import tick from "@e/tick";
import PreviewDeprivedLogo from "$lib/images/DeprivedLogo-NoBackground.png";
@ -23,8 +24,8 @@
import Time3 from "$lib/GamePreviews/time-3.png";
import Time4 from "$lib/GamePreviews/time-4.png";
import Time5 from "$lib/GamePreviews/time-5.gif";
import Tags from "./comps/Tags.svelte";
import NameAndTag from "./comps/NameAndTag.svelte";
// import Tags from "./comps/Tags.svelte";
// import NameAndTag from "./comps/NameAndTag.svelte";
import Profile from "./comps/Profile.svelte";
import DeprivedTrackerSection from "./comps/DeprivedTrackerSection.svelte";
@ -111,9 +112,8 @@
guy.
</p>
<p>
Here's my CV: <a
href="/zhen/cv/rev3?hideOnPrint=1"
style="color:lightblue;">pdf</a
Here's my CV: <a href="/cv?hideOnPrint=1" style="color:lightblue;"
>pdf</a
>
</p>
</span>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { onMount } from "svelte";
import onMount from "@e/onMount";
export let images: string[] = []; // Expose images as a parameter
let currentIndex: number = 0;

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { onMount, onDestroy } from "svelte";
import onMount from "@e/onMount";
import onDestroy from "@e/onDestroy";
import MediaQuery from "svelte-media-queries";
// Public props

View file

@ -1,5 +1,5 @@
<script>
import { onMount } from "svelte";
import onMount from "@e/onMount";
let debug = false;

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { onMount } from "svelte";
import onMount from "@e/onMount";
import { Vector2 } from "../zhen/Utils/Vector2";
// Params

View file

@ -1,9 +1,9 @@
<script lang="ts">
import svelteLogo from "$lib/svelteLogos/svelte-logo.png";
import { browser } from "$app/environment";
import { onDestroy, onMount } from "svelte";
import { ArrowBigDown } from "lucide-svelte";
import { fly } from "svelte/transition";
import onMount from "@e/onMount";
import onDestroy from "@e/onDestroy";
import ArrowBigDown from "lucide-svelte/icons/arrow-big-down";
import fly from "@e/fly";
const buildTime = __BUILD_TIME__;
let scrollY = 0;

View file

@ -22,7 +22,7 @@
import preveiwImage from "$lib/zhen/cv-comps/EposCvPreveiw.png";
// Print detection setup
import { onMount } from "svelte";
import onMount from "@e/onMount";
onMount(() => {
// Check if the query parameter exists in the URL
const urlParams = new URLSearchParams(window.location.search);

View file

@ -5,7 +5,7 @@
export let fontSize: string = "3mm";
export let lineHeight: string = "3.1mm";
import { onMount } from "svelte";
import onMount from "@e/onMount";
onMount(() => {
imageCaption = logo.split(/(\\|\/)/g).pop();
});

View file

@ -3,7 +3,7 @@
export let logoWidths: string = "35%";
import { onMount } from "svelte";
import onMount from "@e/onMount";
onMount(() => {
imageCaption = logo.split(/(\\|\/)/g).pop();
});

View file

@ -1,76 +1,106 @@
<script>
import svelteLogo from "$lib/svelteLogos/svelte-logo-cutout.svg"
import svelteLogo from "$lib/svelteLogos/svelte-logo-cutout.svg";
</script>
<div class="container">
<div class="flex justify-center">
<div class="corner-border-container p-1 m-1">
<div class="flex">
This CV was made using html, css and <a class="grid place-content-center" href="https://kit.svelte.dev/"><img src={svelteLogo} class="w-2 h-2" alt="SvelteKit logo"/></a>
</div>
Sources:
<a href="https://gitea.deprived.dev/Sveskejuice/deprived-main-website/src/branch/dev/src/routes/zhen/cv/rev2/+page.svelte">CV source code</a>
and
<a href="/zhen/cv/rev2?hideOnPrint=1">My Website</a>
<div class="flex justify-center">
<div class="corner-border-container p-1 m-1">
<div class="flex">
This CV was made using html, css and <a
class="grid place-content-center"
href="https://kit.svelte.dev/"
><img src={svelteLogo} class="w-2 h-2" alt="SvelteKit logo" /></a
>
</div>
Sources:
<a
href="https://gitea.deprived.dev/Sveskejuice/deprived-main-website/src/branch/dev/src/routes/zhen/cv/rev2/+page.svelte"
>CV source code</a
>
and
<a href="/cv?hideOnPrint=1">My Website</a>
</div>
</div>
</div>
<style lang="scss">
.corner-border-container {
--length: 5px;
--width: 1px;
background-color: var(--left-grid-bg-color);
background-image:
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color)),
linear-gradient(var(--left-decor-line-color), var(--left-decor-line-color));
background-size:
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length);
background-position:
top left,
top left,
top right,
top right,
bottom right,
bottom right,
bottom left,
bottom left;
background-repeat: no-repeat;
}
.corner-border-container {
--length: 5px;
--width: 1px;
background-color: var(--left-grid-bg-color);
background-image:
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
),
linear-gradient(
var(--left-decor-line-color),
var(--left-decor-line-color)
);
background-size:
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length),
var(--length) var(--width),
var(--width) var(--length);
background-position:
top left,
top left,
top right,
top right,
bottom right,
bottom right,
bottom left,
bottom left;
background-repeat: no-repeat;
}
.container {
z-index: 1;
.container {
z-index: 1;
font-size: 0.5rem;
font-size: 0.5rem;
//white-space: nowrap;
//white-space: nowrap;
color: #777777;
color: #777777;
* a {
color: #3d6ddc;
padding-left: 1mm;
padding-right: 1mm;
* a {
color: #3d6ddc;
padding-left: 1mm;
padding-right: 1mm;
text-decoration: underline;
}
div:nth-child(2){
padding-bottom: 2mm;
}
text-decoration: underline;
}
div:nth-child(2) {
padding-bottom: 2mm;
}
}
</style>

View file

@ -1,53 +0,0 @@
<script>
import A4 from "../zhen/notes/physics/sharedComps/A4.svelte";
import ToolButton from "./comps/ToolButton.svelte";
import { BatteryMedium } from '@lucide/svelte';
</script>
<div class="flex justify-center pt-10">
<A4
bottomBorder={false}
bgColor={"rounded-lg bg-base-300"}
class="cozette text-base-content h-full"
>
<div class="p-4 flex flex-col h-full">
<h1 class="text-5xl font-bold">Tools (NOT FINISHED. come back in the future.)</h1>
<span class="w-full text-xl"
>These are the tools collected from different places of the
internet</span
>
<!-- Spacing -->
<div class="pt-14"></div>
<div class="p-4 bg-base-200 rounded-lg">
<h2 class="text-2xl font-bolc">MPUs/SoCs</h2>
<span>Whatever acronym you want lol</span>
<div class="grid grid-cols-3 gap-4">
<ToolButton
title="Sleeping battery life"
desc="Calculates the battery life depending on sleep and non-sleep power usage."
btnText="To calculator"
toolIcon={BatteryMedium}
/>
<!-- <ToolButton
title="Sleeping battery life"
desc="Calculates the battery life depending on sleep and non-sleep power usage."
btnText="To calculator"
toolIcon={BatteryMedium}
/>
<ToolButton
title="Sleeping battery life"
desc="Calculates the battery life depending on sleep and non-sleep power usage."
btnText="To calculator"
toolIcon={BatteryMedium}
/> -->
</div>
</div>
<div class="mt-auto align-text-bottom">
I if you have tool suggestions, then either create an issue, create a pull request, or send an email. I probably wont add it though, since this is free work lol.
</div>
</div>
</A4>
</div>

View file

@ -1,183 +0,0 @@
<script lang="ts">
import A4 from "../../zhen/notes/physics/sharedComps/A4.svelte";
import { BatteryLifeCalculator } from "./pageSrc/BatteryCalc";
import { getMCU, type MCU_Type } from "./pageSrc/MCU_defs";
// let mathMachine = new BatteryLifeCalculator();
let useCustom: boolean = false;
let selectedText: string = "";
let selectedMcu: MCU_Type | undefined = undefined;
$: selectedMcu = getMCU(selectedText)
const options = ["esp32-s3", "esp32-s3"];
</script>
<div class="flex justify-center pt-10">
<A4
bottomBorder={false}
bgColor={"rounded-lg bg-base-300"}
class="cozette text-base-content h-full"
>
<div class="p-4 flex flex-col h-full">
<h1 class="text-5xl font-bold">Battery life calculator</h1>
<span class="w-full text-xl">
Calculates the time a battery will last. Too lazy to explain
more.
</span>
<!-- Spacing -->
<div class="pt-14"></div>
<div class="p-4 bg-base-200 rounded-lg">
<h2 class="text-2xl font-bolc">Software</h2>
<div class="grid grid-cols-2 gap-4">
<div class="form-control">
<span class="text-sm text-slate-300 text-opacity-60"
>Duration of code execution</span
>
<div class="join">
<input
type="number"
class="input input-bordered input-sm join-item appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
/>
<div
class="bg-base-content bg-opacity-60 join-item grid place-content-center"
>
<span class="text-center pl-1 pr-2">sec</span>
</div>
</div>
</div>
<div class="form-control">
<span class="text-sm text-slate-300 text-opacity-60"
>sleep time</span
>
<div class="join">
<input
type="number"
class="input input-bordered input-sm join-item appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
/>
<div
class="bg-base-content bg-opacity-60 join-item grid place-content-center"
>
<span class="text-center pl-1 pr-2">sec</span>
</div>
</div>
</div>
<div class="col-span-full">
<h2 class=" text-2xl font-bolc">Hardware</h2>
<div class="flex">
<div
class="text-sm text-slate-300 text-opacity-60 text"
>
Use custom values
</div>
<input
bind:checked={useCustom}
class="ml-2 checkbox checkbox-xs my-auto"
type="checkbox"
/>
</div>
</div>
{#if !useCustom}
<div>
<select
bind:value={selectedText}
class="select select-sm select-bordered w-56 max-w-xs"
>
<option disabled value="">Select a text</option>
{#each options as option}
<option value={option}>{option}</option>
{/each}
</select>
{#if selectedMcu != undefined && selectedMcu?.wifi != undefined}
<p class="mt-4 text-lg">
wifi
</p>
{/if}
{#if selectedMcu != undefined && selectedMcu?.wifi != undefined}
<p class="mt-4 text-lg">
ble
</p>
{/if}
</div>
{:else}
<div class="form-control">
<span class="text-sm text-slate-300 text-opacity-60"
>Duration of code execution</span
>
<div class="join">
<input
type="number"
class="input input-bordered input-sm join-item appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
/>
<div
class="bg-base-content bg-opacity-60 join-item grid place-content-center"
>
<span class="text-center pl-1 pr-2"
>sec</span
>
</div>
</div>
</div>
<div class="form-control">
<span class="text-sm text-slate-300 text-opacity-60"
>sleep time</span
>
<div class="join">
<input
type="number"
class="input input-bordered input-sm join-item appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
/>
<div
class="bg-base-content bg-opacity-60 join-item grid place-content-center"
>
<span class="text-center pl-1 pr-2"
>sec</span
>
</div>
</div>
</div>
{/if}
</div>
</div>
<div class="mt-auto align-text-bottom text-center">
Source for the calculations is at this
<a
class="text-blue-500 underline"
target="_blank"
href="https://github.com/simonneutert/batterylife-calculator"
>github</a
>
and the
<a
class="text-blue-500 underline"
target="_blank "
href="https://www.of-things.de/battery-life-calculator.php"
>original website.</a
>
I just mearly made additions.
</div>
</div>
</A4>
</div>
<style>
/* Hide the spinner for Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Hide the spinner for Firefox */
input[type="number"] {
-moz-appearance: textfield;
}
</style>

View file

@ -1,123 +0,0 @@
export class BatteryLifeCalculator {
timeRunSeconds: number;
timeSleepSeconds: number;
consumptionActiveMilliAmpHours: number;
consumptionSleepMilliAmpHours: number;
powerBatteryTotalMilliAmpHours: number;
powerBatteryBufferBeforeEmptyPercent: number;
constructor(
timeRunSeconds: number,
timeSleepSeconds: number,
consumptionActiveMilliAmpHours: number,
consumptionSleepMilliAmpHours: number,
powerBatteryTotalMilliAmpHours: number,
powerBatteryBufferBeforeEmptyPercent: number = 20
) {
this.timeRunSeconds = timeRunSeconds;
this.timeSleepSeconds = timeSleepSeconds;
this.consumptionActiveMilliAmpHours = consumptionActiveMilliAmpHours;
this.consumptionSleepMilliAmpHours = consumptionSleepMilliAmpHours;
this.powerBatteryTotalMilliAmpHours = powerBatteryTotalMilliAmpHours;
this.powerBatteryBufferBeforeEmptyPercent = powerBatteryBufferBeforeEmptyPercent;
console.log(
"The source of this battery calc is here: https://github.com/simonneutert/batterylife-calculator\nI was too lazy to make the math myself."
);
}
// public API
milliAmpToMicroAmp(milliAmps: number): number {
return milliAmps * 1000;
}
microAmpToMilliAmp(milliAmps: number): number {
return milliAmps * 0.001;
}
calculate(): {
powerAveragePerHour: number;
runtimeHoursEstimated: number;
runtimeDaysEstimated: number;
runtimeDaysRemainingHoursEstimated: number;
} {
return {
powerAveragePerHour: this.powerEstimatedHourly(),
runtimeHoursEstimated: this.runtimeHoursEstimated(),
runtimeDaysEstimated: this.runtimeDaysEstimated(),
runtimeDaysRemainingHoursEstimated: this.runtimeDaysRemainingHoursEstimated(),
};
}
powerEstimatedHourly(): number {
return this.calcPowerEst(
this.powerRun(),
this.consumptionActiveMilliAmpHours,
this.powerSleep(),
this.consumptionSleepMilliAmpHours
);
}
runtimeHoursEstimated(): number {
return parseInt((this.powerLipo() / this.powerEstimatedHourly()).toString(), 10);
}
runtimeDaysEstimated(): number {
return parseInt((this.runtimeHoursEstimated() / 24).toString(), 10);
}
runtimeDaysRemainingHoursEstimated(): number {
return parseInt((this.runtimeHoursEstimated() % 24).toString(), 10);
}
// private methods
private roundOff(x: number): number {
return Math.round(x * 100.0) / 100.0;
}
private calcPowerLipo(x: number, y: number): number {
return parseFloat(((x * (100 - y)) / 100).toString());
}
private calcRuns(x: number, y: number): number {
return parseFloat((60 / (x + y)).toString());
}
private calcRunsHour(x: number, y: number): number {
return parseFloat((3600 / (x + y)).toString());
}
private calcPowerRun(x: number, y: number): number {
return parseFloat(((x / (x + y)) * 3600).toString());
}
private calcPowerSleep(x: number, y: number): number {
return parseFloat(((y / (x + y)) * 3600).toString());
}
powerLipo(): number {
return this.calcPowerLipo(this.powerBatteryTotalMilliAmpHours, this.powerBatteryBufferBeforeEmptyPercent);
}
runs(): number {
return this.calcRuns(this.timeRunSeconds, this.timeSleepSeconds);
}
runsHour(): number {
return this.calcRunsHour(this.timeRunSeconds, this.timeSleepSeconds);
}
powerRun(): number {
return this.calcPowerRun(this.timeRunSeconds, this.timeSleepSeconds);
}
powerSleep(): number {
return this.calcPowerSleep(this.timeRunSeconds, this.timeSleepSeconds);
}
private calcPowerEst(a: number, b: number, c: number, d: number): number {
return parseFloat(((a / 3600) * b + (c / 3600) * d).toString());
}
}

View file

@ -1,63 +0,0 @@
export interface MCU_Type {
name: string;
cpu: { [key: string]: Number }; // state: power consumption
sleep: { [key: string]: Number };
wifi?: { [key: string]: Number };
bluetooth?: { [key: string]: Number };
}
const MCUs: MCU_Type[] = [
{
name: "esp32-s3",
cpu: { // mili amps
single_core_40MHz: 21.8,
dual_core_40MHz: 24.4,
single_core_80MHz: 42.6,
dual_core_80MHz: 47.3,
single_core_160MHz: 54.6,
dual_core_160MHz: 54.1,
single_core_240MHz: 65.9,
dual_core_240MHz: 81.3,
},
sleep: {
},
wifi: { //
dBm_21: 318.2,
sleep: 10
},
bluetooth: {
active: 100,
sleep: 5
}
},
{
name: "esp32-c3",
cpu: {
single_core_80MHz: 22,
single_core_160MHz: 54.6,
},
sleep: {
},
wifi: {
active: 110,
sleep: 9
},
bluetooth: {
active: 90,
sleep: 4
}
}
];
export function getMCU(name: string): MCU_Type | undefined{
for (let i = 0; i < MCUs.length; i++) {
const element = MCUs[i];
if (element.name == name)
return element
}
return undefined;
}

View file

@ -1,27 +0,0 @@
<script lang="ts">
import type { Component } from 'svelte';
export let toolIcon: Component | undefined = undefined;
export let title: string = "Sleeping battery life";
export let desc: string = "Calculates the battery life depending on sleep and non-sleep power usage.";
export let btnText: string = "To calculator";
export let btnHref: string = "/tools/battery-life-calculator";
</script>
<div class="min-w-10 min-h-10 bg-base-100 rounded-lg">
<div class="p-4">
<div class="flex">
<div class="font-bold text-xl">{title}</div>
</div>
<div class="text-sm">{desc}</div>
<div class="flex pt-4">
{#if toolIcon != undefined}
<svelte:component this={toolIcon}/>
{/if}
<a href="{btnHref}" class="btn ml-auto btn-primary btn-sm">{btnText}</a>
</div>
</div>
</div>