-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
178 lines (158 loc) · 4.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sahara Dust Information - Coming Soon</title>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap"
rel="stylesheet"
/>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-family: "Poppins", sans-serif;
color: #333;
}
.content {
position: relative;
z-index: 2;
}
h1 {
font-size: 48px;
margin-bottom: 20px;
font-weight: 700;
}
h2 {
font-size: 24px;
font-weight: 400;
}
.language-dropdown {
position: absolute;
top: 20px;
right: 20px;
z-index: 3;
}
.language-dropdown .dropdown-toggle {
background-color: transparent;
border: none;
font-family: "Poppins", sans-serif;
font-size: 16px;
font-weight: 400;
cursor: pointer;
}
.language-dropdown .dropdown-menu {
display: none;
position: absolute;
top: 100%;
right: 0;
background-color: #fff;
border: 1px solid #ccc;
padding: 10px;
list-style: none;
margin: 0;
}
.language-dropdown:hover .dropdown-menu {
display: block;
}
.language-dropdown .dropdown-menu li {
cursor: pointer;
padding: 5px 0;
}
@media screen and (max-width: 600px) {
body {
padding: 16px;
}
h1 {
font-size: 36px;
}
h2 {
font-size: 18px;
}
.language-dropdown .dropdown-toggle {
font-size: 14px;
}
}
</style>
</head>
<body>
<div class="content">
<h3>🚧 Coming Soon</h3>
<h1 class="headline">Your Sahara Dust Information Website</h1>
<h2 class="subheadline">
Understanding The Impact on Health and Climate
</h2>
</div>
<div class="language-dropdown">
<button class="dropdown-toggle" id="selectedLanguage">English</button>
<ul class="dropdown-menu">
<li id="alternateLanguage">Deutsch</li>
</ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.fog.min.js"></script>
<script>
VANTA.FOG({
el: "body",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.0,
minWidth: 200.0,
highlightColor: 0xf0a837,
midtoneColor: 0xbe9795,
lowlightColor: 0xfcfcfc,
baseColor: 0xfce9e9,
blurFactor: 0.18,
speed: 2.5,
zoom: 0.6,
});
const contentData = {
en: {
headline: "Your Sahara Dust Information Website",
subheadline: "Understanding The Impact on Health and Climate",
language: "English",
},
de: {
headline: "Deine Saharastaub Informationsseite",
subheadline: "Verstehe die Auswirkungen auf Gesundheit und Klima",
language: "Deutsch",
},
};
const headline = document.querySelector(".headline");
const subheadline = document.querySelector(".subheadline");
const selectedLanguage = document.getElementById("selectedLanguage");
const alternateLanguage = document.getElementById("alternateLanguage");
function setLanguage(lang) {
headline.textContent = contentData[lang].headline;
subheadline.textContent = contentData[lang].subheadline;
selectedLanguage.textContent = lang === "en" ? "English" : "Deutsch";
alternateLanguage.textContent = lang === "en" ? "Deutsch" : "English";
}
function toggleLanguage() {
const currentLanguage = selectedLanguage.textContent;
if (currentLanguage === "English") {
setLanguage("de");
} else {
setLanguage("en");
}
}
// Check the current domain and set the language accordingly
const currentDomain = window.location.hostname;
const urlParams = new URLSearchParams(window.location.search);
const isRedirectedFromDE = urlParams.get("from") === "de";
if (currentDomain === "sahara-staub.de" || isRedirectedFromDE) {
setLanguage("de");
} else {
setLanguage("en");
}
alternateLanguage.addEventListener("click", toggleLanguage);
</script>
</body>
</html>