-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfaq.html
More file actions
210 lines (189 loc) · 9.21 KB
/
faq.html
File metadata and controls
210 lines (189 loc) · 9.21 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="it">
<head>
<!-- Meta tags per SEO e responsività -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loweredgames Changelog Maps - FAQ</title>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="images/icons/favicon.ico">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="lightbox.css">
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="translate.js"></script>
<script defer src="lightbox.js"></script>
</head>
<body>
<!-- Header con titolo principale e navigazione -->
<header>
<h1 onclick="window.location.href='index.html'">Loweredgames Changelog Maps</h1>
</header>
<!-- Contenuto principale -->
<main>
<!-- Intestazione del post con immagine e metadati -->
<div id="post-header" class="post-header">
</div>
<!-- Contenuto del FAQ da Markdown -->
<div id="faq-content" class="changelog">
<div class="loading">Caricamento delle FAQ in corso...</div>
</div>
<script>
// Gestione delle immagini e video responsive
function handleMediaContent() {
// Gestione immagini
document.querySelectorAll('#faq-content img').forEach(img => {
img.style.maxWidth = '100%';
img.style.height = 'auto';
img.loading = 'lazy';
img.decoding = 'async';
});
// Gestione video
document.querySelectorAll('#faq-content video').forEach(video => {
if (!video.parentElement.classList.contains('video-container')) {
const container = document.createElement('div');
container.className = 'video-container';
video.parentNode.insertBefore(container, video);
container.appendChild(video);
}
});
// Gestione iframe video (es. YouTube)
document.querySelectorAll('#faq-content iframe').forEach(iframe => {
if (iframe.src.includes('youtube.com') || iframe.src.includes('vimeo.com')) {
if (!iframe.parentElement.classList.contains('video-container')) {
const container = document.createElement('div');
container.className = 'video-container';
iframe.parentNode.insertBefore(container, iframe);
container.appendChild(iframe);
}
}
});
}
// Osserva i cambiamenti del contenuto
const observer = new MutationObserver(handleMediaContent);
observer.observe(document.getElementById('faq-content'), {
childList: true,
subtree: true
});
</script>
<!-- Freccia laterale: appare quando si scorre il contenuto -->
</main>
<a id="scroll-arrow" href="#" title="Torna all'inizio" aria-label="Torna all'inizio">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.59 5.58L20 12l-8-8-8 8z" />
</svg>
</a>
</main>
<!-- Sezione Discord -->
<section class="discord-section">
<div class="discord-container">
<h2>Unisciti alla mia community Discord!</h2>
<p>Per supporto o problemi, aggiornamenti e discussioni in tempo reale...</p>
<a href="https://discord.gg/T6PHxhznJ6" class="discord-button">
<img src="images/social_logo/Discord.png" alt="Discord">
Entra nel Server
</a>
</div>
</section>
<!-- Footer con copyright e Link-->
<footer>
<div class="footer-content">
<nav>
<a href="help.html">Risoluzione dei problemi</a>
</nav>
<span> </span>
<h3>Link:</h3>
<div class="social-icons">
<a href="https://github.com/Loweredgames/" class="social-icon" title="GitHub">
<img src="images/social_logo/Github.png" alt="GitHub">
</a>
<a href="https://modrinth.com/user/Loweredgames/" class="social-icon" title="Modrinth">
<img src="images/social_logo/Modrinth.png" alt="Modrinth">
</a>
<a href="https://www.planetminecraft.com/member/loweredgames/" class="social-icon" title="PlanetMinecraft">
<img src="images/social_logo/PlanetMinecraft.png" alt="PlanetMinecraft">
</a>
<a href="https://www.curseforge.com/members/loweredgamesdev/projects/" class="social-icon" title="CurseForge">
<img src="images/social_logo/CursedForge.png" alt="CurseForge">
</a>
<a href="https://smithed.net/Loweredgames/" class="social-icon" title="Smithed">
<img src="images/social_logo/Smithed.png" alt="Smithed">
</a>
<a href="https://crowdin.com/profile/" class="social-icon" title="Crowdin">
<img src="images/social_logo/Crowdin.png" alt="Crowdin">
</a>
</div>
<p>© <a href="license.html">Loweredgames Copyright</a> - Tutti i diritti riservati.</p>
</div>
</footer>
<script>
// Funzione per caricare e convertire il file Markdown
async function loadFAQ() {
try {
const response = await fetch('faq.md');
if (!response.ok) {
throw new Error(`Errore nel caricamento: ${response.status}`);
}
const markdownText = await response.text();
const htmlContent = marked.parse(markdownText);
document.getElementById('faq-content').innerHTML = htmlContent;
// Notifica che il contenuto è stato inserito (usato dallo script della freccia)
document.dispatchEvent(new Event('changelog:loaded'));
} catch (error) {
console.error('Errore:', error);
document.getElementById('faq-content').innerHTML = `
<div class="error-message">
<img src="https://placehold.co/150x150/2d2d2d/ff0000/png?text=⚠" alt="Error">
<h2>Errore nel caricamento</h2>
<p>Non è stato possibile caricare le FAQ.</p>
<p><em>Errore: ${error.message}</em></p>
</div>
`;
}
}
// Carica le FAQ quando la pagina è pronta
document.addEventListener('DOMContentLoaded', loadFAQ);
</script>
<script>
(function(){
const arrow = document.getElementById('scroll-arrow');
const content = document.getElementById('faq-content');
const postHeader = document.getElementById('post-header');
if (!arrow || !content) return;
function isContainerScrollable(el) { return el && el.scrollHeight > el.clientHeight; }
function updateArrow() {
const titleEl = postHeader ? postHeader.querySelector('.post-title') : null;
if (titleEl) {
const titleRect = titleEl.getBoundingClientRect();
const showWhenPx = 56;
if (titleRect.bottom <= showWhenPx) arrow.classList.add('visible');
else arrow.classList.remove('visible');
return;
}
const threshold = 80;
if (isContainerScrollable(content)) {
if (content.scrollTop > threshold) arrow.classList.add('visible');
else arrow.classList.remove('visible');
return;
}
const rect = content.getBoundingClientRect();
const pageOffset = window.pageYOffset || document.documentElement.scrollTop;
const contentTopAbsolute = rect.top + pageOffset;
if (pageOffset > (contentTopAbsolute + threshold)) arrow.classList.add('visible');
else arrow.classList.remove('visible');
}
content.addEventListener('scroll', updateArrow, { passive: true });
window.addEventListener('scroll', updateArrow, { passive: true });
window.addEventListener('resize', updateArrow);
document.addEventListener('changelog:loaded', updateArrow);
arrow.addEventListener('click', function(e){
e.preventDefault();
if (isContainerScrollable(content)) content.scrollTo({ top: 0, behavior: 'smooth' });
else window.scrollTo({ top: 0, behavior: 'smooth' });
});
document.addEventListener('DOMContentLoaded', updateArrow);
const observer = new MutationObserver(() => updateArrow());
observer.observe(content, { childList: true, subtree: true });
})();
</script>
</body>
</html>