From 356f79ad027d246a66d8659a4a3dae87efaa0ef3 Mon Sep 17 00:00:00 2001 From: osmarks Date: Sun, 27 Oct 2024 20:18:37 +0000 Subject: [PATCH] new experiment, fix comments --- experiments/wave-function-collapse/index.html | 334 ++++++++++++++++++ src/comments.css | 2 +- src/index.js | 6 +- src/style.sass | 27 +- 4 files changed, 357 insertions(+), 12 deletions(-) create mode 100644 experiments/wave-function-collapse/index.html diff --git a/experiments/wave-function-collapse/index.html b/experiments/wave-function-collapse/index.html new file mode 100644 index 0000000..0624300 --- /dev/null +++ b/experiments/wave-function-collapse/index.html @@ -0,0 +1,334 @@ +--- +title: Wave Function Collapse +description: A basic implementation of the WFC procedural generation algorithm. +slug: wfc +--- + + + +
+ + + + + + +
+
+
+ diff --git a/src/comments.css b/src/comments.css index 99f200d..ee5b1f9 100644 --- a/src/comments.css +++ b/src/comments.css @@ -1 +1 @@ -.name.svelte-m0gh76{font-weight:600}.internal.svelte-m0gh76{background:linear-gradient(to right,red,lime,blue);background-clip:text;color:transparent}textarea.svelte-1xxfb50{width:100%;resize:vertical}.error.svelte-1xxfb50{padding:.5em}.controls.svelte-1xxfb50{display:flex;justify-content:space-between}.children.svelte-10v2gkf.svelte-10v2gkf{padding-left:.5em;border-left:3px solid black}.comment.svelte-10v2gkf.svelte-10v2gkf{margin-top:.5em;margin-bottom:1.5em}.comment.svelte-10v2gkf .content.svelte-10v2gkf{padding:.25em}.comment.svelte-10v2gkf .container.svelte-10v2gkf{display:flex}.comment.svelte-10v2gkf .container .avatar.svelte-10v2gkf{width:3em;height:3em;margin-right:1em}.comment.svelte-10v2gkf.svelte-10v2gkf:last-of-type{margin-bottom:none}.controls.svelte-10v2gkf a.svelte-10v2gkf{text-decoration:none;color:#76cd26} +.name.svelte-m0gh76{font-weight:600}.internal.svelte-m0gh76{background:linear-gradient(to right,red,lime,blue);background-clip:text;color:transparent}textarea.svelte-1xxfb50{width:100%;resize:vertical}.error.svelte-1xxfb50{padding:.5em}.controls.svelte-1xxfb50{display:flex;justify-content:space-between}.children.svelte-1v7b0ag.svelte-1v7b0ag{padding-left:.5em;border-left:3px solid black}@media (prefers-color-scheme: dark){.children.svelte-1v7b0ag.svelte-1v7b0ag{border-left:3px solid white}}.comment.svelte-1v7b0ag.svelte-1v7b0ag{margin-top:.5em;margin-bottom:1.5em}.comment.svelte-1v7b0ag .content.svelte-1v7b0ag{padding:.25em}.comment.svelte-1v7b0ag .container.svelte-1v7b0ag{display:flex}.comment.svelte-1v7b0ag .container .avatar.svelte-1v7b0ag{width:3em;height:3em;margin-right:1em}.comment.svelte-1v7b0ag.svelte-1v7b0ag:last-of-type{margin-bottom:none}.controls.svelte-1v7b0ag a.svelte-1v7b0ag{text-decoration:none;color:#76cd26}.error.svelte-12gp6sl{padding:.5em;background:salmon;margin-top:.5em;margin-bottom:.5em} diff --git a/src/index.js b/src/index.js index b3d33f9..abbcf11 100644 --- a/src/index.js +++ b/src/index.js @@ -118,7 +118,7 @@ const renderContainer = (tokens, idx) => { if (opening) { if (blockType === "captioned") { const link = `` - return `
${options.link ? link : ""}${options.link ? "" : ""}` + return `${options.wide ? "
" : ""}
${options.link ? link : ""}${options.link ? "" : ""}` } else if (blockType === "epigraph") { return `
` } else if (blockType === "buttons") { @@ -130,7 +130,7 @@ const renderContainer = (tokens, idx) => { } } else { if (blockType === "captioned") { - return `
` + return options.wide ? `
` : `
` } else if (blockType === "epigraph") { let ret = `
` if (options.attribution) { @@ -417,7 +417,7 @@ const fetchFeeds = async () => { })) writeCache("feeds", globalData.openring) } - + const entries = [] for (const [name, feed] of Object.entries(globalData.openring)) { for (const entry of feed.entries) { diff --git a/src/style.sass b/src/style.sass index 2ddfee0..123c00e 100644 --- a/src/style.sass +++ b/src/style.sass @@ -84,7 +84,7 @@ nav a, img, picture margin-right: 0.5em - + @for $i from 1 through 6 a:nth-child(#{$i + 1}) color: hsl(120 + ($i * 30), 100%, 80%) @@ -122,7 +122,7 @@ main display: flex flex-wrap: wrap text-align: left - + > div min-width: 20em background: #eee @@ -182,6 +182,9 @@ button, select, input, textarea, .textarea padding: 1em margin-bottom: 0.5em margin-top: 0.5em + box-sizing: border-box + > a + display: block img, picture width: 100% p @@ -193,11 +196,10 @@ blockquote margin-left: 0.2rem .wider - width: calc(100vw - 2 * $content-margin) - max-width: 80em - min-width: 40em > * - min-width: 40em + width: calc(100vw - 2 * $content-margin) + max-width: 80em + min-width: calc(40rem - 2 * $content-margin) position: relative z-index: 1 @@ -258,6 +260,11 @@ blockquote main.fullwidth margin-left: $content-margin margin-right: $content-margin + .wider + > * + width: calc(100vw - 2 * $content-margin - $navbar-width) + max-width: 80em + min-width: calc(40rem - 2 * $content-margin - $navbar-width) $hl-border: 3px .footnote-item.hl1, .footnote-item.hl2 @@ -298,6 +305,10 @@ $hl-border: 3px blockquote border-left: 0.4rem solid white + button, select, input, textarea, .textarea + background: #333 + color: white + .sidenotes img, .footnotes img width: 100% max-width: 15em @@ -328,7 +339,7 @@ table padding-top: 1rem padding-bottom: 1rem - > div + > div font-style: italic .attribution @@ -393,4 +404,4 @@ table .title font-size: 1.1em font-family: $headers - font-weight: 600 \ No newline at end of file + font-weight: 600