Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,26 @@
</head>
<body>

<div style="position: absolute; top: 1rem; right: 2rem;">
<a href="/ja" style="color: var(--foreground); text-decoration: none; font-weight: 500;">Japanese</a>
<div style="position: absolute; top: 1rem; right: 2rem; z-index: 10;">
<select
id="language-select"
aria-label="Language"
onchange="window.location.href = this.value;"
style="appearance: none; background: rgba(255, 255, 255, 0.06); color: var(--foreground); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 0.45rem 2.25rem 0.45rem 0.8rem; font: inherit; font-weight: 500; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.08);"
>
<option value="/">English</option>
<option value="/ja">Japanese</option>
<option value="/zh">Chinese</option>
</select>
</div>
<script>
(function () {
const select = document.getElementById('language-select');
if (!select) return;
const path = window.location.pathname;
select.value = '/' + path.split('/')[1];
})();
</script>
<div class="container">
<div style="float: right; margin: 1rem 0 1rem 1rem; width: 10rem;">
<img src="images/Figure 0100 horizontal.svg">
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"scripts": {
"extract:ja": "node translation-scripts/extract-content.js index.html ja",
"replace:ja": "node translation-scripts/replace-content.js ja",
"extract:zh": "node translation-scripts/extract-content.js index.html zh",
"replace:zh": "node translation-scripts/replace-content.js zh",
"serve": "python3 -m http.server 8000 || python -m SimpleHTTPServer 8000"
},
"dependencies": {
Expand Down
Loading