forked from Shinmera/promptfont
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ctml
More file actions
222 lines (216 loc) · 7.41 KB
/
Copy pathindex.ctml
File metadata and controls
222 lines (216 loc) · 7.41 KB
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
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB">
<head>
<meta charset="utf-8"/>
<title>PromptFont - A Font for Button Prompts</title>
<meta name="description" content="This is a font with special glyphs to display button prompts in games and applications with special input devices.">
<meta property="og:type" content="website">
<meta property="og:title" content="PromptFont - A Font for Button Prompts">
<meta property="og:description" content="This is a font with special glyphs to display button prompts in games and applications with special input devices.">
<meta property="og:image" content="https://shinmera.github.io/promptfont/preview.png" />
<meta property="og:image:alt" content="PromptFont Preview">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<style type="text/css">
@font-face {
font-family: 'promptfont';
src: url('promptfont.ttf');
}
@keyframes fadeOut {
0% { opacity: 1;}
50% { opacity: 1;}
100% { opacity: 0;}
}
body {
font-family: sans-serif;
font-size: 14pt;
margin: 0;
overflow-y: scroll;
}
header {
padding: 1em;
border-bottom: 3px solid #CCCCCC;
}
footer {
padding: 1em;
border-top: 3px solid #CCCCCC;
text-align: center;
}
a.button {
font-size: 18pt;
font-weight: normal;
color: black;
background: #EEEEEE;
border: 2px solid #CCCCCC;
border-radius: .2em;
padding: .2em .4em;
margin: .2em;
text-decoration: none;
}
a.button:hover {
background: #CCCCCC;
}
main {
background: #EEEEEE;
padding: 4em 0;
}
.search {
box-sizing: border-box;
font-size: 1.5em;
width: 20em;
display: block;
margin: 0 auto;
padding: 0.2em 0.5em;
border: 1px solid #CCCCCC;
border-radius: 0.2em;
}
.glyphsection {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.glyphsection h2 {
width: 100%;
text-align: center;
}
.glyph {
text-align: center;
margin: 1em;
width: 8em;
}
.glyph span {
display: block;
}
.glyph code {
display: block;
}
.glyph i {
display: block;
font-family: promptfont;
font-size: 32pt;
font-style: normal;
transition: font-size .5s;
}
.glyph:hover i{
font-size: 8em;
}
.notice{
position: fixed;
top: 0;
left: 0;
right: 0;
text-align: center;
padding: 0.5em 1em;
font-size: 1.5em;
background: white;
color: black;
border-bottom: 2px solid #CCCCCC;
opacity: 1;
animation: fadeOut 2s;
animation-fill-mode: forwards;
}
.notice i{
font-family: promptfont;
font-style: normal;
display: inline-block;
width: 1em;
}
img{
max-width: 100%;
}
.hidden{
display: none !important;
}
</style>
</head>
<body>
<header>
<h1>
PromptFont
<a class="button" href="https://github.com/Shinmera/promptfont/">GitHub</a>
<a class="button" href="https://github.com/Shinmera/promptfont/archive/refs/heads/gh-pages.zip">Download</a>
</h1>
<p>This is a font designed for button prompts in games. It includes the base alphabet, as well as icons for modifier and control keys, and gamepad buttons. All the icons included in the font are custom made and available under the same <a href="LICENSE.txt">SIL Open Font Licence</a>. Included trademarks however of course still belong to their respective owners.</p>
<p>If you use this font in your project please leave an attribution notice in your credits like this:
<blockquote>PromptFont by Yukari "Shinmera" Hafner, available at https://shinmera.com/promptfont</blockquote>
</p>
</header>
<main>
<input class="search" type="search" placeholder="Search..." spellcheck="false" autofocus>
<c:splice iterate="sections">
<section class="glyphsection" lquery="(attr :id name)">
<h2 lquery="(text name)"></h2>
<c:splice iterate="glyphs">
<div class="glyph" title="Click to copy" lquery="(data :category category :tags tags :code code :name name)">
<i lquery='(html (code-char codepoint))'>!</i>
<code lquery='(text code)'>U+0021</code>
<span lquery="(text name)">!</span>
</div>
</c:splice>
</section>
</c:splice>
</main>
<footer>
Please consider supporting the continued development of this Font by supporting me on Patreon:
<a href="https://patreon.com/shinmera">
<img alt="Patreon" src="https://filebox.tymoon.eu//file/TWpjeU9RPT0=" />
</a>
</footer>
<script type="text/javascript">
let notice = null;
let clearNotice = ()=>{
if(notice){
clearTimeout(notice.timeout);
document.body.removeChild(notice.element);
notice = null;
}
}
let showNotice = (html)=>{
clearNotice();
notice = {};
notice.element = document.createElement("div");
notice.element.setAttribute("class", "notice");
notice.element.innerHTML = html;
document.body.appendChild(notice.element);
notice.timeout = setTimeout(clearNotice, 2000);
};
document.querySelectorAll(".glyph").forEach((element)=>element.addEventListener("click", (ev)=>{
let glyph = element.querySelector("i").innerText;
navigator.clipboard.writeText(glyph).then(
()=>showNotice("<i>"+glyph+"</i> copied to clipboard!"),
()=>showNotice("Failed to copy glyph to clipboard."));
}));
let match = (query, el)=>{
query = query.trim().toLowerCase();
if(query === "") return true;
let inner = el.innerText.toLowerCase();
for(let k in el.dataset){
inner += " "+k+":"+el.dataset[k].toLowerCase();
}
for(let part of query.split(/ +/)){
if(!inner.includes(part))
return false;
}
return true;
};
let search = document.querySelector("input[type=search]");
search.addEventListener("input", (ev)=>{
let query = search.value;
for(let glyph of document.querySelectorAll(".glyph")){
if(match(query, glyph))
glyph.classList.remove("hidden");
else
glyph.classList.add("hidden");
}
for(let section of document.querySelectorAll(".glyphsection")){
if(section.querySelector(".glyph:not(.hidden)") !== null)
section.classList.remove("hidden");
else
section.classList.add("hidden");
}
});
</script>
</body>
</html>