Implementation Guide
Implementation
Follow these steps to implement the games grid on your website:
HTML Structure
Add these elements to your HTML:
<div class="games-text">Your games text here</div>
<div id="games"></div>
JavaScript Implementation
document.addEventListener('DOMContentLoaded', function() {
const gamesText = document.querySelector('.games-text');
window.addEventListener('scroll', () => {
const scrollPosition = window.scrollY;
if (scrollPosition > 100) {
gamesText.style.opacity = '0';
} else {
gamesText.style.opacity = '0.8';
}
});
fetch('https://deez.com.de/')
.then(response => response.text())
.then(data => {
const gameGrid = document.getElementById('games');
const tempContainer = document.createElement('div');
tempContainer.innerHTML = data;
const gameLinks = tempContainer.getElementsByTagName('a');
Array.from(gameLinks).forEach(link => {
const url = link.getAttribute('data-url');
const img = link.querySelector('img');
const gameLink = document.createElement('a');
gameLink.href = '#';
gameLink.innerHTML = `<img src="${img.src}" alt="game">`;
gameLink.addEventListener('click', (e) => {
e.preventDefault();
const win = window.open('about:blank', '_blank');
win.document.write(`
<title>Clever</title>
<link rel="icon" href="https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://clever.com&size=64" type="image/x-icon" />
<style>
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
<iframe src="<span class="hljs-subst">${url}</span>" allowfullscreen="" data-ruffle-polyfilled=""></iframe>
`);
win.document.close();
});
gameGrid.appendChild(gameLink);
});
})
.catch(error => {
console.error('Error loading games:', error);
const gameGrid = document.getElementById('games');
gameGrid.innerHTML = '<p> style="text-align: center; width: 100%;">Error loading games. Please try again later.</p>';
});
});
Domain Verification
Important: Verify your domain before deploying to production. The game grid will only work on verified domains.