diff --git a/components/playground/element.css b/components/playground/element.css index f4e0a03be..80a5c2ee9 100644 --- a/components/playground/element.css +++ b/components/playground/element.css @@ -102,10 +102,35 @@ grid-area: runner; overflow: hidden; - mdn-play-runner { + mdn-play-runner, + .overlay-run-button { flex-grow: 1; border: var(--border); border-radius: 0.25rem; + + &.hidden { + display: none; + } + } + + .overlay-run-button { + border-color: currentcolor; + } + + .overlay-run-button--header { + font-size: clamp(1.5rem, 3vw, 3rem); + + svg { + width: clamp(1.5rem, 3vw, 3rem) !important; + height: clamp(1.5rem, 3vw, 3rem) !important; + vertical-align: bottom; + } + } + + .overlay-run-button--body { + margin-top: 0.5rem; + line-height: var(--font-line-normal); + color: var(--color-text-secondary); } .playground__console { diff --git a/components/playground/element.js b/components/playground/element.js index 66b780e4a..36babdb89 100644 --- a/components/playground/element.js +++ b/components/playground/element.js @@ -4,6 +4,7 @@ import { createRef, ref } from "lit/directives/ref.js"; import { L10nMixin } from "../../l10n/mixin.js"; import { gleanClick } from "../../utils/glean.js"; +import circlePlay from "../icon/circle-play.svg?lit"; import warningIcon from "../icon/triangle-alert.svg?lit"; import { globalUser } from "../user/context.js"; @@ -66,6 +67,7 @@ export class MDNPlayground extends L10nMixin(LitElement) { this._autoRun = true; controller.runOnChange = true; this._storeSession(); + this.requestUpdate(); } } } @@ -402,7 +404,23 @@ ${"```"}`, ` : nothing} - + ${this._autoRun + ? nothing + : html` +
+ ${circlePlay} ${this.l10n("playground-run")`Run`} +
+
+ ${this.l10n.raw({ id: "playground-user-shared-warning" })} +
+
`} +
${this.l10n("playground-console")`Console`}
diff --git a/l10n/locales/en-US.ftl b/l10n/locales/en-US.ftl index 1fa813120..19c144388 100644 --- a/l10n/locales/en-US.ftl +++ b/l10n/locales/en-US.ftl @@ -16,6 +16,8 @@ baseline-unsupported-in = Not widely supported in { $browsers } baseline-supported-and-unsupported-in = Supported in { $supported }, but not widely supported in { $unsupported } homepage-hero-title = Resources for Developers,
by Developers + +playground-user-shared-warning = This is a user-shared playground.
Always inspect the code before running it. homepage-hero-description = Documenting CSS, HTML, and JavaScript, since 2005. not-found-title = Page not found diff --git a/l10n/locales/fr.ftl b/l10n/locales/fr.ftl index 9fcd73d28..f4dbb25d7 100644 --- a/l10n/locales/fr.ftl +++ b/l10n/locales/fr.ftl @@ -272,6 +272,7 @@ playground-share = Partager playground-clear = Effacer playground-reset = Réinitialiser playground-seeing-something-inappropriate = Voir quelque chose d'inapproprié ? +playground-user-shared-warning = Il s'agit d'un terrain d'essai partagé par un·e utilisateur·ice.
Inspectez toujours le code avant de l'exécuter. playground-console = Console playground-share-markdown = Partager le Markdown playground-copy-markdown-to-clipboard = Copier le Markdown dans le presse-papiers diff --git a/l10n/template.ftl b/l10n/template.ftl index 5863e64a6..4f669a380 100644 --- a/l10n/template.ftl +++ b/l10n/template.ftl @@ -11,6 +11,7 @@ baseline-supported-in = Supported in { $browsers } baseline-unsupported-in = Not widely supported in { $browsers } baseline-supported-and-unsupported-in = Supported in { $supported }, but not widely supported in { $unsupported } homepage-hero-title = Resources for Developers,
by Developers +playground-user-shared-warning = This is a user-shared playground.
Always inspect the code before running it. homepage-hero-description = Documenting CSS, HTML, and JavaScript, since 2005. not-found-title = Page not found not-found-description = Sorry, the page { $url } could not be found.