-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
195 lines (185 loc) · 6.16 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Markless-GPT</title>
<style>
:root {
--bg: #121212;
--fg: #e0e0e0;
--accent: #1e88e5;
--input-bg: #1e1e1e;
--border: #333;
--radius: 0.5rem;
--shadow: rgba(0,0,0,0.5);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--fg); display: flex; justify-content: center; }
.container { width: 90%; max-width: 70%; margin: 2rem auto; }
@media (max-width: 600px) {
.container { width: 100%; margin: 1rem; }
}
header { text-align: center; margin-bottom: 1.5rem; }
header h1 { margin: 0; font-size: 2rem; }
nav { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }
nav button {
background: transparent;
border: 2px solid var(--border);
padding: 0.75rem 1.5rem;
font-size: 1rem;
color: var(--fg);
cursor: pointer;
border-radius: var(--radius);
transition: background 0.2s, border-color 0.2s, color 0.2s;
}
nav button:hover {
border-color: var(--accent);
color: var(--accent);
}
nav button.active {
background: var(--accent);
border-color: var(--accent);
color: #fff;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
section h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
textarea {
width: 100%;
min-height: 150px;
background: var(--input-bg);
color: var(--fg);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.75rem;
resize: vertical;
font-family: inherit;
font-size: 1rem;
}
button.action {
margin-top: 1rem;
background: var(--accent);
color: #fff;
border: none;
padding: 0.75rem 1.75rem;
border-radius: var(--radius);
cursor: pointer;
font-size: 1rem;
font-weight: 500;
box-shadow: 0 4px 6px var(--shadow);
transition: transform 0.1s;
}
button.action:hover {
transform: translateY(-1px);
}
.output {
margin-top: 1rem;
white-space: pre-wrap;
word-wrap: break-word;
background: var(--input-bg);
padding: 0.75rem;
border: 1px solid var(--border);
border-radius: var(--radius);
font-family: inherit;
font-size: 1rem;
box-shadow: 0 2px 4px var(--shadow);
}
.output-wrapper {
max-height: 60vh; /* scroll height */
overflow-y: auto;
position: relative;
margin-top: 1rem;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--input-bg);
box-shadow: 0 2px 4px var(--shadow);
}
.output-wrapper .actions {
position: sticky;
top: 0;
background: var(--input-bg);
padding: 0.75rem;
display: flex;
gap: 0.5rem;
border-bottom: 1px solid var(--border);
z-index: 1;
}
.output-wrapper .output {
margin-top: 0;
padding: 0.75rem;
}
#copy-convert { display: none; }
</style>
</head>
<body>
<div class="container">
<header>
<h1>Markless-GPT</h1>
</header>
<nav>
<button data-tab="check" class="active">Check Marks</button>
<button data-tab="convert">Convert Text</button>
</nav>
<main>
<section id="check" class="tab-content active">
<h2>Check for Watermark Markers</h2>
<textarea id="check-input" placeholder="Paste your text here..."></textarea>
<button id="check-btn" class="action">Check</button>
<div id="check-result" class="output"></div>
</section>
<section id="convert" class="tab-content">
<h2>Convert to Markless Text</h2>
<textarea id="convert-input" placeholder="Paste your text here..."></textarea>
<div class="actions">
<button id="convert-btn" class="action">Convert</button>
<button id="copy-convert" class="action">Copy Output</button>
</div>
<div class="output-wrapper">
<div id="convert-result" class="output"></div>
</div>
</section>
</main>
</div>
<script>
function filterText(str) {
let text = str.replace(/\u00A0/g, ' ').replace(/\u202F/g, ' ');
text = text.replace(/[\u200B-\u200D\uFEFF]/g, '');
return text;
}
function checkMarks() {
const input = document.getElementById('check-input').value;
const matches = input.match(/[\u00A0\u200B-\u200D\uFEFF]/g);
const count = matches ? matches.length : 0;
const resultDiv = document.getElementById('check-result');
if (count === 0) {
resultDiv.textContent = '✔ No watermark markers found.';
} else {
resultDiv.textContent = `⚠ Found ${count} watermark marker${count > 1 ? 's' : ''}.`;
}
}
function convertText() {
const input = document.getElementById('convert-input').value;
const out = filterText(input);
const resultDiv = document.getElementById('convert-result');
resultDiv.textContent = out;
document.getElementById('copy-convert').style.display = out ? 'inline-block' : 'none';
}
function copyOutput() {
const out = document.getElementById('convert-result').textContent;
navigator.clipboard.writeText(out);
}
document.getElementById('check-btn').addEventListener('click', checkMarks);
document.getElementById('convert-btn').addEventListener('click', convertText);
document.getElementById('copy-convert').addEventListener('click', copyOutput);
document.querySelectorAll('nav button').forEach((btn) => {
btn.addEventListener('click', () => {
document.querySelectorAll('nav button').forEach((b) => b.classList.remove('active'));
btn.classList.add('active');
document.querySelectorAll('.tab-content').forEach((sec) => sec.classList.remove('active'));
document.getElementById(btn.getAttribute('data-tab')).classList.add('active');
});
});
</script>
</body>
</html>