4sp-dv 1.0.48 → 1.0.50
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/4simpleproblems_v5.html +15 -60
- package/logged-in/games.html +36 -0
- package/package.json +1 -1
- package/settings.html +15 -0
package/4simpleproblems_v5.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>4SP - VERSION 5 CLIENT</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/4sp-dv@latest/images/logo.png">
|
|
8
8
|
|
|
9
|
-
<base href="https://cdn.jsdelivr.net/npm/4sp-dv@1.0.
|
|
9
|
+
<base href="https://cdn.jsdelivr.net/npm/4sp-dv@1.0.48/logged-in/">
|
|
10
10
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap" rel="stylesheet">
|
|
12
12
|
|
|
@@ -236,13 +236,21 @@
|
|
|
236
236
|
transform: translateY(0) scale(0.98);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
.auth-menu-item
|
|
240
|
-
display: inline-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
.auth-menu-item i, .nav-tab i, .settings-tab i {
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
justify-content: center;
|
|
243
|
+
width: 1.1em;
|
|
244
|
+
height: 1.1em;
|
|
245
|
+
line-height: 1;
|
|
246
|
+
position: relative;
|
|
247
|
+
top: 1px;
|
|
248
|
+
flex-shrink: 0;
|
|
249
|
+
margin: 0;
|
|
244
250
|
}
|
|
245
251
|
|
|
252
|
+
|
|
253
|
+
|
|
246
254
|
.auth-header {
|
|
247
255
|
padding: 0.5rem 1rem;
|
|
248
256
|
border-bottom: 1px solid var(--menu-divider, #333);
|
|
@@ -872,7 +880,7 @@
|
|
|
872
880
|
const displayUsername = document.getElementById('display-username');
|
|
873
881
|
const displayEmail = document.getElementById('display-email');
|
|
874
882
|
|
|
875
|
-
const BASE_URL = 'https://cdn.jsdelivr.net/npm/4sp-dv@1.0.
|
|
883
|
+
const BASE_URL = 'https://cdn.jsdelivr.net/npm/4sp-dv@1.0.48/logged-in/';
|
|
876
884
|
|
|
877
885
|
// Preload Logos
|
|
878
886
|
const preloadImgs = [
|
|
@@ -2709,60 +2717,7 @@
|
|
|
2709
2717
|
osc.stop(now + 0.02);
|
|
2710
2718
|
};
|
|
2711
2719
|
|
|
2712
|
-
// Gear Clicking Sequence
|
|
2713
|
-
let gearHoverStartTime = 0;
|
|
2714
|
-
let currentGearRotation = 0;
|
|
2715
|
-
let currentAnimatingGear = null;
|
|
2716
|
-
const gearClickDelays = [0, 120, 240, 360]; // Adjusted for 0.5s total
|
|
2717
|
-
|
|
2718
|
-
const handleGearMouseOver = (e) => {
|
|
2719
|
-
const target = e.target.closest('#auth-settings-btn, #nav-settings-tab');
|
|
2720
|
-
if (target && currentAnimatingGear !== target) {
|
|
2721
|
-
currentAnimatingGear = target;
|
|
2722
|
-
const icon = target.querySelector('.fa-gear');
|
|
2723
|
-
if (!icon) return;
|
|
2724
|
-
|
|
2725
|
-
gearHoverStartTime = Date.now();
|
|
2726
|
-
gearClickDelays.forEach((delay, index) => {
|
|
2727
|
-
setTimeout(() => {
|
|
2728
|
-
if (target.matches(':hover')) {
|
|
2729
|
-
if (window.areAnimationsEnabled) {
|
|
2730
|
-
currentGearRotation = (index + 1) * 45;
|
|
2731
|
-
icon.style.transform = `rotate(${currentGearRotation}deg)`;
|
|
2732
|
-
}
|
|
2733
|
-
window.playMechClick(false);
|
|
2734
|
-
}
|
|
2735
|
-
}, delay);
|
|
2736
|
-
});
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
|
|
2740
|
-
const handleGearMouseOut = (e) => {
|
|
2741
|
-
const target = e.target.closest('#auth-settings-btn, #nav-settings-tab');
|
|
2742
|
-
if (target && !target.contains(e.relatedTarget)) {
|
|
2743
|
-
currentAnimatingGear = null;
|
|
2744
|
-
const icon = target.querySelector('.fa-gear');
|
|
2745
|
-
if (!icon) return;
|
|
2746
|
-
|
|
2747
|
-
const elapsed = Date.now() - gearHoverStartTime;
|
|
2748
|
-
const clickCount = gearClickDelays.filter(d => d <= elapsed).length;
|
|
2749
|
-
|
|
2750
|
-
for (let i = 0; i < clickCount; i++) {
|
|
2751
|
-
setTimeout(() => {
|
|
2752
|
-
if (!target.matches(':hover')) {
|
|
2753
|
-
if (window.areAnimationsEnabled) {
|
|
2754
|
-
currentGearRotation -= 45;
|
|
2755
|
-
icon.style.transform = `rotate(${currentGearRotation}deg)`;
|
|
2756
|
-
}
|
|
2757
|
-
window.playMechClick(true);
|
|
2758
|
-
}
|
|
2759
|
-
}, gearClickDelays[i]);
|
|
2760
|
-
}
|
|
2761
|
-
}
|
|
2762
|
-
};
|
|
2763
2720
|
|
|
2764
|
-
document.addEventListener('mouseover', handleGearMouseOver);
|
|
2765
|
-
document.addEventListener('mouseout', handleGearMouseOut);
|
|
2766
2721
|
|
|
2767
2722
|
const notificationContainer = document.getElementById('notification-container');
|
|
2768
2723
|
function showNotification(message, iconClass = 'fa-solid fa-info-circle', type = 'info') {
|
package/logged-in/games.html
CHANGED
|
@@ -960,6 +960,42 @@
|
|
|
960
960
|
zoneFrame.setAttribute('sandbox', sandboxRules);
|
|
961
961
|
zoneFrame.setAttribute('allow', 'fullscreen; pointer-lock; autoplay; clipboard-write');
|
|
962
962
|
|
|
963
|
+
// --- SM64 SPECIAL HANDLING (Timeout & Retry) ---
|
|
964
|
+
if (game.id === 'other-sm64') {
|
|
965
|
+
let attempts = 0;
|
|
966
|
+
const tryLoadSM64 = () => {
|
|
967
|
+
attempts++;
|
|
968
|
+
let success = false;
|
|
969
|
+
|
|
970
|
+
const loadHandler = () => {
|
|
971
|
+
success = true;
|
|
972
|
+
zoneViewer.style.display = "flex";
|
|
973
|
+
zoneViewer.classList.remove('animate-fade-out');
|
|
974
|
+
zoneViewer.classList.add('active', 'animate-fade-in');
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
zoneFrame.onload = loadHandler;
|
|
978
|
+
// Add timestamp to force reload and bypass cache
|
|
979
|
+
zoneFrame.src = `${game.url}?t=${Date.now()}`;
|
|
980
|
+
|
|
981
|
+
setTimeout(() => {
|
|
982
|
+
if (!success) {
|
|
983
|
+
zoneFrame.onload = null; // Clear handler
|
|
984
|
+
if (attempts < 2) {
|
|
985
|
+
console.log("SM64: Load timed out (5s). Retrying...");
|
|
986
|
+
tryLoadSM64();
|
|
987
|
+
} else {
|
|
988
|
+
console.log("SM64: Failed to load after retry.");
|
|
989
|
+
show404("The game failed to load after multiple attempts.");
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}, 5000);
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
tryLoadSM64();
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
|
|
963
999
|
// --- REVISED LOGIC FOR LOADING GAMES ---
|
|
964
1000
|
const isStandardURLGame = game.category === 'StrongdogXP' || game.category === 'Others' || game.category === 'GN-Math';
|
|
965
1001
|
|
package/package.json
CHANGED
package/settings.html
CHANGED
|
@@ -97,6 +97,21 @@
|
|
|
97
97
|
width: 100%;
|
|
98
98
|
justify-content: flex-start;
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
/* --- Standardized Icon Alignment --- */
|
|
102
|
+
.btn-toolbar-style i, .settings-tab i {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
width: 1.1em;
|
|
107
|
+
height: 1.1em;
|
|
108
|
+
line-height: 1;
|
|
109
|
+
position: relative;
|
|
110
|
+
top: 1px;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
margin: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
100
115
|
.settings-tab.active {
|
|
101
116
|
background-color: rgba(79, 70, 229, 0.1);
|
|
102
117
|
border: 1px solid #4f46e5;
|