-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
### A Pluto.jl notebook ### | ||
# v0.19.27 | ||
|
||
using Markdown | ||
using InteractiveUtils | ||
|
||
# βββ‘ 0fbcbe4e-2580-11ee-1d34-71bbfcec921e | ||
using HypertextLiteral | ||
|
||
# βββ‘ 71ff15f4-a183-4222-bba0-8785668af3fb | ||
md""" | ||
# Switching images depending on light/dark mode | ||
Switch your screen between light and dark mode and watch this content automatically update! | ||
One nice way to use this in Julia is to generate two plots in two color themes, and use this to make sure that the right one is displayed to the reader. | ||
""" | ||
|
||
# βββ‘ 36d3abc9-aadd-4fa5-b8bf-9f35349c461a | ||
md""" | ||
# Test images | ||
""" | ||
|
||
# βββ‘ d1bdbaaa-91fb-424e-8356-141aedfa0764 | ||
big(x) = @htl """ | ||
<span style="font-size: 10rem;">$x</span> | ||
""" | ||
|
||
# βββ‘ 1a25bc4a-dbdf-4cb4-ae78-c1eca48ee7e1 | ||
dark_plot = big("π") | ||
|
||
# βββ‘ 176b2f2e-d648-4af7-9d5b-cafc2304166a | ||
light_plot = big("π") | ||
|
||
# βββ‘ 75b365ee-bc3d-42e8-9b16-44d165584f89 | ||
md""" | ||
# How it works | ||
""" | ||
|
||
# βββ‘ 526aa50e-14c8-4264-b886-eabbff48e308 | ||
lightdark(light, dark) = @htl """ | ||
<style> | ||
.plutoui-only-when-light { | ||
display: unset; | ||
} | ||
.plutoui-only-when-dark { | ||
display: none; | ||
} | ||
@media (prefers-color-scheme: dark) { | ||
.plutoui-only-when-light { | ||
display: none; | ||
} | ||
.plutoui-only-when-dark { | ||
display: unset; | ||
} | ||
} | ||
</style> | ||
<span class="plutoui-only-when-light">$light</span> | ||
<span class="plutoui-only-when-dark">$dark</span> | ||
""" | ||
|
||
# βββ‘ 2161b66e-73bf-41aa-b692-238eccfab347 | ||
lightdark(light_plot, dark_plot) | ||
|
||
# βββ‘ f59cd504-2385-4e21-8150-9bc8bb443438 | ||
lightdark(md"You are in **light** mode!", md"You are in **dark** mode!") | ||
|
||
# βββ‘ 00000000-0000-0000-0000-000000000001 | ||
PLUTO_PROJECT_TOML_CONTENTS = """ | ||
[deps] | ||
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" | ||
[compat] | ||
HypertextLiteral = "~0.9.4" | ||
""" | ||
|
||
# βββ‘ 00000000-0000-0000-0000-000000000002 | ||
PLUTO_MANIFEST_TOML_CONTENTS = """ | ||
# This file is machine-generated - editing it directly is not advised | ||
julia_version = "1.8.3" | ||
manifest_format = "2.0" | ||
project_hash = "fc304fba520d81fb78ea25b98f5762b4591b1182" | ||
[[deps.HypertextLiteral]] | ||
deps = ["Tricks"] | ||
git-tree-sha1 = "c47c5fa4c5308f27ccaac35504858d8914e102f9" | ||
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" | ||
version = "0.9.4" | ||
[[deps.Tricks]] | ||
git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549" | ||
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" | ||
version = "0.1.7" | ||
""" | ||
|
||
# βββ‘ Cell order: | ||
# ββ71ff15f4-a183-4222-bba0-8785668af3fb | ||
# β β2161b66e-73bf-41aa-b692-238eccfab347 | ||
# β βf59cd504-2385-4e21-8150-9bc8bb443438 | ||
# ββ36d3abc9-aadd-4fa5-b8bf-9f35349c461a | ||
# β βd1bdbaaa-91fb-424e-8356-141aedfa0764 | ||
# β β1a25bc4a-dbdf-4cb4-ae78-c1eca48ee7e1 | ||
# β β176b2f2e-d648-4af7-9d5b-cafc2304166a | ||
# ββ75b365ee-bc3d-42e8-9b16-44d165584f89 | ||
# β β0fbcbe4e-2580-11ee-1d34-71bbfcec921e | ||
# β β526aa50e-14c8-4264-b886-eabbff48e308 | ||
# ββ00000000-0000-0000-0000-000000000001 | ||
# ββ00000000-0000-0000-0000-000000000002 |
Oops, something went wrong.