guess-the-year-web-component 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/guess-the-year.d.ts.map +1 -1
- package/dist/guess-the-year.js +17 -8
- package/dist/guess-the-year.js.map +1 -1
- package/dist/lib/ApiService.d.ts.map +1 -1
- package/dist/lib/ApiService.js +14 -9
- package/dist/lib/ApiService.js.map +1 -1
- package/dist/lib/Util.d.ts +1 -0
- package/dist/lib/Util.d.ts.map +1 -1
- package/dist/lib/Util.js +19 -0
- package/dist/lib/Util.js.map +1 -1
- package/dist/lib/i18n/EN.d.ts.map +1 -1
- package/dist/lib/i18n/EN.js +18 -2
- package/dist/lib/i18n/EN.js.map +1 -1
- package/dist/lib/i18n/NL.d.ts.map +1 -1
- package/dist/lib/i18n/NL.js +21 -5
- package/dist/lib/i18n/NL.js.map +1 -1
- package/dist/main.js +55 -48
- package/package.json +1 -1
- package/src/guess-the-year.ts +17 -8
- package/src/lib/ApiService.ts +14 -9
- package/src/lib/Util.ts +12 -0
- package/src/lib/i18n/EN.ts +18 -2
- package/src/lib/i18n/NL.ts +21 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guess-the-year.d.ts","sourceRoot":"","sources":["../src/guess-the-year.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5E,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAwB,MAAM,gBAAgB,CAAC;AAqBhE,qBACa,YAAa,SAAQ,UAAU;IAE1C,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,OAAO,CAA0B;IAEzC,IAAI,OAAO,IAIQ,OAAO,CAFzB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAGD,UAAU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OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,eAAe;IAmEvB,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,WAAW;IAYb,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA8EpC,OAAO,CAAC,iBAAiB;IA4DzB,aAAa,IAAI,cAAc;IAa/B,qBAAqB,QAAS,KAAK,YAAY,QAAQ,uBAiCrD;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
package/dist/guess-the-year.js
CHANGED
|
@@ -72,7 +72,7 @@ let GuessTheYear = class GuessTheYear extends LitElement {
|
|
|
72
72
|
this._handleImageLoadError = (evt, incident) => {
|
|
73
73
|
// grab the image element that triggered the error
|
|
74
74
|
const targetImage = evt.target;
|
|
75
|
-
console.debug(`Error loading image: ${targetImage.src}`);
|
|
75
|
+
console.debug(`Error loading image: ${targetImage.src} `);
|
|
76
76
|
// find out which no image source needs to be used
|
|
77
77
|
const noImageSrc = this.noImageSrc || NoImageImg;
|
|
78
78
|
// don't try to set the image source if it
|
|
@@ -508,12 +508,21 @@ let GuessTheYear = class GuessTheYear extends LitElement {
|
|
|
508
508
|
}
|
|
509
509
|
renderGameEnd() {
|
|
510
510
|
console.debug("renderGameEnd");
|
|
511
|
+
const maxScore = this.numberOfQuestions * this._score;
|
|
512
|
+
const scoreRatio = Math.round((this.totalScore / maxScore) * 100);
|
|
511
513
|
return html `
|
|
512
514
|
${this._renderHeader("The end!")}
|
|
513
|
-
<div class="guess-the-year-game-end"
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
<div class="guess-the-year-game-end">
|
|
516
|
+
<p>
|
|
517
|
+
${this.i18n.translate("end").replace(/__SCORE__/, this.totalScore + '').replace(/__MAX_SCORE__/, maxScore + '').replace(/__PERCENT__/, scoreRatio + '')}
|
|
518
|
+
</p>
|
|
519
|
+
<p>
|
|
520
|
+
${this.i18n.translate(Util.scoreToValueJudgement(scoreRatio))}
|
|
521
|
+
</p>
|
|
522
|
+
</div>
|
|
523
|
+
<button @click="${() => (this._renderState = GameState.SPLASH)}" >
|
|
524
|
+
${this.i18n.translate("new-game")}
|
|
525
|
+
</button>
|
|
517
526
|
${this._renderFooter()}
|
|
518
527
|
`;
|
|
519
528
|
}
|
|
@@ -629,10 +638,10 @@ let GuessTheYear = class GuessTheYear extends LitElement {
|
|
|
629
638
|
}
|
|
630
639
|
// deduplicate array via [...new Set(this.sources)]
|
|
631
640
|
return html `
|
|
632
|
-
<div class="guess-the-year-sources">
|
|
641
|
+
<div class="guess-the-year-sources" >
|
|
633
642
|
Source: ${[...new Set(this.sources)].join(", ")}
|
|
634
|
-
|
|
635
|
-
|
|
643
|
+
</div>
|
|
644
|
+
`;
|
|
636
645
|
}
|
|
637
646
|
};
|
|
638
647
|
GuessTheYear.styles = css `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guess-the-year.js","sourceRoot":"","sources":["../src/guess-the-year.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBA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EAAE,cAAc,EAAE,CAAC;gDAC9B;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;oDAC1B;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;8CAC9B;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACuC;AAM3G;IADP,KAAK,EAAE;+CAC4C;AAK5C;IADP,KAAK,EAAE;2CACsC;AAQtC;IADP,KAAK,EAAE;+CAC0C;AAG3C;IADN,KAAK,EAAE;kDACqC;AAGrC;IADP,KAAK,EAAE;4CACY;AAMZ;IADP,KAAK,EAAE;6CACwC;AA3HrC,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CA6zBxB","sourcesContent":["import { LitElement, css, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport dayjs from \"dayjs\";\nimport { Dayjs } from \"dayjs\";\nconst { setTimeout } = window;\nimport { Incident, Categories, Category } from \"./lib/Incident\";\nimport { NoImageImg } from \"./lib/Icon\";\nimport { ApiService, ContentFeedback } from \"./lib/ApiService\";\nimport { Util } from \"./lib/Util\";\nimport { i18nFactory } from \"./lib/i18n/i18n\";\nimport { GameState } from \"./lib/enums\";\nimport stylesheet from \"./scss/main.scss\";\nimport { QuestionScoreController } from \"./lib/controller/scorecontroller\";\n\nconst SPLASH_DELAY: number = 1000;\nconst MAX_QUESTIONS: number = 10;\nconst HINT_COST: number = 2;\nconst MIN_YEAR: number = 1950;\nconst MAX_YEAR: number = parseInt(dayjs().format('YYYY'), 10);\nconst GTY_FROM_YEAR_VAR = 'gty-from-year';\nconst GTY_TO_YEAR_VAR = 'gty-to-year';\nconst GTY_NUM_QUESTIONS_VAR = 'gty-number-of-questions';\nconst MAX_DOB: number = 1915;\nconst MIN_DOB: number = parseInt(dayjs().format('YYYY'), 10) - 10;\nconst GTY_PLAYER_DOB_VAR = 'gty-player-dob';\n\n@customElement(\"guess-the-year\")\nexport class GuessTheYear extends LitElement {\n\n private sources: Array<string> = [];\n private _loading = false;\n\n private _score0: QuestionScoreController;\n\n get loading() {\n return this._loading;\n }\n\n set loading(value: boolean) {\n this._loading = value;\n }\n\n @property({ type: String, attribute: \"tee-e-api-url\" })\n teeeApiUrl: string = \"https://api.tee-e.com\";\n\n @property({ type: Boolean, attribute: \"report-broken-images\" })\n reportBrokenImages: boolean = false;\n\n @property({ type: String })\n date: string = \"\";\n\n @property({ type: String })\n country: string = \"\";\n\n @property({ type: String })\n category: string = \"\";\n\n @property({ type: String })\n emotion: string = \"\";\n\n @property({ type: String })\n impact: string = \"\";\n\n @property({\n type: Dayjs,\n converter: {\n fromAttribute: (value: string) => {\n console.debug([\"from\", \"from\", value]);\n if (!value) {\n return dayjs();\n }\n\n if (value.length >= 10) {\n return dayjs(value, \"YYYY-MM-DD\");\n }\n\n return dayjs(`${value}-01-01`, \"YYYY-MM-DD\");\n },\n toAttribute: (value: Dayjs) => {\n console.debug([\"from\", \"to\", value]);\n return value.format(\"YYYY-MM-DD\");\n },\n },\n })\n from: Dayjs = dayjs(`${window.localStorage.getItem(GTY_FROM_YEAR_VAR) || MIN_YEAR}-01-01`, \"YYYY-MM-DD\");\n\n @property({\n type: Dayjs,\n converter: {\n fromAttribute: (value: string) => {\n console.debug([\"to\", \"from\", value]);\n if (!value) {\n return dayjs();\n }\n\n if (value.length >= 10) {\n return dayjs(value, \"YYYY-MM-DD\");\n }\n\n return dayjs(`${value}-12-31`, \"YYYY-MM-DD\");\n },\n toAttribute: (value: Dayjs) => {\n console.debug([\"to\", \"to\", value]);\n return value.format(\"YYYY-MM-DD\");\n },\n },\n })\n to: Dayjs = dayjs(`${window.localStorage.getItem(GTY_TO_YEAR_VAR) || MAX_YEAR}-01-01`, \"YYYY-MM-DD\");\n\n @property({ type: String, attribute: \"no-image-src\" })\n noImageSrc: string = \"\";\n\n @property({ type: Boolean, attribute: \"suppress-images\" })\n suppressImages: boolean = false;\n\n @property({ type: Number, attribute: \"max-hints\" })\n maxHints: number = 3;\n\n @property({ type: Number, attribute: \"number-of-questions\", reflect: true })\n numberOfQuestions: number = parseInt(window.localStorage.getItem(GTY_NUM_QUESTIONS_VAR) || MAX_QUESTIONS + '', 10);\n private _numberOfQuestionsSeen: number = 0;\n\n private _playerDob: number = parseInt(window.localStorage.getItem(GTY_PLAYER_DOB_VAR) || 0 + '', 10);\n\n @state()\n private _incident: Incident | undefined = undefined;\n\n private _answers: Array<Number> = [];\n\n @state()\n private _hint: string | undefined = undefined;\n\n private _showHint: boolean = true;\n private _showFooter: boolean = false;\n private _hintsIndex: number = 0;\n private _hints: Array<Incident> = [];\n\n @state()\n private _solution: Number | undefined = undefined;\n\n @state()\n public _renderState: string = GameState.INIT;\n\n @state()\n private _score = 30;\n\n public totalScore = 0;\n\n // _answer is stored as string because it will be entered character for character\n @state()\n private _answer: number | undefined = undefined;\n\n private _apiService = new ApiService(this.teeeApiUrl);\n private i18n = i18nFactory(\"nl\");\n\n static override styles = css`\n ${stylesheet}\n `;\n\n constructor() {\n super();\n this._score0 = new QuestionScoreController(this, 30, 1000);\n }\n\n override connectedCallback() {\n console.debug(\"connectedCallback\");\n super.connectedCallback();\n\n // first step is splash\n this._renderState = GameState.SPLASH;\n }\n\n override disconnectedCallback() {\n console.debug(\"disconnectedCallback\");\n super.disconnectedCallback();\n this._renderState = GameState.INIT;\n this._score0.stop();\n this._score0.reset();\n }\n\n override firstUpdated(changedProperties: PropertyValues): void {\n console.debug(\"firstUpdated\");\n super.firstUpdated(changedProperties);\n }\n\n override shouldUpdate(changedProperties: PropertyValues): boolean {\n console.debug(\"shouldUpdate\");\n return super.shouldUpdate(changedProperties);\n }\n\n override update(changedProperties: PropertyValues) {\n console.debug(\"update\");\n return super.update(changedProperties);\n }\n\n override updated(changedProperties: PropertyValues) {\n console.debug(\"updated\");\n return super.updated(changedProperties);\n }\n\n override render() {\n /**\n * this is the main render function\n * it renders different stages during the game\n */\n console.debug(\"render\");\n\n return html`\n <div class=\"guess-the-year-container\">\n ${this._renderState == GameState.INIT ? \"Loading...\" : \"\"}\n ${this._renderState == GameState.SPLASH\n ? this.renderSplashScreen()\n : \"\"}\n ${this._renderState == GameState.INTRO ? this.renderGameIntro() : \"\"}\n ${this._renderState == GameState.PLAY ? this.renderGameStage() : \"\"}\n ${this._renderState == GameState.END ? this.renderGameEnd() : \"\"}\n ${this._renderFooter()}\n </div>\n `;\n }\n\n colorElement(element: any, color: string) {\n console.debug(\"colorElement\");\n this?.shadowRoot?.querySelector(element)?.style.setProperty(\"color\", color);\n }\n\n // this renders the game header\n private _renderHeader(content: string = this.i18n.translate(\"game-name\")): TemplateResult {\n return html`\n <section id=\"top\" class=\"header guess-the-year-header\">\n <h1>${content}</h1>\n </section>\n `;\n }\n\n // this renders the game footer\n private _renderFooter(): TemplateResult {\n if (this._showFooter) {\n return html`\n <section class=\"footer guess-the-year-footer\">\n <div class=\"guess-the-year-copyright\">\n ${\"The Throwback Company ©\" + dayjs().year()}\n </div>\n </section>\n `;\n }\n return html``;\n }\n\n // render the splash screen\n private renderSplashScreen(): TemplateResult {\n console.debug(\"renderSplashScreen\");\n\n // (pretend) to load before the game starts\n setTimeout(() => {\n this._renderState = GameState.INTRO;\n }, SPLASH_DELAY);\n\n return html`\n <div id=\"splash-screen-container\" class=\"splashscreen\">\n <div class=\"splash-logo\">\n <h2>${this.i18n.translate(\"game-name\")}</h2>\n <p>${this.i18n.translate(\"Loading...\")}</p>\n </div>\n </div>\n `;\n }\n\n // renders a selector for a year\n // TODO: set type of selector\n private _renderYearStepXSelectOptions(from: number, to: number, step: number, selectedValue: string): TemplateResult {\n const selected = parseInt(selectedValue, 10);\n // pre-render year options\n // and mark selected when they match\n const selectYearOptions = [];\n for (let i = from; i <= to; i += step) {\n selectYearOptions.push(html`\n <option value=\"${i}\" ?selected=${selected == i}>${i}</option>\n `);\n }\n\n return html`${selectYearOptions}`;\n }\n\n // render the game intro\n // allows to select the number of questions,\n // select the year range\n // and to start the game\n private renderGameIntro(): TemplateResult {\n console.debug(\"renderGameIntro\");\n\n // pre-render number of question options\n // and mark selected when they match\n const selectQuestionOptions = [];\n for (let i = 1; i <= MAX_QUESTIONS; i++) {\n selectQuestionOptions.push(html`\n <option value=\"${i}\" ?selected=${this.numberOfQuestions == i}>\n ${i}\n </option>\n `);\n }\n\n return html`\n ${this._renderHeader(this.i18n.translate(\"game-introduction-welcome\"))}\n\n <div class=\"game-intro\">\n <div class=\"game-explanation\">\n <p>\n ${this.i18n.translate(\"game-introduction-p1\")}\n </p>\n\n <p>\n ${this.i18n.translate(\"game-introduction-p2\")}\n </p>\n\n <p>\n ${this.i18n.translate(\"game-introduction-p3\")}\n </p>\n </div>\n\n <div class=\"game-settings\">\n <p>\n ${this.i18n.translate(\"game-settings-p0\")}\n <select @change=\"${this._setPlayerDob}\">\n ${this._renderYearStepXSelectOptions(MAX_DOB, MIN_DOB, 1, this._playerDob + '')}\n </select>\n ${this.i18n.translate(\"game-settings-p1\")}\n <select @change=\"${this._setNumberOfQuestions}\">\n ${selectQuestionOptions}\n </select>\n ${this.i18n.translate(\"game-settings-p2\")}\n <select @change=\"${this._setFromDate}\">\n ${this._renderYearStepXSelectOptions(MIN_YEAR, MAX_YEAR, 5, this.from.format(\"YYYY\"))}\n </select>\n ${this.i18n.translate(\"game-settings-p3\")}\n <select @change=\"${this._setToDate}\">\n ${this._renderYearStepXSelectOptions(MIN_YEAR, MAX_YEAR, 5, this.to.format(\"YYYY\"))}\n </select>\n ${this.i18n.translate(\"game-settings-p4\")}\n </p>\n </div>\n\n <div class=\"game-start\">\n <button @click=\"${this.setupNewGame}\">${this.i18n.translate(\"start\")}</button>\n </div>\n </div>\n `;\n }\n private _setPlayerDob(event: any): void {\n this._playerDob = Number(event.target.value);\n window.localStorage.setItem(GTY_PLAYER_DOB_VAR, this._playerDob + '');\n }\n\n private _setNumberOfQuestions(event: any): void {\n this.numberOfQuestions = Number(event.target.value);\n window.localStorage.setItem(GTY_NUM_QUESTIONS_VAR, this.numberOfQuestions + '');\n }\n\n private _setFromDate(event: any): void {\n this.from = this.from.year(event.target.value);\n window.localStorage.setItem(GTY_FROM_YEAR_VAR, this.from.format('YYYY') + '');\n }\n\n private _setToDate(event: any): void {\n this.to = this.to.year(event.target.value);\n window.localStorage.setItem(GTY_TO_YEAR_VAR, this.to.format('YYYY') + '');\n }\n\n // renders the actual game stage\n private renderGameStage(): TemplateResult {\n console.debug(\"renderGameStage\");\n\n return html`\n ${this._renderHeader(this.i18n.translate(\"game-call-to-action\").replace(/__FROM__/, this.from.year() + '').replace(/__TO__/, this.to.year() + ''))}\n <div class=\"guess-the-year-game-stage\">\n <div class=\"game-score\">${this._renderGameScore()}</div>\n\n <div class=\"container\">\n <div class=\"incident\">${this._renderIncident()}</div>\n ${this._renderHint()}\n <div class=\"sources\">${this.renderSources()}</div>\n </div>\n\n <div class=\"game-controls\">\n <div class=\"game-controls--hint\">${this._renderHintButton()}</div>\n <div class=\"game-controls--answers\">${this._renderAnswers()}</div>\n </div>\n\n ${this._renderFeedback()}\n </div>\n `;\n }\n\n // renders the item for the year to guess\n private _renderIncident(): TemplateResult {\n return html`\n <div class=\"incident--title\">\n <h1>${this._incident?.title}</h1>\n </div>\n\n ${this._renderIncidentImage(this._incident)}\n\n <div class=\"incident--text\">\n <p>${this._incident?.text}</p>\n </div>\n `;\n }\n\n private _shouldDisplayAnImage(incident: Incident): boolean {\n const hasImage = !!(incident && incident.image && incident.image[0]);\n const displayImages = !this.suppressImages;\n return hasImage && displayImages;\n }\n\n // renders the optional image with the item\n private _renderIncidentImage(incident: Incident | undefined): TemplateResult {\n if (incident && this._shouldDisplayAnImage(incident)) {\n return html`\n <div class=\"incident--image\">\n <img \n @error=${(evt: Event) => {\n this._handleImageLoadError(evt, incident);\n }}\n src=\"${incident.image[0]}\"\n />\n </div>\n `;\n }\n\n if (!this.suppressImages) {\n // Preserve html structure to prevent the webcomponent to collapse.\n return html`<div class=\"incident--image\">\n <img/>\n </div>`;\n }\n\n return html``;\n }\n\n // renders a list of possible answers\n private _renderAnswers(): TemplateResult {\n return html`\n <div class=\"answers--list\">\n <ul>\n ${this._answers.map(\n (answer) =>\n html`<li @click=\"${this._handleAnswerClicked}\">${answer}</li>`,\n )}\n </ul>\n </div>\n `;\n }\n\n // renders the current question score\n // it counts back to 0\n private _renderGameScore(): TemplateResult {\n return html`\n <div class=\"game-score--total\">\n <div class=\"game-score--label\">${this.i18n.translate(\"question-number\")}:</div>\n <div class=\"game-score--value\">\n ${this._numberOfQuestionsSeen} van ${this.numberOfQuestions}\n </div>\n </div>\n\n <div class=\"game-score--score\">\n <div class=\"game-score--label\">${this.i18n.translate(\"question-score\")}:</div>\n <div class=\"game-score--value\">${this._score0.value}</div>\n </div>\n\n <div class=\"game-score--total\">\n <div class=\"game-score--label\">${this.i18n.translate(\"total-score\")}:</div>\n <div class=\"game-score--value\">${this.totalScore}</div>\n </div>\n `;\n }\n\n // handles the click on an answer\n private _handleAnswerClicked(event: any): void {\n // get the clicked answer\n const answer = event.target.textContent;\n\n // stop the score counter\n this._score0.stop();\n\n // remove the hint button\n this._showHint = false;\n\n // check if the answer is correct\n if (answer) {\n // this._apiService.postIncidentAnswer(this._incident?.id, answer);\n console.debug(\n answer,\n this._solution,\n this._score,\n answer == this._solution,\n );\n\n this._answer = answer;\n }\n }\n\n // renders the requested hint\n private _renderHint(): TemplateResult {\n if (!this._hint) {\n return html``;\n }\n\n return html` <p>${this._hint}</p> `;\n }\n\n // renders the hint button until\n // all max hints have been used\n private _renderHintButton(): TemplateResult {\n if (!this._showHint) {\n return html``;\n }\n\n return html`\n <div class=\"game-controls--hint\">\n <button @click=\"${this._handleHintClicked}\">\n ${this.i18n.translate(\"show-hint\")} (${this._hints.length - this._hintsIndex})\n </button>\n </div>\n `;\n }\n\n // handles the click on the hint button\n // and shows the next hint if available\n // subtracts the cost of the hint from\n // the question score\n private _handleHintClicked(): void {\n console.debug(\"handleHintClicked\", [this._hintsIndex, this._hints.length]);\n\n if (this._hintsIndex < this._hints.length) {\n const hintText = this._generateHintText(this._hints[this._hintsIndex]);\n\n if (hintText) {\n this._hint = hintText;\n this._hintsIndex++;\n this._score0.subtract(HINT_COST);\n }\n }\n\n if (this._hintsIndex >= this._hints.length) {\n // this._hintsIndex = 0;\n this._showHint = false;\n }\n }\n\n // renders the feedback overlay\n private _renderFeedback(): TemplateResult {\n // do not show anything until an answer has been made\n // and the score is greater than 0\n if (!this._answer && this._score0.value > 0) {\n return html``;\n }\n\n // check if the answer is correct\n // cast to strings to compare\n const is_correct = this._answer + \"\" == this._solution + \"\";\n const score = is_correct ? this._score0.value : 0;\n\n if (this._score0.isRunning()) {\n this._score0.stop();\n }\n\n this.totalScore += score;\n\n // Fire-and-forget recallability feedback.\n if (this._incident?.id) {\n this._apiService.incidentRecallability(this._incident?.id, this._playerDob, is_correct);\n }\n\n if (is_correct) {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>${this.i18n.translate(\"answer-correct\")}!</h3>\n <p>\n ${this._hintsIndex == 1 ? this.i18n.translate(\"used-hint-singular\") : this.i18n.translate(\"used-hint-plural\").replace(/__HINTS__/, this._hintsIndex + '')}\n </p>\n <p>\n ${score == 1 ? this.i18n.translate(\"number-points-singular\") : this.i18n.translate(\"number-points-plural\").replace(/__POINTS__/, score + '')}\n </p>\n\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n } else if (!is_correct && this._answer) {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>${this.i18n.translate(\"answer-wrong\")}</h3>\n <p>\n ${this.i18n.translate(\"correct-answer-was\").replace(/__WRONG__/, this._answer + '').replace(/__CORRECT__/, this._solution + '')}\n </p>\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n } else {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>Helaas</h3>\n <p>\n ${this.i18n.translate(\"no-answer-correct-answer-was\").replace(/__CORRECT__/, this._solution + '')}\n </p>\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n }\n }\n\n // renders the next question button\n private _renderNextQuestionButton(): TemplateResult {\n if (this._numberOfQuestionsSeen < this.numberOfQuestions) {\n return html`\n <button @click=\"${this._loadQuestion}\">${this.i18n.translate(\"next-question\")}</button>\n `;\n }\n\n return html` <button @click=\"${this._endGame}\">${this.i18n.translate(\"quit\")}</button> `;\n }\n\n // renders the end of the game\n private _endGame(): void {\n this._renderState = GameState.END;\n }\n\n private renderGameEnd(): TemplateResult {\n console.debug(\"renderGameEnd\");\n return html`\n ${this._renderHeader(\"The end!\")}\n <div class=\"guess-the-year-game-end\">${this.i18n.translate(\"end\")}</div>\n <button @click=\"${() => (this._renderState = GameState.SPLASH)}\">\n ${this.i18n.translate(\"new-game\")}\n </button>\n ${this._renderFooter()}\n `;\n }\n\n private setupNewGame(): void {\n console.debug(\"new game!\");\n\n console.debug({\n \"number of questions\": this.numberOfQuestions,\n from: this.from.toISOString(),\n to: this.to.toISOString(),\n });\n\n this.totalScore = 0;\n this._numberOfQuestionsSeen = 0;\n\n this._loadQuestion();\n }\n\n private _resetStage(): void {\n this.sources = [];\n this._incident = undefined;\n this._hints = [];\n this._answer = undefined;\n this._answers = [];\n this._hintsIndex = 0;\n this._score0.reset();\n this._showHint = false;\n this._hint = undefined;\n }\n\n async _loadQuestion(): Promise<void> {\n this._resetStage();\n\n const response: { incident: Incident | undefined; sources: string[] } =\n await this._apiService.fetchOneIncident(\n this.country,\n this.category,\n this.emotion,\n this.impact,\n this.date,\n this.from.format(\"YYYY-MM-DD\"),\n this.to.format(\"YYYY-MM-DD\"),\n \"40\",\n \"quiz_year\"\n );\n\n this._incident = response.incident;\n this.sources = response.sources;\n\n this._solution = Number(\n (response.incident?.yearplusmonth || \"\").substring(0, 4),\n );\n\n const answers = [this._solution];\n const from = this.from.year();\n const to = this.to.year();\n\n // generate 3 more random and unique answers between to and from\n while (answers.length < 4) {\n const randomAnswer = Math.floor(Math.random() * (to - from)) + from;\n if (!answers.includes(randomAnswer)) {\n answers.push(randomAnswer);\n }\n }\n\n // sort theses answers\n answers.sort();\n\n this._answers = answers;\n\n for (let i = 0; i < this.maxHints; i++) {\n console.debug(\"loading hint\", i);\n\n const response: { incident: Incident | undefined; sources: string[] } =\n await this._apiService.fetchOneIncident(\n this.country,\n Util.shuffleArray([...Categories]).shift(),\n undefined,\n undefined,\n \"\",\n `${this._solution}-01-01`,\n `${this._solution}-12-31`,\n undefined,\n undefined,\n );\n\n if (response.incident) {\n this._hints.push(response.incident);\n }\n }\n\n if (this._hints.length === 0) {\n this._showHint = false;\n }\n else {\n this._showHint = true;\n }\n\n // start render game stage\n this._renderState = GameState.PLAY;\n\n // start score counter\n this._score0.start();\n\n // increment question counter\n this._numberOfQuestionsSeen += 1;\n }\n\n private _generateHintText(hintIncident: Incident): string {\n let hint = \"\";\n const hintTemplates = this.i18n.HintTemplates[hintIncident.category];\n switch (hintIncident.category) {\n case Category.newsItem:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] || \"\"\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.radioSong:\n // The title property of radioSongs always follow this pattern: track - artist\n const track = hintIncident.title.replace(/(.*?)\\s+\\-.*/, \"$1\");\n const artist = hintIncident.title.replace(/.*\\-(.*)/, \"$1\");\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n )\n .replace(/__ARTIST__/, artist)\n .replace(/__TRACK__/, track);\n break;\n case Category.cinemaMovie:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.tech:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.newsPresenter:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.tvShowOrSeries:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.sports:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.showbizz:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n }\n return hint;\n }\n\n renderSources(): TemplateResult {\n console.debug(\"renderSources\");\n if (!this.sources.length) {\n return html``;\n }\n // deduplicate array via [...new Set(this.sources)]\n return html`\n <div class=\"guess-the-year-sources\">\n Source: ${[...new Set(this.sources)].join(\", \")}\n </div>\n `;\n }\n\n _handleImageLoadError = (evt: Event, incident: Incident) => {\n // grab the image element that triggered the error\n const targetImage = evt.target as HTMLImageElement;\n console.debug(`Error loading image: ${targetImage.src}`);\n\n // find out which no image source needs to be used\n const noImageSrc = this.noImageSrc || NoImageImg;\n\n // don't try to set the image source if it\n // has already been set\n if (targetImage.src == noImageSrc) {\n return;\n }\n\n // report broken images back to the server if set.\n if (this.reportBrokenImages) {\n if (incident) {\n this._apiService.postAttributeQualityFeedback(\n incident.id,\n \"image\",\n targetImage.src,\n ContentFeedback.incorrect,\n );\n }\n }\n\n // wait a bit before setting the image\n // so we don't hammer the no image server\n setTimeout(() => {\n targetImage.src = noImageSrc;\n }, 250);\n\n return false;\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"guess-the-year\": GuessTheYear;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"guess-the-year.js","sourceRoot":"","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AY,CAs0BxB","sourcesContent":["import { LitElement, css, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport dayjs from \"dayjs\";\nimport { Dayjs } from \"dayjs\";\nconst { setTimeout } = window;\nimport { Incident, Categories, Category } from \"./lib/Incident\";\nimport { NoImageImg } from \"./lib/Icon\";\nimport { ApiService, ContentFeedback } from \"./lib/ApiService\";\nimport { Util } from \"./lib/Util\";\nimport { i18nFactory } from \"./lib/i18n/i18n\";\nimport { GameState } from \"./lib/enums\";\nimport stylesheet from \"./scss/main.scss\";\nimport { QuestionScoreController } from \"./lib/controller/scorecontroller\";\n\nconst SPLASH_DELAY: number = 1000;\nconst MAX_QUESTIONS: number = 10;\nconst HINT_COST: number = 2;\nconst MIN_YEAR: number = 1950;\nconst MAX_YEAR: number = parseInt(dayjs().format('YYYY'), 10);\nconst GTY_FROM_YEAR_VAR = 'gty-from-year';\nconst GTY_TO_YEAR_VAR = 'gty-to-year';\nconst GTY_NUM_QUESTIONS_VAR = 'gty-number-of-questions';\nconst MAX_DOB: number = 1915;\nconst MIN_DOB: number = parseInt(dayjs().format('YYYY'), 10) - 10;\nconst GTY_PLAYER_DOB_VAR = 'gty-player-dob';\n\n@customElement(\"guess-the-year\")\nexport class GuessTheYear extends LitElement {\n\n private sources: Array<string> = [];\n private _loading = false;\n\n private _score0: QuestionScoreController;\n\n get loading() {\n return this._loading;\n }\n\n set loading(value: boolean) {\n this._loading = value;\n }\n\n @property({ type: String, attribute: \"tee-e-api-url\" })\n teeeApiUrl: string = \"https://api.tee-e.com\";\n\n @property({ type: Boolean, attribute: \"report-broken-images\" })\n reportBrokenImages: boolean = false;\n\n @property({ type: String })\n date: string = \"\";\n\n @property({ type: String })\n country: string = \"\";\n\n @property({ type: String })\n category: string = \"\";\n\n @property({ type: String })\n emotion: string = \"\";\n\n @property({ type: String })\n impact: string = \"\";\n\n @property({\n type: Dayjs,\n converter: {\n fromAttribute: (value: string) => {\n console.debug([\"from\", \"from\", value]);\n if (!value) {\n return dayjs();\n }\n\n if (value.length >= 10) {\n return dayjs(value, \"YYYY-MM-DD\");\n }\n\n return dayjs(`${value}-01-01`, \"YYYY-MM-DD\");\n },\n toAttribute: (value: Dayjs) => {\n console.debug([\"from\", \"to\", value]);\n return value.format(\"YYYY-MM-DD\");\n },\n },\n })\n from: Dayjs = dayjs(`${window.localStorage.getItem(GTY_FROM_YEAR_VAR) || MIN_YEAR}-01-01`, \"YYYY-MM-DD\");\n\n @property({\n type: Dayjs,\n converter: {\n fromAttribute: (value: string) => {\n console.debug([\"to\", \"from\", value]);\n if (!value) {\n return dayjs();\n }\n\n if (value.length >= 10) {\n return dayjs(value, \"YYYY-MM-DD\");\n }\n\n return dayjs(`${value}-12-31`, \"YYYY-MM-DD\");\n },\n toAttribute: (value: Dayjs) => {\n console.debug([\"to\", \"to\", value]);\n return value.format(\"YYYY-MM-DD\");\n },\n },\n })\n to: Dayjs = dayjs(`${window.localStorage.getItem(GTY_TO_YEAR_VAR) || MAX_YEAR}-01-01`, \"YYYY-MM-DD\");\n\n @property({ type: String, attribute: \"no-image-src\" })\n noImageSrc: string = \"\";\n\n @property({ type: Boolean, attribute: \"suppress-images\" })\n suppressImages: boolean = false;\n\n @property({ type: Number, attribute: \"max-hints\" })\n maxHints: number = 3;\n\n @property({ type: Number, attribute: \"number-of-questions\", reflect: true })\n numberOfQuestions: number = parseInt(window.localStorage.getItem(GTY_NUM_QUESTIONS_VAR) || MAX_QUESTIONS + '', 10);\n private _numberOfQuestionsSeen: number = 0;\n\n private _playerDob: number = parseInt(window.localStorage.getItem(GTY_PLAYER_DOB_VAR) || 0 + '', 10);\n\n @state()\n private _incident: Incident | undefined = undefined;\n\n private _answers: Array<Number> = [];\n\n @state()\n private _hint: string | undefined = undefined;\n\n private _showHint: boolean = true;\n private _showFooter: boolean = false;\n private _hintsIndex: number = 0;\n private _hints: Array<Incident> = [];\n\n @state()\n private _solution: Number | undefined = undefined;\n\n @state()\n public _renderState: string = GameState.INIT;\n\n @state()\n private _score = 30;\n\n public totalScore = 0;\n\n // _answer is stored as string because it will be entered character for character\n @state()\n private _answer: number | undefined = undefined;\n\n private _apiService = new ApiService(this.teeeApiUrl);\n private i18n = i18nFactory(\"nl\");\n\n static override styles = css`\n ${stylesheet}\n `;\n\n constructor() {\n super();\n this._score0 = new QuestionScoreController(this, 30, 1000);\n }\n\n override connectedCallback() {\n console.debug(\"connectedCallback\");\n super.connectedCallback();\n\n // first step is splash\n this._renderState = GameState.SPLASH;\n }\n\n override disconnectedCallback() {\n console.debug(\"disconnectedCallback\");\n super.disconnectedCallback();\n this._renderState = GameState.INIT;\n this._score0.stop();\n this._score0.reset();\n }\n\n override firstUpdated(changedProperties: PropertyValues): void {\n console.debug(\"firstUpdated\");\n super.firstUpdated(changedProperties);\n }\n\n override shouldUpdate(changedProperties: PropertyValues): boolean {\n console.debug(\"shouldUpdate\");\n return super.shouldUpdate(changedProperties);\n }\n\n override update(changedProperties: PropertyValues) {\n console.debug(\"update\");\n return super.update(changedProperties);\n }\n\n override updated(changedProperties: PropertyValues) {\n console.debug(\"updated\");\n return super.updated(changedProperties);\n }\n\n override render() {\n /**\n * this is the main render function\n * it renders different stages during the game\n */\n console.debug(\"render\");\n\n return html`\n <div class=\"guess-the-year-container\">\n ${this._renderState == GameState.INIT ? \"Loading...\" : \"\"}\n ${this._renderState == GameState.SPLASH\n ? this.renderSplashScreen()\n : \"\"}\n ${this._renderState == GameState.INTRO ? this.renderGameIntro() : \"\"}\n ${this._renderState == GameState.PLAY ? this.renderGameStage() : \"\"}\n ${this._renderState == GameState.END ? this.renderGameEnd() : \"\"}\n ${this._renderFooter()}\n </div>\n `;\n }\n\n colorElement(element: any, color: string) {\n console.debug(\"colorElement\");\n this?.shadowRoot?.querySelector(element)?.style.setProperty(\"color\", color);\n }\n\n // this renders the game header\n private _renderHeader(content: string = this.i18n.translate(\"game-name\")): TemplateResult {\n return html`\n <section id=\"top\" class=\"header guess-the-year-header\">\n <h1>${content}</h1>\n </section>\n `;\n }\n\n // this renders the game footer\n private _renderFooter(): TemplateResult {\n if (this._showFooter) {\n return html`\n <section class=\"footer guess-the-year-footer\">\n <div class=\"guess-the-year-copyright\">\n ${\"The Throwback Company ©\" + dayjs().year()}\n </div>\n </section>\n `;\n }\n return html``;\n }\n\n // render the splash screen\n private renderSplashScreen(): TemplateResult {\n console.debug(\"renderSplashScreen\");\n\n // (pretend) to load before the game starts\n setTimeout(() => {\n this._renderState = GameState.INTRO;\n }, SPLASH_DELAY);\n\n return html`\n <div id=\"splash-screen-container\" class=\"splashscreen\">\n <div class=\"splash-logo\">\n <h2>${this.i18n.translate(\"game-name\")}</h2>\n <p>${this.i18n.translate(\"Loading...\")}</p>\n </div>\n </div>\n `;\n }\n\n // renders a selector for a year\n // TODO: set type of selector\n private _renderYearStepXSelectOptions(from: number, to: number, step: number, selectedValue: string): TemplateResult {\n const selected = parseInt(selectedValue, 10);\n // pre-render year options\n // and mark selected when they match\n const selectYearOptions = [];\n for (let i = from; i <= to; i += step) {\n selectYearOptions.push(html`\n <option value=\"${i}\" ?selected=${selected == i}>${i}</option>\n `);\n }\n\n return html`${selectYearOptions}`;\n }\n\n // render the game intro\n // allows to select the number of questions,\n // select the year range\n // and to start the game\n private renderGameIntro(): TemplateResult {\n console.debug(\"renderGameIntro\");\n\n // pre-render number of question options\n // and mark selected when they match\n const selectQuestionOptions = [];\n for (let i = 1; i <= MAX_QUESTIONS; i++) {\n selectQuestionOptions.push(html`\n <option value=\"${i}\" ?selected=${this.numberOfQuestions == i}>\n ${i}\n </option>\n `);\n }\n\n return html`\n ${this._renderHeader(this.i18n.translate(\"game-introduction-welcome\"))}\n\n <div class=\"game-intro\">\n <div class=\"game-explanation\">\n <p>\n ${this.i18n.translate(\"game-introduction-p1\")}\n </p>\n\n <p>\n ${this.i18n.translate(\"game-introduction-p2\")}\n </p>\n\n <p>\n ${this.i18n.translate(\"game-introduction-p3\")}\n </p>\n </div>\n\n <div class=\"game-settings\">\n <p>\n ${this.i18n.translate(\"game-settings-p0\")}\n <select @change=\"${this._setPlayerDob}\">\n ${this._renderYearStepXSelectOptions(MAX_DOB, MIN_DOB, 1, this._playerDob + '')}\n </select>\n ${this.i18n.translate(\"game-settings-p1\")}\n <select @change=\"${this._setNumberOfQuestions}\">\n ${selectQuestionOptions}\n </select>\n ${this.i18n.translate(\"game-settings-p2\")}\n <select @change=\"${this._setFromDate}\">\n ${this._renderYearStepXSelectOptions(MIN_YEAR, MAX_YEAR, 5, this.from.format(\"YYYY\"))}\n </select>\n ${this.i18n.translate(\"game-settings-p3\")}\n <select @change=\"${this._setToDate}\">\n ${this._renderYearStepXSelectOptions(MIN_YEAR, MAX_YEAR, 5, this.to.format(\"YYYY\"))}\n </select>\n ${this.i18n.translate(\"game-settings-p4\")}\n </p>\n </div>\n\n <div class=\"game-start\">\n <button @click=\"${this.setupNewGame}\">${this.i18n.translate(\"start\")}</button>\n </div>\n </div>\n `;\n }\n private _setPlayerDob(event: any): void {\n this._playerDob = Number(event.target.value);\n window.localStorage.setItem(GTY_PLAYER_DOB_VAR, this._playerDob + '');\n }\n\n private _setNumberOfQuestions(event: any): void {\n this.numberOfQuestions = Number(event.target.value);\n window.localStorage.setItem(GTY_NUM_QUESTIONS_VAR, this.numberOfQuestions + '');\n }\n\n private _setFromDate(event: any): void {\n this.from = this.from.year(event.target.value);\n window.localStorage.setItem(GTY_FROM_YEAR_VAR, this.from.format('YYYY') + '');\n }\n\n private _setToDate(event: any): void {\n this.to = this.to.year(event.target.value);\n window.localStorage.setItem(GTY_TO_YEAR_VAR, this.to.format('YYYY') + '');\n }\n\n // renders the actual game stage\n private renderGameStage(): TemplateResult {\n console.debug(\"renderGameStage\");\n\n return html`\n ${this._renderHeader(this.i18n.translate(\"game-call-to-action\").replace(/__FROM__/, this.from.year() + '').replace(/__TO__/, this.to.year() + ''))}\n <div class=\"guess-the-year-game-stage\">\n <div class=\"game-score\">${this._renderGameScore()}</div>\n\n <div class=\"container\">\n <div class=\"incident\">${this._renderIncident()}</div>\n ${this._renderHint()}\n <div class=\"sources\">${this.renderSources()}</div>\n </div>\n\n <div class=\"game-controls\">\n <div class=\"game-controls--hint\">${this._renderHintButton()}</div>\n <div class=\"game-controls--answers\">${this._renderAnswers()}</div>\n </div>\n\n ${this._renderFeedback()}\n </div>\n `;\n }\n\n // renders the item for the year to guess\n private _renderIncident(): TemplateResult {\n return html`\n <div class=\"incident--title\">\n <h1>${this._incident?.title}</h1>\n </div>\n\n ${this._renderIncidentImage(this._incident)}\n\n <div class=\"incident--text\">\n <p>${this._incident?.text}</p>\n </div>\n `;\n }\n\n private _shouldDisplayAnImage(incident: Incident): boolean {\n const hasImage = !!(incident && incident.image && incident.image[0]);\n const displayImages = !this.suppressImages;\n return hasImage && displayImages;\n }\n\n // renders the optional image with the item\n private _renderIncidentImage(incident: Incident | undefined): TemplateResult {\n if (incident && this._shouldDisplayAnImage(incident)) {\n return html`\n <div class=\"incident--image\">\n <img \n @error=${(evt: Event) => {\n this._handleImageLoadError(evt, incident);\n }}\n src=\"${incident.image[0]}\"\n />\n </div>\n `;\n }\n\n if (!this.suppressImages) {\n // Preserve html structure to prevent the webcomponent to collapse.\n return html`<div class=\"incident--image\">\n <img/>\n </div>`;\n }\n\n return html``;\n }\n\n // renders a list of possible answers\n private _renderAnswers(): TemplateResult {\n return html`\n <div class=\"answers--list\">\n <ul>\n ${this._answers.map(\n (answer) =>\n html`<li @click=\"${this._handleAnswerClicked}\">${answer}</li>`,\n )}\n </ul>\n </div>\n `;\n }\n\n // renders the current question score\n // it counts back to 0\n private _renderGameScore(): TemplateResult {\n return html`\n <div class=\"game-score--total\">\n <div class=\"game-score--label\">${this.i18n.translate(\"question-number\")}:</div>\n <div class=\"game-score--value\">\n ${this._numberOfQuestionsSeen} van ${this.numberOfQuestions}\n </div>\n </div>\n\n <div class=\"game-score--score\">\n <div class=\"game-score--label\">${this.i18n.translate(\"question-score\")}:</div>\n <div class=\"game-score--value\">${this._score0.value}</div>\n </div>\n\n <div class=\"game-score--total\">\n <div class=\"game-score--label\">${this.i18n.translate(\"total-score\")}:</div>\n <div class=\"game-score--value\">${this.totalScore}</div>\n </div>\n `;\n }\n\n // handles the click on an answer\n private _handleAnswerClicked(event: any): void {\n // get the clicked answer\n const answer = event.target.textContent;\n\n // stop the score counter\n this._score0.stop();\n\n // remove the hint button\n this._showHint = false;\n\n // check if the answer is correct\n if (answer) {\n // this._apiService.postIncidentAnswer(this._incident?.id, answer);\n console.debug(\n answer,\n this._solution,\n this._score,\n answer == this._solution,\n );\n\n this._answer = answer;\n }\n }\n\n // renders the requested hint\n private _renderHint(): TemplateResult {\n if (!this._hint) {\n return html``;\n }\n\n return html` <p>${this._hint}</p> `;\n }\n\n // renders the hint button until\n // all max hints have been used\n private _renderHintButton(): TemplateResult {\n if (!this._showHint) {\n return html``;\n }\n\n return html`\n <div class=\"game-controls--hint\">\n <button @click=\"${this._handleHintClicked}\">\n ${this.i18n.translate(\"show-hint\")} (${this._hints.length - this._hintsIndex})\n </button>\n </div>\n `;\n }\n\n // handles the click on the hint button\n // and shows the next hint if available\n // subtracts the cost of the hint from\n // the question score\n private _handleHintClicked(): void {\n console.debug(\"handleHintClicked\", [this._hintsIndex, this._hints.length]);\n\n if (this._hintsIndex < this._hints.length) {\n const hintText = this._generateHintText(this._hints[this._hintsIndex]);\n\n if (hintText) {\n this._hint = hintText;\n this._hintsIndex++;\n this._score0.subtract(HINT_COST);\n }\n }\n\n if (this._hintsIndex >= this._hints.length) {\n // this._hintsIndex = 0;\n this._showHint = false;\n }\n }\n\n // renders the feedback overlay\n private _renderFeedback(): TemplateResult {\n // do not show anything until an answer has been made\n // and the score is greater than 0\n if (!this._answer && this._score0.value > 0) {\n return html``;\n }\n\n // check if the answer is correct\n // cast to strings to compare\n const is_correct = this._answer + \"\" == this._solution + \"\";\n const score = is_correct ? this._score0.value : 0;\n\n if (this._score0.isRunning()) {\n this._score0.stop();\n }\n\n this.totalScore += score;\n\n // Fire-and-forget recallability feedback.\n if (this._incident?.id) {\n this._apiService.incidentRecallability(this._incident?.id, this._playerDob, is_correct);\n }\n\n if (is_correct) {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>${this.i18n.translate(\"answer-correct\")}!</h3>\n <p>\n ${this._hintsIndex == 1 ? this.i18n.translate(\"used-hint-singular\") : this.i18n.translate(\"used-hint-plural\").replace(/__HINTS__/, this._hintsIndex + '')}\n </p>\n <p>\n ${score == 1 ? this.i18n.translate(\"number-points-singular\") : this.i18n.translate(\"number-points-plural\").replace(/__POINTS__/, score + '')}\n </p>\n\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n } else if (!is_correct && this._answer) {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>${this.i18n.translate(\"answer-wrong\")}</h3>\n <p>\n ${this.i18n.translate(\"correct-answer-was\").replace(/__WRONG__/, this._answer + '').replace(/__CORRECT__/, this._solution + '')}\n </p>\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n } else {\n return html`\n <div class=\"feedback\">\n <div class=\"feedback--content\">\n <h3>Helaas</h3>\n <p>\n ${this.i18n.translate(\"no-answer-correct-answer-was\").replace(/__CORRECT__/, this._solution + '')}\n </p>\n ${this._renderNextQuestionButton()}\n </div>\n </div>\n `;\n }\n }\n\n // renders the next question button\n private _renderNextQuestionButton(): TemplateResult {\n if (this._numberOfQuestionsSeen < this.numberOfQuestions) {\n return html`\n <button @click=\"${this._loadQuestion}\">${this.i18n.translate(\"next-question\")}</button>\n `;\n }\n\n return html` <button @click=\"${this._endGame}\">${this.i18n.translate(\"quit\")}</button> `;\n }\n\n // renders the end of the game\n private _endGame(): void {\n this._renderState = GameState.END;\n }\n\n private renderGameEnd(): TemplateResult {\n console.debug(\"renderGameEnd\");\n const maxScore: number = this.numberOfQuestions * this._score;\n const scoreRatio = Math.round((this.totalScore / maxScore) * 100);\n return html`\n ${this._renderHeader(\"The end!\")}\n <div class=\"guess-the-year-game-end\">\n <p>\n ${this.i18n.translate(\"end\").replace(/__SCORE__/, this.totalScore + '').replace(/__MAX_SCORE__/, maxScore + '').replace(/__PERCENT__/, scoreRatio + '')}\n </p>\n <p>\n ${this.i18n.translate(Util.scoreToValueJudgement(scoreRatio))}\n </p>\n </div>\n <button @click=\"${() => (this._renderState = GameState.SPLASH)}\" >\n ${this.i18n.translate(\"new-game\")}\n </button>\n ${this._renderFooter()}\n `;\n }\n\n private setupNewGame(): void {\n console.debug(\"new game!\");\n\n console.debug({\n \"number of questions\": this.numberOfQuestions,\n from: this.from.toISOString(),\n to: this.to.toISOString(),\n });\n\n this.totalScore = 0;\n this._numberOfQuestionsSeen = 0;\n\n this._loadQuestion();\n }\n\n private _resetStage(): void {\n this.sources = [];\n this._incident = undefined;\n this._hints = [];\n this._answer = undefined;\n this._answers = [];\n this._hintsIndex = 0;\n this._score0.reset();\n this._showHint = false;\n this._hint = undefined;\n }\n\n async _loadQuestion(): Promise<void> {\n this._resetStage();\n\n const response: { incident: Incident | undefined; sources: string[] } =\n await this._apiService.fetchOneIncident(\n this.country,\n this.category,\n this.emotion,\n this.impact,\n this.date,\n this.from.format(\"YYYY-MM-DD\"),\n this.to.format(\"YYYY-MM-DD\"),\n \"40\",\n \"quiz_year\"\n );\n\n this._incident = response.incident;\n this.sources = response.sources;\n\n this._solution = Number(\n (response.incident?.yearplusmonth || \"\").substring(0, 4),\n );\n\n const answers = [this._solution];\n const from = this.from.year();\n const to = this.to.year();\n\n // generate 3 more random and unique answers between to and from\n while (answers.length < 4) {\n const randomAnswer = Math.floor(Math.random() * (to - from)) + from;\n if (!answers.includes(randomAnswer)) {\n answers.push(randomAnswer);\n }\n }\n\n // sort theses answers\n answers.sort();\n\n this._answers = answers;\n\n for (let i = 0; i < this.maxHints; i++) {\n console.debug(\"loading hint\", i);\n\n const response: { incident: Incident | undefined; sources: string[] } =\n await this._apiService.fetchOneIncident(\n this.country,\n Util.shuffleArray([...Categories]).shift(),\n undefined,\n undefined,\n \"\",\n `${this._solution}-01-01`,\n `${this._solution}-12-31`,\n undefined,\n undefined,\n );\n\n if (response.incident) {\n this._hints.push(response.incident);\n }\n }\n\n if (this._hints.length === 0) {\n this._showHint = false;\n }\n else {\n this._showHint = true;\n }\n\n // start render game stage\n this._renderState = GameState.PLAY;\n\n // start score counter\n this._score0.start();\n\n // increment question counter\n this._numberOfQuestionsSeen += 1;\n }\n\n private _generateHintText(hintIncident: Incident): string {\n let hint = \"\";\n const hintTemplates = this.i18n.HintTemplates[hintIncident.category];\n switch (hintIncident.category) {\n case Category.newsItem:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] || \"\"\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.radioSong:\n // The title property of radioSongs always follow this pattern: track - artist\n const track = hintIncident.title.replace(/(.*?)\\s+\\-.*/, \"$1\");\n const artist = hintIncident.title.replace(/.*\\-(.*)/, \"$1\");\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n )\n .replace(/__ARTIST__/, artist)\n .replace(/__TRACK__/, track);\n break;\n case Category.cinemaMovie:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.tech:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title);\n break;\n case Category.newsPresenter:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.tvShowOrSeries:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.sports:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n case Category.showbizz:\n hint = (\n hintTemplates[Math.round(Math.random() * hintTemplates.length)] ||\n hintTemplates[0]\n ).replace(/__TITLE__/, hintIncident.title || hintIncident.text);\n break;\n }\n return hint;\n }\n\n renderSources(): TemplateResult {\n console.debug(\"renderSources\");\n if (!this.sources.length) {\n return html``;\n }\n // deduplicate array via [...new Set(this.sources)]\n return html`\n <div class=\"guess-the-year-sources\" >\n Source: ${[...new Set(this.sources)].join(\", \")}\n </div>\n `;\n }\n\n _handleImageLoadError = (evt: Event, incident: Incident) => {\n // grab the image element that triggered the error\n const targetImage = evt.target as HTMLImageElement;\n console.debug(`Error loading image: ${targetImage.src} `);\n\n // find out which no image source needs to be used\n const noImageSrc = this.noImageSrc || NoImageImg;\n\n // don't try to set the image source if it\n // has already been set\n if (targetImage.src == noImageSrc) {\n return;\n }\n\n // report broken images back to the server if set.\n if (this.reportBrokenImages) {\n if (incident) {\n this._apiService.postAttributeQualityFeedback(\n incident.id,\n \"image\",\n targetImage.src,\n ContentFeedback.incorrect,\n );\n }\n }\n\n // wait a bit before setting the image\n // so we don't hammer the no image server\n setTimeout(() => {\n targetImage.src = noImageSrc;\n }, 250);\n\n return false;\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"guess-the-year\": GuessTheYear;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiService.d.ts","sourceRoot":"","sources":["../../src/lib/ApiService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,UAAU;IACT,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,MAAM;IAEzB,gBAAgB,CAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI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BAAgB,CAAE,uDAAuD;IACpF,OAAO,YAAY,CAAE,iCAAiC;IACtD,OAAO,YAAY,CAAE,oDAAoD;IACzE,OAAO,YAAY,CAAE,iCAAiC;IACtD,OAAO,YAAY;CACpB"}
|
package/dist/lib/ApiService.js
CHANGED
|
@@ -40,15 +40,20 @@ export class ApiService {
|
|
|
40
40
|
urls.push(url);
|
|
41
41
|
}
|
|
42
42
|
else if (fromString && toString) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
try {
|
|
44
|
+
const from = new Date(fromString).toISOString().substring(0, 10);
|
|
45
|
+
const to = new Date(toString).toISOString().substring(0, 10);
|
|
46
|
+
// add from and to date to search
|
|
47
|
+
urlSearch.set("from", from);
|
|
48
|
+
urlSearch.set("to", to);
|
|
49
|
+
// setup url
|
|
50
|
+
const url = new URL(this.teeeApiUrl);
|
|
51
|
+
url.search = urlSearch.toString();
|
|
52
|
+
urls.push(url);
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
console.error(e, fromString, toString);
|
|
56
|
+
}
|
|
52
57
|
}
|
|
53
58
|
else {
|
|
54
59
|
throw "No correct date or period specified.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiService.js","sourceRoot":"","sources":["../../src/lib/ApiService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAS,MAAM,QAAQ,CAAC;AAGrC,MAAM,OAAO,UAAU;IACrB,YAAoB,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAI,CAAC;IAEpC,KAAK,CAAC,gBAAgB,CAC3B,GAAW,EACX,QAA4B,EAC5B,OAA2B,EAC3B,MAA0B,EAC1B,IAAY,EACZ,IAAY,EACZ,EAAU,EACV,SAA6B,EAC7B,OAA2B;QAE3B,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,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rF,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,wBAAwB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF;AAED,MAAM,CAAN,IAAY,eASX;AATD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACrB,CAAC,EATW,eAAe,KAAf,eAAe,QAS1B","sourcesContent":["import { Util, IHash } from \"./Util\";\nimport { Incident } from \"./Incident\";\n\nexport class ApiService {\n constructor(private teeeApiUrl: string) { }\n\n public async fetchOneIncident(\n pov: string,\n category: string | undefined,\n emotion: string | undefined,\n impact: string | undefined,\n date: string,\n from: string,\n to: string,\n maxLasted: string | undefined,\n variant: string | undefined,\n ): Promise<{ incident: Incident | undefined; sources: string[] }> {\n return new Promise(async (resolve, reject) => {\n console.debug(\"fetchHistory\");\n\n // Set defaults to explicit empty string.\n const povs = pov || \"\";\n const categories = category || \"\";\n const emotions = emotion || \"\";\n const impacts = impact || \"\";\n const dateString = date || \"\";\n const fromString = from || \"\";\n const toString = to || \"\";\n const limitString = \"1\";\n const maxLastedString = maxLasted || \"\";\n const variants = variant || \"\";\n\n try {\n const urls: Array<URL> = [];\n\n const urlSearch = new URLSearchParams({\n pov: povs,\n emotion: emotions,\n impact: impacts,\n limit: limitString,\n variant: variants\n });\n\n // Always randomize incidents on the backend.\n urlSearch.append(\"seed\", \"\" + new Date().getTime());\n\n if (maxLasted) {\n urlSearch.append(\"maxlasted\", \"\" + maxLastedString);\n }\n\n // add category to search\n urlSearch.set(\"category\", categories);\n\n if (dateString) {\n // setup url\n const url = new URL(`${this.teeeApiUrl}/${date}`);\n url.search = urlSearch.toString();\n\n urls.push(url);\n } else if (fromString && toString) {\n try {\n const from = new Date(fromString).toISOString().substring(0, 10);\n const to = new Date(toString).toISOString().substring(0, 10);\n\n // add from and to date to search\n urlSearch.set(\"from\", from);\n urlSearch.set(\"to\", to);\n\n // setup url\n const url = new URL(this.teeeApiUrl);\n url.search = urlSearch.toString();\n\n urls.push(url);\n }\n catch (e) {\n console.error(e, fromString, toString);\n }\n } else {\n throw \"No correct date or period specified.\";\n }\n\n // start fetching all incidents\n let incidents: Array<Incident> = [];\n await Util.asyncForeach(urls, async (url: string) => {\n const response = await fetch(url);\n const json = await response.json();\n incidents = incidents.concat(json.results);\n });\n // Choose the first incident in the list as the one to return.\n const firstIncidentInList = incidents.length ? incidents[0] : undefined;\n\n // search for sources on incidents\n const sourcesFoundInIncidents: IHash = {};\n incidents.forEach((incident: Incident) => {\n if (incident.source) {\n sourcesFoundInIncidents[incident.source] = true;\n }\n });\n\n console.debug([incidents, sourcesFoundInIncidents]);\n\n resolve({\n incident: firstIncidentInList,\n sources: Object.keys(sourcesFoundInIncidents),\n });\n } catch (e) {\n reject(e);\n }\n });\n }\n\n // post feedback about the attribute of an incident.\n public async postAttributeQualityFeedback(\n incidentid: string,\n attribute: string,\n value: string,\n remark: string,\n ) {\n const url = `${this.teeeApiUrl}/feedback/${incidentid}/attribute`;\n await fetch(url, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n attribute,\n value,\n remark,\n }),\n });\n }\n\n // post feedback about an incident.\n public async postIncidentFeedback(incidentid: string, remark: string) {\n const url = `${this.teeeApiUrl}/feedback/${incidentid}/remark`;\n await fetch(url, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n remark,\n }),\n });\n }\n\n // Post the recallability of this incident by the player.\n public async incidentRecallability(incidentid: string, dob: number, is_correct: boolean) {\n this.postIncidentFeedback(incidentid, `recall:absolute-year:${Util.dobToGeneration(dob)}:${is_correct}`);\n }\n}\n\nexport enum ContentFeedback {\n incorrect = \"incorrect\", // This content is not correct\n tooShort = \"tooShort\", // This content is too short\n tooLong = \"tooLong\", // This content is too long\n toneOfVoice = \"toneOfVoice\", // The tone of voice of this content should be improved\n missing = \"missing\", // This content should be created\n noMatch = \"noMatch\", // This content does not match with its sibling data\n badData = \"badData\", // This content contains bad data\n unknown = \"unknown\", // We did not expect this input...\n}\n"]}
|
package/dist/lib/Util.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class Util {
|
|
|
7
7
|
*/
|
|
8
8
|
static shuffleArray(array: Array<any>): Array<any>;
|
|
9
9
|
static dobToGeneration(dob: number): string;
|
|
10
|
+
static scoreToValueJudgement(scoreAsPercent: number): string;
|
|
10
11
|
}
|
|
11
12
|
export interface IHash {
|
|
12
13
|
[Identifier: string | number]: boolean | number | string | string[] | undefined;
|
package/dist/lib/Util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/lib/Util.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;WACK,YAAY,CAC9B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,yDAAyD;IAC5E,QAAQ,EAAE,GAAG;WAOD,iBAAiB,CAC7B,aAAa,EAAE,WAAW,GAAG,SAAS,GACrC,IAAI;IAWP;;OAEG;WACW,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;WAK3C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/lib/Util.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;WACK,YAAY,CAC9B,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,yDAAyD;IAC5E,QAAQ,EAAE,GAAG;WAOD,iBAAiB,CAC7B,aAAa,EAAE,WAAW,GAAG,SAAS,GACrC,IAAI;IAWP;;OAEG;WACW,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;WAK3C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;WAmBpC,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;CAWpE;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAC1B,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,EAAE,GACR,SAAS,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CACzC"}
|
package/dist/lib/Util.js
CHANGED
|
@@ -46,5 +46,24 @@ export class Util {
|
|
|
46
46
|
// generationz: 1997-2012
|
|
47
47
|
// generationalpha: 2013-2028
|
|
48
48
|
}
|
|
49
|
+
static scoreToValueJudgement(scoreAsPercent) {
|
|
50
|
+
if (scoreAsPercent >= 90)
|
|
51
|
+
return 'excellent';
|
|
52
|
+
if (scoreAsPercent >= 80)
|
|
53
|
+
return 'very-good';
|
|
54
|
+
if (scoreAsPercent >= 70)
|
|
55
|
+
return 'good';
|
|
56
|
+
if (scoreAsPercent >= 60)
|
|
57
|
+
return 'reasonable-good';
|
|
58
|
+
if (scoreAsPercent >= 50)
|
|
59
|
+
return 'reasonable';
|
|
60
|
+
if (scoreAsPercent >= 40)
|
|
61
|
+
return 'not-so-good';
|
|
62
|
+
if (scoreAsPercent >= 20)
|
|
63
|
+
return 'not-good';
|
|
64
|
+
if (scoreAsPercent >= 0)
|
|
65
|
+
return 'bad';
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
49
68
|
}
|
|
50
69
|
//# sourceMappingURL=Util.js.map
|
package/dist/lib/Util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.js","sourceRoot":"","sources":["../../src/lib/Util.ts"],"names":[],"mappings":"A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;QACtC,IAAI,GAAG,IAAI,IAAI;YAAE,OAAO,aAAa,CAAC;QACtC,IAAI,GAAG,IAAI,IAAI;YAAE,OAAO,kBAAkB,CAAC;QAC3C,IAAI,GAAG,IAAI,IAAI;YAAE,OAAO,oBAAoB,CAAC;QAC7C,OAAO,EAAE,CAAC;QACV,gCAAgC;QAChC,8BAA8B;QAC9B,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;QACzB,yBAAyB;QACzB,6BAA6B;IAC/B,CAAC;IAGM,MAAM,CAAC,qBAAqB,CAAC,cAAsB;QACxD,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,WAAW,CAAC;QAC7C,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,WAAW,CAAC;QAC7C,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,MAAM,CAAC;QACxC,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,iBAAiB,CAAC;QACnD,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,YAAY,CAAC;QAC9C,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,aAAa,CAAC;QAC/C,IAAI,cAAc,IAAI,EAAE;YAAE,OAAO,UAAU,CAAC;QAC5C,IAAI,cAAc,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["export class Util {\n public static async asyncForeach(\n array: Array<any>, // eslint-disable-line @typescript-eslint/no-explicit-any\n callback: any, // eslint-disable-line @typescript-eslint/no-explicit-any\n ) {\n for (let index = 0; index < array.length; index++) {\n await callback(array[index], index, array);\n }\n }\n\n public static removeAllChildren(\n parentElement: HTMLElement | undefined,\n ): void {\n if (!parentElement) {\n return;\n }\n let childToDelete = parentElement.lastChild;\n while (childToDelete) {\n parentElement.removeChild(childToDelete);\n childToDelete = parentElement.lastChild;\n }\n }\n\n /**\n * Shuffle an array\n */\n public static shuffleArray(array: Array<any>): Array<any> {\n return array.sort(() => Math.random() - 0.5);\n }\n\n // The naming of the generations should conform to what the backend expects.\n public static dobToGeneration(dob: number): string {\n if (dob >= 2013) return 'generationalpha';\n if (dob >= 1997) return 'generationz';\n if (dob >= 1981) return 'generationy';\n if (dob >= 1965) return 'generationx';\n if (dob >= 1946) return 'babyboomers';\n if (dob >= 1928) return 'silentgeneration';\n if (dob >= 1901) return 'greatestgeneration';\n return '';\n // greatestgeneration: 1901-1927\n // silentgeneration: 1928-1945\n // babyboomers: 1946-1964\n // generationx: 1965-1980\n // generationy: 1981-1996\n // generationz: 1997-2012\n // generationalpha: 2013-2028\n }\n\n\n public static scoreToValueJudgement(scoreAsPercent: number): string {\n if (scoreAsPercent >= 90) return 'excellent';\n if (scoreAsPercent >= 80) return 'very-good';\n if (scoreAsPercent >= 70) return 'good';\n if (scoreAsPercent >= 60) return 'reasonable-good';\n if (scoreAsPercent >= 50) return 'reasonable';\n if (scoreAsPercent >= 40) return 'not-so-good';\n if (scoreAsPercent >= 20) return 'not-good';\n if (scoreAsPercent >= 0) return 'bad';\n return '';\n }\n}\n\nexport interface IHash {\n [Identifier: string | number]:\n | boolean\n | number\n | string\n | string[]\n | undefined;\n}\n\nexport interface IStringArrayHash {\n [Identifier: string | number]: string[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EN.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/EN.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,EAAG,YAAW,IAAI;IACV,aAAa,EAAE,gBAAgB;gBAA/B,aAAa,GAAE,gBAAqB;IA+CvD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"EN.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/EN.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,EAAG,YAAW,IAAI;IACV,aAAa,EAAE,gBAAgB;gBAA/B,aAAa,GAAE,gBAAqB;IA+CvD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CA2F/B"}
|
package/dist/lib/i18n/EN.js
CHANGED
|
@@ -54,9 +54,25 @@ export class EN {
|
|
|
54
54
|
case "start":
|
|
55
55
|
return "start";
|
|
56
56
|
case "new-game":
|
|
57
|
-
return "
|
|
57
|
+
return "Try again";
|
|
58
58
|
case "end":
|
|
59
|
-
return "You
|
|
59
|
+
return "You scored __SCORE__ of the __MAX_SCORE__ points. That is a score of __PERCENT__%";
|
|
60
|
+
case "excellent":
|
|
61
|
+
return "That is excellent!";
|
|
62
|
+
case "very-good":
|
|
63
|
+
return "That is very good!";
|
|
64
|
+
case "good":
|
|
65
|
+
return "That is good!";
|
|
66
|
+
case "reasonable-good":
|
|
67
|
+
return "That is reasonably good";
|
|
68
|
+
case "reasonable":
|
|
69
|
+
return "That is reasonable!";
|
|
70
|
+
case "not-so-good":
|
|
71
|
+
return "That is ok";
|
|
72
|
+
case "not-good":
|
|
73
|
+
return "That is not so good";
|
|
74
|
+
case "bad":
|
|
75
|
+
return "That is really bad :)";
|
|
60
76
|
case "next-question":
|
|
61
77
|
return "Next question";
|
|
62
78
|
case "quit":
|
package/dist/lib/i18n/EN.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EN.js","sourceRoot":"","sources":["../../../src/lib/i18n/EN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,MAAM,OAAO,EAAE;IACb,YAAmB,gBAAkC,EAAE;QAApC,kBAAa,GAAb,aAAa,CAAuB;QACrD,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG;YACtC,6CAA6C;SAC9C,CAAC;QACF,aAAa,CAA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OAAO,sBAAsB,CAAA;YAC/B,KAAK,kBAAkB;gBACrB,OAAO,yFAAyF,CAAA;YAClG,KAAK,kBAAkB;gBACrB,OAAO,mDAAmD,CAAA;YAC5D,KAAK,kBAAkB;gBACrB,OAAO,2CAA2C,CAAA;YACpD,KAAK,kBAAkB;gBACrB,OAAO,0CAA0C,CAAA;YACnD,KAAK,sBAAsB;gBACzB,OAAO,UAAU,CAAA;YACnB,KAAK,sBAAsB;gBACzB,OAAO,6JAA6J,CAAA;YACtK,KAAK,sBAAsB;gBACzB,OAAO,oNAAoN,CAAA;YAC7N,KAAK,2BAA2B;gBAC9B,OAAO,4BAA4B,CAAA;QACvC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["import { Category } from \"../Incident\";\nimport { IStringArrayHash } from \"../Util\";\nimport { i18n } from \"./i18n\";\n\nexport class EN implements i18n {\n constructor(public HintTemplates: IStringArrayHash = {}) {\n HintTemplates[Category.newsPresenter] = [\n \"__TITLE__ presented the eight o'clock news.\",\n ];\n HintTemplates[Category.tech] = [\n \"Tech news: __TITLE__.\",\n \"Tech enthusiasts were excited about '__TITLE__'.\",\n ];\n HintTemplates[Category.sports] = [\n \"Sports news: __TITLE__.\",\n \"Sports fans were talking about '__TITLE__'.\",\n ];\n HintTemplates[Category.tvShowOrSeries] = [\n \"We watched '__TITLE__' on television.\",\n ];\n HintTemplates[Category.newsItem] = [\n \"The newspaper also mentioned '__TITLE__' this year.\",\n \"'__TITLE__' was also in the news this year.\",\n ];\n HintTemplates[Category.cinemaMovie] = [\n \"The movie '__TITLE__' was playing in theaters.\",\n \"The movie '__TITLE__' was a blockbuster.\",\n \"The movie '__TITLE__' could be seen in cinemas.\",\n \"'__TITLE__' was on the silver screen.\",\n ];\n HintTemplates[Category.radioSong] = [\n \"The hit '__TRACK__' by __ARTIST__ was a frequently played tune on the radio.\",\n \"The song '__TRACK__' by __ARTIST__ was unavoidable on the radio.\",\n \"__ARTIST__'s '__TRACK__' was regularly heard on the radio.\",\n \"You couldn't miss '__TRACK__' by __ARTIST__ on the radio, it was played so often.\",\n \"'__TRACK__' by __ARTIST__ was a staple on the radio.\",\n \"At that time, '__TRACK__' by __ARTIST__ was a frequently heard radio hit.\",\n \"'__TRACK__' by __ARTIST__ was a radio favorite in this year.\",\n \"The radio stations broadcast '__TRACK__' by __ARTIST__.\",\n \"The song '__TRACK__' by __ARTIST__ enjoyed a lot of airplay on the radio.\",\n \"'__TRACK__' by __ARTIST__ was a frequently heard song on the radio stations.\",\n \"'__TRACK__' by __ARTIST__ became a radio classic.\",\n \"'__TRACK__' by __ARTIST__ was an unforgettable hit that dominated the radio.\",\n \"'__TRACK__' by __ARTIST__ was a frequently heard hit.\",\n \"The radio stations played '__TRACK__' by __ARTIST__ incessantly.\",\n \"'__TRACK__' by __ARTIST__ was a catchy song that you kept singing along to.\",\n \"The beat of '__TRACK__' by __ARTIST__ was irresistible.\",\n \"'__TRACK__' by __ARTIST__ had a unique sound that you wouldn't soon forget.\",\n \"You couldn't ignore '__TRACK__' by __ARTIST__.\",\n ];\n }\n\n translate(key: string): string {\n switch (key) {\n case \"year\":\n return \"year\";\n case \"start\":\n return \"start\";\n case \"new-game\":\n return \"Try again\";\n case \"end\":\n return \"You scored __SCORE__ of the __MAX_SCORE__ points. That is a score of __PERCENT__%\";\n case \"excellent\":\n return \"That is excellent!\";\n case \"very-good\":\n return \"That is very good!\";\n case \"good\":\n return \"That is good!\";\n case \"reasonable-good\":\n return \"That is reasonably good\";\n case \"reasonable\":\n return \"That is reasonable!\";\n case \"not-so-good\":\n return \"That is ok\";\n case \"not-good\":\n return \"That is not so good\";\n case \"bad\":\n return \"That is really bad :)\";\n case \"next-question\":\n return \"Next question\";\n case \"quit\":\n return \"Quit\";\n case \"answer-correct\":\n return \"Correct\";\n case \"answer-wrong\":\n return \"Unfortunately\";\n case \"question-number\":\n return \"Question\";\n case \"question-score\":\n return \"Score\";\n case \"total-score\":\n return \"Total score\";\n case \"show-hint\":\n return \"Show hint\";\n case \"used-hint-singular\":\n return \"You have used 1 hint\";\n case \"used-hint-plural\":\n return \"You have used __HINTS__ hints\";\n case \"number-points-singular\":\n return \"You scored 1 point for this question\";\n case \"number-points-plural\":\n return \"You scored __POINTS__ points for this question\";\n case \"correct-answer-was\":\n return \"You chose __WRONG__ but the correct answer was __CORRECT__\";\n case \"no-answer-correct-answer-was\":\n return \"You didn't answer, but the correct answer was __CORRECT__\";\n case \"game-name\":\n return \"Guessss The Year\";\n case \"game-call-to-action\":\n return \"Game on!\";\n case \"your-answer\":\n return \"My answer\";\n case \"your-feedback\":\n return \"comments\";\n case \"try-left\":\n return \"__TRIES__ try left\";\n case \"tries-left\":\n return \"__TRIES__ tries left\";\n case \"in-one-second\":\n return \"In __SECONDS__ second\";\n case \"in-x-seconds\":\n return \"In __SECONDS__ seconds\";\n case \"game-settings-p0\":\n return \" What year of birth?\"\n case \"game-settings-p1\":\n return \" Right. Oh hey, Biff, hey, guys, how are you doing? Look, there's a rhythmic\"\n case \"game-settings-p2\":\n return \" questions ceremonial ritual coming up.From start\"\n case \"game-settings-p3\":\n return \" Precisely, just relax now Calvin. To end\"\n case \"game-settings-p4\":\n return \" you've got a big bruise on you're head.\"\n case \"game-introduction-p1\":\n return \"somethng\"\n case \"game-introduction-p2\":\n return \"Excuse me. Go. Go. Never mind that, never mind that now, never mind that, never mind- Yeah, well, how about my homework, McFly? Don't stop, Wilbert, drive.\"\n case \"game-introduction-p3\":\n return \"Mom, is that you? Oh. Uh Doc, uh no. No, don't be silly. What did your mother ever see in that kid? You guys, take him in back and I'll be right there. Well c'mon, this ain't no peep show.\"\n case \"game-introduction-welcome\":\n return `Welcome to Guess The Year!`\n }\n return key;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NL.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/NL.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,EAAG,YAAW,IAAI;IACV,aAAa,EAAE,gBAAgB;gBAA/B,aAAa,GAAE,gBAAqB;IAmDvD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"NL.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/NL.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,EAAG,YAAW,IAAI;IACV,aAAa,EAAE,gBAAgB;gBAA/B,aAAa,GAAE,gBAAqB;IAmDvD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CA2F/B"}
|
package/dist/lib/i18n/NL.js
CHANGED
|
@@ -58,9 +58,25 @@ export class NL {
|
|
|
58
58
|
case "start":
|
|
59
59
|
return "start";
|
|
60
60
|
case "new-game":
|
|
61
|
-
return "
|
|
61
|
+
return "Probeer opnieuw";
|
|
62
62
|
case "end":
|
|
63
|
-
return "
|
|
63
|
+
return "Je haalde __SCORE__ van de mogelijke __MAX_SCORE__ punten. Dat komt overeen met __PERCENT__%";
|
|
64
|
+
case "excellent":
|
|
65
|
+
return "Dat is echt ongelooflijk goed!";
|
|
66
|
+
case "very-good":
|
|
67
|
+
return "Dat is heel goed!";
|
|
68
|
+
case "good":
|
|
69
|
+
return "Dat is goed!";
|
|
70
|
+
case "reasonable-good":
|
|
71
|
+
return "Dat is best goed";
|
|
72
|
+
case "reasonable":
|
|
73
|
+
return "Dat is best redelijk!";
|
|
74
|
+
case "not-so-good":
|
|
75
|
+
return "Dat is redelijk";
|
|
76
|
+
case "not-good":
|
|
77
|
+
return "Dat is niet zo goed";
|
|
78
|
+
case "bad":
|
|
79
|
+
return "Dat is ronduit slecht :)";
|
|
64
80
|
case "next-question":
|
|
65
81
|
return "Volgende vraag";
|
|
66
82
|
case "quit":
|
|
@@ -116,11 +132,11 @@ export class NL {
|
|
|
116
132
|
case "game-settings-p4":
|
|
117
133
|
return " you've got a big bruise on you're head.";
|
|
118
134
|
case "game-introduction-p1":
|
|
119
|
-
return "
|
|
135
|
+
return "Welkom bij de ultieme test van je historische kennis!";
|
|
120
136
|
case "game-introduction-p2":
|
|
121
|
-
return "
|
|
137
|
+
return "Duik in de tijd en daag jezelf en je vrienden uit om de jaartallen van fascinerende gebeurtenissen te raden. Van baanbrekende uitvindingen tot memorabele momenten, dit spel neemt je mee op een reis door de geschiedenis.";
|
|
122
138
|
case "game-introduction-p3":
|
|
123
|
-
return "
|
|
139
|
+
return "Ben jij de meester van de chronologie? Ontdek het nu!";
|
|
124
140
|
case "game-introduction-welcome":
|
|
125
141
|
return `Welkom bij Guess The Year!`;
|
|
126
142
|
}
|