Add Maturity Filter functionality; implement toggle and hide mature games
This commit is contained in:
@@ -795,6 +795,17 @@
|
||||
link.setAttribute('target', '_blank'); // Open in a new tab
|
||||
});
|
||||
}
|
||||
|
||||
// Check if Maturity Filter is enabled
|
||||
const maturityFilterEnabled = getCookie('maturityFilter') === 'true';
|
||||
|
||||
if (maturityFilterEnabled) {
|
||||
// Hide games marked as mature
|
||||
const matureGames = document.querySelectorAll('.game.mature');
|
||||
matureGames.forEach(game => {
|
||||
game.style.display = 'none';
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+39
-5
@@ -52,6 +52,15 @@
|
||||
.setting-item button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
/* Red button for Clear Cookies */
|
||||
.setting-item.clear-cookies button {
|
||||
background-color: #ff4d4d;
|
||||
}
|
||||
|
||||
.setting-item.clear-cookies button:hover {
|
||||
background-color: #cc0000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -63,17 +72,21 @@
|
||||
<button id="toggleDarkMode">Enable</button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span>Clear Cookies</span>
|
||||
<button id="clearCookies">Clear</button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span>Enable CloakJS not working yet</span>
|
||||
<span>Enable CloakJS (comming soon)</span>
|
||||
<button id="toggleCloakJS">Enable</button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span>Show FPS Counter</span>
|
||||
<button id="toggleFPSCounter">Enable</button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span>Enable Maturity Filter(comming soon)</span>
|
||||
<button id="toggleMaturityFilter">Enable</button>
|
||||
</div>
|
||||
<div class="setting-item clear-cookies">
|
||||
<span>Clear Cookies</span>
|
||||
<button id="clearCookies">Clear</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -173,6 +186,27 @@
|
||||
|
||||
// Apply saved FPS Counter preference on load
|
||||
applyFPSCounterSetting(fpsCounterEnabled);
|
||||
|
||||
// Maturity Filter Toggle
|
||||
const toggleMaturityFilterButton = document.getElementById('toggleMaturityFilter');
|
||||
const maturityFilterEnabled = getCookie('maturityFilter') === 'true';
|
||||
|
||||
function applyMaturityFilterSetting(enabled) {
|
||||
if (enabled) {
|
||||
toggleMaturityFilterButton.textContent = 'Disable';
|
||||
} else {
|
||||
toggleMaturityFilterButton.textContent = 'Enable';
|
||||
}
|
||||
}
|
||||
|
||||
toggleMaturityFilterButton.addEventListener('click', () => {
|
||||
const isMaturityFilterEnabled = getCookie('maturityFilter') === 'true';
|
||||
setCookie('maturityFilter', !isMaturityFilterEnabled, 30); // Save preference for 30 days
|
||||
applyMaturityFilterSetting(!isMaturityFilterEnabled);
|
||||
});
|
||||
|
||||
// Apply saved Maturity Filter preference on load
|
||||
applyMaturityFilterSetting(maturityFilterEnabled);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user