Skip to content

Commit 94d2f56

Browse files
committed
feat: update README.md with dark mode image link; enhance global.css for improved dark/light mode support; adjust Sun.svelte box-shadow for better visibility; refine layout styles; implement dynamic iframe styling in Empirical_growth_testing; add resources documentation
1 parent bca4d8c commit 94d2f56

File tree

7 files changed

+50
-9
lines changed

7 files changed

+50
-9
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
On push the github action described in .github/workflows/pages.yml will compile the code with svelte on nodejs. Then the output the compiled code to "gh-pages" branch which is github pages default load source for https://flmath.github.io/.
22

33
The main page picture based on: https://www.pexels.com/photo/city-view-photography-2129886/
4+
In the dark mode: https://pixabay.com/photos/castle-hohenzollern-night-fortress-811336/
45

5-
The different geometrical fidguresbased on:
6+
The different geometrical fidgures based on:
67

78
the Penrose triangle https://en.wikipedia.org/wiki/Penrose_triangle
89
Oscar Reutersward "Blue Meander" http://www.zludzenia.pl/reutersvard,5,5,oscar-reutersward-bryla-4.html#showimage
@@ -15,6 +16,6 @@ CSS animations: https://www.youtube.com/watch?v=q-i0rZBZvBk
1516

1617
PWA: Based on: https://dev.to/100lvlmaster/create-a-pwa-with-sveltekit-svelte-a36
1718

18-
The rest of resources, links to them and their authors are in devnotes.org and RESOURCES.md.# sv
19+
The rest of resources, links to them and their authors are in devnotes.org and RESOURCES.md.
1920

2021

src/lib/assets/global.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
font-family: Arial, Helvetica, sans-serif;
55
--transition-speed: 600ms;
66
--size-limit: 600px;
7+
8+
79
}
810
[color-scheme='sun'] {
911
color-scheme: sun;
@@ -28,7 +30,8 @@
2830
--contain-border: rgba(255, 255, 255, 0.4);
2931
--nav-invert: 0;
3032

31-
--bg-darklight: #ffdf22;
33+
--bg-darklight: #00a2d9;
34+
3235

3336
}
3437
@media (prefers-color-scheme: sun) {
@@ -60,7 +63,9 @@
6063
--contain-border: rgba(0, 0, 0, 0.4);
6164

6265
--nav-invert: 1;
63-
--bg-darklight: #00a2d9;
66+
--bg-darklight: #fff;
67+
68+
6469
}
6570
@media (prefers-color-scheme: moon) {
6671
:root {

src/lib/svg/Sun.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
border-color: var(--bg-darklight);
2424
border-radius: 102px;
2525
background-color: var(--bg-darklight);
26-
box-shadow: 0 0 10px 7px var(--bg-darklight);
26+
box-shadow: 0 0 25px 15px var(--bg-darklight);
2727
}
2828
path{
2929
fill: black;

src/routes/+layout.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
max-height: calc(100% - 8rem);
121121
width: 100%;
122122
max-width: 100%;
123+
124+
123125
}
124126
.navbar {
125127
padding-top: 1rem;

src/routes/+page.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ h3{
7878
.container {
7979
position: absolute;
8080
background-color: #d2d9df;
81+
8182
height: 100%;
8283
padding: 0;
8384
padding-top: 2rem;

src/routes/posts/jupyter/Empirical_growth_testing/+page.svelte

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
11
<script>
22
import { onMount } from "svelte";
3+
import { theme } from '$lib/components/theme.svelte';
4+
5+
let mounted = $state(false);
36
4-
let mounted = false;
57
/**
68
* @type {string | null | undefined}
79
*/
8-
let HTML;
10+
let HTML = $state(null);
11+
let iframeElement = $state(null); // Reference to the iframe DOM element
12+
913
1014
onMount(async () => {
1115
HTML = (await import("./page.html?raw")).default;
1216
mounted = true;
1317
});
18+
19+
function styleIframeContent() {
20+
if (!iframeElement?.contentDocument) return;
21+
22+
const body = iframeElement.contentDocument.body;
23+
if (!body) return;
24+
25+
const rootStyle = getComputedStyle(document.documentElement);
26+
const bgColor = rootStyle.getPropertyValue('--bg-primary').trim();
27+
const textColor = rootStyle.getPropertyValue('--text-primary').trim();
28+
29+
body.style.backgroundColor = bgColor;
30+
body.style.color = textColor;
31+
}
32+
33+
function onLoad() {
34+
styleIframeContent();
35+
}
36+
37+
$effect(() => {
38+
$theme.darkstate
39+
styleIframeContent();
40+
})
1441
</script>
1542
16-
<iframe title="jupyter" srcdoc={HTML}></iframe>
43+
<iframe title="jupyter" srcdoc={HTML} bind:this={iframeElement} onload={onLoad}></iframe>
1744
1845
{#if !mounted}
1946
<p>Loading...</p>

src/routes/posts/jupyter/Empirical_growth_testing/page.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
<meta property="date" content="2024-08-25" />
1717

18-
18+
<style type="text/css">
19+
/* Set the background color for the content inside the iframe */
20+
.main-container {
21+
background-color: var(--bg-primary);
22+
}
23+
</style>
1924

2025
<title>Empirical Growth Testing</title>
2126

0 commit comments

Comments
 (0)