mirror of
https://github.com/deunix-educ/PyQuest.git
synced 2026-11-25 08:19:44 +01:00
Add header tagline, footer (copyright, contact, MIT licence) and an About/credits panel with CC BY attribution
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 PyQuest contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -359,3 +359,91 @@ pre {
|
||||
.voices-message:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Bandeau : ce que fait PyQuest, en une ligne sous le titre. */
|
||||
.app-tagline {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.brand > div {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Pied de page : droits, contact, licence, à propos. */
|
||||
.app-footer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem 1.5rem;
|
||||
margin-top: 2rem;
|
||||
padding: 1rem;
|
||||
border-top: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
color: var(--muted);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.app-footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem 1.25rem;
|
||||
}
|
||||
|
||||
.app-footer a,
|
||||
.link-button {
|
||||
color: var(--link, var(--accent));
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Bouton d'apparence de lien : vraie commande clavier, cible assez grande. */
|
||||
.link-button {
|
||||
min-height: 2.75rem;
|
||||
padding: 0 0.25rem;
|
||||
background: none;
|
||||
border: 0;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.app-footer a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 2.75rem;
|
||||
}
|
||||
|
||||
/* Panneau « À propos ». */
|
||||
.about-section h3 {
|
||||
margin: 1.25rem 0 0.25rem;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.about-section:first-child h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.about-credits {
|
||||
padding-left: 1.25rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Le pied de page reste en bas de la fenêtre même quand le contenu est court. */
|
||||
#app-root {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
#notebook-region {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.app-footer {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
+14
-2
@@ -4,7 +4,8 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#0f766e">
|
||||
<title>PyQuest</title>
|
||||
<title>PyQuest — apprendre Python par la pratique</title>
|
||||
<meta name="description" content="PyQuest : apprendre Python par la pratique, directement dans le navigateur. Sans installation, hors ligne, en français et en anglais.">
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
<link rel="icon" href="icons/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="icons/icon-180.png">
|
||||
@@ -22,7 +23,10 @@
|
||||
<div class="app-heading">
|
||||
<div class="brand">
|
||||
<img src="icons/icon.svg" alt="" width="32" height="32">
|
||||
<h1 id="app-title">PyQuest</h1>
|
||||
<div>
|
||||
<h1 id="app-title">PyQuest</h1>
|
||||
<p class="app-tagline" id="app-tagline"></p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="level-nav" id="level-nav">
|
||||
<button type="button" class="btn" id="level-prev"><span aria-hidden="true">‹</span></button>
|
||||
@@ -33,6 +37,14 @@
|
||||
<button type="button" class="btn" id="settings-toggle"></button>
|
||||
</header>
|
||||
<div id="notebook-region"></div>
|
||||
<footer class="app-footer" id="app-footer">
|
||||
<p id="footer-copyright"></p>
|
||||
<p class="footer-links">
|
||||
<a id="footer-contact" href="mailto:dd@linuxtarn.org">dd@linuxtarn.org</a>
|
||||
<a id="footer-license" href="LICENSE.txt" target="_blank" rel="noopener"></a>
|
||||
<button type="button" class="link-button" id="about-toggle"></button>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
<div id="drawer-region"></div>
|
||||
<div id="toast-region"></div>
|
||||
|
||||
+31
-1
@@ -145,5 +145,35 @@
|
||||
"voices.download": "Download the voices for offline use",
|
||||
"voices.downloading": "Downloading: {done} of {total}…",
|
||||
"voices.done": "Voices downloaded: they will be read even without a connection.",
|
||||
"voices.failed": "{failed} file(s) could not be downloaded. Try again with a connection."
|
||||
"voices.failed": "{failed} file(s) could not be downloaded. Try again with a connection.",
|
||||
"app.tagline": "Learn Python by doing, in your browser: no installation, even offline.",
|
||||
"app.docTitle": "PyQuest — learn Python by doing",
|
||||
"footer.copyright": "© {year} PyQuest",
|
||||
"footer.license": "MIT licence",
|
||||
"footer.about": "About and credits",
|
||||
"about.title": "About PyQuest",
|
||||
"about.what.title": "What is PyQuest?",
|
||||
"about.what.text": "PyQuest teaches you Python by practising it: 15 levels, short explanations, guided exercises with hints, errors explained in plain language and a mission in every level. The Python you write is real Python, run right in your browser.",
|
||||
"about.how.title": "How it works",
|
||||
"about.how.1": "Everything happens in your browser: nothing to install, and the app works without a connection once loaded.",
|
||||
"about.how.2": "Your progress (points, badges, day streak) stays on your device. You can save it to a file or, if your instance offers it, sync it between devices without creating an account.",
|
||||
"about.how.3": "No ads, no analytics, no third-party service.",
|
||||
"about.how.4": "Accessible: full keyboard use, light and dark themes, adjustable text size, sound and voice always switchable off.",
|
||||
"about.license.title": "Licence",
|
||||
"about.license.text": "© {year} PyQuest. Free software, released under the MIT licence: you may use, copy, modify and share it, as long as you keep the copyright notice and the licence text. It comes without warranty.",
|
||||
"about.license.read": "Read the full text of the MIT licence",
|
||||
"about.contact.title": "Contact",
|
||||
"about.contact.text": "A question, a mistake, an idea for a level:",
|
||||
"about.credits.title": "Credits",
|
||||
"about.credits.intro": "PyQuest builds on free software and resources:",
|
||||
"about.credit.python": "the Python language",
|
||||
"about.credit.pyodide": "Python in the browser (WebAssembly)",
|
||||
"about.credit.piper": "speech synthesis, used to produce the voices (build tool, not shipped)",
|
||||
"about.credit.voice_fr": "data behind the French voice (University of Edinburgh)",
|
||||
"about.credit.voice_en": "data behind the English voice",
|
||||
"about.credit.font": "text font",
|
||||
"about.credit.font_code": "code font",
|
||||
"about.credit.yaml": "reading level files",
|
||||
"about.credit.schema": "validating levels",
|
||||
"about.credits.cc": "French voice: model trained on the SIWIS database (Honnet et al., University of Edinburgh), licence CC BY 4.0: https://creativecommons.org/licenses/by/4.0/. Sound effects are synthesised in your browser, without samples."
|
||||
}
|
||||
|
||||
+31
-1
@@ -145,5 +145,35 @@
|
||||
"voices.download": "Télécharger les voix pour le hors ligne",
|
||||
"voices.downloading": "Téléchargement : {done} sur {total}…",
|
||||
"voices.done": "Voix téléchargées : elles seront lues même sans connexion.",
|
||||
"voices.failed": "{failed} fichier(s) n'ont pas pu être téléchargés. Réessaie avec une connexion."
|
||||
"voices.failed": "{failed} fichier(s) n'ont pas pu être téléchargés. Réessaie avec une connexion.",
|
||||
"app.tagline": "Apprendre Python par la pratique, dans ton navigateur : sans installation, même hors ligne.",
|
||||
"app.docTitle": "PyQuest — apprendre Python par la pratique",
|
||||
"footer.copyright": "© {year} PyQuest",
|
||||
"footer.license": "Licence MIT",
|
||||
"footer.about": "À propos et crédits",
|
||||
"about.title": "À propos de PyQuest",
|
||||
"about.what.title": "Qu'est-ce que PyQuest ?",
|
||||
"about.what.text": "PyQuest t'apprend Python en le pratiquant : 15 niveaux, des explications courtes, des exercices guidés avec indices, des erreurs expliquées en langage simple et une mission à chaque niveau. Le Python que tu écris est du vrai Python, exécuté directement dans ton navigateur.",
|
||||
"about.how.title": "Comment ça marche",
|
||||
"about.how.1": "Tout se passe dans ton navigateur : rien à installer, et l'application fonctionne même sans connexion une fois chargée.",
|
||||
"about.how.2": "Ta progression (points, badges, série de jours) reste sur ton appareil. Tu peux la sauvegarder dans un fichier ou, si ton instance le propose, la synchroniser entre appareils sans créer de compte.",
|
||||
"about.how.3": "Aucune publicité, aucune statistique, aucun service tiers.",
|
||||
"about.how.4": "Accessible : clavier complet, thèmes clair et sombre, taille du texte réglable, son et voix toujours désactivables.",
|
||||
"about.license.title": "Licence",
|
||||
"about.license.text": "© {year} PyQuest. Logiciel libre, distribué sous licence MIT : tu peux l'utiliser, le copier, le modifier et le partager, à condition de conserver la mention de droits et le texte de la licence. Il est fourni sans garantie.",
|
||||
"about.license.read": "Lire le texte complet de la licence MIT",
|
||||
"about.contact.title": "Contact",
|
||||
"about.contact.text": "Une question, une erreur, une idée de niveau :",
|
||||
"about.credits.title": "Crédits",
|
||||
"about.credits.intro": "PyQuest repose sur des logiciels et des ressources libres :",
|
||||
"about.credit.python": "le langage Python",
|
||||
"about.credit.pyodide": "Python dans le navigateur (WebAssembly)",
|
||||
"about.credit.piper": "synthèse vocale, utilisée pour fabriquer les voix (outil de construction, non embarqué)",
|
||||
"about.credit.voice_fr": "données de la voix française (University of Edinburgh)",
|
||||
"about.credit.voice_en": "données de la voix anglaise",
|
||||
"about.credit.font": "police du texte",
|
||||
"about.credit.font_code": "police du code",
|
||||
"about.credit.yaml": "lecture des fichiers de niveaux",
|
||||
"about.credit.schema": "validation des niveaux",
|
||||
"about.credits.cc": "Voix française : modèle entraîné sur la base SIWIS (Honnet et al., University of Edinburgh), licence CC BY 4.0 : https://creativecommons.org/licenses/by/4.0/. Les effets sonores sont synthétisés dans ton navigateur, sans échantillon."
|
||||
}
|
||||
|
||||
+30
-2
@@ -21,6 +21,7 @@ import { el } from './ui/dom.js';
|
||||
import { CellManager } from './ui/CellManager.js';
|
||||
import { NotebookView } from './ui/NotebookView.js';
|
||||
import { ProgressMap } from './ui/ProgressMap.js';
|
||||
import { AboutPanel, COPYRIGHT_YEAR } from './ui/AboutPanel.js';
|
||||
import { SettingsPanel } from './ui/SettingsPanel.js';
|
||||
|
||||
const LANGUAGES = ['fr', 'en'];
|
||||
@@ -72,6 +73,8 @@ class App {
|
||||
#map;
|
||||
#shelf;
|
||||
#panel;
|
||||
#about;
|
||||
#aboutDrawer;
|
||||
#levelsDrawer;
|
||||
#settingsDrawer;
|
||||
#levelIds = [];
|
||||
@@ -128,6 +131,7 @@ class App {
|
||||
this.#levelsDrawer.close();
|
||||
this.#goTo(event.detail.id);
|
||||
});
|
||||
this.#about = new AboutPanel(this.#i18n);
|
||||
this.#panel = new SettingsPanel(this.#i18n);
|
||||
this.#panel.setSync(this.#sync.state);
|
||||
this.#panel.addEventListener('change', (event) => this.#onSettingChange(event.detail));
|
||||
@@ -237,12 +241,28 @@ class App {
|
||||
trigger: document.getElementById('settings-toggle'),
|
||||
inertTargets: [appRoot],
|
||||
});
|
||||
region.append(...this.#levelsDrawer.elements, ...this.#settingsDrawer.elements);
|
||||
this.#aboutDrawer = new Drawer({
|
||||
side: 'right',
|
||||
title: '',
|
||||
closeLabel: '',
|
||||
content: this.#about.element,
|
||||
trigger: document.getElementById('about-toggle'),
|
||||
inertTargets: [appRoot],
|
||||
});
|
||||
region.append(...this.#levelsDrawer.elements, ...this.#settingsDrawer.elements, ...this.#aboutDrawer.elements);
|
||||
this.#levelsDrawer.addEventListener('open', () => {
|
||||
this.#settingsDrawer.close({ restoreFocus: false });
|
||||
this.#aboutDrawer.close({ restoreFocus: false });
|
||||
this.#map.scrollToCurrent();
|
||||
});
|
||||
this.#settingsDrawer.addEventListener('open', () => this.#levelsDrawer.close({ restoreFocus: false }));
|
||||
this.#settingsDrawer.addEventListener('open', () => {
|
||||
this.#levelsDrawer.close({ restoreFocus: false });
|
||||
this.#aboutDrawer.close({ restoreFocus: false });
|
||||
});
|
||||
this.#aboutDrawer.addEventListener('open', () => {
|
||||
this.#levelsDrawer.close({ restoreFocus: false });
|
||||
this.#settingsDrawer.close({ restoreFocus: false });
|
||||
});
|
||||
}
|
||||
|
||||
#bindLevelNav() {
|
||||
@@ -263,6 +283,11 @@ class App {
|
||||
#renderChrome() {
|
||||
const t = (key) => this.#i18n.t(key);
|
||||
document.getElementById('app-title').textContent = t('app.title');
|
||||
document.getElementById('app-tagline').textContent = t('app.tagline');
|
||||
document.title = t('app.docTitle');
|
||||
document.getElementById('footer-copyright').textContent = this.#i18n.t('footer.copyright', { year: COPYRIGHT_YEAR });
|
||||
document.getElementById('footer-license').textContent = t('footer.license');
|
||||
document.getElementById('about-toggle').textContent = t('footer.about');
|
||||
document.getElementById('levels-toggle').replaceChildren(el('span', { 'aria-hidden': 'true', text: '☰ ' }), t('nav.levels'));
|
||||
document.getElementById('settings-toggle').replaceChildren(el('span', { 'aria-hidden': 'true', text: '⚙ ' }), t('nav.settings'));
|
||||
document.getElementById('level-prev').setAttribute('aria-label', t('nav.prev'));
|
||||
@@ -270,6 +295,9 @@ class App {
|
||||
document.getElementById('level-nav').setAttribute('aria-label', t('nav.label'));
|
||||
this.#levelsDrawer?.setTitle(t('progress.title'));
|
||||
this.#levelsDrawer?.setCloseLabel(t('nav.close'));
|
||||
this.#aboutDrawer?.setTitle(t('about.title'));
|
||||
this.#aboutDrawer?.setCloseLabel(t('nav.close'));
|
||||
this.#about.render();
|
||||
this.#settingsDrawer?.setTitle(t('settings.title'));
|
||||
this.#settingsDrawer?.setCloseLabel(t('nav.close'));
|
||||
this.#panel.render(this.#settings.settings);
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// « À propos » : ce qu'est PyQuest, comment ça marche, licence, contact et crédits (dont l'attribution CC BY 4.0
|
||||
// exigée par la voix française). Contenu construit sans HTML interprété ; textes dans les catalogues fr/en.
|
||||
|
||||
import { el } from './dom.js';
|
||||
|
||||
export const CONTACT_EMAIL = 'dd@linuxtarn.org';
|
||||
export const COPYRIGHT_YEAR = 2026;
|
||||
|
||||
// name, rôle (clé i18n), licence, adresse. Les noms et licences ne se traduisent pas.
|
||||
const CREDITS = [
|
||||
{ name: 'Python (CPython)', role: 'about.credit.python', license: 'PSF License', url: 'https://www.python.org/' },
|
||||
{ name: 'Pyodide', role: 'about.credit.pyodide', license: 'MPL-2.0', url: 'https://pyodide.org/' },
|
||||
{ name: 'Piper', role: 'about.credit.piper', license: 'GPL-3.0', url: 'https://github.com/OHF-Voice/piper1-gpl' },
|
||||
{ name: 'SIWIS French Speech Synthesis Database', role: 'about.credit.voice_fr', license: 'CC BY 4.0', url: 'https://datashare.is.ed.ac.uk/handle/10283/2353' },
|
||||
{ name: 'LJ Speech', role: 'about.credit.voice_en', license: 'Public domain', url: 'https://keithito.com/LJ-Speech-Dataset/' },
|
||||
{ name: 'Atkinson Hyperlegible', role: 'about.credit.font', license: 'OFL 1.1', url: 'https://brailleinstitute.org/freefont' },
|
||||
{ name: 'JetBrains Mono', role: 'about.credit.font_code', license: 'OFL 1.1', url: 'https://www.jetbrains.com/lp/mono/' },
|
||||
{ name: 'js-yaml', role: 'about.credit.yaml', license: 'MIT', url: 'https://github.com/nodeca/js-yaml' },
|
||||
{ name: '@cfworker/json-schema', role: 'about.credit.schema', license: 'MIT', url: 'https://github.com/cfworker/cfworker' },
|
||||
];
|
||||
|
||||
export class AboutPanel {
|
||||
#i18n;
|
||||
#root;
|
||||
|
||||
/** @param {import('../i18n/i18n.js').I18n} i18n */
|
||||
constructor(i18n) {
|
||||
this.#i18n = i18n;
|
||||
this.#root = el('div', { class: 'about' });
|
||||
}
|
||||
|
||||
get element() {
|
||||
return this.#root;
|
||||
}
|
||||
|
||||
render() {
|
||||
const t = (key, params) => this.#i18n.t(key, params);
|
||||
const section = (titleKey, ...content) => el('section', { class: 'about-section' }, el('h3', { text: t(titleKey) }), ...content);
|
||||
const externalLink = (url, text) => el('a', { href: url, target: '_blank', rel: 'noopener noreferrer', text });
|
||||
this.#root.replaceChildren(
|
||||
section('about.what.title', el('p', { text: t('about.what.text') })),
|
||||
section('about.how.title', el('ul', {}, ...[1, 2, 3, 4].map((n) => el('li', { text: t(`about.how.${n}`) })))),
|
||||
section(
|
||||
'about.license.title',
|
||||
el('p', { text: t('about.license.text', { year: COPYRIGHT_YEAR }) }),
|
||||
el('p', {}, el('a', { href: 'LICENSE.txt', target: '_blank', rel: 'noopener', text: t('about.license.read') })),
|
||||
),
|
||||
section('about.contact.title', el('p', {}, t('about.contact.text'), ' ', el('a', { href: `mailto:${CONTACT_EMAIL}`, text: CONTACT_EMAIL }))),
|
||||
section(
|
||||
'about.credits.title',
|
||||
el('p', { text: t('about.credits.intro') }),
|
||||
el(
|
||||
'ul',
|
||||
{ class: 'about-credits' },
|
||||
...CREDITS.map((credit) => el('li', {}, externalLink(credit.url, credit.name), ` — ${t(credit.role)} (${credit.license})`)),
|
||||
),
|
||||
el('p', { class: 'hint', text: t('about.credits.cc') }),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user