mm-math 0.0.0
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/admin.html +145 -0
- package/ads.txt +880 -0
- package/api.js +179 -0
- package/assets/favicon.png +0 -0
- package/assets/logo.png +0 -0
- package/browse.html +178 -0
- package/change-password.html +168 -0
- package/control-panel.html +885 -0
- package/css/style.css +615 -0
- package/index.html +577 -0
- package/js/admin.js +285 -0
- package/js/games.js +192 -0
- package/js/main.js +191 -0
- package/js/pin-modal.js +13 -0
- package/js/theme.js +20 -0
- package/package.json +36 -0
- package/tool.html +227 -0
- package/version.txt +1 -0
package/admin.html
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<script>
|
|
6
|
+
(function(){
|
|
7
|
+
var n=performance.getEntriesByType('navigation')[0];
|
|
8
|
+
if(n&&n.type==='reload'){sessionStorage.clear();window.location.replace('./index.html');return;}
|
|
9
|
+
if(sessionStorage.getItem('mm_auth')!=='true'){window.location.replace('./index.html');return;}
|
|
10
|
+
if(sessionStorage.getItem('mm_force_change')==='true'){window.location.replace('./change-password.html');return;}
|
|
11
|
+
var rank=sessionStorage.getItem('mm_rank');
|
|
12
|
+
if(rank==='admin'){window.location.replace('./control-panel.html');return;}
|
|
13
|
+
if(rank!=='administrator'){window.location.replace('./browse.html');}
|
|
14
|
+
})();
|
|
15
|
+
</script>
|
|
16
|
+
<link rel="icon" type="image/png" href="/assets/favicon.png">
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
<title>Admin — MM Games</title>
|
|
19
|
+
<link rel="stylesheet" href="./css/style.css">
|
|
20
|
+
<style>
|
|
21
|
+
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }
|
|
22
|
+
.page-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
|
|
23
|
+
.page-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 32px; }
|
|
24
|
+
.overflow-x { overflow-x: auto; }
|
|
25
|
+
.thumb-preview { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--surface); }
|
|
26
|
+
.thumb-ph { width: 56px; height: 42px; border-radius: 4px; background: #e0e7ff; display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:600; padding:4px; line-height:1.2; overflow:hidden; }
|
|
27
|
+
.rank-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
|
|
28
|
+
.rank-administrator { background: #ede9fe; color: #6d28d9; }
|
|
29
|
+
.rank-admin { background: #fef3c7; color: #92400e; }
|
|
30
|
+
.rank-user { background: #ecfdf5; color: #065f46; }
|
|
31
|
+
.rank-select { font-size: 0.8rem; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
|
|
32
|
+
</style>
|
|
33
|
+
</head>
|
|
34
|
+
<body>
|
|
35
|
+
|
|
36
|
+
<header class="site-header">
|
|
37
|
+
<div class="header-inner">
|
|
38
|
+
<a href="./browse.html" class="logo-link">
|
|
39
|
+
<img src="./assets/logo.png?v=new" alt="" class="logo-img" onerror="this.style.display='none'">
|
|
40
|
+
<span>MM Games</span>
|
|
41
|
+
</a>
|
|
42
|
+
<nav class="site-nav">
|
|
43
|
+
<a href="./browse.html">Browse</a>
|
|
44
|
+
<a href="./admin.html" class="active">Admin</a>
|
|
45
|
+
<a href="./index.html" class="nav-calc-btn" title="Calculator"><svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="8" y1="6" x2="16" y2="6"/><line x1="8" y1="10" x2="10" y2="10"/><line x1="8" y1="14" x2="10" y2="14"/><line x1="8" y1="18" x2="10" y2="18"/><line x1="14" y1="10" x2="16" y2="10"/><line x1="14" y1="14" x2="16" y2="14"/><line x1="14" y1="18" x2="16" y2="18"/></svg></a>
|
|
46
|
+
<button onclick="sessionStorage.clear();window.location.href='./index.html';" style="background:none;border:1px solid var(--border);color:var(--muted);font-size:.8rem;padding:5px 12px;border-radius:8px;cursor:pointer;margin-left:4px;">Logout</button>
|
|
47
|
+
</nav>
|
|
48
|
+
</div>
|
|
49
|
+
</header>
|
|
50
|
+
|
|
51
|
+
<div class="admin-wrap">
|
|
52
|
+
<div class="page-title">Admin Panel</div>
|
|
53
|
+
<div class="page-sub">Manage games, users, and site settings</div>
|
|
54
|
+
|
|
55
|
+
<!-- Stats -->
|
|
56
|
+
<div class="card">
|
|
57
|
+
<div class="card-title">Site Stats</div>
|
|
58
|
+
<div class="stats-grid" id="stats-grid">
|
|
59
|
+
<div class="stat-card"><div class="stat-value" id="stat-total">—</div><div class="stat-label">Total Games</div></div>
|
|
60
|
+
<div class="stat-card"><div class="stat-value" id="stat-visible">—</div><div class="stat-label">Visible</div></div>
|
|
61
|
+
<div class="stat-card"><div class="stat-value" id="stat-action">—</div><div class="stat-label">Action</div></div>
|
|
62
|
+
<div class="stat-card"><div class="stat-value" id="stat-sports">—</div><div class="stat-label">Sports</div></div>
|
|
63
|
+
<div class="stat-card"><div class="stat-value" id="stat-racing">—</div><div class="stat-label">Racing</div></div>
|
|
64
|
+
<div class="stat-card"><div class="stat-value" id="stat-puzzle">—</div><div class="stat-label">Puzzle</div></div>
|
|
65
|
+
<div class="stat-card"><div class="stat-value" id="stat-multi">—</div><div class="stat-label">Multiplayer</div></div>
|
|
66
|
+
<div class="stat-card"><div class="stat-value" id="stat-casual">—</div><div class="stat-label">Casual</div></div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<!-- User Management -->
|
|
71
|
+
<div class="card">
|
|
72
|
+
<div class="card-title">User Management</div>
|
|
73
|
+
|
|
74
|
+
<!-- Add user -->
|
|
75
|
+
<div class="form-grid">
|
|
76
|
+
<div class="form-group">
|
|
77
|
+
<label>Username</label>
|
|
78
|
+
<input type="text" id="new-username" placeholder="New username" autocomplete="off">
|
|
79
|
+
</div>
|
|
80
|
+
<div class="form-group">
|
|
81
|
+
<label>Password</label>
|
|
82
|
+
<input type="password" id="new-password" placeholder="Password">
|
|
83
|
+
</div>
|
|
84
|
+
<div class="form-group">
|
|
85
|
+
<label>Rank</label>
|
|
86
|
+
<select id="new-rank">
|
|
87
|
+
<option value="user">user</option>
|
|
88
|
+
<option value="admin">admin</option>
|
|
89
|
+
<option value="administrator">administrator</option>
|
|
90
|
+
</select>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div style="margin-top:16px; display:flex; gap:10px; align-items:center;">
|
|
94
|
+
<button class="btn btn-primary" id="add-user-btn">Add User</button>
|
|
95
|
+
<span class="feedback" id="add-user-feedback"></span>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<!-- Users table -->
|
|
99
|
+
<div class="overflow-x" style="margin-top:28px;">
|
|
100
|
+
<table class="admin-table" id="users-table">
|
|
101
|
+
<thead>
|
|
102
|
+
<tr>
|
|
103
|
+
<th>Username</th>
|
|
104
|
+
<th>Rank</th>
|
|
105
|
+
<th>Force Password Change</th>
|
|
106
|
+
<th>Actions</th>
|
|
107
|
+
</tr>
|
|
108
|
+
</thead>
|
|
109
|
+
<tbody id="users-tbody">
|
|
110
|
+
<tr><td colspan="4" style="color:var(--muted);text-align:center;padding:24px;">Loading…</td></tr>
|
|
111
|
+
</tbody>
|
|
112
|
+
</table>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="feedback" id="users-feedback" style="margin-top:12px;"></div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<!-- Games table -->
|
|
118
|
+
<div class="card">
|
|
119
|
+
<div class="card-title" style="margin-bottom:16px;">All Games</div>
|
|
120
|
+
<div class="overflow-x">
|
|
121
|
+
<table class="admin-table" id="games-table">
|
|
122
|
+
<thead>
|
|
123
|
+
<tr>
|
|
124
|
+
<th>Thumb</th>
|
|
125
|
+
<th>Name</th>
|
|
126
|
+
<th>Category</th>
|
|
127
|
+
<th>Type</th>
|
|
128
|
+
<th>GOTD</th>
|
|
129
|
+
<th>Visible</th>
|
|
130
|
+
<th>Actions</th>
|
|
131
|
+
</tr>
|
|
132
|
+
</thead>
|
|
133
|
+
<tbody id="table-body">
|
|
134
|
+
<tr><td colspan="7" style="color:var(--muted); text-align:center; padding:32px;">Loading…</td></tr>
|
|
135
|
+
</tbody>
|
|
136
|
+
</table>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="feedback" id="table-feedback" style="margin-top:12px;"></div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<script src="./js/admin.js?v=0.0.1"></script>
|
|
143
|
+
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|