Skip to content

Commit ccb876c

Browse files
committed
feat: cleaned up the ui & made logs have a max of 250 slots
1 parent 4121e68 commit ccb876c

16 files changed

Lines changed: 1561 additions & 1200 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "discorch-deleter",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "A script to delete all messages provided from Discorch",
55
"main": "dist/script.user.js",
66
"type": "module",

src/assets/index.html

Lines changed: 109 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,144 @@
1+
<!-- Header -->
12
<div id="ui-header">
23
<div class="header-left">
34
<svg class="header-icon" width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
4-
<path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61.22l2-3.46c.12-.22-.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" />
5+
<path d="M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z" />
56
</svg>
67
<h1>DiscorchDeleter</h1>
78
</div>
8-
<button id="minimizeButton" title="Minimize/Expand" class="icon-button">
9+
<button id="minimizeButton" title="Minimize" class="icon-button" aria-label="Toggle minimize">
910
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
1011
<path d="M19 13H5v-2h14v2z" />
1112
</svg>
1213
</button>
1314
</div>
1415

16+
<!-- Main Content -->
1517
<div class="ui-content-wrapper">
18+
<!-- Banner -->
1619
<div id="ui-banner" class="banner info-banner d-none">
17-
<span class="banner-text">This is an informational banner!</span>
18-
<button class="banner-close" aria-label="Close banner">&times;</button>
20+
<span class="banner-text"></span>
21+
<button class="banner-close" aria-label="Close">&times;</button>
1922
</div>
2023

21-
<section class="section">
22-
<h2 class="section-title">INPUT SOURCE</h2>
23-
<div class="input-method-toggle-group">
24-
<button id="showFileUploadButton" class="input-method-toggle-button active">
25-
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 6px;">
26-
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z" />
27-
</svg>
28-
Upload File
29-
</button>
30-
<button id="showJsonPasteButton" class="input-method-toggle-button">
31-
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 6px;">
32-
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" />
33-
</svg>
34-
Paste JSON
35-
</button>
36-
</div>
24+
<!-- Main Grid Layout -->
25+
<div class="main-grid">
26+
<!-- Left Column: Data & Settings -->
27+
<div class="left-column">
28+
<!-- Data Import -->
29+
<section class="section">
30+
<h2 class="section-title">Data Source</h2>
31+
32+
<div class="input-method-tabs">
33+
<button id="showFileUploadButton" class="tab-button active">
34+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
35+
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z" />
36+
</svg>
37+
File
38+
</button>
39+
<button id="showJsonPasteButton" class="tab-button">
40+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
41+
<path d="M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z" />
42+
</svg>
43+
Paste
44+
</button>
45+
</div>
3746

38-
<div id="fileInputSection" class="input-section">
39-
<div class="file-input-area">
40-
<label for="jsonFile" class="sr-only">Upload JSON File</label>
41-
<div class="file-input-controls">
42-
<button id="customFileButton" class="button-secondary">
47+
<div id="fileInputSection" class="tab-content">
48+
<input type="file" id="jsonFile" accept=".json" class="sr-only">
49+
<button id="customFileButton" class="button-file-select">
50+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
51+
<path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z" />
52+
</svg>
4353
Choose File
4454
</button>
45-
<input type="file" id="jsonFile" accept=".json">
4655
</div>
47-
</div>
48-
</div>
4956

50-
<div id="pasteInputSection" class="input-section d-none">
51-
<div class="form-field">
52-
<label for="jsonPaste" class="sr-only">Paste JSON Content</label>
53-
<textarea id="jsonPaste" rows="6" placeholder="Paste JSON data from messages/index.json here..."></textarea>
54-
</div>
55-
</div>
56-
</section>
57+
<div id="pasteInputSection" class="tab-content d-none">
58+
<label for="jsonPaste" class="sr-only">Paste JSON</label>
59+
<textarea
60+
id="jsonPaste"
61+
placeholder="Paste JSON data here..."
62+
spellcheck="false"
63+
></textarea>
64+
</div>
65+
</section>
5766

58-
<section class="section">
59-
<h2 class="section-title">CONFIGURATION</h2>
60-
<div class="form-field">
61-
<label for="deleteInterval" class="form-label">Delete Interval (ms)</label>
62-
<input type="number" id="deleteInterval" value="1500" step="50" min="750" max="600000" class="form-input">
63-
<small id="intervalHelper" class="form-hint">Min: 750ms, Max: 600,000ms (10 min). Recommended: 1000-2500ms.</small>
64-
<div id="intervalWarning" class="form-warning d-none"></div>
67+
<!-- Settings -->
68+
<section class="section">
69+
<h2 class="section-title">Settings</h2>
70+
<div class="form-field">
71+
<label for="deleteInterval" class="form-label">Delete Interval (ms)</label>
72+
<input
73+
type="number"
74+
id="deleteInterval"
75+
value="1500"
76+
step="50"
77+
min="750"
78+
max="600000"
79+
class="form-input"
80+
>
81+
<div id="intervalWarning" class="form-warning d-none"></div>
82+
<small class="form-hint">Recommended: 1500-2500ms</small>
83+
</div>
84+
</section>
6585
</div>
66-
</section>
6786

68-
<section class="section">
69-
<h2 class="section-title">CONTROLS</h2>
70-
<div class="button-group main-controls">
71-
<button id="startButton" class="button-primary">
72-
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
73-
<path d="M8 5v14l11-7z" />
74-
</svg>
75-
Start
76-
</button>
77-
<button id="stopButton" class="button-danger">
78-
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
79-
<path d="M6 6h12v12H6z" />
80-
</svg>
81-
Stop
82-
</button>
83-
<button id="clearDataButton" class="button-secondary">
84-
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
85-
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
86-
</svg>
87-
Clear Data
88-
</button>
89-
</div>
90-
</section>
87+
<!-- Right Column: Status & Controls -->
88+
<div class="right-column">
89+
<!-- Status -->
90+
<section class="section">
91+
<h2 class="section-title">Status</h2>
92+
<div id="statusOutput" class="status-text">Ready</div>
93+
<div id="importSummaryOutput" class="status-summary"></div>
94+
<div class="progress-bar-container d-none" id="progressBarContainer">
95+
<div id="progressBar" class="progress-bar-fill"></div>
96+
</div>
97+
<div id="etaDisplay" class="eta-display d-none"></div>
98+
</section>
9199

92-
<section class="section status-section">
93-
<h2 class="section-title">STATUS</h2>
94-
<div id="importSummaryOutput" class="status-output-text"></div>
95-
<div id="statusOutput" class="status-output-text">Idle. Ready to begin.</div>
96-
<div class="progress-bar-container d-none" id="progressBarContainer">
97-
<div id="progressBar" class="progress-bar-fill" style="width: 0%;"></div>
100+
<!-- Controls -->
101+
<section class="section">
102+
<h2 class="section-title">Controls</h2>
103+
<div class="controls-grid">
104+
<button id="startButton" class="button-control button-start">
105+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
106+
<path d="M8 5v14l11-7z" />
107+
</svg>
108+
Start
109+
</button>
110+
<button id="stopButton" class="button-control button-stop" disabled>
111+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
112+
<path d="M6 6h12v12H6z" />
113+
</svg>
114+
Stop
115+
</button>
116+
</div>
117+
<button id="clearDataButton" class="button-control button-clear button-full-width">
118+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
119+
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
120+
</svg>
121+
Clear Data
122+
</button>
123+
</section>
98124
</div>
99-
<div id="etaDisplay" class="eta-display d-none"></div>
100-
</section>
125+
</div>
101126

102-
<section id="logContainer" class="section log-section d-none">
103-
<h2 class="section-title">LOGS</h2>
127+
<!-- Logs (Full Width) -->
128+
<section id="logContainer" class="section d-none">
129+
<h2 class="section-title">Logs</h2>
104130
<pre id="logOutput" class="log-content d-none"></pre>
105131
</section>
106-
132+
107133
<div class="bottom-spacing"></div>
108134
</div>
109135

136+
<!-- Footer -->
110137
<div id="ui-footer">
111138
<div class="footer-links">
112-
<a href="https://github.com/Darker-Ink/DiscorchDeleter" class="footer-link" target="_blank" rel="noopener noreferrer">GitHub</a>
113-
<a href="https://github.com/Darker-Ink/DiscorchDeleter/issues" class="footer-link" target="_blank" rel="noopener noreferrer">Report Issue</a>
139+
<a href="https://github.com/Darker-Ink/DiscorchDeleter" target="_blank" rel="noopener noreferrer">GitHub</a>
140+
<span class="footer-separator"></span>
141+
<a href="https://github.com/Darker-Ink/DiscorchDeleter/issues" target="_blank" rel="noopener noreferrer">Report Issue</a>
114142
</div>
115-
<div class="footer-version" id="footerVersion">vUNKNOWN</div>
116-
</div>
143+
<div class="footer-version" id="footerVersion">v1.0.0</div>
144+
</div>

0 commit comments

Comments
 (0)