-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
209 lines (205 loc) · 5.17 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ASCII Hypercube</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.png" />
<script src="lib/coffeescript.js"></script>
<script src="lib/grapheme-splitter.js"></script>
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
body {
font-family: sans-serif;
padding: 0 1rem;
box-sizing: border-box;
}
main {
flex: 1 0 auto;
}
footer {
text-align: center;
padding-bottom: 1rem;
}
h1, h2, h3, h4, h5, h6, p, p ~ output {
margin: 1.5rem 0;
display: block;
}
#output-textarea,
#add-dimension {
margin-top: 1.5rem;
}
p {
max-width: 65em;
}
h1, h2, h3, h4, h5, h6, p {
margin-bottom: 0;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0;
}
h1 {
font-size: 3.5em;
}
h2 {
font-size: 2em;
/*font-size: 1.7em;*/
/*margin-top: 0;*/
}
h3 {
font-size: 1.7em;
}
h4 {
font-size: 1.2em;
}
textarea {
font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;
box-sizing: border-box;
width: 100%;
padding: 0.5em;
border-radius: 2px;
border: 1px solid rgba(0, 0, 0, 0.5);
overflow-x: auto;
overflow-y: hidden;
resize: none;
white-space: pre;
}
label ~ label {
margin-left: 1em;
}
input {
border: 1px solid rgba(0, 0, 0, 0.5);
padding: 0.1em;
}
input[type="number"],
/* input.text-input, */
input.vector-input {
width: 3em;
}
input:invalid {
background: rgba(255, 87, 34, 0.35);
}
a {
color: inherit;
}
#copied-to-clipboard {
pointer-events: none;
background-color: #00c030;
color: white;
border-radius: 100px;
padding: 2px 10px;
transition: opacity .5s ease-out;
-moz-transition: opacity .5s ease-out;
-webkit-transition: opacity .5s ease-out;
-o-transition: opacity .5s ease-out;
opacity: 1;
position: absolute;
margin-top: 5px;
}
#copied-to-clipboard[aria-hidden] {
opacity: 0;
}
@keyframes bump {
0% { transform: translateY(0); }
40% { transform: translateY(-5px); }
100% { transform: translateY(0); }
}
details summary {
cursor: pointer;
}
.two-column-layout {
display: flex;
flex-direction: column; /* i.e. NOT a two column layout */
}
@media (min-width: 1200px) {
.two-column-layout {
flex-direction: row;
}
#input-column {
margin-right: 15px;
}
}
#output-column {
flex-grow: 1;
}
#input-column {
flex-grow: 0.1;
}
</style>
</head>
<body>
<header>
<h1>ASCII Hypercube</h1>
<!-- <h2>Create hyperrectangular ASCII art</h2> -->
</header>
<main>
<p>
Create AESTHETIC square, cube, and tesseract ASCII art, and more.
</p>
<p>
You can configure each dimension with
the length (number of drawn glyphs minus one),
text to be drawn across line segments (which will be repeated if its shorter than the length),
and the projection’s offset vector (in characters) per unit of length.
</p>
<div class="two-column-layout">
<div class="column" id="input-column">
<h3>Input</h3>
<form>
<div id="inputs"></div>
<button id="add-dimension" type="button">Add Dimension</button>
</form>
</div>
<div class="column" id="output-column">
<h3>Output</h3>
<details id="overlaps">
<summary id="overlap-summary"></summary>
<div id="overlap-details"></div>
</details>
<textarea readonly id="output-textarea"></textarea>
<button id="copy-to-clipboard">Copy</button>
<span style="margin-left: 10px">
<label for="markdown-format-checkbox">
<input id="markdown-format-checkbox" type="checkbox"/>
Format for Markdown (Reddit, etc.)
</label>
</span>
<div style="pointer-events: none">
<span id="copied-to-clipboard" aria-hidden="true" role="alert">Copied to Clipboard</span>
</div>
</div>
</div>
<p>
The output is intended to be used with a <a href="https://en.wikipedia.org/wiki/Monospaced_font"><strong>monospaced font</strong></a>.
To get monospacing on Reddit, GitHub, and other places that support <a href="https://daringfireball.net/projects/markdown/syntax">Markdown</a>,
check “Format for Markdown” above, which will indent the output by four spaces.
Be sure to leave blank lines on either side of the output, if including alongside other text.
</p>
<p>
You may also find an option to create “code blocks” in some forums/apps/services,
in the form of an icon that generally looks like
a pair of angle brackets <span style="font-family: monospace" aria-hidden="true"><></span>
or curly brackets <span style="font-family: monospace" aria-hidden="true">{}</span>.
Select the text to format and click this icon (where available) to get monospaced text.
</p>
<p>
<strong>Recommended:</strong> make further edits by importing in <a href="http://asciiflow.com/">ASCIIFlow Infinity</a>
(not affiliated), or my own project, <a href="https://github.com/1j01/textual-paint">Textual Paint</a>.
</p>
</main>
<footer>
<p>
Made by <a href="https://isaiahodhner.io/">Isaiah Odhner</a>.
Open source <a href="https://github.com/1j01/ascii-hypercube">on GitHub</a>.
</p>
</footer>
<script src="./src/ascii-hypercube.coffee" type="text/coffeescript"></script>
<script src="./src/app.coffee" type="text/coffeescript"></script>
</body>