diff --git a/res/js/index.ts b/res/js/index.ts index 89892f5..ec760f3 100644 --- a/res/js/index.ts +++ b/res/js/index.ts @@ -1,6 +1,7 @@ import swal from 'sweetalert2'; import * as ArrayFrom from 'array-from'; import {Category, Simulation} from '../../lib/types'; +import { template as reactiveTemplate } from '../templates/reactive-template' if (!(Array as any).from) (Array as any).from = ArrayFrom; @@ -39,7 +40,7 @@ const currentCategory = (localStorage && localStorage[window.lsPrefix + 'current const ractive = new Ractive({ el: '#ractive-target', - template: '#ractive-template', + template: reactiveTemplate, computed: { languages() { return Object.entries(this.get('languageMappings')); diff --git a/res/template.html b/res/template.html index ff93b20..e4adadb 100644 --- a/res/template.html +++ b/res/template.html @@ -38,39 +38,6 @@
- - diff --git a/res/templates/reactive-template.ts b/res/templates/reactive-template.ts new file mode 100644 index 0000000..cd5704d --- /dev/null +++ b/res/templates/reactive-template.ts @@ -0,0 +1,32 @@ +export const template: string = ` +
+ {{#if languages.length > 1}} + + {{/if}} + +
+
+ {{#each simulations}} +
+ Screenshot of the {{display}} +
+ +

{{title}}

+
+
+ {{/each}} +
+` \ No newline at end of file