diff --git a/config/development/server.toml b/config/development/server.toml new file mode 100644 index 0000000..52f15e5 --- /dev/null +++ b/config/development/server.toml @@ -0,0 +1,8 @@ +[[headers]] + for = '/**' + [headers.values] + # for the cube + Cross-Origin-Opener-Policy = "same-origin" + Cross-Origin-Resource-Policy = "same-site" + Cross-Origin-Embedder-Policy = "require-corp" + Referrer-Policy = 'origin' diff --git a/content/en/posts/cube.md b/content/en/posts/cube.md new file mode 100644 index 0000000..80e6d7d --- /dev/null +++ b/content/en/posts/cube.md @@ -0,0 +1,9 @@ ++++ +title = 'Cube' +date = 2025-09-07T06:09:55-04:00 ++++ + +## This page requires WASM / WebGL! + +here is a small animations of a cube rolling. its meant for game boy architecture, and is a WIP. +{{< cube >}} diff --git a/gbaWasm/package.json b/gbaWasm/package.json new file mode 100644 index 0000000..2df3236 --- /dev/null +++ b/gbaWasm/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@thenick775/mgba-wasm": "^2.3.4" + } +} diff --git a/gbaWasm/vi.gba b/gbaWasm/vi.gba new file mode 100755 index 0000000..585fbcb Binary files /dev/null and b/gbaWasm/vi.gba differ diff --git a/hugo.toml b/hugo.toml index 65f1550..72ddf29 100644 --- a/hugo.toml +++ b/hugo.toml @@ -41,3 +41,12 @@ weight = 30 path = "github.com/KKKZOZ/hugo-admonitions" [[module.imports]] theme = "violette" + [[module.mounts]] + source = "gbaWasm/node_modules/@thenick775/mgba-wasm/dist" + target = "assets/js" + [[module.mounts]] + source = "gbaWasm/mgba.map.wasm" + target = "assets/js/mgba.map.wasm" + [[module.mounts]] + source = "gbaWasm/vi.gba" + target = "assets/js/vi.gba" diff --git a/themes/violette/layouts/_shortcodes/cube.html b/themes/violette/layouts/_shortcodes/cube.html new file mode 100644 index 0000000..14d85cd --- /dev/null +++ b/themes/violette/layouts/_shortcodes/cube.html @@ -0,0 +1,30 @@ + +{{ with resources.Get "js/mgba.js" }} +{{ $wasm := resources.Get "js/mgba.wasm" }} +{{ $cube := resources.Get "js/vi.gba" }} +{{ $wasm_map := resources.Get "js/mgba.wasm.map" }} + +{{ end }} +