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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>An Immoral Web Font Vacuum</title>
<meta name="description" content="Enter a URL to find, preview, and download web fonts (WOFF/TTF/WOFF2/OTF) present on the page.">
<style>
:root {
--beige: #f5f2e9;
--dark: #111111;
--accent: #ff4d00;
--grid-line: #ccbea7;
--container-bg: #ffffff;
--focus-outline: #2563eb;
}
body {
font-family: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
max-width: 900px;
margin: 0 auto;
padding: 1rem;
line-height: 1.5;
background: var(--beige);
color: var(--dark);
}
h1, h2 {
text-transform: uppercase;
letter-spacing: 2px;
border-bottom: 3px solid var(--accent);
padding-bottom: 0.5rem;
font-weight: 900;
}
.container {
background: var(--container-bg);
padding: 2rem;
border: 3px solid var(--dark);
box-shadow: 8px 8px 0 var(--dark);
margin-top: 2rem;
}
.input-group {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
border: 2px solid var(--dark);
padding: 1rem;
background: var(--beige);
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
input[type="url"] {
flex: 1;
padding: 0.75rem;
font-size: 1rem;
border: 2px solid var(--dark);
background: var(--beige);
font-family: 'Courier New', monospace;
}
input[type="url"]:focus {
outline: 3px solid var(--focus-outline);
outline-offset: 2px;
}
button {
padding: 0.75rem 1.5rem;
font-size: 1rem;
background: var(--dark);
color: var(--beige);
border: 2px solid var(--dark);
cursor: pointer;
text-transform: uppercase;
font-weight: bold;
font-family: 'Courier New', monospace;
transition: all 0.2s;
}
button:hover,
button:focus-visible {
background: var(--accent);
transform: translateY(-2px);
outline: 3px solid var(--focus-outline);
outline-offset: 2px;
}
button:focus:not(:focus-visible) {
outline: none;
}
.error {
color: var(--accent);
padding: 1rem;
background: rgba(255, 77, 0, 0.1);
border: 2px solid var(--accent);
margin-top: 1rem;
display: none;
font-weight: bold;
}
#results {
margin-top: 1rem;
}
.immoral {
color: #cc0000;
text-shadow:
0 0 1px #fff,
0 0 3px #fff,
0 0 5px #ff0000,
2px 2px 0 #600;
font-weight: 900;
letter-spacing: 2px;
transform: skew(-5deg);
display: inline-block;
position: relative;
padding: 0 4px;
}
.immoral::first-letter {
font-size: 1.2em;
text-shadow:
0 0 1px #fff,
0 0 3px #fff,
0 0 5px #ff0000,
2px 2px 0 #800;
}
</style>
</head>
<body>
<main class="container">
<h1><span class="immoral">Immoral</span> Web Font Vacuum</h1>
<p>Enter a URL to find, preview, and download web fonts (WOFF/TTF/WOFF2/OTF) present on the page.</p>
<section id="urlForm">
<form class="input-group" role="search" aria-label="Website URL search form" onsubmit="event.preventDefault();">
<label for="urlInput" class="sr-only">Website URL</label>
<input
type="url"
id="urlInput"
name="urlInput"
placeholder="Enter website URL (e.g., https://example.com)"
required
aria-required="true"
aria-describedby="urlHint"
>
<span id="urlHint" class="sr-only">Enter the full website URL including https:// or http://</span>
<button
id="analyzeBtn"
type="submit"
aria-label="Analyze website for fonts"
>Analyze Fonts</button>
</form>
</section>
<section class="bookmarklet-section" style="margin: 2rem 0; padding: 1rem; border: 2px dashed var(--dark); background: var(--beige);">
<h2>Web Font Vacuum Bookmarklet</h2>
<p>Drag this link to your bookmarks bar to vacuum web fonts from any webpage:</p>
<p style="text-align: center;">
<a href="javascript:(function(){
const script = document.createElement('script');
script.src = 'https://smallandnearlysilent.com/immoral/bookmarklet.js';
document.body.appendChild(script);
})()"
class="bookmarklet-link"
style="display: inline-block; padding: 0.5rem 1rem; background: var(--dark); color: var(--beige); text-decoration: none; border-radius: 4px; font-weight: bold;"
onclick="event.preventDefault(); alert('Drag this to your bookmarks bar!');">
Web Font Vacuum
</a>
</p>
<p>
Use the bookmarklet on any webpage to find and download its fonts directly.
</p>
</section>
<section id="error" class="error" role="alert" aria-live="polite"></section>
<section id="results" role="region" aria-label="Font analysis results"></section>
</main>
<footer>
<br>
<br>
<p>This project is the result of taking a passing thought about 1500 lines of code too far.</p>
</footer>
<script src="app.js"></script>
</body>
</html>
|