-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
index.html
151 lines (124 loc) ยท 4.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Mystic Bot๐ฎ</title>
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:[email protected]&display=swap" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="web/favicon.ico">
<link rel="stylesheet" href="web/estilo.css">
<style>
/* Estilo de Carga*/
.loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #232323;
z-index: 1000;
}
.loading-screen p {
font-size: 2em;
font-family: 'Comfortaa', sans-serif;
}
/* Ocultar el Cargando cuando Cargo gg */
.hide {
display: none;
}
</style>
</head>
<body>
<div class="loading-screen" id="loading-screen">
<p>โCargandoโณ</p>
</div>
<video autoplay muted loop id="bg-video" preload="auto">
<source src="https://github.com/user-attachments/assets/39cbf647-28cd-4604-a717-ada1439d274b" type="video/mp4">
Er Video
</video>
<div class="content" id="content">
<p>โCargandoโณ</p>
</div>
<script>
function hideLoadingScreen() {
document.getElementById('loading-screen').classList.add('hide');
}
async function loadContent(url, fallbackUrl = null) {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`Error fetching ${url}: ${response.statusText}`);
document.getElementById('content').innerHTML = await response.text();
// Comentarios Disqus, PErsonalizable y Claramente Opcional.
loadDisqus();
} catch (error) {
console.error(`Error cargando D: ${error.message}`);
if (fallbackUrl) {
console.log(`Usando fallback URL: ${fallbackUrl}`);
loadContent(fallbackUrl);
} else {
document.getElementById('content').innerHTML = `<p>Error Cargando: ${error.message}</p>`;
}
}
}
function loadDisqus() {
const disqusDiv = document.createElement('div');
disqusDiv.id = 'disqus_thread';
document.getElementById('content').appendChild(disqusDiv);
const disqus_config = function () {
this.page.url = window.location.href;
this.page.identifier = document.title;
};
(function() {
const d = document, s = d.createElement('script');
s.src = 'https://amigos-steam.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
}
function getLocalizedUrl(urlBase) {
const lang = navigator.language || navigator.userLanguage;
const langMap = {
es: 'es.html',
pt: 'pt.html',
fr: 'fr.html',
ru: 'ru.html',
ar: 'ar.html',
hi: 'hi.html'
};
return urlBase + (langMap[lang.slice(0, 2)] || 'ingles.html');
}
function loadLocalizedContent(urlBase) {
const localizedUrl = getLocalizedUrl(urlBase);
const fallbackUrl = `${urlBase}ingles.html`;
loadContent(localizedUrl, fallbackUrl);
}
document.addEventListener("DOMContentLoaded", () => {
const bgVideo = document.getElementById('bg-video');
bgVideo.addEventListener('loadeddata', () => {
loadLocalizedContent('web/');
hideLoadingScreen();
});
});
document.addEventListener('click', (event) => {
const anchor = event.target.closest('a');
if (anchor && anchor.getAttribute('href')?.includes('web/')) {
event.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
loadLocalizedContent(anchor.getAttribute('href').replace('.html', ''));
}
});
window.onpopstate = () => location.reload();
</script>
<!-- Widget de Discord -->
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer>
new Crate({
server: '1278571215635877908',
channel: '1286022420330840215'
});
</script>
<noscript>JavaScript OFF. Se requiere JS activado para visualizar esta pรกgina. Consulta el repositorio si tienes problemas.</noscript>
</body>
</html>