Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (105 loc) · 2.81 KB
/
Copy pathindex.html
File metadata and controls
110 lines (105 loc) · 2.81 KB
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
---
layout: null
---
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Internet Public Library - Redirecting...</title>
<script>
// Function to detect browser language and redirect accordingly
function redirectToLocalizedPage() {
// Get browser language
var language = navigator.language || navigator.userLanguage;
language = language.toLowerCase();
// Default path
var redirectPath = '/en-US/';
// Check if language is Portuguese (Brazil)
if (language.indexOf('pt-br') !== -1 || language.indexOf('pt') !== -1) {
redirectPath = '/pt-BR/';
}
// Get user's preferred language from localStorage if available
var storedLanguage = localStorage.getItem('preferred_language');
if (storedLanguage) {
redirectPath = '/' + storedLanguage + '/';
}
// Redirect to the appropriate language version
window.location.href = redirectPath;
}
// Execute redirection on page load
window.onload = redirectToLocalizedPage;
</script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-color: #f8f9fa;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
padding: 20px;
box-sizing: border-box;
}
.container {
max-width: 600px;
text-align: center;
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h1 {
color: #2563eb;
margin-top: 0;
}
p {
color: #4b5563;
margin-bottom: 20px;
line-height: 1.5;
}
.links {
margin-top: 30px;
}
a {
display: inline-block;
margin: 0 10px;
padding: 10px 20px;
background-color: #2563eb;
color: white;
text-decoration: none;
border-radius: 4px;
font-weight: 500;
transition: background-color 0.2s;
}
a:hover {
background-color: #1d4ed8;
}
.spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top: 4px solid #2563eb;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="container">
<h1>Internet Public Library</h1>
<p>Redirecting you to the appropriate language version...</p>
<div class="spinner"></div>
<p>If you are not redirected automatically, please choose your language:</p>
<div class="links">
<a href="/en-US/">English (US)</a>
<a href="/pt-BR/">Português (Brasil)</a>
</div>
</div>
</body>
</html>