mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
import Template, { ErrorTemplate } from './templates';
|
|
import './styles.css';
|
|
import { parse } from 'gift-pegjs';
|
|
|
|
const multiple = parse(`
|
|
Who's buried in Grant's tomb? {~%-50%Grant=%50%Jefferson=%50%no one####Not sure? There are many answers for this question so do not fret. Not sure? There are many answers for this question so do not fret.}
|
|
|
|
Grant is _____ in Grant's tomb. {=buried#No one is buried there.=entombed~living}
|
|
|
|
Grant is buried in Grant's tomb. {FALSE}
|
|
|
|
Who's buried in Grant's tomb? {=no one=nobody}
|
|
|
|
When was Ulysses S. Grant born? {#1822:5}
|
|
|
|
What is the capital of Canada? {=Canada -> Ottawa =Italy -> Rome =Japan -> Tokyo}
|
|
`);
|
|
|
|
|
|
const items = multiple.map((item) => Template(item, { theme: 'dark' })).join('');
|
|
const errorItemDark = ErrorTemplate('Hello', 'Error');
|
|
|
|
const lightItems = multiple.map((item) => Template(item, { theme: 'light' })).join('');
|
|
|
|
const errorItem = ErrorTemplate('Hello', 'Error');
|
|
|
|
const app = document.getElementById('app');
|
|
if (app) app.innerHTML = items + errorItemDark + lightItems + errorItem;
|