-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.html
169 lines (169 loc) · 6.08 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{site.title}}</title>
<meta name="description" content="{{site.description}}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="{{ '/favicon.ico' | url }}" />
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="stylesheet" href="{{ '/css/style.css' | url }}" />
<link rel="stylesheet" href="{{ '/css/tags.css' | url }}" />
{% if site.env == 'production' %}
<script
defer
data-domain="fontlibrary.dev"
src="https://plausible.io/js/script.manual.js"
></script>
<script>
window.plausible =
window.plausible ||
function () {
(window.plausible.q = window.plausible.q || []).push(arguments);
};
</script>
<script>
function prepareUrl(params) {
const url = new URL(location.href);
const queryParams = new URLSearchParams(location.search);
let customUrl =
url.protocol + "//" + url.hostname + url.pathname.replace(/\/$/, "");
for (const paramName of params) {
const paramValue = queryParams.get(paramName);
if (paramValue) customUrl = customUrl + "/" + paramValue;
}
return customUrl;
}
plausible("pageview", {
u: prepareUrl(["tag"]) + window.location.search,
});
</script>
{% endif %}
</head>
<body>
<header>
<div class="title">
<h1>{{site.title}}</h1>
<div>{{site.description}}</div>
</div>
<a href="{{site.contributing}}" class="btn">Contribute on GitHub</a>
</header>
<main-app current-page="1" results-length="{{metadata.totalFamilies}}">
<div class="container">
<aside class="sidebar">
<section class="sidebar-group">
<h2>Tags</h2>
<ul class="tags-container">
{% for tag in metadata.tags %}
<li>
<button
is="tag-button"
title="{{tag.name}}"
value="{{tag.name}}"
>
{{tag.name}}
</button>
</li>
{% endfor %}
</ul>
</section>
<div class="sidebar-group">
<h3>Want to help the project?</h3>
<p>
Sort by fonts that
<button is="tag-button" value="need tags">need tags</button>.
Learn <a href="{{site.contributing}}">how to contribute</a>.
</p>
</div>
</aside>
<div class="content" id="content">
<section class="selects">
<h2>Filters</h2>
<div class="select-group-container">
<div class="select-group">
<label for="selectedSearch">Filter fonts</label>
<input type="text" id="selectedSearch" value="" />
</div>
<div class="select-group">
<label for="selectedTag">Tags</label>
<select data-param="tag" is="filter-select" id="selectedTag">
<option value="">All tags</option>
<option id="need tags" value="need tags">need tags</option>
{%- for option in metadata.tags -%}
<option id="{{option.name}}" value="{{option.name}}">
{{option.name}}
</option>
{%- endfor -%}
</select>
</div>
<div class="select-group">
<label for="selectedCategory">Categories</label>
<select
data-param="category"
is="filter-select"
id="selectedCategory"
>
<option value="">All categories</option>
{%- for option in metadata.categories -%}
<option id="{{option}}" value="{{option}}">{{option}}</option>
{%- endfor -%}
</select>
</div>
<div class="select-group">
<label for="selectedSubset">Subsets</label>
<select
data-param="subset"
is="filter-select"
id="selectedSubset"
>
<option value="">All subsets</option>
{%- for option in metadata.subsets -%}
<option id="{{option}}" value="{{option}}">{{option}}</option>
{%- endfor -%}
</select>
</div>
<div class="select-group">
<label for="selectedVariant">Variants</label>
<select
data-param="variant"
is="filter-select"
id="selectedVariant"
>
<option value="">All variants</option>
{%- for option in metadata.variants -%}
<option id="{{option}}" value="{{option}}">{{option}}</option>
{%- endfor -%}
</select>
</div>
<div class="select-group">
<label for="selectedVariable"
>Variable font
<input
is="filter-checkbox"
type="checkbox"
id="selectedVariable"
/></label>
</div>
</div>
</section>
<section class="results">
<search-status
results-length="{{metadata.totalFamilies}}"
></search-status>
<sort-by
results-length="{{metadata.totalFamilies}}"
sort-by="family"
></sort-by>
<ul class="families" is="font-list"></ul>
<pagination-buttons
current-page="1"
results-length="{{metadata.totalFamilies}}"
></pagination-buttons>
</section>
</div>
</div>
</main-app>
<script src="//unpkg.com/@ungap/custom-elements/es.js"></script>
<script src="{{ '/js/bundle.js' | url }}"></script>
</body>
</html>