Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for multiple languages #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true

[*.css]
css.format.newlineBetweenSelectors = false
css.format.spaceAroundSelectorSeparator = true
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"livePreview.defaultPreviewPath": "/index.html"
}
66 changes: 33 additions & 33 deletions Assets/CSS/main.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200;300;400;500;600;700;800;900&display=swap');

@font-face {
font-family: 'Horizon';
src: url(/assets/fonts/Horizon.woff2) format('woff2');
}

:root {
font-family: 'Horizon';
color: white;
}

* {
box-sizing: border-box;
}

a, a:focus, a:hover {
-webkit-touch-callout: none;
/* -webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; */
color: unset;
text-decoration: none;
}

html, body {
height: 100vh;
height: fill-available;
height: -moz-fill-available;
height: -webkit-fill-available;
}
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200;300;400;500;600;700;800;900&display=swap');
@font-face {
font-family: 'Horizon';
src: url(/assets/fonts/Horizon.woff2) format('woff2');
}
:root {
font-family: 'Horizon';
color: white;
}
* {
box-sizing: border-box;
}
a, a:focus, a:hover {
-webkit-touch-callout: none;
/* -webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; */
color: unset;
text-decoration: none;
}
html, body {
height: 100vh;
height: fill-available;
height: -moz-fill-available;
height: -webkit-fill-available;
}
Binary file added Assets/Images/languages/en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Images/languages/pl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions Assets/JS/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const print = console.log
const gid = id_name=>document.getElementById(id_name)
const sum = (list, lambda=e=>e)=>list.reduce((acc,val)=>acc+lambda(val), 0)
const logtime = (stime, process, color="greenyellow")=>print(`%c${process}%c completed in %c${new Date()-stime}ms%c`, "background-color: white; color: black; font-weight: 700;", "", `color: ${color};`, "")

var base = window.location.href
base = base.substring(base.indexOf("//") + 2)
base = base.substring(base.indexOf("/"))
base = base.substring(0, base.lastIndexOf("/"))
const print = console.log
const gid = id_name => document.getElementById(id_name)
const sum = (list, lambda = e => e) => list.reduce((acc, val) => acc + lambda(val), 0)
const logtime = (stime, process, color = "greenyellow") => print(`%c${process}%c completed in %c${new Date() - stime}ms%c`, "background-color: white; color: black; font-weight: 700;", "", `color: ${color};`, "")

const base = new URL(window.location.href).pathname.replace(/\/[^\/]*$/, '')
133 changes: 74 additions & 59 deletions forbidden-west/index.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SWXMZEH7DD"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-SWXMZEH7DD');
</script>

<!-- Normal Site Stuff -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="All datapoints and lore-related collectibles in Horizon: Forbidden West, with a responsive version of the in-game UI">
<meta name="keywords" content="Horizon 2, Horizon: Forbidden West, The Apollo Archive, Datapoints, Horizon Collectibles">
<meta name="author" content="Aryan Pingle">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Twitter -->
<meta property="twitter:card" content="summary">
<meta property="twitter:creator" content="@aryan_pingle">
<meta property="twitter:title" content="The Apollo Archive | Horizon: Forbidden West">
<meta property="twitter:description" content="All datapoints and lore-related collectibles in Horizon: Forbidden West, with a responsive version of the in-game UI">
<meta property="twitter:image" content="https://apollo-archive.netlify.app/assets/images/favicon-opaque.png">
<meta property="twitter:image:src" content="https://apollo-archive.netlify.app/assets/images/favicon-opaque.png">
<meta property="twitter:image:alt" content="A symbol of the focus, which is an in-game object">

<!-- For The Page -->
<base href="/">
<title>The Apollo Archive | Horizon: Forbidden West</title>
<link rel="icon" href="/assets/images/favicon-16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/assets/images/favicon-32.png" sizes="32x32" type="image/png">
<link rel="icon" href="/assets/images/favicon-48.png" sizes="48x48" type="image/png">
<link rel="icon" href="/assets/images/favicon-62.png" sizes="62x62" type="image/png">

<!-- CSS -->
<link rel="stylesheet" href="/index.css">

<!-- JS -->
<script>
if("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js")
}
</script>
</head>
<body>
<div id="page">
<nav>
<a class="nav__item" id="apollo-logo" href="/"></a>
</nav>
<section id="section-hero">
Maybe<br>Soon
</section>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="pl">

<head>
<script>
window.language = "en";
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SWXMZEH7DD"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'G-SWXMZEH7DD');
</script>

<!-- Normal Site Stuff -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="keywords" content="Horizon Zero Dawn, The Frozen Wilds, Horizon Forbidden West, Apollo Archive, Datapoints, Horizon Collectables">
<meta name="author" content="Aryan Pingle">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Twitter -->
<meta property="twitter:card" content="summary">
<meta property="twitter:creator" content="@aryan_pingle">
<meta property="twitter:title" content="Apollo Archive | Horizon Forbidden West">
<meta property="twitter:description" content="">
<meta property="twitter:image" content="https://apollo-archive.netlify.app/assets/images/favicon-opaque.png">
<meta property="twitter:image:src" content="https://apollo-archive.netlify.app/assets/images/favicon-opaque.png">
<meta property="twitter:image:alt" content="A symbol of the focus, which is an in-game object">

<!-- For The Page -->
<base href="/">
<title>Apollo Archive | Horizon Forbidden West</title>
<link rel="icon" href="/assets/images/favicon-16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/assets/images/favicon-32.png" sizes="32x32" type="image/png">
<link rel="icon" href="/assets/images/favicon-48.png" sizes="48x48" type="image/png">
<link rel="icon" href="/assets/images/favicon-62.png" sizes="62x62" type="image/png">

<!-- CSS -->
<link rel="stylesheet" href="/index.css">

<!-- JS -->
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js")
}
</script>
</head>

<body>
<div id="page">
<nav>
<a class="nav__item" id="apollo-logo" href="/"></a>
</nav>
<section id="section-hero">
<script>
document.addEventListener("DOMContentLoaded", function() {
var text;
if (sessionStorage.getItem("language") === "en") {
document.getElementById("section-hero").innerText = "Maybe Soon";
} else if (sessionStorage.getItem("language") === "pl") {
document.getElementById("section-hero").innerText = "Być może kiedyś ...";
}
});
</script>
</section>
</div>
</body>

</html>
Loading