front/home page: make first word of the title choosen at random in a list

This commit is contained in:
Alice Gaudon 2021-11-21 13:15:15 +01:00
parent c0918b17ed
commit 428990dc00
1 changed files with 9 additions and 1 deletions

View File

@ -2,11 +2,19 @@
import {locals} from "../ts/stores";
import {route, hasRoute, hasAnyRoute} from "../../common/Routing";
import BaseTemplate from "./templates/BaseTemplate.svelte";
import {onMount} from "svelte";
let randomTitleSWord = 'Svelte';
const possibleSWords = ['Svelte', 'Simple', 'Scalable', 'Super', 'Structure', 'Satisfying'];
onMount(() => {
randomTitleSWord = possibleSWords[Math.floor(Math.random() * possibleSWords.length)];
});
</script>
<BaseTemplate title="{$locals.app.name}" h1={false}>
<div class="panel">
<h1>swaf - Svelte Web Application Framework</h1>
<h1>swaf - {randomTitleSWord} Web Application Framework</h1>
<p>Welcome to {$locals.app.name}!</p>
{#if hasAnyRoute('tests', 'design')}