@indextools/index-games 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/config.js +28 -33
- package/public/games/10fastfingers.html +12 -0
- package/public/games/2048.html +12 -0
- package/public/games/absurdle.html +12 -0
- package/public/games/actorle.html +12 -0
- package/public/games/adventurecapitalist.html +12 -0
- package/public/games/agario.html +12 -0
- package/public/games/airhockey.html +12 -0
- package/public/games/among.html +12 -0
- package/public/games/anagram.html +12 -0
- package/public/games/angrybirds.html +12 -0
- package/public/games/archery.html +12 -0
- package/public/games/artquiz.html +12 -0
- package/public/games/asteroids.html +12 -0
- package/public/games/backgammon.html +12 -0
- package/public/games/ballblast.html +12 -0
- package/public/games/bandle.html +12 -0
- package/public/games/basketballstars.html +12 -0
- package/public/games/battleship.html +12 -0
- package/public/games/betweenle.html +12 -0
- package/public/games/bingo.html +12 -0
- package/public/games/blackjack.html +12 -0
- package/public/games/blockpuzzle.html +12 -0
- package/public/games/bobbleheadbrawl.html +12 -0
- package/public/games/bookworm.html +12 -0
- package/public/games/bowlingking.html +12 -0
- package/public/games/brutal.html +12 -0
- package/public/games/bubbshooter.html +12 -0
- package/public/games/candycrush.html +12 -0
- package/public/games/capitalcities.html +12 -0
- package/public/games/cardgame.html +12 -0
- package/public/games/carparking.html +12 -0
- package/public/games/castlevania.html +12 -0
- package/public/games/checkers.html +12 -0
- package/public/games/chess.html +12 -0
- package/public/games/citybuilder.html +12 -0
- package/public/games/clue.html +12 -0
- package/public/games/cluelike.html +12 -0
- package/public/games/codecombat.html +12 -0
- package/public/games/colonist.html +12 -0
- package/public/games/colonists.html +12 -0
- package/public/games/colorfle.html +12 -0
- package/public/games/connectfour.html +12 -0
- package/public/games/connections.html +12 -0
- package/public/games/contexto.html +12 -0
- package/public/games/cookieclicker.html +12 -0
- package/public/games/counterblox.html +12 -0
- package/public/games/crazycattle.html +12 -0
- package/public/games/cribbage.html +12 -0
- package/public/games/crossword.html +12 -0
- package/public/games/crossyroad.html +12 -0
- package/public/games/curling.html +12 -0
- package/public/games/cutherope.html +12 -0
- package/public/games/darts.html +12 -0
- package/public/games/defly.html +12 -0
- package/public/games/diablo2d.html +12 -0
- package/public/games/dice.html +12 -0
- package/public/games/diepio.html +12 -0
- package/public/games/dinogame.html +12 -0
- package/public/games/doctorgame.html +12 -0
- package/public/games/dominoes.html +12 -0
- package/public/games/dordle.html +12 -0
- package/public/games/doublicator.html +12 -0
- package/public/games/driftboss.html +12 -0
- package/public/games/drivertest.html +12 -0
- package/public/games/dungeoncrawl.html +12 -0
- package/public/games/euchre.html +12 -0
- package/public/games/ev.html +12 -0
- package/public/games/farmidler.html +12 -0
- package/public/games/fencing.html +12 -0
- package/public/games/fibble.html +12 -0
- package/public/games/finalfantasy.html +12 -0
- package/public/games/fishdom.html +12 -0
- package/public/games/flagle.html +12 -0
- package/public/games/flappybird.html +12 -0
- package/public/games/foosball.html +12 -0
- package/public/games/fortnite2d.html +12 -0
- package/public/games/framed.html +12 -0
- package/public/games/freecell.html +12 -0
- package/public/games/frutninja.html +12 -0
- package/public/games/galaxydefense.html +12 -0
- package/public/games/games.json +2843 -29
- package/public/games/garticphone.html +12 -0
- package/public/games/geoguessr.html +12 -0
- package/public/games/geoquiz.html +12 -0
- package/public/games/getaway.html +12 -0
- package/public/games/getgoodgames.html +12 -0
- package/public/games/gin.html +12 -0
- package/public/games/golfgame.html +12 -0
- package/public/games/guessr.html +12 -0
- package/public/games/gunblood.html +12 -0
- package/public/games/gunfight.html +12 -0
- package/public/games/hackeridler.html +12 -0
- package/public/games/hangaroo.html +12 -0
- package/public/games/heardle.html +12 -0
- package/public/games/heartsgame.html +12 -0
- package/public/games/heroquest.html +12 -0
- package/public/games/historyquiz.html +12 -0
- package/public/games/hospitallife.html +12 -0
- package/public/games/hoteltycoon.html +12 -0
- package/public/games/infinitecraft.html +12 -0
- package/public/games/islandtrivia.html +12 -0
- package/public/games/jelly.html +12 -0
- package/public/games/jewels.html +12 -0
- package/public/games/kahoot.html +12 -0
- package/public/games/kirka.html +12 -0
- package/public/games/knifehit.html +12 -0
- package/public/games/krunker.html +12 -0
- package/public/games/leaguedle.html +12 -0
- package/public/games/letterle.html +12 -0
- package/public/games/life.html +12 -0
- package/public/games/lightbot.html +12 -0
- package/public/games/loldle.html +12 -0
- package/public/games/lordz.html +12 -0
- package/public/games/magicblast.html +12 -0
- package/public/games/mahjong.html +12 -0
- package/public/games/mario.html +12 -0
- package/public/games/matchmaster.html +12 -0
- package/public/games/mathblaster.html +12 -0
- package/public/games/mathgame.html +12 -0
- package/public/games/mathler.html +12 -0
- package/public/games/megaman.html +12 -0
- package/public/games/mergedragons.html +12 -0
- package/public/games/mergefight.html +12 -0
- package/public/games/minecraftclone.html +12 -0
- package/public/games/minesweeper.html +12 -0
- package/public/games/miniclip.html +12 -0
- package/public/games/monopoly.html +12 -0
- package/public/games/mope.html +12 -0
- package/public/games/moto3.html +12 -0
- package/public/games/moviedle.html +12 -0
- package/public/games/moviesquiz.html +12 -0
- package/public/games/musiquiz.html +12 -0
- package/public/games/nationle.html +12 -0
- package/public/games/nba2k.html +12 -0
- package/public/games/nerdle.html +12 -0
- package/public/games/ninjago.html +12 -0
- package/public/games/octordle.html +12 -0
- package/public/games/pacman.html +12 -0
- package/public/games/papergame.html +12 -0
- package/public/games/pilotsim.html +12 -0
- package/public/games/pinball.html +12 -0
- package/public/games/pinochle.html +12 -0
- package/public/games/pinturillo.html +12 -0
- package/public/games/pirateio.html +12 -0
- package/public/games/pizzamaking.html +12 -0
- package/public/games/pogo.html +12 -0
- package/public/games/pointerpointer.html +12 -0
- package/public/games/pokedle.html +12 -0
- package/public/games/pokedle2.html +12 -0
- package/public/games/pokemonbattle.html +12 -0
- package/public/games/pokerclassic.html +12 -0
- package/public/games/poolrush.html +12 -0
- package/public/games/popculturequiz.html +12 -0
- package/public/games/primel.html +12 -0
- package/public/games/prodigygame.html +12 -0
- package/public/games/questland.html +12 -0
- package/public/games/quizlet.html +12 -0
- package/public/games/quordle.html +12 -0
- package/public/games/reslife.html +12 -0
- package/public/games/reversi.html +12 -0
- package/public/games/ridleracing.html +12 -0
- package/public/games/risk.html +12 -0
- package/public/games/roadfury.html +12 -0
- package/public/games/rooftopsnipers.html +12 -0
- package/public/games/run3.html +12 -0
- package/public/games/schoolbus.html +12 -0
- package/public/games/sciencequiz.html +12 -0
- package/public/games/scrabble.html +12 -0
- package/public/games/scratch.html +12 -0
- package/public/games/sedecordle.html +12 -0
- package/public/games/semantle.html +12 -0
- package/public/games/shellshock.html +12 -0
- package/public/games/shipsim.html +12 -0
- package/public/games/skribbl.html +12 -0
- package/public/games/skyblock.html +12 -0
- package/public/games/slots.html +12 -0
- package/public/games/snakegame.html +12 -0
- package/public/games/snakeio.html +12 -0
- package/public/games/snowball.html +12 -0
- package/public/games/soccerskills.html +12 -0
- package/public/games/solitaire.html +12 -0
- package/public/games/sonic.html +12 -0
- package/public/games/spaceshipshooter.html +12 -0
- package/public/games/spacesurvive.html +12 -0
- package/public/games/spades.html +12 -0
- package/public/games/spellcast.html +12 -0
- package/public/games/spellinbee.html +12 -0
- package/public/games/spellingbee2.html +12 -0
- package/public/games/spidersolitaire.html +12 -0
- package/public/games/sportsquiz.html +12 -0
- package/public/games/squaredle.html +12 -0
- package/public/games/squirdle.html +12 -0
- package/public/games/stardew.html +12 -0
- package/public/games/starve.html +12 -0
- package/public/games/stickmanfight.html +12 -0
- package/public/games/stratego.html +12 -0
- package/public/games/strategydefense.html +12 -0
- package/public/games/stuntcar.html +12 -0
- package/public/games/sudoku.html +12 -0
- package/public/games/superhero.html +12 -0
- package/public/games/superhex.html +12 -0
- package/public/games/superhot.html +12 -0
- package/public/games/surviv.html +12 -0
- package/public/games/sushichef.html +12 -0
- package/public/games/tabletopia.html +12 -0
- package/public/games/tennisgame.html +12 -0
- package/public/games/terraria2d.html +12 -0
- package/public/games/tetris.html +12 -0
- package/public/games/theimpossiblequiz.html +12 -0
- package/public/games/timersniper.html +12 -0
- package/public/games/towerblitz.html +12 -0
- package/public/games/traindriver.html +12 -0
- package/public/games/truckgame.html +12 -0
- package/public/games/tunnel.html +12 -0
- package/public/games/typeracer.html +12 -0
- package/public/games/typingclub.html +12 -0
- package/public/games/typingtower.html +12 -0
- package/public/games/undergame.html +12 -0
- package/public/games/voxiom.html +12 -0
- package/public/games/wepons.html +12 -0
- package/public/games/wordle.html +12 -0
- package/public/games/worldflags.html +12 -0
- package/public/games/worldle.html +12 -0
- package/public/games/wormate.html +12 -0
- package/public/games/wormszone.html +12 -0
- package/public/games/zelda.html +12 -0
- package/public/games/zombiederby.html +12 -0
- package/public/games/zombiesurvive.html +12 -0
- package/public/games/zombs.html +12 -0
- package/public/games/zuma.html +12 -0
- package/public/index.html +416 -263
- package/public/index.svg +31 -1154
- package/public/register-sw.js +37 -21
- package/public/sw.js +35 -11
- package/index.svg +0 -1159
package/public/index.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
<iframe class="game-modal-iframe" id="gm-iframe" allowfullscreen
|
|
32
|
-
sandbox="allow-scripts allow-same-origin allow-forms allow-modals"></iframe>
|
|
32
|
+
sandbox="allow-scripts allow-same-origin allow-forms allow-modals allow-popups"></iframe>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
<div id="app">
|
|
@@ -37,22 +37,20 @@
|
|
|
37
37
|
<button id="new-tab-btn" title="New tab">+</button>
|
|
38
38
|
<button id="games-btn" title="Games">🎮 games</button>
|
|
39
39
|
<button id="apps-btn" title="Apps">🗂 apps</button>
|
|
40
|
-
<!-- settings button removed from tab bar — now a FAB -->
|
|
41
40
|
</div>
|
|
42
41
|
<div id="main-area">
|
|
43
42
|
<div id="tab-content"></div>
|
|
44
|
-
<div id="settings-panel"></div
|
|
43
|
+
<div id="settings-panel"></div>
|
|
45
44
|
</div>
|
|
46
45
|
</div>
|
|
47
46
|
|
|
48
|
-
<!--
|
|
47
|
+
<!-- SETTINGS FAB -->
|
|
49
48
|
<button id="settings-fab" title="Settings">⚙</button>
|
|
50
49
|
|
|
51
|
-
<!--
|
|
50
|
+
<!-- SETTINGS DRAWER OVERLAY -->
|
|
52
51
|
<div id="settings-overlay">
|
|
53
52
|
<div id="settings-drawer">
|
|
54
53
|
|
|
55
|
-
<!-- topbar (dynamic) -->
|
|
56
54
|
<div class="drawer-topbar" id="drawer-topbar">
|
|
57
55
|
<button class="drawer-back-btn" id="drawer-back" style="display:none">← back</button>
|
|
58
56
|
<span class="drawer-page-title" id="drawer-title">// settings</span>
|
|
@@ -84,7 +82,7 @@
|
|
|
84
82
|
<span class="settings-nav-icon">🌐</span>
|
|
85
83
|
<div>
|
|
86
84
|
<div>Privacy</div>
|
|
87
|
-
<div class="settings-nav-desc">about:blank & proxy</div>
|
|
85
|
+
<div class="settings-nav-desc">about:blank & proxy engine</div>
|
|
88
86
|
</div>
|
|
89
87
|
<span class="settings-nav-arrow">›</span>
|
|
90
88
|
</div>
|
|
@@ -97,19 +95,9 @@
|
|
|
97
95
|
<span class="settings-nav-arrow">›</span>
|
|
98
96
|
</div>
|
|
99
97
|
</div>
|
|
100
|
-
|
|
101
|
-
<!--<div class="dsection-label">community</div>
|
|
102
|
-
<a href="https://discord.gg/TYPE_HERE" target="_blank" class="drawer-link-btn discord-btn">
|
|
103
|
-
<div class="discord-icon">D</div>
|
|
104
|
-
<div>
|
|
105
|
-
<div>Join our Discord</div>
|
|
106
|
-
<div style="font-size:10px;color:#7289da;margin-top:2px;">discord.gg/TYPE_HERE</div>
|
|
107
|
-
</div>
|
|
108
|
-
<span class="settings-nav-arrow" style="margin-left:auto">↗</span>
|
|
109
|
-
</a>-->
|
|
110
98
|
</div>
|
|
111
99
|
|
|
112
|
-
<!-- PAGE: appearance
|
|
100
|
+
<!-- PAGE: appearance -->
|
|
113
101
|
<div class="drawer-page" id="dpage-appearance">
|
|
114
102
|
<div class="dsection-label">theme</div>
|
|
115
103
|
<div class="theme-options" id="theme-options">
|
|
@@ -179,6 +167,14 @@
|
|
|
179
167
|
<div class="cloak-option-icon">📝</div>
|
|
180
168
|
<div class="cloak-option-info"><div class="cloak-option-name">Schoology</div><div class="cloak-option-url">schoology.com</div></div>
|
|
181
169
|
</div>
|
|
170
|
+
<div class="cloak-option" data-title="Canvas" data-favicon="https://instructure-uploads.s3.amazonaws.com/account_168/attachments/95820/canvas_logomark_only%402x.png" data-cloak="canvas">
|
|
171
|
+
<div class="cloak-option-icon">🖼️</div>
|
|
172
|
+
<div class="cloak-option-info"><div class="cloak-option-name">Canvas LMS</div><div class="cloak-option-url">canvas.instructure.com</div></div>
|
|
173
|
+
</div>
|
|
174
|
+
<div class="cloak-option" data-title="Duolingo" data-favicon="https://d35aaqx5ub95lt.cloudfront.net/favicon.ico" data-cloak="duolingo">
|
|
175
|
+
<div class="cloak-option-icon">🦜</div>
|
|
176
|
+
<div class="cloak-option-info"><div class="cloak-option-name">Duolingo</div><div class="cloak-option-url">duolingo.com</div></div>
|
|
177
|
+
</div>
|
|
182
178
|
</div>
|
|
183
179
|
<div class="dsection-note">changes the tab title and favicon — won't affect other users.</div>
|
|
184
180
|
</div>
|
|
@@ -194,6 +190,27 @@
|
|
|
194
190
|
</div>
|
|
195
191
|
</button>
|
|
196
192
|
<div class="dsection-note">opens proxy pages in a popup showing about:blank in the address bar.</div>
|
|
193
|
+
|
|
194
|
+
<div class="dsection-label" style="margin-top:18px;">proxy engine</div>
|
|
195
|
+
<div class="proxy-options" id="proxy-options">
|
|
196
|
+
<div class="proxy-option selected" data-proxy="scramjet">
|
|
197
|
+
<div class="proxy-option-icon">⚡</div>
|
|
198
|
+
<div class="proxy-option-info">
|
|
199
|
+
<div class="proxy-option-name">ScramJet</div>
|
|
200
|
+
<div class="proxy-option-desc">fastest — experimental, best for most sites</div>
|
|
201
|
+
</div>
|
|
202
|
+
<span class="proxy-check">✓</span>
|
|
203
|
+
</div>
|
|
204
|
+
<div class="proxy-option" data-proxy="ultraviolet">
|
|
205
|
+
<div class="proxy-option-icon">🔵</div>
|
|
206
|
+
<div class="proxy-option-info">
|
|
207
|
+
<div class="proxy-option-name">Ultraviolet</div>
|
|
208
|
+
<div class="proxy-option-desc">stable — better compat for older sites</div>
|
|
209
|
+
</div>
|
|
210
|
+
<span class="proxy-check">✓</span>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<div class="dsection-note">switch proxy engines if a site won't load.</div>
|
|
197
214
|
</div>
|
|
198
215
|
|
|
199
216
|
<!-- PAGE: about -->
|
|
@@ -207,36 +224,31 @@
|
|
|
207
224
|
</div>
|
|
208
225
|
|
|
209
226
|
<div class="about-desc">
|
|
210
|
-
Index is a proxy
|
|
227
|
+
Index is a proxy site for bypassing network restrictions. Supports both ScramJet and Ultraviolet proxy engines — toggle them in Privacy settings if a site won't load.
|
|
211
228
|
</div>
|
|
212
229
|
|
|
213
230
|
<div class="about-row">
|
|
214
231
|
<span class="about-row-label">proxy engine</span>
|
|
215
|
-
<span class="about-row-val">ScramJet
|
|
232
|
+
<span class="about-row-val" id="about-proxy-label">ScramJet<span class="about-badge" id="about-proxy-badge">active</span></span>
|
|
216
233
|
</div>
|
|
217
234
|
<div class="about-row">
|
|
218
235
|
<span class="about-row-label">version</span>
|
|
219
|
-
<span class="about-row-val">v0.0
|
|
236
|
+
<span class="about-row-val">v0.1.0</span>
|
|
220
237
|
</div>
|
|
221
238
|
<div class="about-row">
|
|
222
239
|
<span class="about-row-label">max tabs</span>
|
|
223
240
|
<span class="about-row-val">20</span>
|
|
224
241
|
</div>
|
|
242
|
+
<div class="about-row">
|
|
243
|
+
<span class="about-row-label">games</span>
|
|
244
|
+
<span class="about-row-val">244+</span>
|
|
245
|
+
</div>
|
|
225
246
|
|
|
226
|
-
<div class="dsection-label" style="margin-top:20px;">
|
|
247
|
+
<div class="dsection-label" style="margin-top:20px;">engines</div>
|
|
227
248
|
<div class="about-desc">
|
|
228
|
-
|
|
249
|
+
ScramJet (default) — fastest, modern rewriting. Ultraviolet — legacy fallback with high compatibility. Both run through epoxy transport for maximum speed.
|
|
229
250
|
</div>
|
|
230
|
-
|
|
231
|
-
<!--<a href="https://discord.gg/TYPE_HERE" target="_blank" class="drawer-link-btn discord-btn" style="margin-top:4px;">
|
|
232
|
-
<div class="discord-icon">D</div>
|
|
233
|
-
<div>
|
|
234
|
-
<div>Join our Discord</div>
|
|
235
|
-
<div style="font-size:10px;color:#7289da;margin-top:2px;">community & support</div>
|
|
236
|
-
</div>
|
|
237
|
-
<span style="margin-left:auto;color:var(--text-dim)">↗</span>
|
|
238
|
-
</a>
|
|
239
|
-
</div>-->
|
|
251
|
+
</div>
|
|
240
252
|
|
|
241
253
|
</div><!-- /drawer-body -->
|
|
242
254
|
</div><!-- /settings-drawer -->
|
|
@@ -246,7 +258,60 @@
|
|
|
246
258
|
"use strict";
|
|
247
259
|
|
|
248
260
|
/* ══════════════════════════════════════════
|
|
249
|
-
|
|
261
|
+
SVG CONTEXT DETECTION
|
|
262
|
+
The page may be loaded as a plain .html OR embedded inside
|
|
263
|
+
index.svg via <foreignObject>. We normalise baseHref here so
|
|
264
|
+
all relative resource fetches (games.json, icons, sw.js) work
|
|
265
|
+
in both contexts.
|
|
266
|
+
══════════════════════════════════════════ */
|
|
267
|
+
(function patchBaseHref() {
|
|
268
|
+
// If we're inside an SVG foreignObject the document.URL might
|
|
269
|
+
// point at index.svg. Force a <base> tag so relative URLs
|
|
270
|
+
// resolve against the HTML directory, not the SVG.
|
|
271
|
+
const loc = document.URL || location.href;
|
|
272
|
+
if (loc.endsWith(".svg") || loc.includes(".svg?") || loc.includes(".svg#")) {
|
|
273
|
+
// Try to construct the sibling index.html path
|
|
274
|
+
const htmlBase = loc.replace(/index\.svg[^/]*$/, "");
|
|
275
|
+
let base = document.querySelector("base");
|
|
276
|
+
if (!base) {
|
|
277
|
+
base = document.createElement("base");
|
|
278
|
+
document.head.insertBefore(base, document.head.firstChild);
|
|
279
|
+
}
|
|
280
|
+
if (!base.href || base.href === loc) {
|
|
281
|
+
base.href = htmlBase;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
})();
|
|
285
|
+
|
|
286
|
+
/* ══════════════════════════════════════════
|
|
287
|
+
PROXY ENGINE STATE
|
|
288
|
+
'scramjet' | 'ultraviolet'
|
|
289
|
+
══════════════════════════════════════════ */
|
|
290
|
+
let activeProxy = localStorage.getItem("proxyEngine") || "scramjet";
|
|
291
|
+
|
|
292
|
+
function saveProxyEngine(name) {
|
|
293
|
+
activeProxy = name;
|
|
294
|
+
localStorage.setItem("proxyEngine", name);
|
|
295
|
+
document.querySelectorAll(".proxy-option").forEach(o => {
|
|
296
|
+
o.classList.toggle("selected", o.dataset.proxy === name);
|
|
297
|
+
});
|
|
298
|
+
// Update about page label
|
|
299
|
+
const lbl = document.getElementById("about-proxy-label");
|
|
300
|
+
const bdg = document.getElementById("about-proxy-badge");
|
|
301
|
+
if (lbl) lbl.firstChild.textContent = name === "scramjet" ? "ScramJet" : "Ultraviolet";
|
|
302
|
+
if (bdg) bdg.textContent = "active";
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
document.getElementById("proxy-options").addEventListener("click", function(e) {
|
|
306
|
+
const opt = e.target.closest(".proxy-option");
|
|
307
|
+
if (!opt) return;
|
|
308
|
+
saveProxyEngine(opt.dataset.proxy);
|
|
309
|
+
// Reset transport ready flag so next navigate re-inits with new engine
|
|
310
|
+
transportReady = false;
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
/* ══════════════════════════════════════════
|
|
314
|
+
CANVAS / THEMES
|
|
250
315
|
══════════════════════════════════════════ */
|
|
251
316
|
const canvas = document.getElementById("bg-canvas");
|
|
252
317
|
const ctx = canvas.getContext("2d");
|
|
@@ -259,25 +324,10 @@
|
|
|
259
324
|
r: Math.random() * 2 + 0.3,
|
|
260
325
|
speed: Math.random() * 0.00015 + 0.00005,
|
|
261
326
|
drift: (Math.random() - 0.5) * 0.0001,
|
|
262
|
-
opacity: Math.random() * 0.7 + 0.3
|
|
327
|
+
opacity: Math.random() * 0.7 + 0.3,
|
|
328
|
+
offset: Math.random() * Math.PI * 2,
|
|
263
329
|
}));
|
|
264
330
|
|
|
265
|
-
const LINE_COUNT = 51;
|
|
266
|
-
const waveLines = Array.from({length: LINE_COUNT}, (_, i) => {
|
|
267
|
-
const points = 120;
|
|
268
|
-
return {
|
|
269
|
-
baseY: (i + 1) / (LINE_COUNT + 1),
|
|
270
|
-
points: Array.from({length: points}, (_, j) => ({
|
|
271
|
-
x: j / (points - 1),
|
|
272
|
-
offset: Math.random() * Math.PI * 2,
|
|
273
|
-
speed: 0.003 + Math.random() * 0.002,
|
|
274
|
-
amp: 0.012 + Math.random() * 0.018,
|
|
275
|
-
mouseInfluence: 0
|
|
276
|
-
}))
|
|
277
|
-
};
|
|
278
|
-
});
|
|
279
|
-
let waveT = 0;
|
|
280
|
-
|
|
281
331
|
const fernNodes = Array.from({length: 40}, () => ({
|
|
282
332
|
x: Math.random() * window.innerWidth,
|
|
283
333
|
y: Math.random() * window.innerHeight,
|
|
@@ -335,40 +385,36 @@
|
|
|
335
385
|
window.addEventListener("resize", resizeCanvas);
|
|
336
386
|
resizeCanvas();
|
|
337
387
|
|
|
388
|
+
let waveT = 0;
|
|
389
|
+
|
|
338
390
|
function drawNexora() {
|
|
339
391
|
const W = canvas.width, H = canvas.height;
|
|
340
392
|
ctx.clearRect(0, 0, W, H);
|
|
341
393
|
const grad = ctx.createRadialGradient(W*0.4, H*0.5, 0, W*0.5, H*0.5, W*0.8);
|
|
342
394
|
grad.addColorStop(0, "rgba(30,10,0,0.95)");
|
|
343
395
|
grad.addColorStop(1, "rgba(5,2,0,0.98)");
|
|
344
|
-
ctx.fillStyle = grad;
|
|
345
|
-
ctx.fillRect(0, 0, W, H);
|
|
396
|
+
ctx.fillStyle = grad; ctx.fillRect(0, 0, W, H);
|
|
346
397
|
for (const s of stars) {
|
|
347
398
|
s.x += s.speed; s.y += s.drift;
|
|
348
399
|
if (s.x > 1) s.x = 0;
|
|
349
|
-
if (s.y > 1) s.y = 0;
|
|
350
|
-
if (s.y < 0) s.y = 1;
|
|
400
|
+
if (s.y > 1) s.y = 0; if (s.y < 0) s.y = 1;
|
|
351
401
|
const sx = s.x * W, sy = s.y * H;
|
|
352
|
-
const twinkle = 0.5 + 0.5 * Math.sin(Date.now() * 0.002 * s.speed * 300 + s.offset
|
|
353
|
-
ctx.beginPath();
|
|
354
|
-
ctx.
|
|
355
|
-
ctx.fillStyle = `rgba(255,220,180,${s.opacity * (0.6 + 0.4 * twinkle)})`;
|
|
356
|
-
ctx.fill();
|
|
402
|
+
const twinkle = 0.5 + 0.5 * Math.sin(Date.now() * 0.002 * s.speed * 300 + s.offset);
|
|
403
|
+
ctx.beginPath(); ctx.arc(sx, sy, s.r, 0, Math.PI * 2);
|
|
404
|
+
ctx.fillStyle = `rgba(255,220,180,${s.opacity * (0.6 + 0.4 * twinkle)})`; ctx.fill();
|
|
357
405
|
}
|
|
358
406
|
const orb = ctx.createRadialGradient(W*0.35, H*0.55, 0, W*0.35, H*0.55, W*0.45);
|
|
359
407
|
orb.addColorStop(0, "rgba(255,80,0,0.12)");
|
|
360
408
|
orb.addColorStop(0.5, "rgba(255,40,0,0.05)");
|
|
361
409
|
orb.addColorStop(1, "transparent");
|
|
362
|
-
ctx.fillStyle = orb;
|
|
363
|
-
ctx.fillRect(0, 0, W, H);
|
|
410
|
+
ctx.fillStyle = orb; ctx.fillRect(0, 0, W, H);
|
|
364
411
|
animFrame = requestAnimationFrame(drawNexora);
|
|
365
412
|
}
|
|
366
413
|
|
|
367
414
|
function drawWave() {
|
|
368
415
|
const W = canvas.width, H = canvas.height;
|
|
369
416
|
ctx.clearRect(0, 0, W, H);
|
|
370
|
-
ctx.fillStyle = "#1a2530";
|
|
371
|
-
ctx.fillRect(0, 0, W, H);
|
|
417
|
+
ctx.fillStyle = "#1a2530"; ctx.fillRect(0, 0, W, H);
|
|
372
418
|
waveT += 0.004;
|
|
373
419
|
const TOTAL_LINES = 120;
|
|
374
420
|
for (let li = 0; li < TOTAL_LINES; li++) {
|
|
@@ -378,13 +424,11 @@
|
|
|
378
424
|
const baseColor = isAccent
|
|
379
425
|
? `rgba(${80 + accentStrength * 100},${180 + accentStrength * 60},${80 + accentStrength * 20},${0.4 + accentStrength * 0.5})`
|
|
380
426
|
: `rgba(60,100,75,${0.06 + t * 0.12})`;
|
|
381
|
-
ctx.beginPath();
|
|
382
|
-
ctx.strokeStyle = baseColor;
|
|
427
|
+
ctx.beginPath(); ctx.strokeStyle = baseColor;
|
|
383
428
|
ctx.lineWidth = isAccent ? 1.5 + accentStrength * 1.5 : 0.6;
|
|
384
429
|
const STEPS = 300;
|
|
385
430
|
for (let si = 0; si <= STEPS; si++) {
|
|
386
|
-
const x = (si / STEPS) * W;
|
|
387
|
-
const px = si / STEPS;
|
|
431
|
+
const x = (si / STEPS) * W, px = si / STEPS;
|
|
388
432
|
const dx = px - mouseX, dy = t - mouseY;
|
|
389
433
|
const dist = Math.sqrt(dx * dx + dy * dy * 4);
|
|
390
434
|
const repel = dist < 0.12 ? (0.12 - dist) / 0.12 : 0;
|
|
@@ -393,9 +437,8 @@
|
|
|
393
437
|
const w2 = Math.sin(px * 11 - waveT * 0.7 + li * 0.31) * 0.014;
|
|
394
438
|
const w3 = Math.sin(px * 2 + waveT * 0.4 + li * 0.09) * 0.045;
|
|
395
439
|
const w4 = Math.sin(px * 18 + waveT * 1.8 + li * 0.55) * 0.006;
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
if (si === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y);
|
|
440
|
+
const y = (t + 0.02 + w1 + w2 + w3 + w4 + repel * repelDir * 0.06) * H;
|
|
441
|
+
si === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
|
|
399
442
|
}
|
|
400
443
|
ctx.stroke();
|
|
401
444
|
}
|
|
@@ -406,8 +449,7 @@
|
|
|
406
449
|
function drawVoid() {
|
|
407
450
|
const W = canvas.width, H = canvas.height;
|
|
408
451
|
ctx.clearRect(0, 0, W, H);
|
|
409
|
-
ctx.fillStyle = "#000000";
|
|
410
|
-
ctx.fillRect(0, 0, W, H);
|
|
452
|
+
ctx.fillStyle = "#000000"; ctx.fillRect(0, 0, W, H);
|
|
411
453
|
voidT += 0.004;
|
|
412
454
|
const TOTAL_LINES = 100;
|
|
413
455
|
for (let li = 0; li < TOTAL_LINES; li++) {
|
|
@@ -415,13 +457,11 @@
|
|
|
415
457
|
const isAccent = li >= TOTAL_LINES - 3;
|
|
416
458
|
const accentStrength = isAccent ? (li - (TOTAL_LINES - 3)) / 3 : 0;
|
|
417
459
|
const alpha = isAccent ? 0.55 + accentStrength * 0.45 : 0.04 + t * 0.18;
|
|
418
|
-
ctx.beginPath();
|
|
419
|
-
ctx.strokeStyle = `rgba(255,255,255,${alpha})`;
|
|
460
|
+
ctx.beginPath(); ctx.strokeStyle = `rgba(255,255,255,${alpha})`;
|
|
420
461
|
ctx.lineWidth = isAccent ? 1.2 + accentStrength * 1.0 : 0.5;
|
|
421
462
|
const STEPS = 300;
|
|
422
463
|
for (let si = 0; si <= STEPS; si++) {
|
|
423
|
-
const x = (si / STEPS) * W;
|
|
424
|
-
const px = si / STEPS;
|
|
464
|
+
const x = (si / STEPS) * W, px = si / STEPS;
|
|
425
465
|
const dx = px - mouseX, dy = t - mouseY;
|
|
426
466
|
const dist = Math.sqrt(dx * dx + dy * dy * 4);
|
|
427
467
|
const repel = dist < 0.12 ? (0.12 - dist) / 0.12 : 0;
|
|
@@ -430,9 +470,8 @@
|
|
|
430
470
|
const w2 = Math.sin(px * 9 - voidT * 0.6 + li * 0.28) * 0.016;
|
|
431
471
|
const w3 = Math.sin(px * 2.5 + voidT * 0.35 + li * 0.10) * 0.050;
|
|
432
472
|
const w4 = Math.sin(px * 16 + voidT * 1.5 + li * 0.50) * 0.007;
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
if (si === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y);
|
|
473
|
+
const y = (t + 0.02 + w1 + w2 + w3 + w4 + repel * repelDir * 0.06) * H;
|
|
474
|
+
si === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);
|
|
436
475
|
}
|
|
437
476
|
ctx.stroke();
|
|
438
477
|
}
|
|
@@ -442,15 +481,12 @@
|
|
|
442
481
|
function drawFern() {
|
|
443
482
|
const W = canvas.width, H = canvas.height;
|
|
444
483
|
ctx.clearRect(0, 0, W, H);
|
|
445
|
-
ctx.fillStyle = "#000000";
|
|
446
|
-
ctx.fillRect(0, 0, W, H);
|
|
484
|
+
ctx.fillStyle = "#000000"; ctx.fillRect(0, 0, W, H);
|
|
447
485
|
const now = Date.now() * 0.001;
|
|
448
486
|
for (const s of fernStars) {
|
|
449
487
|
const twinkle = 0.6 + 0.4 * Math.sin(now * 1.2 + s.twinkleOffset);
|
|
450
|
-
ctx.beginPath();
|
|
451
|
-
ctx.
|
|
452
|
-
ctx.fillStyle = `rgba(255,255,255,${s.opacity * twinkle})`;
|
|
453
|
-
ctx.fill();
|
|
488
|
+
ctx.beginPath(); ctx.arc(s.x * W, s.y * H, s.r, 0, Math.PI * 2);
|
|
489
|
+
ctx.fillStyle = `rgba(255,255,255,${s.opacity * twinkle})`; ctx.fill();
|
|
454
490
|
}
|
|
455
491
|
const mx = mouseX * W, my = mouseY * H;
|
|
456
492
|
for (const n of fernNodes) {
|
|
@@ -458,8 +494,7 @@
|
|
|
458
494
|
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
459
495
|
if (dist < 100 && dist > 0) {
|
|
460
496
|
const force = (100 - dist) / 100 * 0.4;
|
|
461
|
-
n.vx += (dx / dist) * force;
|
|
462
|
-
n.vy += (dy / dist) * force;
|
|
497
|
+
n.vx += (dx / dist) * force; n.vy += (dy / dist) * force;
|
|
463
498
|
}
|
|
464
499
|
const speed = Math.sqrt(n.vx * n.vx + n.vy * n.vy);
|
|
465
500
|
if (speed > 1.2) { n.vx = (n.vx / speed) * 1.2; n.vy = (n.vy / speed) * 1.2; }
|
|
@@ -483,30 +518,23 @@
|
|
|
483
518
|
}
|
|
484
519
|
}
|
|
485
520
|
for (const n of fernNodes) {
|
|
486
|
-
ctx.beginPath();
|
|
487
|
-
ctx.
|
|
488
|
-
ctx.fillStyle = "rgba(255,255,255,0.5)";
|
|
489
|
-
ctx.fill();
|
|
521
|
+
ctx.beginPath(); ctx.arc(n.x, n.y, n.r, 0, Math.PI * 2);
|
|
522
|
+
ctx.fillStyle = "rgba(255,255,255,0.5)"; ctx.fill();
|
|
490
523
|
}
|
|
491
524
|
fernShootingTimer++;
|
|
492
525
|
if (fernShootingTimer > 180 + Math.random() * 240) {
|
|
493
|
-
spawnShootingStar();
|
|
494
|
-
fernShootingTimer = 0;
|
|
526
|
+
spawnShootingStar(); fernShootingTimer = 0;
|
|
495
527
|
}
|
|
496
528
|
shootingStars = shootingStars.filter(s => s.life > 0);
|
|
497
529
|
for (const s of shootingStars) {
|
|
498
530
|
const tx = s.x + Math.cos(s.angle) * s.len;
|
|
499
531
|
const ty = s.y + Math.sin(s.angle) * s.len;
|
|
500
532
|
const grad = ctx.createLinearGradient(s.x, s.y, tx, ty);
|
|
501
|
-
grad.addColorStop(0,
|
|
533
|
+
grad.addColorStop(0, "rgba(255,255,255,0)");
|
|
502
534
|
grad.addColorStop(0.3, `rgba(255,255,255,${s.life * 0.6})`);
|
|
503
535
|
grad.addColorStop(1, `rgba(255,255,255,${s.life})`);
|
|
504
|
-
ctx.beginPath();
|
|
505
|
-
ctx.
|
|
506
|
-
ctx.lineWidth = 1.5;
|
|
507
|
-
ctx.moveTo(s.x, s.y);
|
|
508
|
-
ctx.lineTo(tx, ty);
|
|
509
|
-
ctx.stroke();
|
|
536
|
+
ctx.beginPath(); ctx.strokeStyle = grad; ctx.lineWidth = 1.5;
|
|
537
|
+
ctx.moveTo(s.x, s.y); ctx.lineTo(tx, ty); ctx.stroke();
|
|
510
538
|
s.x += Math.cos(s.angle) * s.speed;
|
|
511
539
|
s.y += Math.sin(s.angle) * s.speed;
|
|
512
540
|
s.life -= s.decay;
|
|
@@ -538,18 +566,9 @@
|
|
|
538
566
|
drawVoid();
|
|
539
567
|
} else if (theme === "fern") {
|
|
540
568
|
document.body.classList.add("theme-fern");
|
|
541
|
-
shootingStars = [];
|
|
542
|
-
fernShootingTimer = 0;
|
|
569
|
+
shootingStars = []; fernShootingTimer = 0;
|
|
543
570
|
drawFern();
|
|
544
571
|
}
|
|
545
|
-
updateQuickAppColors();
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
function updateQuickAppColors() {
|
|
549
|
-
const color = getComputedStyle(document.documentElement).getPropertyValue("--green").trim() || "#4ab464";
|
|
550
|
-
document.querySelectorAll(".quick-app-icon svg path, .quick-app-icon svg polygon").forEach(el => {
|
|
551
|
-
if (el.getAttribute("fill") && el.getAttribute("fill") !== "none") el.setAttribute("fill", color);
|
|
552
|
-
});
|
|
553
572
|
}
|
|
554
573
|
|
|
555
574
|
document.getElementById("theme-options").addEventListener("click", function(e) {
|
|
@@ -559,15 +578,32 @@
|
|
|
559
578
|
});
|
|
560
579
|
|
|
561
580
|
/* ══════════════════════════════════════════
|
|
562
|
-
CLOAK
|
|
581
|
+
CLOAK — works in both HTML and SVG context
|
|
563
582
|
══════════════════════════════════════════ */
|
|
564
583
|
let currentCloak = { title: "Index", favicon: "", cloak: "none" };
|
|
565
584
|
|
|
566
585
|
function applyCloak(title, favicon) {
|
|
567
|
-
document
|
|
586
|
+
// Set document title
|
|
587
|
+
try { document.title = title; } catch(_) {}
|
|
588
|
+
// Set favicon — works in HTML context; in SVG context this is a no-op
|
|
589
|
+
// but that's fine because the SVG wrapper's containing document controls
|
|
590
|
+
// the browser tab, not the foreignObject.
|
|
568
591
|
let link = document.querySelector("link[rel~='icon']");
|
|
569
|
-
if (!link) {
|
|
592
|
+
if (!link) {
|
|
593
|
+
link = document.createElement("link");
|
|
594
|
+
link.rel = "shortcut icon";
|
|
595
|
+
document.head.appendChild(link);
|
|
596
|
+
}
|
|
570
597
|
link.href = favicon || "data:,";
|
|
598
|
+
|
|
599
|
+
// In SVG context: also try to reach the parent window
|
|
600
|
+
try {
|
|
601
|
+
if (window.parent && window.parent !== window) {
|
|
602
|
+
window.parent.document.title = title;
|
|
603
|
+
const pLink = window.parent.document.querySelector("link[rel~='icon']");
|
|
604
|
+
if (pLink) pLink.href = favicon || "data:,";
|
|
605
|
+
}
|
|
606
|
+
} catch(_) {}
|
|
571
607
|
}
|
|
572
608
|
|
|
573
609
|
document.getElementById("cloak-options").addEventListener("click", function(e) {
|
|
@@ -587,7 +623,13 @@
|
|
|
587
623
|
const entry = tabs.get(activeId);
|
|
588
624
|
let url = null;
|
|
589
625
|
if (entry && entry.frame) {
|
|
590
|
-
try {
|
|
626
|
+
try {
|
|
627
|
+
if (activeProxy === "ultraviolet" && entry.uvFrame) {
|
|
628
|
+
url = entry.uvFrame.src;
|
|
629
|
+
} else if (entry.frame && entry.frame.frame) {
|
|
630
|
+
url = entry.frame.frame.contentWindow.location.href;
|
|
631
|
+
}
|
|
632
|
+
} catch(_) {}
|
|
591
633
|
}
|
|
592
634
|
if (!url || url === "about:blank") {
|
|
593
635
|
url = prompt("Enter a URL to open in about:blank:");
|
|
@@ -600,29 +642,49 @@
|
|
|
600
642
|
function openAboutBlank(url) {
|
|
601
643
|
const win = window.open("about:blank", "_blank");
|
|
602
644
|
if (!win) { alert("Allow popups for about:blank to work."); return; }
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
645
|
+
// Resolve base relative to HTML file not SVG
|
|
646
|
+
const base = (() => {
|
|
647
|
+
const b = document.querySelector("base");
|
|
648
|
+
return (b && b.href && !b.href.endsWith(".svg")) ? b.href : (location.origin + location.pathname.replace(/index\.svg$/, ""));
|
|
649
|
+
})();
|
|
650
|
+
const workerPath = base + "baremux/worker.js";
|
|
651
|
+
const swScriptPath = base + "register-sw.js";
|
|
652
|
+
const scramjetPrefix = base + "service/";
|
|
653
|
+
const uvPrefix = base + "uv/";
|
|
654
|
+
const proxyToUse = activeProxy;
|
|
655
|
+
|
|
607
656
|
win.document.open();
|
|
608
657
|
win.document.write(`<!doctype html><html><head>
|
|
609
658
|
<script src="https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.all.js"><\/script>
|
|
659
|
+
<script src="https://unpkg.com/@titaniumnetwork-dev/ultraviolet@3.2.10/dist/uv.bundle.js"><\/script>
|
|
660
|
+
<script src="https://unpkg.com/@titaniumnetwork-dev/ultraviolet@3.2.10/dist/uv.config.js"><\/script>
|
|
610
661
|
<script src="https://unpkg.com/@mercuryworkshop/bare-mux@2.1.7/dist/index.js"><\/script>
|
|
611
662
|
<script src="${swScriptPath}"><\/script>
|
|
612
663
|
<style>*{margin:0;padding:0;}iframe{width:100vw;height:100vh;border:none;}<\/style>
|
|
613
664
|
</head><body><script>
|
|
614
665
|
(async()=>{
|
|
615
|
-
const {ScramjetController}=$scramjetLoadController();
|
|
616
|
-
const sj=new ScramjetController({prefix:"${scramjetPrefix}",files:{wasm:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.wasm.wasm",all:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.all.js",sync:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.sync.js"}});
|
|
617
|
-
sj.init();
|
|
618
666
|
await registerSW();
|
|
619
|
-
const c=new BareMux.BareMuxConnection("${workerPath}");
|
|
620
|
-
const wispUrl=
|
|
621
|
-
const
|
|
622
|
-
if((await c.getTransport())!==
|
|
623
|
-
const f=
|
|
624
|
-
|
|
625
|
-
f.
|
|
667
|
+
const c = new BareMux.BareMuxConnection("${workerPath}");
|
|
668
|
+
const wispUrl = (location.protocol==="https:"?"wss":"ws")+"://"+location.host+"/wisp/";
|
|
669
|
+
const transport = "https://unpkg.com/@mercuryworkshop/epoxy-transport@2.1.29/dist/index.mjs";
|
|
670
|
+
if((await c.getTransport()) !== transport) await c.setTransport(transport,[{websocket:wispUrl}]);
|
|
671
|
+
const f = document.createElement("iframe");
|
|
672
|
+
f.style.cssText = "width:100%;height:100%;border:none;position:fixed;inset:0;";
|
|
673
|
+
f.allow = "gamepad *";
|
|
674
|
+
document.body.appendChild(f);
|
|
675
|
+
const proxy = "${proxyToUse}";
|
|
676
|
+
if(proxy === "ultraviolet") {
|
|
677
|
+
if(self.__uv\$config) self.__uv\$config.prefix = "${uvPrefix}";
|
|
678
|
+
f.src = __uv\$config.prefix + __uv\$config.encodeUrl("${url}");
|
|
679
|
+
} else {
|
|
680
|
+
const {ScramjetController} = \$scramjetLoadController();
|
|
681
|
+
const sj = new ScramjetController({prefix:"${scramjetPrefix}",files:{wasm:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.wasm.wasm",all:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.all.js",sync:"https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.sync.js"}});
|
|
682
|
+
sj.init();
|
|
683
|
+
const frame = sj.createFrame();
|
|
684
|
+
document.body.innerHTML = "";
|
|
685
|
+
document.body.appendChild(frame.frame);
|
|
686
|
+
frame.go("${url}");
|
|
687
|
+
}
|
|
626
688
|
})();
|
|
627
689
|
<\/script></body></html>`);
|
|
628
690
|
win.document.close();
|
|
@@ -654,10 +716,7 @@
|
|
|
654
716
|
drawerBack.style.display = pageHistory.length > 1 ? "inline-flex" : "none";
|
|
655
717
|
}
|
|
656
718
|
|
|
657
|
-
function gotoPage(pageId) {
|
|
658
|
-
pageHistory.push(pageId);
|
|
659
|
-
showPage(pageId);
|
|
660
|
-
}
|
|
719
|
+
function gotoPage(pageId) { pageHistory.push(pageId); showPage(pageId); }
|
|
661
720
|
|
|
662
721
|
drawerBack.addEventListener("click", () => {
|
|
663
722
|
if (pageHistory.length <= 1) return;
|
|
@@ -672,112 +731,104 @@
|
|
|
672
731
|
fab.addEventListener("click", () => {
|
|
673
732
|
const open = overlay.classList.toggle("open");
|
|
674
733
|
fab.classList.toggle("active", open);
|
|
675
|
-
if (open) {
|
|
676
|
-
pageHistory = ["dpage-main"];
|
|
677
|
-
showPage("dpage-main");
|
|
678
|
-
}
|
|
734
|
+
if (open) { pageHistory = ["dpage-main"]; showPage("dpage-main"); }
|
|
679
735
|
});
|
|
680
736
|
|
|
681
737
|
overlay.addEventListener("click", e => {
|
|
682
|
-
if (e.target === overlay) {
|
|
683
|
-
overlay.classList.remove("open");
|
|
684
|
-
fab.classList.remove("active");
|
|
685
|
-
}
|
|
738
|
+
if (e.target === overlay) { overlay.classList.remove("open"); fab.classList.remove("active"); }
|
|
686
739
|
});
|
|
687
740
|
|
|
688
|
-
drawerClose.addEventListener("click", () => {
|
|
689
|
-
overlay.classList.remove("open");
|
|
690
|
-
fab.classList.remove("active");
|
|
691
|
-
});
|
|
692
|
-
|
|
693
|
-
/* ══════════════════════════════════════════
|
|
694
|
-
RESTORE SETTINGS
|
|
695
|
-
══════════════════════════════════════════ */
|
|
696
|
-
(function restoreSettings() {
|
|
697
|
-
const savedCloak = localStorage.getItem("cloak");
|
|
698
|
-
if (savedCloak) {
|
|
699
|
-
try {
|
|
700
|
-
const c = JSON.parse(savedCloak);
|
|
701
|
-
currentCloak = c;
|
|
702
|
-
applyCloak(c.title, c.favicon);
|
|
703
|
-
document.querySelectorAll(".cloak-option").forEach(o => {
|
|
704
|
-
o.classList.toggle("selected", o.dataset.cloak === c.cloak);
|
|
705
|
-
});
|
|
706
|
-
} catch(_) {}
|
|
707
|
-
}
|
|
708
|
-
const savedTheme = localStorage.getItem("theme") || "default";
|
|
709
|
-
applyTheme(savedTheme);
|
|
710
|
-
})();
|
|
741
|
+
drawerClose.addEventListener("click", () => { overlay.classList.remove("open"); fab.classList.remove("active"); });
|
|
711
742
|
|
|
712
743
|
/* ══════════════════════════════════════════
|
|
713
|
-
|
|
744
|
+
PROXY ENGINE INIT — ScramJet + UV
|
|
714
745
|
══════════════════════════════════════════ */
|
|
715
|
-
const QUICK_APPS = [
|
|
716
|
-
{ name: "duckduckgo", url: "https://www.duckduckgo.com", icon: `<img src="icons/DDG-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
717
|
-
{ name: "youtube", url: "https://www.youtube.com", icon: `<img src="icons/YT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
718
|
-
{ name: "tiktok", url: "https://www.tiktok.com", icon: `<img src="icons/TT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
719
|
-
{ name: "discord", url: "https://www.discord.com", icon: `<img src="icons/DC-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
720
|
-
{ name: "Cool Math Games", url: "https://www.coolmathgames.com", icon: `<img src="icons/CMG-Favicon.jpg" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
721
|
-
{ name: "x [twitter]", url: "https://www.x.com", icon: `<img src="icons/X-Favicon.jpg" width="25" height="24" style="border-radius:2px;object-fit:contain;" />` },
|
|
722
|
-
{ name: "chatgpt", url: "https://chat.openai.com", icon: `<img src="icons/CGPT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
723
|
-
{ name: "music", url: "https://freefy.app/", icon: `<img src="icons/MCTF-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
724
|
-
{ name: "movies", url: "https://www.justwatch.com/ca/provider/free-all/", icon: `<img src="icons/MP4-Favicon.webp" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
725
|
-
];
|
|
726
|
-
|
|
727
|
-
const APPS_REGISTRY = [
|
|
728
|
-
{ name: "Google", url: "https://www.google.com", icon: `<img src="icons/G-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Search the web", tags: ["search","google"] },
|
|
729
|
-
{ name: "YouTube", url: "https://www.youtube.com", icon: `<img src="icons/YT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Watch videos", tags: ["video","media"] },
|
|
730
|
-
{ name: "Discord", url: "https://discord.com/app", icon: `<img src="icons/DC-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Chat with friends", tags: ["social","chat"] },
|
|
731
|
-
{ name: "Spotify", url: "https://open.spotify.com", icon: `<img src="icons/S-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Stream music", tags: ["music","media"] },
|
|
732
|
-
{ name: "Monochrome.tf", url: "https://monochrome.tf", icon: `<img src="icons/MCTF-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Stream music", tags: ["music","media"] },
|
|
733
|
-
{ name: "Reddit", url: "https://www.reddit.com", icon: `<img src="icons/RDT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Browse communities", tags: ["social","news"] },
|
|
734
|
-
{ name: "X / Twitter", url: "https://www.x.com", icon: `<img src="icons/X-Favicon.jpg" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Trending topics & posts", tags: ["social","news"] },
|
|
735
|
-
{ name: "TikTok", url: "https://www.tiktok.com", icon: `<img src="icons/TT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Short-form videos", tags: ["video","social"] },
|
|
736
|
-
{ name: "ChatGPT", url: "https://chat.openai.com", icon: `<img src="icons/CGPT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "AI assistant by OpenAI", tags: ["ai","tools"] },
|
|
737
|
-
{ name: "Now.gg", url: "https://www.now.gg/", icon: `<img src="icons/NGG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Online games for all.", tags: ["games","dev"] },
|
|
738
|
-
{ name: "Crazy Games", url: "https://www.crazygames.com/", icon: `<img src="icons/CZG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Online games for all.", tags: ["games","dev"] },
|
|
739
|
-
{ name: "Gmail", url: "https://mail.google.com", icon: `<img src="https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Email by Google", tags: ["productivity","google"] },
|
|
740
|
-
{ name: "DuckDuckGo", url: "https://www.duckduckgo.com", icon: `<img src="icons/DDG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Private search", tags: ["search"] },
|
|
741
|
-
{ name: "Bing", url: "https://www.bing.com", icon: `<img src="icons/BNG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Microsoft search", tags: ["search"] },
|
|
742
|
-
{ name: "GitHub", url: "https://github.com", icon: `<img src="icons/GH-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Code & collaboration", tags: ["tools","dev"] },
|
|
743
|
-
{ name: "Replit", url: "https://replit.com", icon: `<img src="icons/RPT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Code in the browser", tags: ["tools","dev"] },
|
|
744
|
-
{ name: "Neal.fun", url: "https://www.neal.fun", icon: `<img src="icons/NDF-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Many fun games.", tags: ["games","education"] },
|
|
745
|
-
{ name: "Cool Math Games", url: "https://www.coolmathgames.com", icon: `<img src="icons/CMG-Favicon.jpg" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Math-based browser games", tags: ["games","education"] },
|
|
746
|
-
];
|
|
747
|
-
|
|
748
746
|
const cfg = (typeof window !== "undefined" && window.__INDEX_CONFIG) || {};
|
|
749
747
|
const scramjetFiles = cfg.scramjet || {
|
|
750
748
|
wasm: "https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.wasm.wasm",
|
|
751
749
|
all: "https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.all.js",
|
|
752
|
-
sync: "https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.sync.js"
|
|
750
|
+
sync: "https://unpkg.com/@mercuryworkshop/scramjet@2.0.0-alpha/dist/scramjet.sync.js",
|
|
753
751
|
};
|
|
754
|
-
|
|
755
|
-
|
|
752
|
+
|
|
753
|
+
// Resolve base so both engines use the right path regardless of SVG/HTML loading
|
|
754
|
+
const baseDir = (() => {
|
|
755
|
+
const b = document.querySelector("base");
|
|
756
|
+
if (b && b.href && !b.href.endsWith(".svg")) {
|
|
757
|
+
return new URL("./", b.href).pathname;
|
|
758
|
+
}
|
|
759
|
+
return new URL("./", location.href).pathname;
|
|
760
|
+
})();
|
|
761
|
+
|
|
762
|
+
const workerPath = (cfg.baremux && cfg.baremux.worker) || (baseDir + "baremux/worker.js");
|
|
756
763
|
const scramjetPrefix = baseDir + "service/";
|
|
764
|
+
const uvPrefix = baseDir + "uv/";
|
|
757
765
|
|
|
766
|
+
// Init ScramJet
|
|
758
767
|
const { ScramjetController } = $scramjetLoadController();
|
|
759
|
-
const scramjet = new ScramjetController({
|
|
760
|
-
files: scramjetFiles,
|
|
761
|
-
prefix: scramjetPrefix
|
|
762
|
-
});
|
|
768
|
+
const scramjet = new ScramjetController({ files: scramjetFiles, prefix: scramjetPrefix });
|
|
763
769
|
scramjet.init();
|
|
764
770
|
|
|
771
|
+
// UV config prefix
|
|
772
|
+
if (self.__uv$config) {
|
|
773
|
+
self.__uv$config.prefix = uvPrefix;
|
|
774
|
+
}
|
|
775
|
+
|
|
765
776
|
const connection = new BareMux.BareMuxConnection(workerPath);
|
|
766
777
|
let transportReady = false;
|
|
767
778
|
|
|
768
779
|
async function ensureTransport() {
|
|
769
780
|
if (transportReady) return;
|
|
770
|
-
await registerSW();
|
|
771
|
-
const wispUrl = cfg.wispUrl ||
|
|
772
|
-
|
|
773
|
-
|
|
781
|
+
if (typeof registerSW === "function") await registerSW();
|
|
782
|
+
const wispUrl = cfg.wispUrl ||
|
|
783
|
+
((location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/");
|
|
784
|
+
// Prefer epoxy (Rust/Wasm, fastest), fall back to libcurl
|
|
785
|
+
const transportUrl = (cfg.epoxy && cfg.epoxy.transport)
|
|
786
|
+
|| (cfg.transport)
|
|
787
|
+
|| "https://unpkg.com/@mercuryworkshop/epoxy-transport@2.1.29/dist/index.mjs";
|
|
788
|
+
const current = await connection.getTransport().catch(() => null);
|
|
789
|
+
if (current !== transportUrl) {
|
|
774
790
|
await connection.setTransport(transportUrl, [{ websocket: wispUrl }]);
|
|
775
791
|
}
|
|
776
792
|
transportReady = true;
|
|
777
793
|
}
|
|
778
794
|
|
|
779
795
|
/* ══════════════════════════════════════════
|
|
780
|
-
|
|
796
|
+
NAVIGATE WITH ACTIVE PROXY ENGINE
|
|
797
|
+
══════════════════════════════════════════ */
|
|
798
|
+
async function proxyNavigate(entry, url, id) {
|
|
799
|
+
if (activeProxy === "ultraviolet" && self.__uv$config) {
|
|
800
|
+
// UV uses a plain iframe with encoded URL
|
|
801
|
+
if (!entry.uvFrame) {
|
|
802
|
+
entry.uvFrame = document.createElement("iframe");
|
|
803
|
+
entry.uvFrame.style.cssText = "width:100%;height:100%;border:none;";
|
|
804
|
+
entry.uvFrame.allow = "gamepad *";
|
|
805
|
+
entry.uvFrame.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms allow-modals allow-popups");
|
|
806
|
+
}
|
|
807
|
+
entry.paneEl.innerHTML = "";
|
|
808
|
+
entry.paneEl.appendChild(entry.uvFrame);
|
|
809
|
+
entry.uvFrame.src = __uv$config.prefix + __uv$config.encodeUrl(url);
|
|
810
|
+
entry.uvFrame.onload = () => {
|
|
811
|
+
setTabLoading(id, false);
|
|
812
|
+
try {
|
|
813
|
+
const t = entry.uvFrame.contentDocument?.title;
|
|
814
|
+
if (t) setTabTitle(id, t);
|
|
815
|
+
} catch(_) {}
|
|
816
|
+
};
|
|
817
|
+
} else {
|
|
818
|
+
// ScramJet
|
|
819
|
+
if (!entry.frame) entry.frame = scramjet.createFrame();
|
|
820
|
+
entry.paneEl.innerHTML = "";
|
|
821
|
+
entry.paneEl.appendChild(entry.frame.frame);
|
|
822
|
+
entry.frame.go(url);
|
|
823
|
+
entry.frame.frame.addEventListener("load", function() {
|
|
824
|
+
setTabLoading(id, false);
|
|
825
|
+
try { const t = entry.frame.frame.contentDocument?.title; if (t) setTabTitle(id, t); } catch(_) {}
|
|
826
|
+
}, { once: true });
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
/* ══════════════════════════════════════════
|
|
831
|
+
TAB ENGINE
|
|
781
832
|
══════════════════════════════════════════ */
|
|
782
833
|
const tabBar = document.getElementById("tab-bar");
|
|
783
834
|
const newTabBtn = document.getElementById("new-tab-btn");
|
|
@@ -807,7 +858,8 @@
|
|
|
807
858
|
paneEl.innerHTML = getHomeHTML(id);
|
|
808
859
|
tabBar.insertBefore(tabEl, newTabBtn);
|
|
809
860
|
tabContent.appendChild(paneEl);
|
|
810
|
-
|
|
861
|
+
const entry = { tabEl, paneEl, frame: null, uvFrame: null };
|
|
862
|
+
tabs.set(id, entry);
|
|
811
863
|
wireHome(paneEl, id);
|
|
812
864
|
tabEl.addEventListener("click", e => { if (!e.target.classList.contains("tab-close")) activateTab(id); });
|
|
813
865
|
tabEl.querySelector(".tab-close").addEventListener("click", e => { e.stopPropagation(); closeTab(id); });
|
|
@@ -821,6 +873,9 @@
|
|
|
821
873
|
tabEl.classList.toggle("active", tid === id);
|
|
822
874
|
paneEl.classList.toggle("active", tid === id);
|
|
823
875
|
});
|
|
876
|
+
// Manage games/apps button active state
|
|
877
|
+
document.getElementById("games-btn").classList.toggle("active", id === gamesTabId);
|
|
878
|
+
document.getElementById("apps-btn").classList.toggle("active", id === appsTabId);
|
|
824
879
|
}
|
|
825
880
|
|
|
826
881
|
function closeTab(id) {
|
|
@@ -828,6 +883,8 @@
|
|
|
828
883
|
const entry = tabs.get(id); if (!entry) return;
|
|
829
884
|
const keys = [...tabs.keys()], idx = keys.indexOf(id);
|
|
830
885
|
entry.tabEl.remove(); entry.paneEl.remove(); tabs.delete(id);
|
|
886
|
+
if (id === gamesTabId) gamesTabId = null;
|
|
887
|
+
if (id === appsTabId) appsTabId = null;
|
|
831
888
|
if (activeId === id) {
|
|
832
889
|
const r = [...tabs.keys()];
|
|
833
890
|
activateTab(r[Math.min(idx, r.length - 1)]);
|
|
@@ -840,29 +897,67 @@
|
|
|
840
897
|
try { await ensureTransport(); }
|
|
841
898
|
catch (err) {
|
|
842
899
|
setTabLoading(id, false); setTabTitle(id, "error");
|
|
843
|
-
entry.paneEl.innerHTML = '<div class="home-content"><div class="home-center"><p class="sj-error">
|
|
900
|
+
entry.paneEl.innerHTML = '<div class="home-content"><div class="home-center"><p class="sj-error">Service worker failed: ' + err.message + '</p></div></div>';
|
|
844
901
|
return;
|
|
845
902
|
}
|
|
846
|
-
entry
|
|
847
|
-
|
|
848
|
-
entry.paneEl.appendChild(entry.frame.frame);
|
|
849
|
-
entry.frame.go(url);
|
|
850
|
-
entry.frame.frame.addEventListener("load", function() {
|
|
851
|
-
setTabLoading(id, false);
|
|
852
|
-
try { const t = entry.frame.frame.contentDocument?.title; if (t) setTabTitle(id, t); } catch(_) {}
|
|
853
|
-
}, { once: true });
|
|
903
|
+
await proxyNavigate(entry, url, id);
|
|
904
|
+
// Poll for title up to 8 seconds
|
|
854
905
|
let attempts = 0;
|
|
855
906
|
const poll = setInterval(() => {
|
|
856
907
|
attempts++;
|
|
857
|
-
try {
|
|
908
|
+
try {
|
|
909
|
+
let t;
|
|
910
|
+
if (activeProxy === "ultraviolet" && entry.uvFrame) {
|
|
911
|
+
t = entry.uvFrame.contentDocument?.title;
|
|
912
|
+
} else if (entry.frame && entry.frame.frame) {
|
|
913
|
+
t = entry.frame.frame.contentDocument?.title;
|
|
914
|
+
}
|
|
915
|
+
if (t) { setTabTitle(id, t); setTabLoading(id, false); clearInterval(poll); }
|
|
916
|
+
} catch(_) {}
|
|
858
917
|
if (attempts > 80) { setTabLoading(id, false); clearInterval(poll); }
|
|
859
918
|
}, 100);
|
|
860
919
|
}
|
|
861
920
|
|
|
921
|
+
/* ══════════════════════════════════════════
|
|
922
|
+
HOME PAGE
|
|
923
|
+
══════════════════════════════════════════ */
|
|
924
|
+
const QUICK_APPS = [
|
|
925
|
+
{ name: "duckduckgo", url: "https://duckduckgo.com", icon: `<img src="icons/DDG-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
926
|
+
{ name: "youtube", url: "https://www.youtube.com", icon: `<img src="icons/YT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
927
|
+
{ name: "tiktok", url: "https://www.tiktok.com", icon: `<img src="icons/TT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
928
|
+
{ name: "discord", url: "https://discord.com/app", icon: `<img src="icons/DC-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
929
|
+
{ name: "cool math", url: "https://www.coolmathgames.com", icon: `<img src="icons/CMG-Favicon.jpg" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
930
|
+
{ name: "x/twitter", url: "https://x.com", icon: `<img src="icons/X-Favicon.jpg" width="25" height="24" style="border-radius:2px;object-fit:contain;" />` },
|
|
931
|
+
{ name: "chatgpt", url: "https://chat.openai.com", icon: `<img src="icons/CGPT-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
932
|
+
{ name: "music", url: "https://freefy.app/", icon: `<img src="icons/MCTF-Favicon.png" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
933
|
+
{ name: "movies", url: "https://www.justwatch.com", icon: `<img src="icons/MP4-Favicon.webp" width="25" height="25" style="border-radius:2px;object-fit:contain;" />` },
|
|
934
|
+
];
|
|
935
|
+
|
|
936
|
+
const APPS_REGISTRY = [
|
|
937
|
+
{ name: "Google", url: "https://www.google.com", icon: `<img src="icons/G-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Search the web", tags: ["search","google"] },
|
|
938
|
+
{ name: "YouTube", url: "https://www.youtube.com", icon: `<img src="icons/YT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Watch videos", tags: ["video","media"] },
|
|
939
|
+
{ name: "Discord", url: "https://discord.com/app", icon: `<img src="icons/DC-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Chat with friends", tags: ["social","chat"] },
|
|
940
|
+
{ name: "Spotify", url: "https://open.spotify.com", icon: `<img src="icons/S-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Stream music", tags: ["music","media"] },
|
|
941
|
+
{ name: "Reddit", url: "https://www.reddit.com", icon: `<img src="icons/RDT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Browse communities", tags: ["social","news"] },
|
|
942
|
+
{ name: "X / Twitter", url: "https://x.com", icon: `<img src="icons/X-Favicon.jpg" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Trending topics", tags: ["social","news"] },
|
|
943
|
+
{ name: "TikTok", url: "https://www.tiktok.com", icon: `<img src="icons/TT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Short-form videos", tags: ["video","social"] },
|
|
944
|
+
{ name: "ChatGPT", url: "https://chat.openai.com", icon: `<img src="icons/CGPT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "AI assistant", tags: ["ai","tools"] },
|
|
945
|
+
{ name: "Now.gg", url: "https://now.gg", icon: `<img src="icons/NGG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Mobile games online", tags: ["games"] },
|
|
946
|
+
{ name: "Crazy Games", url: "https://www.crazygames.com", icon: `<img src="icons/CZG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Free online games", tags: ["games"] },
|
|
947
|
+
{ name: "Gmail", url: "https://mail.google.com", icon: `<img src="https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Email by Google", tags: ["productivity","google"] },
|
|
948
|
+
{ name: "DuckDuckGo", url: "https://duckduckgo.com", icon: `<img src="icons/DDG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Private search", tags: ["search"] },
|
|
949
|
+
{ name: "Bing", url: "https://www.bing.com", icon: `<img src="icons/BNG-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Microsoft search", tags: ["search"] },
|
|
950
|
+
{ name: "GitHub", url: "https://github.com", icon: `<img src="icons/GH-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Code & collaboration", tags: ["tools","dev"] },
|
|
951
|
+
{ name: "Replit", url: "https://replit.com", icon: `<img src="icons/RPT-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Code in the browser", tags: ["tools","dev"] },
|
|
952
|
+
{ name: "Neal.fun", url: "https://neal.fun", icon: `<img src="icons/NDF-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Fun interactive games", tags: ["games","fun"] },
|
|
953
|
+
{ name: "Cool Math Games",url: "https://www.coolmathgames.com", icon: `<img src="icons/CMG-Favicon.jpg" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Math-based browser games",tags: ["games","education"] },
|
|
954
|
+
{ name: "Monochrome.tf", url: "https://monochrome.tf", icon: `<img src="icons/MCTF-Favicon.png" width="32" height="32" style="border-radius:6px;object-fit:contain;" />`, description: "Free music streaming", tags: ["music","media"] },
|
|
955
|
+
];
|
|
956
|
+
|
|
862
957
|
function buildQuickAppsHTML() {
|
|
863
958
|
let html = '<div class="quick-apps"><div class="quick-apps-label">quick apps</div><div class="quick-apps-grid">';
|
|
864
959
|
for (const app of QUICK_APPS) {
|
|
865
|
-
html +=
|
|
960
|
+
html += `<div class="quick-app" data-url="${app.url}"><div class="quick-app-icon">${app.icon}</div><span class="quick-app-name">${app.name}</span></div>`;
|
|
866
961
|
}
|
|
867
962
|
return html + '</div></div>';
|
|
868
963
|
}
|
|
@@ -872,29 +967,42 @@
|
|
|
872
967
|
'<div class="home-center">' +
|
|
873
968
|
'<div class="index-title"><span class="tw-text"></span><span class="index-cursor"></span></div>' +
|
|
874
969
|
'<div class="index-sub tw-sub"> </div>' +
|
|
875
|
-
'<
|
|
876
|
-
'<
|
|
877
|
-
'<div class="search-row">' +
|
|
970
|
+
'<div class="search-row-wrap" style="width:100%;max-width:560px;display:flex;flex-direction:column;align-items:center;">' +
|
|
971
|
+
'<div class="search-row" data-tabid="' + id + '">' +
|
|
878
972
|
'<span class="search-prompt">>_</span>' +
|
|
879
973
|
'<input class="sj-address" type="text" placeholder="search or enter a url" autocomplete="off" spellcheck="false" />' +
|
|
880
974
|
'<span class="search-enter">enter ↵</span>' +
|
|
881
|
-
'</div><p class="sj-error"></p></
|
|
975
|
+
'</div><p class="sj-error"></p></div>' +
|
|
882
976
|
buildQuickAppsHTML() +
|
|
883
977
|
'</div>' +
|
|
884
978
|
'</div>';
|
|
885
979
|
}
|
|
886
980
|
|
|
887
981
|
function wireHome(paneEl, id) {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
982
|
+
// Use keydown on the input directly — no form tag, avoids SVG foreignObject form issues
|
|
983
|
+
const input = paneEl.querySelector(".sj-address");
|
|
984
|
+
if (input) {
|
|
985
|
+
input.addEventListener("keydown", async e => {
|
|
986
|
+
if (e.key !== "Enter") return;
|
|
891
987
|
e.preventDefault();
|
|
892
|
-
const val = (
|
|
988
|
+
const val = (input.value || "").trim();
|
|
893
989
|
if (!val) return;
|
|
894
|
-
|
|
895
|
-
|
|
990
|
+
// DuckDuckGo search — use direct search URL that always returns results
|
|
991
|
+
const engine = "https://duckduckgo.com/?q=%s&ia=web";
|
|
992
|
+
if (typeof search === "function") {
|
|
993
|
+
await navigateTab(id, search(val, engine));
|
|
994
|
+
} else {
|
|
995
|
+
// Fallback if search.js not loaded
|
|
996
|
+
let url;
|
|
997
|
+
try { url = new URL(val).toString(); } catch(_) {
|
|
998
|
+
try { const u = new URL("https://" + val); if (u.hostname.includes(".")) url = u.toString(); } catch(_) {}
|
|
999
|
+
}
|
|
1000
|
+
if (!url) url = "https://duckduckgo.com/?q=" + encodeURIComponent(val) + "&ia=web";
|
|
1001
|
+
await navigateTab(id, url);
|
|
1002
|
+
}
|
|
896
1003
|
});
|
|
897
1004
|
}
|
|
1005
|
+
|
|
898
1006
|
paneEl.querySelectorAll(".quick-app").forEach(el => {
|
|
899
1007
|
el.addEventListener("click", () => navigateTab(id, el.dataset.url));
|
|
900
1008
|
});
|
|
@@ -911,18 +1019,22 @@
|
|
|
911
1019
|
let fontIndex = 0;
|
|
912
1020
|
|
|
913
1021
|
function runCycle() {
|
|
1022
|
+
// Bail if the tab was closed
|
|
1023
|
+
if (!document.contains(paneEl)) return;
|
|
914
1024
|
const titleEl = paneEl.querySelector(".index-title");
|
|
915
1025
|
if (titleEl) titleEl.style.fontFamily = fonts[fontIndex % fonts.length];
|
|
916
1026
|
fontIndex++;
|
|
917
1027
|
if (twSub) twSub.classList.remove("visible");
|
|
918
1028
|
let i = 0;
|
|
919
1029
|
function type() {
|
|
1030
|
+
if (!document.contains(paneEl)) return;
|
|
920
1031
|
twEl.textContent = word.slice(0, i);
|
|
921
1032
|
if (i < word.length) { i++; setTimeout(type, 80 + Math.random() * 70); }
|
|
922
1033
|
else { if (twSub) twSub.classList.add("visible"); setTimeout(deleteText, 2200); }
|
|
923
1034
|
}
|
|
924
1035
|
let j = word.length;
|
|
925
1036
|
function deleteText() {
|
|
1037
|
+
if (!document.contains(paneEl)) return;
|
|
926
1038
|
if (twSub) twSub.classList.remove("visible");
|
|
927
1039
|
twEl.textContent = word.slice(0, j);
|
|
928
1040
|
if (j > 0) { j--; setTimeout(deleteText, 55 + Math.random() * 40); }
|
|
@@ -934,10 +1046,36 @@
|
|
|
934
1046
|
}
|
|
935
1047
|
|
|
936
1048
|
newTabBtn.addEventListener("click", () => createTab());
|
|
1049
|
+
|
|
1050
|
+
/* ══════════════════════════════════════════
|
|
1051
|
+
RESTORE SETTINGS (after createTab so updateQuickAppColors works)
|
|
1052
|
+
══════════════════════════════════════════ */
|
|
1053
|
+
function restoreSettings() {
|
|
1054
|
+
// Restore cloak
|
|
1055
|
+
const savedCloak = localStorage.getItem("cloak");
|
|
1056
|
+
if (savedCloak) {
|
|
1057
|
+
try {
|
|
1058
|
+
const c = JSON.parse(savedCloak);
|
|
1059
|
+
currentCloak = c;
|
|
1060
|
+
applyCloak(c.title, c.favicon);
|
|
1061
|
+
document.querySelectorAll(".cloak-option").forEach(o => {
|
|
1062
|
+
o.classList.toggle("selected", o.dataset.cloak === c.cloak);
|
|
1063
|
+
});
|
|
1064
|
+
} catch(_) {}
|
|
1065
|
+
}
|
|
1066
|
+
// Restore proxy engine
|
|
1067
|
+
saveProxyEngine(activeProxy);
|
|
1068
|
+
// Restore theme
|
|
1069
|
+
const savedTheme = localStorage.getItem("theme") || "default";
|
|
1070
|
+
applyTheme(savedTheme);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
// Create first tab BEFORE restoreSettings so icon color patch works
|
|
937
1074
|
createTab();
|
|
1075
|
+
restoreSettings();
|
|
938
1076
|
|
|
939
1077
|
/* ══════════════════════════════════════════
|
|
940
|
-
GAMES TAB
|
|
1078
|
+
GAMES TAB
|
|
941
1079
|
══════════════════════════════════════════ */
|
|
942
1080
|
const gamesBtn = document.getElementById("games-btn");
|
|
943
1081
|
let gamesTabId = null;
|
|
@@ -946,9 +1084,9 @@
|
|
|
946
1084
|
async function loadGamesRegistry() {
|
|
947
1085
|
try {
|
|
948
1086
|
const res = await fetch("games/games.json");
|
|
949
|
-
if (!res.ok) throw new Error();
|
|
1087
|
+
if (!res.ok) throw new Error("HTTP " + res.status);
|
|
950
1088
|
gamesRegistry = await res.json();
|
|
951
|
-
} catch(
|
|
1089
|
+
} catch(e) { gamesRegistry = []; console.warn("Failed to load games.json:", e); }
|
|
952
1090
|
}
|
|
953
1091
|
|
|
954
1092
|
function getAllTags(registry) {
|
|
@@ -982,7 +1120,7 @@
|
|
|
982
1120
|
renderCards(entry.paneEl, gamesRegistry);
|
|
983
1121
|
const searchInput = entry.paneEl.querySelector("#games-search-input");
|
|
984
1122
|
const searchClear = entry.paneEl.querySelector("#games-search-clear");
|
|
985
|
-
let
|
|
1123
|
+
let activeTag = "all";
|
|
986
1124
|
function applyFilters() {
|
|
987
1125
|
const q = searchInput.value.trim().toLowerCase();
|
|
988
1126
|
searchClear.classList.toggle("visible", q.length > 0);
|
|
@@ -1005,22 +1143,31 @@
|
|
|
1005
1143
|
applyFilters();
|
|
1006
1144
|
});
|
|
1007
1145
|
}
|
|
1008
|
-
entry.paneEl.querySelector("#games-close-btn").addEventListener("click", () => {
|
|
1146
|
+
entry.paneEl.querySelector("#games-close-btn").addEventListener("click", () => {
|
|
1147
|
+
closeTab(tabId); gamesTabId = null;
|
|
1148
|
+
gamesBtn.classList.remove("active");
|
|
1149
|
+
});
|
|
1009
1150
|
}
|
|
1010
1151
|
|
|
1011
1152
|
function renderCards(paneEl, list) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}
|
|
1153
|
+
const grid = paneEl.querySelector("#games-grid"); if (!grid) return;
|
|
1154
|
+
if (list.length === 0) {
|
|
1155
|
+
grid.innerHTML = '<div class="games-noresults">no games match your search.<br><span style="opacity:0.5">try a different keyword or tag</span></div>';
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
grid.innerHTML = list.map(g => {
|
|
1159
|
+
const tagsHTML = (g.tags||[]).length ? `<div class="game-card-tags">${(g.tags).map(t=>`<span class="game-card-tag">${t}</span>`).join("")}</div>` : "";
|
|
1160
|
+
const iconSrc = g.icon && g.icon.startsWith("/") ? g.icon.replace(/^\/+/, '') : g.icon;
|
|
1161
|
+
const iconHTML = (iconSrc && (iconSrc.includes("/") || iconSrc.includes(".")))
|
|
1162
|
+
? `<img src="${iconSrc}" style="width:2em;height:2em;object-fit:contain;border-radius:4px;" onerror="this.outerHTML='🎮'" />`
|
|
1163
|
+
: (iconSrc || "🎮");
|
|
1164
|
+
return `<div class="game-card" data-file="${g.file}" data-name="${g.name}"><div class="game-card-icon">${iconHTML}</div><div class="game-card-name">${g.name}</div>${g.description?`<div class="game-card-desc">${g.description}</div>`:""}${tagsHTML}</div>`;
|
|
1165
|
+
}).join("");
|
|
1166
|
+
grid.querySelectorAll(".game-card").forEach(card => {
|
|
1167
|
+
card.addEventListener("click", () => openGameModal(card.dataset.file, card.dataset.name));
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1024
1171
|
const gameModal = document.getElementById("game-modal");
|
|
1025
1172
|
const gmName = document.getElementById("gm-name");
|
|
1026
1173
|
const gmFile = document.getElementById("gm-file");
|
|
@@ -1029,14 +1176,14 @@
|
|
|
1029
1176
|
const gmFullscreen = document.getElementById("gm-fullscreen");
|
|
1030
1177
|
|
|
1031
1178
|
function openGameModal(file, name) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
}
|
|
1179
|
+
if (file === "gamesuggestion.html" || file === "gamesuggestions.html") {
|
|
1180
|
+
window.open("https://forms.gle/aSBH2kMVEUwmhiRp6", "_blank");
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
gmName.textContent = name; gmFile.textContent = file;
|
|
1184
|
+
gmIframe.src = "games/" + file;
|
|
1185
|
+
gameModal.classList.add("open");
|
|
1186
|
+
}
|
|
1040
1187
|
function closeGameModal() { gameModal.classList.remove("open"); gmIframe.src="about:blank"; }
|
|
1041
1188
|
gmClose.addEventListener("click", closeGameModal);
|
|
1042
1189
|
document.addEventListener("keydown", e => { if (e.key==="Escape" && gameModal.classList.contains("open")) closeGameModal(); });
|
|
@@ -1046,7 +1193,11 @@
|
|
|
1046
1193
|
});
|
|
1047
1194
|
|
|
1048
1195
|
async function openGamesTab() {
|
|
1049
|
-
if (gamesTabId && tabs.has(gamesTabId)) {
|
|
1196
|
+
if (gamesTabId && tabs.has(gamesTabId)) {
|
|
1197
|
+
activateTab(gamesTabId);
|
|
1198
|
+
gamesBtn.classList.add("active");
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1050
1201
|
await loadGamesRegistry();
|
|
1051
1202
|
gamesTabId = createTab("🎮 games");
|
|
1052
1203
|
setTabTitle(gamesTabId, "🎮 games");
|
|
@@ -1056,7 +1207,7 @@
|
|
|
1056
1207
|
gamesBtn.addEventListener("click", openGamesTab);
|
|
1057
1208
|
|
|
1058
1209
|
/* ══════════════════════════════════════════
|
|
1059
|
-
APPS TAB
|
|
1210
|
+
APPS TAB
|
|
1060
1211
|
══════════════════════════════════════════ */
|
|
1061
1212
|
const appsBtn = document.getElementById("apps-btn");
|
|
1062
1213
|
let appsTabId = null;
|
|
@@ -1092,7 +1243,7 @@
|
|
|
1092
1243
|
renderAppCards(entry.paneEl, APPS_REGISTRY, tabId);
|
|
1093
1244
|
const searchInput = entry.paneEl.querySelector("#apps-search-input");
|
|
1094
1245
|
const searchClear = entry.paneEl.querySelector("#apps-search-clear");
|
|
1095
|
-
let
|
|
1246
|
+
let activeTag = "all";
|
|
1096
1247
|
function applyFilters() {
|
|
1097
1248
|
const q = searchInput.value.trim().toLowerCase();
|
|
1098
1249
|
searchClear.classList.toggle("visible", q.length > 0);
|
|
@@ -1115,12 +1266,14 @@
|
|
|
1115
1266
|
applyFilters();
|
|
1116
1267
|
});
|
|
1117
1268
|
}
|
|
1118
|
-
entry.paneEl.querySelector("#apps-close-btn").addEventListener("click", () => {
|
|
1269
|
+
entry.paneEl.querySelector("#apps-close-btn").addEventListener("click", () => {
|
|
1270
|
+
closeTab(tabId); appsTabId = null; appsBtn.classList.remove("active");
|
|
1271
|
+
});
|
|
1119
1272
|
}
|
|
1120
1273
|
|
|
1121
1274
|
function renderAppCards(paneEl, list, tabId) {
|
|
1122
1275
|
const grid = paneEl.querySelector("#apps-grid"); if (!grid) return;
|
|
1123
|
-
if (list.length===0) { grid.innerHTML='<div class="games-noresults">no apps match your search
|
|
1276
|
+
if (list.length===0) { grid.innerHTML='<div class="games-noresults">no apps match your search.</div>'; return; }
|
|
1124
1277
|
grid.innerHTML = list.map(a => {
|
|
1125
1278
|
const tagsHTML = (a.tags||[]).length ? `<div class="game-card-tags">${(a.tags).map(t=>`<span class="game-card-tag">${t}</span>`).join("")}</div>` : "";
|
|
1126
1279
|
return `<div class="app-card game-card" data-url="${a.url}" data-name="${a.name}"><div class="game-card-icon app-card-icon">${a.icon}</div><div class="game-card-name">${a.name}</div>${a.description?`<div class="game-card-desc">${a.description}</div>`:""}${tagsHTML}</div>`;
|
|
@@ -1140,4 +1293,4 @@
|
|
|
1140
1293
|
appsBtn.addEventListener("click", openAppsTab);
|
|
1141
1294
|
</script>
|
|
1142
1295
|
</body>
|
|
1143
|
-
</html>
|
|
1296
|
+
</html>
|