Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding some after solve fun facts #321

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/content/challenges-part1.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export const part1 = [
}
},
solution: secrets('chal_1'),
afterSolveText: {
de: '<p>Die Antwort auf die große Frage nach dem Leben, dem Universum und allem lautet ... 42!</p>',
en: '<p>The answer to the ultimate question of life, the universe, and everything is ... 42!</p>',
},
},

{
Expand Down Expand Up @@ -451,6 +455,10 @@ export const part1 = [
correct: trimmed === secrets('chal_4'),
}
},
afterSolveText: {
de: '<p>Die ursprüngliche Version von ASCII enthielt 95 druckbare Zeichen. Unicode enthält mittlerweile mehr als 100 000 Zeichen ... + 500 Aura.</p>',
en: '<p>The original version of ASCII included 95 printable characters. Unicode now contains more than 100,000 characters ... + 500 Aura.</p>',
},
},

{
Expand Down Expand Up @@ -819,7 +827,7 @@ export const part1 = [
document.getElementById('statusbar-user-score').innerHTML = newVal
PowerGlitch.glitch('#statusbar-user-score', {playMode: 'manual'}).startGlitch()

setTimeout(update, Math.random()*1000 + 1500)
setTimeout(update, Math.random() * 1000 + 500)
}

update()
Expand Down Expand Up @@ -1155,6 +1163,10 @@ export const part1 = [
`,
},
solution: secrets('chal_24'),
afterSolveText: {
de: '<p>Ein geübter Leser braucht ungefähr 0,25 Sekunden, um ein Wort zu erkennen.</p>',
en: '<p>An experienced reader takes approximately 0.25 seconds to recognize a word.</p>',
},
},

{
Expand Down Expand Up @@ -2237,6 +2249,10 @@ export const part1 = [
`,
},
solution: secrets('chal_55'),
afterSolveText: {
de: '<p>Die Farbe wurde zum Gedenken an die verstorbene Tochter des CSS-Entwicklers Eric A. Meyer benannt und findet sich im neuen <a href="https://de.m.wikipedia.org/wiki/Datei:Official_CSS_Logo.svg" target="_blank">CSS-Logo</a>.</p>',
en: '<p>The color was named in memory of the late daughter of CSS developer Eric A. Meyer and is featured in the new <a href="https://de.m.wikipedia.org/wiki/Datei:Official_CSS_Logo.svg" target="_blank">CSS logo</a>.</p>',
},
},

{
Expand Down Expand Up @@ -4264,6 +4280,10 @@ PIXI.loader
`,
},
solution: secrets('chal_336'),
afterSolveText: {
de: '<p>Durch Bugs kann Bedrock auch im Survival Mode abgebaut werden.</p>',
en: '<p>Due to bugs, bedrock can also be mined in Survival mode.</p>',
},
},

{
Expand Down
1 change: 1 addition & 0 deletions src/data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export interface HtwChallenge {
| Promise<boolean>
| Promise<{ rawAnswer?: boolean; answer: string; correct: boolean }>
hidesubmit?: boolean
afterSolveText?: { de: string; en: string }
}

export interface ChallengeStatsData {
Expand Down
5 changes: 5 additions & 0 deletions src/server/routes/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,10 @@ export function setupChallenges(App) {
? hintsData[challenge.id].entries.length
: 0

const afterSolveText = challenge.afterSolveText
? challenge.afterSolveText[req.lng]
: ''

renderPage(App, req, res, {
page: 'challenge',
props: {
Expand All @@ -491,6 +495,7 @@ export function setupChallenges(App) {
lastSolvedUserName,
author,
hintsCount,
afterSolveText,
},
backButton: false,
title: challengeTitle,
Expand Down
1 change: 1 addition & 0 deletions src/server/views/pages/challenge.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function goBack() {
<div style="height:16px"></div>

<% if (props.correct === true) { %>
<%- props.afterSolveText %>
<p><a href="<%=prefix%>/map"><%= t('continue') %></a></p>
<% } else { %>
<%- props.html %>
Expand Down
Loading