diff options
author | Daniel Schadt <kingdread@gmx.de> | 2024-04-04 21:31:57 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2024-04-04 21:31:57 +0200 |
commit | 6ee21f6c078891e4453415cbebd6b7d591185c5f (patch) | |
tree | f57490cda863521a352570cb5081435470a4564a /asset-sources | |
parent | f3902c84e07514f252f02a38a2795946f70ba896 (diff) | |
parent | 3968fad3a060c40a84eb07a0cf93e22e1161da61 (diff) | |
download | fietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.tar.gz fietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.tar.bz2 fietsboek-6ee21f6c078891e4453415cbebd6b7d591185c5f.zip |
Merge branch 'language-chooser'
Diffstat (limited to 'asset-sources')
-rw-r--r-- | asset-sources/fietsboek.ts | 14 | ||||
-rw-r--r-- | asset-sources/theme.scss | 25 |
2 files changed, 39 insertions, 0 deletions
diff --git a/asset-sources/fietsboek.ts b/asset-sources/fietsboek.ts index b76b98b..1073ae4 100644 --- a/asset-sources/fietsboek.ts +++ b/asset-sources/fietsboek.ts @@ -52,6 +52,20 @@ function addHandler<K extends keyof GlobalEventHandlersEventMap>( } /** + * Handler for when a language is clicked. Sets the cookie to the correct locale. + * + * @param event - The triggering event. + */ +function languageClicked(event: MouseEvent) { + const language = (event.target as HTMLElement).getAttribute("data-langcode"); + document.cookie = "fietsboek_locale=" + language; + window.location.reload(); + event.preventDefault(); +} + +addHandler(".language-choice", "click", languageClicked); + +/** * Handler for when a tag is clicked. Removes the tag from the tag list. * * @param event - The triggering event. diff --git a/asset-sources/theme.scss b/asset-sources/theme.scss index 8e0f001..610e688 100644 --- a/asset-sources/theme.scss +++ b/asset-sources/theme.scss @@ -1,14 +1,39 @@ +html { + min-height: 100%; +} + body { font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; color: #101010; background: #efefef; + min-height: 100vh; + display: flex; + flex-direction: column; } strong { font-weight: 700; } +#mainContent { + flex: 1; +} + +#siteFooter { + padding-bottom: 20px; +} + +#languageChooser { + display: flex; + + .language-choice { + display: block; + margin-right: 20px; + text-decoration: none; + } +} + .brand-link { text-decoration: none; } |