Skip to content

Commit

Permalink
Small JS optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
WallSoGB committed Nov 18, 2024
1 parent eacda56 commit bebf6d6
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 202 deletions.
7 changes: 0 additions & 7 deletions avoid-mods.html
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,6 @@ <h3>DSOAL</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>
</body>

</html>
7 changes: 0 additions & 7 deletions avoid-tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,6 @@ <h3>Save Cleaner</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>
</body>

</html>
1 change: 1 addition & 0 deletions basefinish.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<meta http-equiv='pragma' content='no-cache'>
<meta http-equiv='clear-site-data' content='cache'>

<script src="imageViewer.js"></script>
<script src="javascript.js"></script>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/cards.css">
Expand Down
8 changes: 0 additions & 8 deletions bugfix.html
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,6 @@ <h3 class="install">Installation instructions</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>

</body>

</html>
7 changes: 0 additions & 7 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -2557,13 +2557,6 @@ <h2><strong>Utilities</strong></h2>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>
</body>

</html>
8 changes: 0 additions & 8 deletions content.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,6 @@ <h3 class="install">Installation instructions</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>

</body>

</html>
1 change: 1 addition & 0 deletions decompress.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<meta http-equiv='pragma' content='no-cache'>
<meta http-equiv='clear-site-data' content='cache'>

<script src="imageViewer.js"></script>
<script src="javascript.js"></script>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/cards.css">
Expand Down
7 changes: 0 additions & 7 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,6 @@ <h3>Why didn't I get any DLC pop-ups/items after starting a new game?</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>
</body>

</html>
1 change: 1 addition & 0 deletions finish.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<meta http-equiv='pragma' content='no-cache'>
<meta http-equiv='clear-site-data' content='cache'>

<script src="imageViewer.js"></script>
<script src="javascript.js"></script>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/cards.css">
Expand Down
8 changes: 0 additions & 8 deletions gameplay.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,6 @@ <h3 class="install">Installation instructions</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>

</body>

</html>
8 changes: 0 additions & 8 deletions hud.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,6 @@ <h3 class="install">Installation instructions</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>

</body>

</html>
29 changes: 29 additions & 0 deletions imageViewer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Image overlay

document.addEventListener('DOMContentLoaded', function () {
createImageHandlers();
});

function createImageHandlers() {
const imageOverlay = document.getElementById('image-overlay');
const enlargedImage = document.getElementById('enlarged-image');
if (!enlargedImage || !imageOverlay)
return;

const images = document.querySelectorAll('.content-img');

if (!images)
return;

images.forEach(image => {
image.addEventListener('click', function () {
imageOverlay.style.display = "flex";
enlargedImage.src = this.src;
});
});

imageOverlay.addEventListener('click', function () {
imageOverlay.style.display = "none";
enlargedImage.src = '';
});
}
8 changes: 0 additions & 8 deletions intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,6 @@ <h3 onclick="location.href='#RecommendedSpecs'">Recommended Specs</h3>
</div>

<footer>ModdingLinked 2024</footer>

<div id="image-overlay" class="overlay" hidden>
<div class="image-container">
<img id="enlarged-image" class="enlarged-image" src="" alt="Enlarged Image">
<div class="resize-overlay shrink"></div>
</div>
</div>

</body>

</html>
Loading

0 comments on commit bebf6d6

Please sign in to comment.