PageSourceSearch

https://stickdefendersunblocked.github.io/rs/js/footer.js

js stickdefendersunblocked.github.io collected 2026-10-03 09:59:52 UTC 9,643 bytes, 232 lines download raw bytes

1$(document).ready(function () {
2        const analyticsConfig = {
3                gtagId: "G-02ZWQPBW96",
4                clarityId: "tfd980bvug",
5        };
6
7        const ensureAnalyticsLoaded = () => {
8                const { gtagId, clarityId } = analyticsConfig;
9                const gtagSrc = `https://www.googletagmanager.com/gtag/js?id=${gtagId}`;
10
11                if (!document.querySelector(`script[src="${gtagSrc}"]`)) {
12                        const gtagScript = document.createElement("script");
13                        gtagScript.async = true;
14                        gtagScript.src = gtagSrc;
15                        const head = document.head || document.getElementsByTagName("head")[0];
16                        (head || document.body || document.documentElement).appendChild(gtagScript);
17                }
18
19                window.dataLayer = Array.isArray(window.dataLayer) ? window.dataLayer : [];
20                if (typeof window.gtag !== "function") {
21                        window.gtag = function () {
22                                window.dataLayer.push(arguments);
23                        };
24                }
25
26                const hasJsEvent = window.dataLayer.some(function (entry) {
27                        return Array.isArray(entry) && entry[0] === "js";
28                });
29                if (!hasJsEvent) {
30                        window.gtag("js", new Date());
31                }
32
33                const hasConfigEvent = window.dataLayer.some(function (entry) {
34                        return Array.isArray(entry) && entry[0] === "config" && entry[1] === gtagId;
35                });
36                if (!hasConfigEvent) {
37                        window.gtag("config", gtagId);
38                }
39
40                const claritySrc = `https://www.clarity.ms/tag/${clarityId}`;
41                const clarityLoaded = typeof window.clarity === "function" || document.querySelector(`script[src="${claritySrc}"]`);
42
43                if (!clarityLoaded) {
44                        (function (c, l, a, r, i, t, y) {
45                                c[a] = c[a] || function () {
46                                        (c[a].q = c[a].q || []).push(arguments);
47                                };
48                                t = l.createElement(r);
49                                t.async = 1;
50                                t.src = "https://www.clarity.ms/tag/" + i;
51                                y = l.getElementsByTagName(r)[0];
52                                y.parentNode.insertBefore(t, y);
53                        })(window, document, "clarity", "script", clarityId);
54                }
55        };
56
57        ensureAnalyticsLoaded();
58
59        $(".icon-menu-mobile").on('click', function () {
60                $(".mobile-dropdown").slideToggle();
61        });
62
63        const footer = document.querySelector('footer');
64        if (footer && !footer.querySelector('.site-footer')) {
65                footer.insertAdjacentHTML('afterbegin', `
66        <div class="site-footer">
67          <div class="footer-grid">
68            <div class="footer-column">
69              <a class="footer-logo" href="/">StickDefendersUnblocked</a>
70              <p class="footer-text">Play classroom-safe browser games without downloads and discover new unblocked hits every week.</p>
71            </div>
72            <div class="footer-column">
73              <h2>Popular Categories</h2>
74              <ul>
75                <li><a href="/categogy/New.html">New Releases</a></li>
76                <li><a href="/categogy/Car.html">Racing Games</a></li>
77                <li><a href="/categogy/Shotting.html">Shooting Games</a></li>
78                <li><a href="/categogy/Sport.html">Sports Games</a></li>
79              </ul>
80            </div>
81            <div class="footer-column">
82              <h2>Player Resources</h2>
83              <ul>
84                <li><a href="/sitemap.xml">XML Sitemap</a></li>
85                <li><a href="/sitemap.txt">Plain Sitemap</a></li>
86                <li><a href="/robots.txt">Robots.txt</a></li>
87                <li><a href="https://github.com/stickdefendersunblocked/stickdefendersunblocked.github.io/issues" target="_blank" rel="noopener">Request a Game</a></li>
88              </ul>
89            </div>
90            <div class="footer-column">
91              <h2>Stay Updated</h2>
92              <p class="footer-text">Bookmark this hub or follow our GitHub project to get notified when new unblocked games go live.</p>
93              <a class="footer-cta" href="https://github.com/stickdefendersunblocked/stickdefendersunblocked.github.io" target="_blank" rel="noopener">Follow on GitHub</a>
94            </div>
95          </div>
96          <div class="footer-meta">
97            <p>© 2025 StickDefendersUnblocked. Curated browser games for students and office breaks.</p>
98          </div>
99        </div>
100        `);
101        }
102        async function logJSONData() {
103                const response = await fetch("data/config.json");
104                const jsonData = await response.json();
105                renderHtmlConfig(jsonData);
106	}
107	// logJSONData();
108})
109function renderHtmlConfig(data = []) {
110	if (!data.length) return;
111	let html = "";
112	for (let game of data) {
113		html += '<div class="game-flex-item">';
114		html += `<a class="flex-item" href="/${repository}/${game.slug}">`;
115		html += `<img width="180" height="180" src="rs/imgs/${game.image}" title="${game.image}" alt="${game.image}">`
116		html += `<div class="header-flex-item"><a class="text-overflow header-game-title" href="/${repository}/${game.slug}">${game.name}</a></div>`;
117		html += '</a>';
118		html += '</div>';
119	}
120	$("#ajax-append").html(html);
121}
122function theaterMode() {
123	let iframe = document.querySelector("#iframehtml5");
124	if (iframe.classList.contains("force_half_full_screen")) {
125		iframe.classList.remove("force_half_full_screen");
126		document.body.style.overflow = "unset";
127		document.querySelector(".header-game").classList.remove("header_game_enable_half_full_screen");
128		document.querySelector('body').setAttribute('style', '');
129	} else {
130		let above = 0;
131		let left = 0;
132		let below = document.querySelector(".header-game").clientHeight;
133		let right = 0;
134		// let width = window.innerWidth;
135		// let height = window.innerHeight;
136		if (!document.querySelector("#style-append")) {
137			let styleElement = document.createElement("style");
138			styleElement.type = "text/css";
139			styleElement.setAttribute('id', "style-append");
140			let cssCode = `
141		.force_half_full_screen{
142		position: fixed!important;
143		top: 0!important;
144		left: 0!important;
145		z-index: 887;
146		top:${above}px!important;
147		left:${left}px!important;
148		width:calc(100% - ${left}px)!important;
149		height:calc(100% - ${above + below}px)!important;
150		background-color:#000;
151		}
152		.header_game_enable_half_full_screen{
153			position:fixed;
154			left:${left}px!important;
155			bottom:0!important;
156			right:0!important;
157			z-index:887!important;
158			width:calc(100% - ${left}px)!important;
159			padding-left:10px;
160			padding-right:10px;
161		}
162		@media (max-width: 1364px){
163			.force_half_full_screen{
164				left:0!important;
165				width:100%!important;
166			}
167			.header_game_enable_half_full_screen{
168				width:100%!important;
169				left:0!important;
170			}
171		}`
172			styleElement.innerHTML = cssCode;
173			document.querySelector('head').appendChild(styleElement);
174		}
175		document.querySelector('body').setAttribute('style', 'overflow:hidden');
176		iframe.classList.add("force_half_full_screen")
177		document.querySelector(".header-game").classList.add("header_game_enable_half_full_screen")
178	}
179}
180$("#expand").on('click', function () {
181	$("#iframehtml5").addClass("force_full_screen");
182	$("#_exit_full_screen").removeClass('hidden');
183	requestFullScreen(document.body);
184});
185$("#_exit_full_screen").on('click', cancelFullScreen);
186function requestFullScreen(element) {
187	$("#iframehtml5").removeClass("force_half_full_screen");
188	$(".header-game").removeClass("header_game_enable_half_full_screen");
189	// Supports most browsers and their versions.
190	var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
191	if (requestMethod) { // Native full screen.
192		requestMethod.call(element);
193	} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
194		var wscript = new ActiveXObject("WScript.Shell");
195		if (wscript !== null) {
196			wscript.SendKeys("{F11}");
197		}
198	}
199}
200
201function cancelFullScreen() {
202	$("#_exit_full_screen").addClass('hidden');
203	$("#iframehtml5").removeClass("force_full_screen");
204	$("#iframehtml5").removeClass("force_half_full_screen");
205	$(".header-game").removeClass("header_game_enable_half_full_screen");
206	document.querySelector('body').setAttribute('style', '');
207	document.body.style.overflow = "unset";
208	var requestMethod = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreenBtn;
209	if (requestMethod) { // cancel full screen.
210		requestMethod.call(document);
211	} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
212		var wscript = new ActiveXObject("WScript.Shell");
213		if (wscript !== null) {
214			wscript.SendKeys("{F11}");
215		}
216	}
217}
218
219if (document.addEventListener) {
220	document.addEventListener('webkitfullscreenchange', exitHandler, false);
221	document.addEventListener('mozfullscreenchange', exitHandler, false);
222	document.addEventListener('fullscreenchange', exitHandler, false);
223	document.addEventListener('MSFullscreenChange', exitHandler, false);
224}
225
226function exitHandler() {
227	if (document.webkitIsFullScreen === false ||
228		document.mozFullScreen === false ||
229		document.msFullscreenElement === false) {
230		cancelFullScreen();
231	}
232}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.