Skip to content

Commit 5a4b9f6

Browse files
committed
Add support link to site footer, enhance button styles, and update text for clarity
1 parent 43eac04 commit 5a4b9f6

6 files changed

Lines changed: 75 additions & 58 deletions

File tree

‎src/_data/site.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default {
2323
tagline: "Browser-based OSS and tools",
2424
url: "https://missing-elements.github.io",
2525
github: "https://github.com/missing-elements",
26+
// Where to give to the project's development: the home page's hero button, and the footer.
27+
support: "https://donatello.to/OleksandrShevchuk",
2628
// Google Search Console's code for the site, from the "HTML tag" check of its URL-prefix property,
2729
// https://missing-elements.github.io/: base.njk writes it on every page while it is set.
2830
googleSiteVerification: "_z8PPC9AkWc2rKheTsM0kGmM6UA6FLfgMf0aRxDzULU",

‎src/_includes/site-foot.njk‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<li><a href="{{ site.github }}">GitHub</a></li>
4444
<li><a href="https://www.npmjs.com/org/missing-elements">npm</a></li>
4545
<li><a href="{{ site.github }}/missing-elements.github.io">This site's source</a></li>
46-
<li><a href="https://donatello.to/OleksandrShevchuk">Support the project</a></li>
46+
<li><a href="{{ site.support }}">Support development</a></li>
4747
</ul>
4848
</div>
4949
</nav>

‎src/assets/site.css‎

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,16 @@ blockquote > :last-child { margin-bottom: 0; }
160160
cursor: pointer;
161161
}
162162
.button:hover { background: var(--tint); }
163+
/* A link drawn as a button: its words are not underlined as a link's in text are. */
164+
a.button { text-decoration: none; }
163165
.button-primary { border-color: var(--focus); color: var(--accent); font-weight: 600; }
164166

165-
/* Code blocks */
167+
/* Code blocks, on the cards' color: it stands out from the page and from a tinted band alike. */
166168
.code {
167169
margin: 1rem 0 1.25rem;
168170
border: 1px solid var(--border);
169171
border-radius: var(--radius);
170-
background: var(--surface);
172+
background: var(--raised);
171173
overflow: hidden;
172174
}
173175
/* The preview pane's bar shares these, so it matches the Current markup bar below it. */
@@ -187,7 +189,7 @@ pre[class*="language-"] {
187189
margin: 0;
188190
padding: 0.85rem 1rem;
189191
overflow: auto;
190-
background: var(--surface);
192+
background: var(--raised);
191193
font: 0.8125rem/1.6 var(--mono);
192194
tab-size: 2;
193195
}
@@ -476,8 +478,8 @@ tbody th a:hover code { text-decoration: underline; }
476478
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 18 6-6-6-6M8 6l-6 6 6 6'/%3E%3C/svg%3E");
477479
}
478480
/* Grows with the markup, so a typical setup shows in full; past a third of the screen it scrolls,
479-
leaving the viewer most of the pane. */
480-
.preview pre.preview-markup { max-height: 35dvh; padding: 0.5rem 0.75rem; background: var(--bg); font-size: 0.75rem; }
481+
leaving the viewer most of the pane. On the cards' color, as every code block is. */
482+
.preview pre.preview-markup { max-height: 35dvh; padding: 0.5rem 0.75rem; font-size: 0.75rem; }
481483
.preview-markup code { white-space: pre-wrap; overflow-wrap: anywhere; }
482484

483485
.flash { animation: flash 0.6s ease-out; }
@@ -557,9 +559,24 @@ tbody th a:hover code { text-decoration: underline; }
557559

558560
/* Org home: the build page's bands, its first screen's words no wider than a heading of two lines. */
559561
.home .hero-words { max-inline-size: 46rem; }
560-
/* Cards: on the home page, the elements and the tools, as the build page's steps are drawn. Three to
561-
a row on a wide screen, two on a tablet, one on a phone; each an <article> as tall as its row,
562-
with its links in its <footer>, at its foot. */
562+
/* Its one action, support for the work: a heart before the words, masked as the site's icons are,
563+
in the warm red the code's tags take. */
564+
.button-support::before {
565+
content: "";
566+
flex: none;
567+
inline-size: 1.125em;
568+
block-size: 1.125em;
569+
background: var(--t-tag);
570+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.6-4.7-9.6-9.6C1 7.9 3 4 6.9 4c2.2 0 3.9 1.2 5.1 3 1.2-1.8 2.9-3 5.1-3C21 4 23 7.9 21.6 11.4 19.6 16.3 12 21 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
571+
}
572+
@media (forced-colors: active) {
573+
/* Masked icons paint with their background, which forced colors would turn into Canvas. */
574+
.button-support::before { forced-color-adjust: none; background: CanvasText; }
575+
}
576+
/* Cards: on the home page, the elements and the tools, and at the build page's foot, where else a
577+
package plays and how it went; drawn as the build page's steps are. Three to a row on a wide
578+
screen, two on a tablet, one on a phone; each an <article> as tall as its row, its title an h2
579+
or an h3 by where it stands, with its links or buttons in its <footer>, at its foot. */
563580
.cards {
564581
display: grid;
565582
grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
@@ -570,7 +587,7 @@ tbody th a:hover code { text-decoration: underline; }
570587
}
571588
.cards > li { display: grid; margin: 0; }
572589
.cards article { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--raised); }
573-
.cards h3 { margin: 0; font-size: 1.125rem; }
590+
.cards :is(h2, h3) { margin: 0; padding: 0; border: 0; font-size: 1.125rem; }
574591
.cards p { margin: 0; color: var(--muted); }
575592
.card-tag code { font-size: 0.8125rem; }
576593
.cards .links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: auto; padding-top: 0.5rem; font-size: 0.875rem; }
@@ -608,7 +625,6 @@ tbody th a:hover code { text-decoration: underline; }
608625
steps are, its steps on the skill page's timeline, its prompts in code blocks to copy, and the
609626
types it lists by name and use. */
610627
.guide > * { max-inline-size: 48rem; }
611-
.guide a.button { text-decoration: none; }
612628
.guide h3 + .code { margin-top: 0.75rem; }
613629
/* A row each, the name beside its use where the list is wide enough for both, over it where not. */
614630
.type-list {
@@ -796,16 +812,9 @@ tbody th a:hover code { text-decoration: underline; }
796812
}
797813
.how h3 { margin: 0 0 0.4rem; font-size: 1.0625rem; }
798814
.how p { margin: 0; color: var(--muted); }
799-
/* The prompt, in a code block's frame for its Copy button: prose, so it wraps. It is on the
800-
accent's tint, which a code block's color is not: that is a tinted band's own, as on the build
801-
page, and next to the page's. Its frame takes the tint once, the text and the bar showing it
802-
through; the bar's label then takes the text's color, where the muted one is too faint on the
803-
tint in the dark theme (4.4:1). */
815+
/* The prompt, in a code block's frame for its Copy button: prose, so it wraps. */
804816
.prompt-box { max-inline-size: 48rem; }
805817
pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9375rem; }
806-
pre.prompt, .code:has(> pre.prompt) { background: var(--tint); }
807-
.code > pre.prompt { background: none; }
808-
.code:has(> pre.prompt) .code-bar { color: var(--text); }
809818

810819
/* Build it: the steps on the same left edge as the rest, no wider than the source's editor reads. */
811820
.tool .step { max-inline-size: 60rem; }
@@ -824,12 +833,9 @@ pre.prompt, .code:has(> pre.prompt) { background: var(--tint); }
824833
.stats-note { margin: 0.75rem 0 1.5rem; color: var(--muted); font-size: 0.8125rem; }
825834
.cost-more { margin: 0; color: var(--muted); }
826835

827-
/* Under it all: where else it plays, and how it went, a card each, side by side where they fit. */
836+
/* Under it all: where else it plays, and how it went, as cards (.cards); the second's footer holds
837+
its two buttons. */
828838
.linked .closing { padding-block-start: 0; }
829-
.closing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; }
830-
.closing-grid > section { display: flex; flex-direction: column; gap: 0.75rem; padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
831-
.closing-grid h2 { margin: 0; padding: 0; border: 0; font-size: 1.375rem; }
832-
.closing-grid p { margin: 0; color: var(--muted); }
833839
.feedback-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-start: auto; padding-block-start: 0.5rem; }
834840

835841
/* H5P build page, /h5p/build/ */
@@ -987,7 +993,6 @@ pre.prompt, .code:has(> pre.prompt) { background: var(--tint); }
987993
cursor: pointer;
988994
}
989995
.build input[type="file"]::file-selector-button:hover { background: var(--tint); }
990-
.build a.button { text-decoration: none; }
991996
.button-large { padding: 0.55rem 1.1rem; font-size: 0.9375rem; }
992997
/* The page's two main actions, Build and Download, filled where the site's other buttons are outlined. */
993998
.button-solid, .button-solid:hover { border-color: var(--accent); background: var(--accent); color: var(--bg); font-weight: 600; }

‎src/h5p/build/index.njk‎

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ socialImage:
1414
alt: "The build page: its headline, Build an H5P activity with AI, and a course presentation playing beside it."
1515
# The top bar's links to the page's own sections (topbar.njk), for a visitor who came with no source.
1616
topbarLinks:
17-
- { href: "#make", text: "Make your own" }
18-
- { href: "#build-it", text: "Build" }
19-
- { href: "#cost", text: "Build cost" }
17+
- { href: "#make", text: "How it works" }
18+
- { href: "#build-it", text: "Try it" }
19+
- { href: "#cost", text: "Tokens saved" }
2020
topbarLinksClass: when-unlinked
2121
# The page's only policy: GitHub Pages sends no headers. base.njk writes it first in <head>, and the
2222
# page's inline scripts, the site's color-scheme script and the one below, are added to script-src
@@ -113,7 +113,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' da
113113
<section class="band band-tint make when-unlinked" id="make" aria-labelledby="make-heading">
114114
<div class="wrap">
115115
<header class="band-head">
116-
<h2 id="make-heading">Make your own</h2>
116+
<h2 id="make-heading">How it works</h2>
117117
<p>Three steps, with an AI chat that can open a web page.</p>
118118
</header>
119119
<ol class="how" role="list">
@@ -127,7 +127,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' da
127127
</li>
128128
<li>
129129
<h3>Play it, then download it</h3>
130-
<p>It hands over a link that opens the activity here, or its source, a block of JSON to paste under <a href="#build-it">Build it</a>. Some chats build the <code>.h5p</code> file themselves.</p>
130+
<p>It hands over a link that opens the activity here, or its source, a block of JSON to <a href="#build-it">paste below</a>. Some chats build the <code>.h5p</code> file themselves.</p>
131131
</li>
132132
</ol>
133133
<div class="prompt-box">
@@ -150,7 +150,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' da
150150
<section class="band tool" id="build-it" aria-labelledby="build-it-heading">
151151
<div class="wrap">
152152
<header class="band-head">
153-
<h2 id="build-it-heading">Build it</h2>
153+
<h2 id="build-it-heading">Try it</h2>
154154
<p class="when-unlinked">Paste the JSON your chat wrote, build it, play it, and download the <code>.h5p</code> file.</p>
155155
</header>
156156

@@ -234,7 +234,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' da
234234
<section class="band band-tint cost when-unlinked" id="cost" aria-labelledby="cost-heading">
235235
<div class="wrap">
236236
<header class="band-head">
237-
<h2 id="cost-heading">Build cost, in tokens</h2>
237+
<h2 id="cost-heading">Tokens saved</h2>
238238
<p>
239239
An AI chat counts its work in tokens, about four characters each. Asked plainly for an H5P
240240
activity, a chat writes it the way H5P stores it, <code>content.json</code> and
@@ -268,31 +268,38 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' da
268268
</div>
269269
</section>
270270

271-
{#- Where else a package plays, with no H5P site, and where to say how it went: by email first, which
272-
asks for no account, or a public discussion for someone with a GitHub account. -#}
271+
{#- At the foot, cards as the home page's: where else a package plays with no H5P site, each way a
272+
link in the card's footer, and where to say how it went, by email first, which asks for no
273+
account, or in a public discussion for someone with a GitHub account. -#}
273274
<div class="band closing">
274-
<div class="wrap closing-grid">
275-
<section class="plays" aria-labelledby="plays-heading">
276-
<h2 id="plays-heading">Play it without an H5P site</h2>
277-
<p>
278-
Any H5P site takes the file you download. With none, use h5p-offline-player, the player
279-
this page plays it in:
280-
<a href="https://github.com/missing-elements/h5p-offline-player/blob/main/docs/setup.md">on a site of your own</a>,
281-
or <a href="https://h5p-offline-player.vercel.app/app/">offline, in its app</a>.
282-
</p>
283-
</section>
284-
<section class="feedback" aria-labelledby="feedback-heading">
285-
<h2 id="feedback-heading">How did it go?</h2>
286-
<p>
287-
Say what you made, and what went well or wrong with the chat's source or this page. Write
288-
to the author or, with a GitHub account, start a public discussion where the h5p-author
289-
skill is made.
290-
</p>
291-
<div class="feedback-actions">
292-
<a class="button button-primary button-large" href="{{ site.buildFeedback.email }}">Email feedback</a>
293-
<a class="button button-large" href="{{ site.buildFeedback.github }}">Discuss on GitHub</a>
294-
</div>
295-
</section>
275+
<div class="wrap">
276+
<ul class="cards" role="list">
277+
<li><article>
278+
<h2>Play it without an H5P site</h2>
279+
<p>
280+
Any H5P site takes the file you download. With none, h5p-offline-player, the player on
281+
this page, plays it on your own site, offline, in VS Code, or in an LMS as SCORM.
282+
</p>
283+
<footer class="links">
284+
<a href="https://github.com/missing-elements/h5p-offline-player/blob/main/docs/setup.md">Set up on your site</a>
285+
<a href="https://h5p-offline-player.vercel.app/app/">Offline app</a>
286+
<a href="https://marketplace.visualstudio.com/items?itemName=MissingElements.h5p-preview">VS Code extension</a>
287+
<a href="https://h5p-offline-player.vercel.app/demo/scorm.html">SCORM for an LMS</a>
288+
</footer>
289+
</article></li>
290+
<li><article>
291+
<h2>How did it go?</h2>
292+
<p>
293+
Say what you made, and what went well or wrong with the chat's source or this page. Write
294+
to the author or, with a GitHub account, start a public discussion where the h5p-author
295+
skill is made.
296+
</p>
297+
<footer class="feedback-actions">
298+
<a class="button button-primary button-large" href="{{ site.buildFeedback.email }}">Email feedback</a>
299+
<a class="button button-large" href="{{ site.buildFeedback.github }}">Discuss on GitHub</a>
300+
</footer>
301+
</article></li>
302+
</ul>
296303
</div>
297304
</div>
298305
</main>

‎src/h5p/create-with-ai/index.njk‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self'; o
7474
<p>What the chat hands you depends on what it can run:</p>
7575
<ul>
7676
<li>a link that opens the activity on the build page;</li>
77-
<li>its source, a block of JSON: paste it under <a href="/h5p/build/#build-it">Build it</a> on the build page and choose Build;</li>
77+
<li>its source, a block of JSON: paste it <a href="/h5p/build/#build-it">on the build page</a> and choose Build;</li>
7878
<li>or the <code>.h5p</code> file itself, from a chat that runs code.</li>
7979
</ul>
8080
<p>
@@ -217,7 +217,7 @@ csp: "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self'; o
217217

218218
<h3>The chat's link builds nothing</h3>
219219
<p>
220-
Ask the chat for the source as JSON instead, and paste it under Build it. A link is made by
220+
Ask the chat for the source as JSON instead, and paste it on the build page. A link is made by
221221
running code, and one a chat wrote out itself breaks.
222222
</p>
223223

‎src/index.njk‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ description: Elements the web platform is missing, as web components you host yo
1919
browser, your editor and your AI agent. Free and open source, with no server of ours
2020
between you and your files.
2121
</p>
22+
<div class="hero-actions">
23+
<a class="button button-large button-support" href="{{ site.support }}">Support development</a>
24+
</div>
2225
</div>
2326
</div>
2427
</section>

0 commit comments

Comments
 (0)