mirror of
https://github.com/deunix-educ/PyQuest.git
synced 2026-11-25 08:19:44 +01:00
Apply visual identity: palette B, Atkinson/JetBrains fonts, split CSS, syntax-highlighted editor, owl icon
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 Braille Institute of America, Inc. AtkinsonHyperlegible-Italic.ttf: Copyright 2020 Braille Institute of America, Inc. AtkinsonHyperlegible-Bold.ttf: Copyright 2020 Braille Institute of America, Inc. AtkinsonHyperlegible-BoldItalic.ttf: Copyright 2020 Braille Institute of America, Inc.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono) JetBrainsMono-Italic[wght].ttf: Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+159
-225
@@ -1,57 +1,10 @@
|
||||
/* Styles de l'application : jetons de thème, clair/sombre, taille réglable, focus visible. */
|
||||
|
||||
:root {
|
||||
--bg: #ffffff;
|
||||
--surface: #f4f6fa;
|
||||
--text: #1b1f27;
|
||||
--muted: #4a5365;
|
||||
--border: #b8c0cf;
|
||||
--accent: #1d4ed8;
|
||||
--accent-text: #ffffff;
|
||||
--ok: #146c2e;
|
||||
--ko: #a31515;
|
||||
--focus: #b45309;
|
||||
/* Réglable par SettingsPanel : html { font-size: calc(var(--font-scale) * 100%) } */
|
||||
--font-scale: 1;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #12151c;
|
||||
--surface: #1c212c;
|
||||
--text: #eceff5;
|
||||
--muted: #b3bccd;
|
||||
--border: #4a5365;
|
||||
--accent: #8ab4ff;
|
||||
--accent-text: #0b1020;
|
||||
--ok: #6ee08a;
|
||||
--ko: #ff8a8a;
|
||||
--focus: #ffcc66;
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #12151c;
|
||||
--surface: #1c212c;
|
||||
--text: #eceff5;
|
||||
--muted: #b3bccd;
|
||||
--border: #4a5365;
|
||||
--accent: #8ab4ff;
|
||||
--accent-text: #0b1020;
|
||||
--ok: #6ee08a;
|
||||
--ko: #ff8a8a;
|
||||
--focus: #ffcc66;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: calc(var(--font-scale) * 100%);
|
||||
}
|
||||
/* Base : corps de page, focus, boutons, en-tête, notebook, tiroirs, toasts, réglages. */
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
font-family: var(--font-ui);
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
@@ -60,26 +13,33 @@ body {
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.notebook {
|
||||
max-width: 48rem;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
/* L'attribut hidden doit toujours l'emporter sur les règles display des composants. */
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.notebook-status {
|
||||
color: var(--muted);
|
||||
min-height: 1.5em;
|
||||
code,
|
||||
pre {
|
||||
font-family: var(--font-code);
|
||||
/* Pas de ligatures : un débutant doit voir exactement les caractères tapés (>= et non ≥). */
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
.explain,
|
||||
.cell {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
margin: 1rem 0;
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
left: 1rem;
|
||||
top: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
/* Boutons */
|
||||
.btn {
|
||||
min-height: 2.75rem; /* cible tactile confortable (WCAG 2.5.8) */
|
||||
padding: 0.4rem 1rem;
|
||||
@@ -102,167 +62,6 @@ body {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.cell-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
.code-editor {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
|
||||
font-size: 1rem;
|
||||
padding: 0.75rem;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.375rem;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
.cell-shortcut {
|
||||
margin: 0.25rem 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.cell-output {
|
||||
min-height: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--bg);
|
||||
border-left: 4px solid var(--border);
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.feedback-ok {
|
||||
color: var(--ok);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.feedback-ko,
|
||||
.error-title {
|
||||
color: var(--ko);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.hint-list {
|
||||
flex-basis: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toast-region {
|
||||
position: fixed;
|
||||
right: 1rem;
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
max-width: calc(100vw - 2rem);
|
||||
}
|
||||
|
||||
.toast {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
align-items: center;
|
||||
padding: 0.75rem 1rem;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
border: 2px solid var(--accent);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.level-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.level-button {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
margin: 0.25rem 0;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.375rem;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.level-button.is-current {
|
||||
border-width: 3px;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.setting {
|
||||
display: grid;
|
||||
grid-template-columns: 8rem 1fr;
|
||||
gap: 0.75rem;
|
||||
align-items: center;
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
.setting select,
|
||||
.setting input[type="range"] {
|
||||
width: 100%;
|
||||
min-height: 2.5rem;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.setting input[type="checkbox"] {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
.setting > .btn:only-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
left: 1rem;
|
||||
top: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.explain > :first-child,
|
||||
.cell > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.level-button {
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem 0.75rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.level-title {
|
||||
flex: 1 1 8rem;
|
||||
}
|
||||
|
||||
.level-state {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* En-tête : accès aux niveaux (gauche), niveau courant avec navigation (centre), réglages (droite). */
|
||||
.app-header {
|
||||
display: grid;
|
||||
@@ -281,6 +80,18 @@ body {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.brand img {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.app-heading h1 {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
@@ -306,6 +117,59 @@ body {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Notebook */
|
||||
.notebook {
|
||||
max-width: 48rem;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.notebook-status {
|
||||
color: var(--muted);
|
||||
min-height: 1.5em;
|
||||
}
|
||||
|
||||
.explain {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.explain > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.explain code {
|
||||
background: var(--code);
|
||||
padding: 0.05rem 0.3rem;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
.toast-region {
|
||||
position: fixed;
|
||||
right: 1rem;
|
||||
bottom: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
max-width: calc(100vw - 2rem);
|
||||
z-index: 40;
|
||||
}
|
||||
|
||||
.toast {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
align-items: center;
|
||||
padding: 0.75rem 1rem;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
border: 2px solid var(--accent);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
/* Tiroirs coulissants. Fermés : visibility:hidden (hors navigation clavier), ouverts : glissent. */
|
||||
.drawer-overlay {
|
||||
position: fixed;
|
||||
@@ -375,6 +239,7 @@ body {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* Progression */
|
||||
.progress-bar {
|
||||
width: 100%;
|
||||
height: 1rem;
|
||||
@@ -383,7 +248,69 @@ body {
|
||||
|
||||
.progress-count {
|
||||
margin: 0 0 0.25rem;
|
||||
font-weight: 600;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.level-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.level-button {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
gap: 0.25rem 0.75rem;
|
||||
width: 100%;
|
||||
margin: 0.25rem 0;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.375rem;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.level-button.is-current {
|
||||
border-width: 3px;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.level-title {
|
||||
flex: 1 1 8rem;
|
||||
}
|
||||
|
||||
.level-state {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Réglages */
|
||||
.setting {
|
||||
display: grid;
|
||||
grid-template-columns: 8rem 1fr;
|
||||
gap: 0.75rem;
|
||||
align-items: center;
|
||||
margin: 0.75rem 0;
|
||||
}
|
||||
|
||||
.setting select,
|
||||
.setting input[type="range"] {
|
||||
width: 100%;
|
||||
min-height: 2.5rem;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.setting input[type="checkbox"] {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
justify-self: start;
|
||||
accent-color: var(--accent);
|
||||
}
|
||||
|
||||
.setting > .btn:only-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
@media (max-width: 40rem) {
|
||||
@@ -396,3 +323,10 @@ body {
|
||||
grid-row: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
/* Cellules de code : éditeur coloré, actions, sortie, retours de validation, indices, saisie. */
|
||||
|
||||
.cell {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.cell > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.cell-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
.cell-shortcut {
|
||||
margin: 0.25rem 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
/* Éditeur : un <textarea> réel (clavier, lecteurs d'écran) dont le texte est rendu transparent, au-dessus
|
||||
d'un <pre> qui affiche le même code coloré. Même police, mêmes marges et même retour à la ligne. */
|
||||
.code-editor-wrap {
|
||||
position: relative;
|
||||
background: var(--code);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.code-editor-wrap:focus-within {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 2px var(--accent);
|
||||
}
|
||||
|
||||
.code-highlight,
|
||||
.code-editor {
|
||||
margin: 0;
|
||||
padding: 0.75rem;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
font-family: var(--font-code);
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
tab-size: 4;
|
||||
white-space: pre;
|
||||
overflow: auto;
|
||||
border: 0;
|
||||
letter-spacing: 0;
|
||||
word-spacing: 0;
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
.code-highlight {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
color: var(--text);
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.code-editor {
|
||||
position: relative;
|
||||
display: block;
|
||||
resize: none;
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
caret-color: var(--text);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.code-editor::selection {
|
||||
background: color-mix(in srgb, var(--accent) 35%, transparent);
|
||||
}
|
||||
|
||||
.tok-keyword {
|
||||
color: var(--tok-keyword);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tok-string {
|
||||
color: var(--tok-string);
|
||||
}
|
||||
|
||||
.tok-number {
|
||||
color: var(--tok-number);
|
||||
}
|
||||
|
||||
.tok-comment {
|
||||
color: var(--tok-comment);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tok-builtin {
|
||||
color: var(--tok-builtin);
|
||||
}
|
||||
|
||||
.tok-def {
|
||||
color: var(--tok-def);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cell-output {
|
||||
min-height: 1.5rem;
|
||||
margin: 0.5rem 0;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--bg);
|
||||
border-left: 4px solid var(--border);
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.feedback-ok {
|
||||
color: var(--ok);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.feedback-ko,
|
||||
.error-title {
|
||||
color: var(--ko);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hint-list {
|
||||
flex-basis: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cell-input {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
.cell-input-field {
|
||||
flex: 1 1 12rem;
|
||||
min-height: 2.5rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-family: var(--font-code);
|
||||
font-variant-ligatures: none;
|
||||
font-size: 1rem;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/* Identité visuelle : palette « Forêt & Corail », typographie Atkinson Hyperlegible + JetBrains Mono.
|
||||
Jetons de couleur clair/sombre (rapports de contraste vérifiés par tests/js/theme-contrast.test.mjs),
|
||||
polices auto-hébergées (COEP : aucune ressource cross-origin), taille de texte réglable. */
|
||||
|
||||
@font-face {
|
||||
font-family: "Atkinson Hyperlegible";
|
||||
src: url("../assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Atkinson Hyperlegible";
|
||||
src: url("../assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--font-ui: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
||||
--font-code: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
|
||||
/* Réglable par SettingsPanel : html { font-size: calc(var(--font-scale) * 100%) } */
|
||||
--font-scale: 1;
|
||||
|
||||
/* Clair */
|
||||
--bg: #ffffff;
|
||||
--surface: #f3f7f6;
|
||||
--code: #ebf2f0;
|
||||
--text: #16231f;
|
||||
--muted: #475b55;
|
||||
--border: #b4c4bf;
|
||||
--accent: #0f766e;
|
||||
--accent-text: #ffffff;
|
||||
--hl: #c2410c; /* corail : XP, focus */
|
||||
--focus: #c2410c;
|
||||
--ok: #166534;
|
||||
--ko: #b42318;
|
||||
--tok-keyword: #9a3412;
|
||||
--tok-string: #166534;
|
||||
--tok-number: #1d4ed8;
|
||||
--tok-comment: #4f625c;
|
||||
--tok-builtin: #0f766e;
|
||||
--tok-def: #6d28d9;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #0f1715;
|
||||
--surface: #18231f;
|
||||
--code: #121c19;
|
||||
--text: #e8f1ee;
|
||||
--muted: #a9bdb6;
|
||||
--border: #41544e;
|
||||
--accent: #5eead4;
|
||||
--accent-text: #04201c;
|
||||
--hl: #fdba74;
|
||||
--focus: #fdba74;
|
||||
--ok: #86efac;
|
||||
--ko: #fda4af;
|
||||
--tok-keyword: #fdba74;
|
||||
--tok-string: #86efac;
|
||||
--tok-number: #93c5fd;
|
||||
--tok-comment: #9db0a9;
|
||||
--tok-builtin: #5eead4;
|
||||
--tok-def: #c4b5fd;
|
||||
}
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #0f1715;
|
||||
--surface: #18231f;
|
||||
--code: #121c19;
|
||||
--text: #e8f1ee;
|
||||
--muted: #a9bdb6;
|
||||
--border: #41544e;
|
||||
--accent: #5eead4;
|
||||
--accent-text: #04201c;
|
||||
--hl: #fdba74;
|
||||
--focus: #fdba74;
|
||||
--ok: #86efac;
|
||||
--ko: #fda4af;
|
||||
--tok-keyword: #fdba74;
|
||||
--tok-string: #86efac;
|
||||
--tok-number: #93c5fd;
|
||||
--tok-comment: #9db0a9;
|
||||
--tok-builtin: #5eead4;
|
||||
--tok-def: #c4b5fd;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: calc(var(--font-scale) * 100%);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
+13
-3
@@ -1,5 +1,15 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="PyQuest">
|
||||
<rect width="512" height="512" rx="96" fill="#1d4ed8"/>
|
||||
<path d="M150 200l-70 56 70 56M362 200l70 56-70 56" fill="none" stroke="#ffffff" stroke-width="36" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M286 150l-60 212" fill="none" stroke="#ffcc66" stroke-width="36" stroke-linecap="round"/>
|
||||
<rect width="512" height="512" fill="#0f766e"/>
|
||||
<g transform="translate(96 88) scale(2.67)">
|
||||
<ellipse cx="60" cy="68" rx="38" ry="42" fill="#d7ebe6"/>
|
||||
<path d="M30 38 L38 14 L52 30 Z M90 38 L82 14 L68 30 Z" fill="#d7ebe6"/>
|
||||
<circle cx="44" cy="58" r="15" fill="#ffffff"/>
|
||||
<circle cx="76" cy="58" r="15" fill="#ffffff"/>
|
||||
<circle cx="46" cy="59" r="7" fill="#16231f"/>
|
||||
<circle cx="74" cy="59" r="7" fill="#16231f"/>
|
||||
<circle cx="48" cy="56" r="2.2" fill="#ffffff"/>
|
||||
<circle cx="76" cy="56" r="2.2" fill="#ffffff"/>
|
||||
<path d="M54 72 L66 72 L60 84 Z" fill="#ea580c"/>
|
||||
<ellipse cx="60" cy="92" rx="22" ry="14" fill="#ffffff" opacity="0.75"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 834 B |
+9
-3
@@ -3,11 +3,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#1d4ed8">
|
||||
<meta name="theme-color" content="#0f766e">
|
||||
<title>PyQuest</title>
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
<link rel="icon" href="icons/icon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
<link rel="apple-touch-icon" href="icons/icon-180.png">
|
||||
<link rel="stylesheet" href="css/themes.css">
|
||||
<link rel="stylesheet" href="css/base.css">
|
||||
<link rel="stylesheet" href="css/cells.css">
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Aller au contenu / Skip to content</a>
|
||||
@@ -15,7 +18,10 @@
|
||||
<header class="app-header">
|
||||
<button type="button" class="btn" id="levels-toggle"></button>
|
||||
<div class="app-heading">
|
||||
<h1 id="app-title">PyQuest</h1>
|
||||
<div class="brand">
|
||||
<img src="icons/icon.svg" alt="" width="32" height="32">
|
||||
<h1 id="app-title">PyQuest</h1>
|
||||
</div>
|
||||
<nav class="level-nav" id="level-nav">
|
||||
<button type="button" class="btn" id="level-prev"><span aria-hidden="true">‹</span></button>
|
||||
<span class="level-current" id="level-current"></span>
|
||||
|
||||
+11
-13
@@ -2,6 +2,7 @@
|
||||
// Émet les événements 'run' (detail: { code }), 'stop' et 'reset'. Aucune logique d'exécution ici.
|
||||
|
||||
import { el, renderInline, uniqueId } from './dom.js';
|
||||
import { CodeEditor } from './CodeEditor.js';
|
||||
import { HintPanel } from './HintPanel.js';
|
||||
|
||||
export class CellView extends EventTarget {
|
||||
@@ -33,19 +34,16 @@ export class CellView extends EventTarget {
|
||||
|
||||
const editorId = uniqueId('editor');
|
||||
const outputId = uniqueId('output');
|
||||
this.#editor = el('textarea', {
|
||||
id: editorId,
|
||||
class: 'code-editor',
|
||||
spellcheck: 'false',
|
||||
autocapitalize: 'off',
|
||||
autocomplete: 'off',
|
||||
autocorrect: 'off',
|
||||
rows: Math.max(3, starter.split('\n').length + 1),
|
||||
'aria-label': i18n.t('cell.editor'),
|
||||
'aria-describedby': `${editorId}-hint`,
|
||||
onkeydown: (event) => this.#onKeyDown(event),
|
||||
this.#editor = new CodeEditor({
|
||||
value: starter,
|
||||
attrs: {
|
||||
id: editorId,
|
||||
rows: Math.max(3, starter.split('\n').length + 1),
|
||||
'aria-label': i18n.t('cell.editor'),
|
||||
'aria-describedby': `${editorId}-hint`,
|
||||
},
|
||||
onKeyDown: (event) => this.#onKeyDown(event),
|
||||
});
|
||||
this.#editor.value = starter;
|
||||
|
||||
this.#runButton = el('button', { type: 'button', class: 'btn btn-primary cell-run', text: i18n.t('cell.run'), onclick: () => this.#emitRun() });
|
||||
this.#stopButton = el('button', {
|
||||
@@ -79,7 +77,7 @@ export class CellView extends EventTarget {
|
||||
'section',
|
||||
{ class: 'cell', tabindex: '-1' },
|
||||
el('p', { class: 'cell-instruction' }, renderInline(instruction)),
|
||||
this.#editor,
|
||||
this.#editor.element,
|
||||
el('p', { id: `${editorId}-hint`, class: 'cell-shortcut', text: i18n.t('cell.shortcut') }),
|
||||
el('div', { class: 'cell-actions' }, this.#runButton, this.#stopButton, resetButton, new HintPanel(i18n, hints).element),
|
||||
this.#output,
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
// Éditeur de code coloré. Un <textarea> réel reste le contrôle (clavier, lecteurs d'écran,
|
||||
// saisie mobile) ; un <pre> placé derrière affiche le même code coloré (aria-hidden).
|
||||
|
||||
import { el } from './dom.js';
|
||||
import { tokenizePython } from './highlightPython.js';
|
||||
|
||||
const MIN_ROWS = 3;
|
||||
|
||||
export class CodeEditor {
|
||||
#root;
|
||||
#textarea;
|
||||
#highlight;
|
||||
|
||||
/**
|
||||
* @param {object} options
|
||||
* @param {string} options.value
|
||||
* @param {Record<string, string>} [options.attrs] Attributs du textarea (id, aria-label…).
|
||||
* @param {(event: KeyboardEvent) => void} [options.onKeyDown]
|
||||
*/
|
||||
constructor({ value, attrs = {}, onKeyDown = () => {} }) {
|
||||
this.#highlight = el('pre', { class: 'code-highlight', 'aria-hidden': 'true' });
|
||||
this.#textarea = el('textarea', {
|
||||
class: 'code-editor',
|
||||
wrap: 'off',
|
||||
spellcheck: 'false',
|
||||
autocapitalize: 'off',
|
||||
autocomplete: 'off',
|
||||
autocorrect: 'off',
|
||||
...attrs,
|
||||
oninput: () => this.#render(),
|
||||
onscroll: () => this.#syncScroll(),
|
||||
onkeydown: onKeyDown,
|
||||
});
|
||||
this.#root = el('div', { class: 'code-editor-wrap' }, this.#highlight, this.#textarea);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
get element() {
|
||||
return this.#root;
|
||||
}
|
||||
|
||||
get value() {
|
||||
return this.#textarea.value;
|
||||
}
|
||||
|
||||
set value(code) {
|
||||
this.#textarea.value = code;
|
||||
this.#render();
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.#textarea.focus();
|
||||
}
|
||||
|
||||
#render() {
|
||||
const code = this.#textarea.value;
|
||||
this.#textarea.rows = Math.max(MIN_ROWS, code.split('\n').length + 1);
|
||||
const nodes = tokenizePython(code).map(({ type, text }) =>
|
||||
type === 'text' ? document.createTextNode(text) : el('span', { class: `tok-${type}`, text }),
|
||||
);
|
||||
this.#highlight.replaceChildren(...nodes);
|
||||
this.#syncScroll();
|
||||
}
|
||||
|
||||
#syncScroll() {
|
||||
this.#highlight.scrollTop = this.#textarea.scrollTop;
|
||||
this.#highlight.scrollLeft = this.#textarea.scrollLeft;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// Coloration syntaxique Python minimale, sans dépendance : découpe le code en jetons typés.
|
||||
// Tolérante (jamais d'exception sur du code incomplet) et sans perte : la concaténation des
|
||||
// textes des jetons redonne exactement le code d'entrée.
|
||||
|
||||
const KEYWORDS = new Set([
|
||||
'False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del',
|
||||
'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal',
|
||||
'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield',
|
||||
]);
|
||||
|
||||
const BUILTINS = new Set([
|
||||
'abs', 'all', 'any', 'bool', 'dict', 'enumerate', 'filter', 'float', 'input', 'int', 'isinstance', 'len', 'list',
|
||||
'map', 'max', 'min', 'open', 'print', 'range', 'reversed', 'round', 'set', 'sorted', 'str', 'sum', 'tuple', 'type', 'zip',
|
||||
]);
|
||||
|
||||
// Ordre des alternatives = priorité : commentaire, chaîne triple, chaîne simple, nombre, identifiant, autre.
|
||||
// Les rétro-références comptent aussi les groupes nommés : \3 = guillemets triples, \5 = guillemet simple.
|
||||
const TOKEN = new RegExp(
|
||||
[
|
||||
String.raw`(?<comment>#[^\n]*)`,
|
||||
String.raw`(?<triple>(?:[rRuUbBfF]{0,2})("""|''')[\s\S]*?(?:\3|$))`,
|
||||
String.raw`(?<string>(?:[rRuUbBfF]{0,2})(["'])(?:\\.|(?!\5)[^\\\n])*(?:\5|(?=\n)|$))`,
|
||||
String.raw`(?<number>\d+(?:_\d+)*(?:\.\d+)?(?:[eE][+-]?\d+)?|\.\d+)`,
|
||||
String.raw`(?<identifier>[A-Za-z_À-ÿ][\wÀ-ÿ]*)`,
|
||||
String.raw`(?<other>[\s\S])`,
|
||||
].join('|'),
|
||||
'y',
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {string} code
|
||||
* @returns {{type: 'keyword'|'string'|'number'|'comment'|'builtin'|'def'|'text', text: string}[]}
|
||||
*/
|
||||
export function tokenizePython(code) {
|
||||
const tokens = [];
|
||||
let expectName = false; // vrai juste après `def` ou `class` : le prochain identifiant est un nom défini
|
||||
TOKEN.lastIndex = 0;
|
||||
while (TOKEN.lastIndex < code.length) {
|
||||
const match = TOKEN.exec(code);
|
||||
const { comment, triple, string, number, identifier } = match.groups;
|
||||
let type = 'text';
|
||||
if (comment !== undefined) {
|
||||
type = 'comment';
|
||||
} else if (triple !== undefined || string !== undefined) {
|
||||
type = 'string';
|
||||
} else if (number !== undefined) {
|
||||
type = 'number';
|
||||
} else if (identifier !== undefined) {
|
||||
if (KEYWORDS.has(identifier)) {
|
||||
type = 'keyword';
|
||||
expectName = identifier === 'def' || identifier === 'class';
|
||||
} else {
|
||||
type = expectName ? 'def' : BUILTINS.has(identifier) ? 'builtin' : 'text';
|
||||
expectName = false;
|
||||
}
|
||||
}
|
||||
// Les espaces entre `def` et le nom ne rompent pas l'attente ; tout autre jeton la rompt.
|
||||
if (identifier === undefined && !/^\s+$/.test(match[0])) {
|
||||
expectName = false;
|
||||
}
|
||||
// Fusionne les jetons « texte » adjacents pour limiter le nombre de nœuds.
|
||||
const last = tokens.at(-1);
|
||||
if (type === 'text' && last?.type === 'text') {
|
||||
last.text += match[0];
|
||||
} else {
|
||||
tokens.push({ type, text: match[0] });
|
||||
}
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
@@ -6,10 +6,32 @@
|
||||
"start_url": "./",
|
||||
"scope": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#12151c",
|
||||
"theme_color": "#1d4ed8",
|
||||
"background_color": "#0f1715",
|
||||
"theme_color": "#0f766e",
|
||||
"icons": [
|
||||
{ "src": "icons/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any" },
|
||||
{ "src": "icons/icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "maskable" }
|
||||
{
|
||||
"src": "icons/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
// - Pyodide vendorisé, niveaux, scripts : mis en cache à la première utilisation (hors ligne ensuite).
|
||||
// Les en-têtes COOP/COEP du document viennent du serveur ; ce worker ne les fabrique pas.
|
||||
|
||||
const CACHE_VERSION = 'pyquest-v2';
|
||||
const CACHE_VERSION = 'pyquest-v3';
|
||||
|
||||
const SHELL = ['./', 'index.html', 'manifest.webmanifest', 'css/app.css', 'icons/icon.svg', 'js/main.js'];
|
||||
const SHELL = ['./', 'index.html', 'manifest.webmanifest', 'css/themes.css', 'css/base.css', 'css/cells.css', 'icons/icon.svg', 'js/main.js'];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(caches.open(CACHE_VERSION).then((cache) => cache.addAll(SHELL)));
|
||||
|
||||
Reference in New Issue
Block a user