Skip to content

Commit cf60210

Browse files
committed
vercel - hide filter by default
1 parent 92e6590 commit cf60210

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

docs/vercel/src/Index.svelte

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
let tagName: string;
99
let htmlUrl: string;
10+
let showMenu: boolean;
1011
1112
const languages: Language[] = Object.entries(data as Languages).map(
1213
([name, { type, ascii, colors }]) => ({
@@ -71,28 +72,31 @@
7172
Suggestions and PRs are welcome at <a
7273
href="https://github.com/o2sh/onefetch">github.com/o2sh/onefetch</a>
7374
</p>
74-
75-
<h3>Languages <small>({$filteredLanguages.length})</small></h3>
76-
77-
<strong>Filter by type</strong>
78-
79-
<div class="checkbox-group">
80-
{#each languageTypes as type}
81-
<label for={type}>
82-
<input
83-
id={type}
84-
type="checkbox"
85-
value={type}
86-
bind:group={$filter.checkboxes} />
87-
{type}
88-
</label>
89-
{/each}
75+
<div class="title">
76+
<h3>Languages <small>({$filteredLanguages.length})</small></h3>
77+
<button class="filter-button" on:click={() => (showMenu = !showMenu)}
78+
>Filter by type</button>
9079
</div>
9180

92-
<small
93-
>Note: By default, onefetch will only recognize <strong>programming</strong>
94-
and <strong>markup</strong> types. Use the
95-
<code>--type</code> flag to configure.</small>
81+
<div class:hide={!showMenu}>
82+
<div class="checkbox-group">
83+
{#each languageTypes as type}
84+
<label for={type}>
85+
<input
86+
id={type}
87+
type="checkbox"
88+
value={type}
89+
bind:group={$filter.checkboxes} />
90+
{type}
91+
</label>
92+
{/each}
93+
</div>
94+
<small
95+
>Note: By default, onefetch will only recognize <strong
96+
>programming</strong>
97+
and <strong>markup</strong> types. Use the
98+
<code>--type</code> flag to configure.</small>
99+
</div>
96100

97101
{#each $filteredLanguages as language}
98102
<AsciiPreview
@@ -115,15 +119,29 @@
115119
padding: 0.5rem 0;
116120
}
117121
122+
.title {
123+
display: flex;
124+
justify-content: space-between;
125+
align-items: center;
126+
margin-top: 3rem;
127+
margin-bottom: 1.5rem;
128+
}
129+
130+
.title h3 {
131+
margin-bottom: 0;
132+
margin-top: 0;
133+
}
134+
118135
.checkbox-group {
119136
margin-top: 1.5rem;
120137
}
121138
122139
.checkbox-group label {
123140
width: fit-content;
141+
text-transform: capitalize;
124142
}
125143
126-
.checkbox-group label {
127-
text-transform: capitalize;
144+
.hide {
145+
display: none;
128146
}
129147
</style>

0 commit comments

Comments
 (0)