-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathascii.html
154 lines (144 loc) · 6.89 KB
/
ascii.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple web Page</title>
<link rel="stylesheet" href="ascii.css">
<script src='ascii.js' defer></script>
</head>
<body>
<main style="width: 100vh;">
<div class="layout">
<aside class="sidebar">
<section class="control-group global-settings">
<h3>Global Settings</h3>
<div class="control">
<label for="theme">Theme:</label>
<select id="theme">
<option value="dark" selected>Dark</option>
<option value="light">Light</option>
</select>
</div>
<div class="control">
<label for="ignoreWhite">Ignore Pure White:</label>
<input type="checkbox" id="ignoreWhite" checked>
</div>
</section>
<section class="control-group upload-group">
<h3>1. Upload Your File</h3>
<div class="control">
<input type="file" id="upload" accept="image/*">
</div>
</section>
<section class="control-group image-processing">
<h3>2. Basic Adjustments</h3>
<div class="control">
<label for="asciiWidth">Output Width (chars):</label>
<input type="range" id="asciiWidth" min="20" max="300" value="150">
<span class="value-label" id="asciiWidthVal">100</span>
</div>
<div class="control">
<label for="brightness">Brightness:</label>
<input type="range" id="brightness" min="-100" max="100" value="0">
<span class="value-label" id="brightnessVal">0</span>
</div>
<div class="control">
<label for="contrast">Contrast:</label>
<input type="range" id="contrast" min="-100" max="100" value="0">
<span class="value-label" id="contrastVal">0</span>
</div>
<div class="control">
<label for="blur">Blur (px):</label>
<input type="range" id="blur" min="0" max="10" step="0.01" value="0">
<span class="value-label" id="blurVal">0</span>
</div>
<div class="control">
<label for="invert">Invert Colors:</label>
<input type="checkbox" id="invert">
</div>
</section>
<section class="control-group dithering-settings">
<h3>3. Dithering Options</h3>
<div class="control">
<label for="dithering">Enable Dithering:</label>
<input type="checkbox" id="dithering" checked>
</div>
<div class="control">
<label for="ditherAlgorithm">Dither Algorithm:</label>
<select id="ditherAlgorithm">
<option value="floyd" selected>Floyd–Steinberg</option>
<option value="atkinson">Atkinson</option>
<option value="noise">Noise</option>
<option value="ordered">Ordered</option>
</select>
</div>
</section>
<section class="control-group charset-settings">
<h3>4. Character Set</h3>
<div class="control">
<label for="charset">Select Set:</label>
<select id="charset">
<option value="detailed" selected>Detailed</option>
<option value="standard">Standard</option>
<option value="blocks">Blocks</option>
<option value="binary">Binary</option>
<option value="hex">Hex</option>
<option value="manual">Manual</option>
</select>
</div>
<div class="control" id="manualCharControl" style="display: none;">
<label for="manualCharInput">Manual Character:</label>
<input type="text" id="manualCharInput" maxlength="1" value="0">
</div>
</section>
<section class="control-group edge-detection-settings">
<h3>5. Edge Detection</h3>
<p>Select one edge detection method:</p>
<div class="control">
<input type="radio" name="edgeMethod" id="edgeNone" value="none" checked>
<label for="edgeNone">No Edge Detection</label>
</div>
<div class="control">
<input type="radio" name="edgeMethod" id="edgeSobel" value="sobel">
<label for="edgeSobel">Sobel Edge Detection</label>
</div>
<div class="control">
<input type="radio" name="edgeMethod" id="edgeDoG" value="dog">
<label for="edgeDoG">DoG (Contour) Detection</label>
</div>
<div class="control" id="sobelThresholdControl" style="display: none;">
<label for="edgeThreshold">Sobel Threshold:</label>
<input type="range" id="edgeThreshold" min="0" max="255" value="100">
<span class="value-label" id="edgeThresholdVal">100</span>
</div>
<div class="control" id="dogThresholdControl" style="display: none;">
<label for="dogEdgeThreshold">DoG Threshold:</label>
<input type="range" id="dogEdgeThreshold" min="0" max="255" value="100">
<span class="value-label" id="dogEdgeThresholdVal">100</span>
</div>
</section>
<section class="control-group display-settings">
<h3>6. Display Settings</h3>
<div class="control">
<label for="zoom">Zoom (%):</label>
<input type="range" id="zoom" min="20" max="600" value="100">
<span class="value-label" id="zoomVal">100</span>
</div>
</section>
<section class="control-group misc-settings">
<div class="control">
<button id="reset">Reset All Settings</button>
</div>
</section>
</aside>
<main class="main-content">
<pre id="ascii-art"></pre>
<button id="copyBtn">Copy ASCII Art</button>
<button id="downloadBtn">Download PNG</button>
</main>
</div>
<canvas id="canvas" style="display: none;"></canvas>
</main>
</body>
</html>