Skip to content

Commit 5652e27

Browse files
authored
Merge pull request #285 from qerionx/main
fix gms, ui updates, bug fixes
2 parents e69cf4f + 9485d4d commit 5652e27

4 files changed

Lines changed: 235 additions & 29 deletions

File tree

src/components/DisableAds.jsx

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
import clsx from 'clsx';
2+
import { Megaphone, X, Copy, Check } from 'lucide-react';
3+
import { useEffect, useState } from 'react';
4+
import { createPortal } from 'react-dom';
5+
import { useOptions } from '../utils/optionsContext';
6+
7+
const DisableAds = ({ isOpen, onClose }) => {
8+
const { options } = useOptions();
9+
const [anim, setAnim] = useState(false);
10+
const [render, setRender] = useState(false);
11+
const [copied, setCopied] = useState(false);
12+
const dUrl = 'https://discord.gg/ZBef7HnAeg';
13+
14+
useEffect(() => {
15+
if (isOpen) {
16+
setRender(true);
17+
setCopied(false);
18+
setTimeout(() => setAnim(true), 10);
19+
} else {
20+
setAnim(false);
21+
setTimeout(() => setRender(false), 200);
22+
}
23+
}, [isOpen]);
24+
25+
const copyDiscordUrl = async () => {
26+
try {
27+
await navigator.clipboard.writeText(dUrl);
28+
setCopied(true);
29+
} catch {
30+
setCopied(false);
31+
}
32+
};
33+
34+
if (!render) return null;
35+
36+
const light = options.type === 'light';
37+
const cardBg = options.settingsPanelItemBackgroundColor || (light ? '#f3f4f6' : '#ffffff0c');
38+
const cardBorder = options.paginationBorderColor || (light ? '#d1d5db' : '#374151');
39+
const mutedText = options.paginationTextColor || (light ? '#4b5563' : '#9ca3af');
40+
const actionColor = options.siteTextColor || '#a0b0c8';
41+
const badgeText = light ? '#111827' : '#ffffff';
42+
const badgeBg = actionColor;
43+
44+
return createPortal(
45+
<div
46+
className={clsx(
47+
'fixed inset-0 z-9999 flex items-center justify-center p-4 transition-opacity',
48+
anim ? 'opacity-100' : 'opacity-0',
49+
)}
50+
>
51+
<div className="fixed inset-0 bg-black/50" onClick={onClose} />
52+
53+
<div
54+
className={clsx(
55+
'relative w-full max-w-2xl max-h-[80vh] rounded-lg border shadow-lg overflow-hidden transition-all',
56+
anim ? 'scale-100 opacity-100' : 'scale-95 opacity-0',
57+
)}
58+
style={{ backgroundColor: options.menuColor || '#1a252f' }}
59+
>
60+
<div
61+
className="flex items-center justify-between px-4 py-3 border-b"
62+
style={{ borderColor: light ? '#e5e7eb' : '#374151' }}
63+
>
64+
<div className="flex items-center gap-2">
65+
<Megaphone size={18} />
66+
<h2 className="text-lg font-medium">Disable Ads</h2>
67+
</div>
68+
<button
69+
onClick={onClose}
70+
className={clsx('p-1 rounded-md', light ? 'hover:bg-gray-100' : 'hover:bg-[#ffffff0c]')}
71+
>
72+
<X size={20} />
73+
</button>
74+
</div>
75+
76+
<div className="p-4 overflow-y-auto max-h-[calc(80vh-4rem)]">
77+
<div className="space-y-3">
78+
<p className="text-sm" style={{ color: mutedText }}>
79+
Follow these steps to disable ads:
80+
</p>
81+
82+
<div
83+
className="rounded-md border p-3 flex items-start gap-3"
84+
style={{ backgroundColor: cardBg, borderColor: cardBorder }}
85+
>
86+
<div
87+
className="w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold"
88+
style={{ backgroundColor: badgeBg, color: badgeText }}
89+
>
90+
1
91+
</div>
92+
<div className="min-w-0 text-sm">
93+
<div className="font-medium">Join our Discord</div>
94+
<div className="mt-1 flex items-center gap-2">
95+
<a
96+
href={dUrl}
97+
target="_blank"
98+
rel="noopener noreferrer"
99+
className="text-xs px-2 py-1 rounded border break-all"
100+
style={{
101+
color: actionColor,
102+
borderColor: cardBorder,
103+
backgroundColor: options.paginationBgColor || cardBg,
104+
}}
105+
>
106+
{dUrl}
107+
</a>
108+
<button
109+
onClick={copyDiscordUrl}
110+
className="text-xs px-2 py-1 rounded border inline-flex items-center gap-1"
111+
style={{
112+
color: actionColor,
113+
borderColor: cardBorder,
114+
backgroundColor: options.paginationBgColor || cardBg,
115+
}}
116+
>
117+
{copied ? <Check size={13} /> : <Copy size={13} />}
118+
{copied ? 'Copied' : 'Copy'}
119+
</button>
120+
</div>
121+
</div>
122+
</div>
123+
124+
<div
125+
className="rounded-md border p-3 flex items-start gap-3"
126+
style={{ backgroundColor: cardBg, borderColor: cardBorder }}
127+
>
128+
<div
129+
className="w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold"
130+
style={{ backgroundColor: badgeBg, color: badgeText }}
131+
>
132+
2
133+
</div>
134+
<div className="text-sm">
135+
<div className="font-medium">Obtain an ad key</div>
136+
<div className="mt-1" style={{ color: mutedText }}>
137+
Ask in Discord and copy your ad key
138+
</div>
139+
</div>
140+
</div>
141+
142+
<div
143+
className="rounded-md border p-3 flex items-start gap-3"
144+
style={{ backgroundColor: cardBg, borderColor: cardBorder }}
145+
>
146+
<div
147+
className="w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold"
148+
style={{ backgroundColor: badgeBg, color: badgeText }}
149+
>
150+
3
151+
</div>
152+
<div className="text-sm">
153+
<div className="font-medium">Add key in Settings</div>
154+
<div className="mt-1" style={{ color: mutedText }}>
155+
Go to Settings &gt; Advanced and paste your ad key to disable ads.
156+
</div>
157+
</div>
158+
</div>
159+
</div>
160+
</div>
161+
</div>
162+
</div>,
163+
document.body,
164+
);
165+
};
166+
167+
export default DisableAds;

src/components/Footer.jsx

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
import { useOptions } from '../utils/optionsContext';
2-
import { Bookmark, HeartPlus } from 'lucide-react';
2+
import { Bookmark, HeartPlus, Megaphone } from 'lucide-react';
33
import { memo, useCallback, useState } from 'react';
44
import Disc from './Discord';
55
import clsx from 'clsx';
66
import BookmarksModal from './Bookmarks';
7+
import DisableAdsModal from './DisableAds';
78

89
const Footer = memo(() => {
910
const { options } = useOptions();
1011
const [isBookmarksOpen, setIsBookmarksOpen] = useState(false);
12+
const [isDisableAdsOpen, setIsDisableAdsOpen] = useState(false);
1113
const handleDs = useCallback(() => {
12-
window.open('/ds', '_blank');
14+
window.open(isStaticBuild ? 'https://discord.gg/ZBef7HnAeg' : '/ds', '_blank');
1315
}, []);
1416
const handleAboutBlank = useCallback(() => {
1517
import('/src/utils/utils.js').then(({ openAboutBlankPopup }) => openAboutBlankPopup(true));
1618
}, []);
1719
return (
1820
<div className="w-full fixed bottom-0 flex items-end justify-between p-2">
1921
{' '}
20-
{options.donationBtn !== false && (
21-
<a
22-
href="https://ko-fi.com/I3I81MF4CH"
23-
target="_blank"
24-
rel="noopener noreferrer"
22+
<div className="flex gap-2 items-center">
23+
{options.donationBtn !== false && (
24+
<a
25+
href="https://ko-fi.com/I3I81MF4CH"
26+
target="_blank"
27+
rel="noopener noreferrer"
28+
className={clsx(
29+
'flex gap-1 items-center cursor-pointer',
30+
'hover:-translate-y-0.5 duration-200',
31+
)}
32+
>
33+
{' '}
34+
<HeartPlus className="w-4" /> Support us{' '}
35+
</a>
36+
)}
37+
{options.donationBtn !== false && <span className="text-gray-500"></span>}
38+
<div
2539
className={clsx(
2640
'flex gap-1 items-center cursor-pointer',
2741
'hover:-translate-y-0.5 duration-200',
2842
)}
43+
onClick={() => setIsDisableAdsOpen(true)}
2944
>
3045
{' '}
31-
<HeartPlus className="w-4" /> Support us{' '}
32-
</a>
33-
)}{' '}
46+
<Megaphone className="w-4" /> Disable Ads{' '}
47+
</div>
48+
</div>{' '}
3449
<div className="flex gap-2 items-center">
3550
{' '}
3651
<div
@@ -67,6 +82,7 @@ const Footer = memo(() => {
6782
</div>{' '}
6883
</div>{' '}
6984
<BookmarksModal isOpen={isBookmarksOpen} onClose={() => setIsBookmarksOpen(false)} />{' '}
85+
<DisableAdsModal isOpen={isDisableAdsOpen} onClose={() => setIsDisableAdsOpen(false)} />{' '}
7086
</div>
7187
);
7288
});

src/data/apps.json

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,9 @@
692692
"appName": "Tag",
693693
"desc": "Fun Action",
694694
"icon": "/assets/img/tag.webp",
695-
"url": "https://kdata1.com/2024/05/tag/",
695+
"url": "https://cdn.jsdelivr.net/gh/ashxmed/symmetrical-adventure@51f0a8d68136a61fea47a3ff12850ba532dea929/tag.zip",
696696
"disabled": false,
697-
"local": false
697+
"local": true
698698
},
699699
{
700700
"appName": "Cheese Chompers 3D",
@@ -1585,9 +1585,9 @@
15851585
"appName": "Ages of Conflict",
15861586
"desc": "Domination-type fun",
15871587
"icon": "/assets-fb/ages-of-conflict/splash.jpg",
1588-
"url": "https://assets.hbmc.net/ages-of-conflict/index.html",
1588+
"url": "https://cdn.jsdelivr.net/gh/ashxmed/symmetrical-adventure@ae83372f43759999a9f00c72c5bf2eb199db9fca/ag-conf.zip",
15891589
"disabled": false,
1590-
"local": false
1590+
"local": true
15911591
},
15921592
{
15931593
"appName": "Alien Hominid",
@@ -2261,7 +2261,7 @@
22612261
"appName": "Polytrack",
22622262
"desc": "Car/Racing apps",
22632263
"icon": "/assets-fb/polytrack/pltrk.webp",
2264-
"url": "https://cdn.jsdelivr.net/gh/ashxmed/symmetrical-adventure@c0499269bb26b580162503f1ce371eee657f093e/polytack.zip",
2264+
"url": "https://cdn.jsdelivr.net/gh/ashxmed/symmetrical-adventure@c0499269bb26b580162503f1ce371eee657f093e/polytrack.zip",
22652265
"disabled": false,
22662266
"local": true
22672267
},
@@ -2615,9 +2615,9 @@
26152615
"appName": "Bitlife",
26162616
"desc": "Brain apps",
26172617
"icon": "/assets/img/bitlife.webp",
2618-
"url": "https://assets.hbmc.net/bitlife/index.html",
2618+
"url": "https://cdn.jsdelivr.net/gh/ashxmed/symmetrical-adventure@dd57660e4ddf2af86dc0c2c694d5e29c83bd85ee/lifbit.zip",
26192619
"disabled": false,
2620-
"local": false
2620+
"local": true
26212621
},
26222622
{
26232623
"appName": "Black Hole Square",
@@ -5067,14 +5067,6 @@
50675067
"disabled": false,
50685068
"local": false
50695069
},
5070-
{
5071-
"appName": "Geometry Dash Lite",
5072-
"desc": "Ball/Platformer apps",
5073-
"icon": "/assets/img/geometrydash.webp",
5074-
"url": "https://geometrydashwave.io/game/gd/?v=5",
5075-
"disabled": false,
5076-
"local": false
5077-
},
50785070
{
50795071
"appName": "Evowars.io",
50805072
"desc": "Domination-type fun",

src/utils/utils.js

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,41 @@ export const check = (() => {
116116
e.returnValue = '';
117117
});
118118
}
119-
const openOnStartup =
120-
op.aboutBlankAutoOpen === true || (op.aboutBlank && op.aboutBlankAutoOpen !== false);
121-
if (window.top === window.self && openOnStartup) {
122-
openAboutBlankPopup(true);
119+
if (window.top === window.self && op.aboutBlank) {
120+
const w = open('about:blank');
121+
if (!w || w.closed) {
122+
alert('Please enable popups to continue.');
123+
location.href = 'https://google.com';
124+
} else {
125+
const win = w.window,
126+
d = win.document,
127+
f = d.createElement('iframe');
128+
129+
Object.assign(f, { src: location.href });
130+
Object.assign(f.style, { width: '100%', height: '100%', border: 'none' });
131+
Object.assign(d.body.style, { margin: 0, height: '100vh' });
132+
d.documentElement.style.height = '100%';
133+
d.head.appendChild(Object.assign(document.createElement('link'), { rel: 'icon', href: '' }));
134+
d.body.append(f);
135+
const s = d.createElement('script');
136+
s.textContent = `
137+
const d = document;
138+
setInterval(() => {
139+
const op = JSON.parse(localStorage.getItem('options') || '{}');
140+
d.title = op.tabName || '';
141+
let icon = d.querySelector("link[rel~='icon']");
142+
if (!icon) {
143+
icon = d.createElement('link');
144+
icon.rel = 'icon';
145+
d.head.appendChild(icon);
146+
}
147+
icon.href = op.tabIcon || '';
148+
}, 800);
149+
`;
150+
d.head.appendChild(s);
151+
location.href = 'https://google.com';
152+
}
153+
history.replaceState(null, '', '/');
123154
}
124155

125156
ckOff();

0 commit comments

Comments
 (0)