PageSourceSearch

https://bitlife-free.github.io/rs/js/footer.js

js bitlife-free.github.io collected 2026-10-03 08:43:02 UTC 4,863 bytes, 135 lines download raw bytes

1$(document).ready(function () {
2	$(".icon-menu-mobile").on('click', function () {
3		$(".mobile-dropdown").slideToggle();
4	})
5	async function logJSONData() {
6		const response = await fetch("data/config.json");
7		const jsonData = await response.json();
8		renderHtmlConfig(jsonData);
9	}
10	// logJSONData();
11})
12function renderHtmlConfig(data = []) {
13	if (!data.length) return;
14	let html = "";
15	for (let game of data) {
16		html += '<div class="game-flex-item">';
17		html += `<a class="flex-item" href="/${repository}/${game.slug}">`;
18		html += `<img width="180" height="180" src="rs/imgs/${game.image}" title="${game.image}" alt="${game.image}">`
19		html += `<div class="header-flex-item"><a class="text-overflow header-game-title" href="/${repository}/${game.slug}">${game.name}</a></div>`;
20		html += '</a>';
21		html += '</div>';
22	}
23	$("#ajax-append").html(html);
24}
25function theaterMode() {
26	let iframe = document.querySelector("#iframehtml5");
27	if (iframe.classList.contains("force_half_full_screen")) {
28		iframe.classList.remove("force_half_full_screen");
29		document.body.style.overflow = "unset";
30		document.querySelector(".header-game").classList.remove("header_game_enable_half_full_screen");
31		document.querySelector('body').setAttribute('style', '');
32	} else {
33		let above = 0;
34		let left = 0;
35		let below = document.querySelector(".header-game").clientHeight;
36		let right = 0;
37		// let width = window.innerWidth;
38		// let height = window.innerHeight;
39		if (!document.querySelector("#style-append")) {
40			let styleElement = document.createElement("style");
41			styleElement.type = "text/css";
42			styleElement.setAttribute('id', "style-append");
43			let cssCode = `
44		.force_half_full_screen{
45		position: fixed!important;
46		top: 0!important;
47		left: 0!important;
48		z-index: 887;
49		top:${above}px!important;
50		left:${left}px!important;
51		width:calc(100% - ${left}px)!important;
52		height:calc(100% - ${above + below}px)!important;
53		background-color:#000;
54		}
55		.header_game_enable_half_full_screen{
56			position:fixed;
57			left:${left}px!important;
58			bottom:0!important;
59			right:0!important;
60			z-index:887!important;
61			width:calc(100% - ${left}px)!important;
62			padding-left:10px;
63			padding-right:10px;
64		}
65		@media (max-width: 1364px){
66			.force_half_full_screen{
67				left:0!important;
68				width:100%!important;
69			}
70			.header_game_enable_half_full_screen{
71				width:100%!important;
72				left:0!important;
73			}
74		}`
75			styleElement.innerHTML = cssCode;
76			document.querySelector('head').appendChild(styleElement);
77		}
78		document.querySelector('body').setAttribute('style', 'overflow:hidden');
79		iframe.classList.add("force_half_full_screen")
80		document.querySelector(".header-game").classList.add("header_game_enable_half_full_screen")
81	}
82}
83$("#expand").on('click', function () {
84	$("#iframehtml5").addClass("force_full_screen");
85	$("#_exit_full_screen").removeClass('hidden');
86	requestFullScreen(document.body);
87});
88$("#_exit_full_screen").on('click', cancelFullScreen);
89function requestFullScreen(element) {
90	$("#iframehtml5").removeClass("force_half_full_screen");
91	$(".header-game").removeClass("header_game_enable_half_full_screen");
92	// Supports most browsers and their versions.
93	var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
94	if (requestMethod) { // Native full screen.
95		requestMethod.call(element);
96	} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
97		var wscript = new ActiveXObject("WScript.Shell");
98		if (wscript !== null) {
99			wscript.SendKeys("{F11}");
100		}
101	}
102}
103
104function cancelFullScreen() {
105	$("#_exit_full_screen").addClass('hidden');
106	$("#iframehtml5").removeClass("force_full_screen");
107	$("#iframehtml5").removeClass("force_half_full_screen");
108	$(".header-game").removeClass("header_game_enable_half_full_screen");
109	document.querySelector('body').setAttribute('style', '');
110	document.body.style.overflow = "unset";
111	var requestMethod = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreenBtn;
112	if (requestMethod) { // cancel full screen.
113		requestMethod.call(document);
114	} else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
115		var wscript = new ActiveXObject("WScript.Shell");
116		if (wscript !== null) {
117			wscript.SendKeys("{F11}");
118		}
119	}
120}
121
122if (document.addEventListener) {
123	document.addEventListener('webkitfullscreenchange', exitHandler, false);
124	document.addEventListener('mozfullscreenchange', exitHandler, false);
125	document.addEventListener('fullscreenchange', exitHandler, false);
126	document.addEventListener('MSFullscreenChange', exitHandler, false);
127}
128
129function exitHandler() {
130	if (document.webkitIsFullScreen === false ||
131		document.mozFullScreen === false ||
132		document.msFullscreenElement === false) {
133		cancelFullScreen();
134	}
135}

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.