|
7 | 7 |
|
8 | 8 | let tagName: string;
|
9 | 9 | let htmlUrl: string;
|
| 10 | + let showMenu: boolean; |
10 | 11 |
|
11 | 12 | const languages: Language[] = Object.entries(data as Languages).map(
|
12 | 13 | ([name, { type, ascii, colors }]) => ({
|
|
71 | 72 | Suggestions and PRs are welcome at <a
|
72 | 73 | href="https://github.com/o2sh/onefetch">github.com/o2sh/onefetch</a>
|
73 | 74 | </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> |
90 | 79 | </div>
|
91 | 80 |
|
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> |
96 | 100 |
|
97 | 101 | {#each $filteredLanguages as language}
|
98 | 102 | <AsciiPreview
|
|
115 | 119 | padding: 0.5rem 0;
|
116 | 120 | }
|
117 | 121 |
|
| 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 | +
|
118 | 135 | .checkbox-group {
|
119 | 136 | margin-top: 1.5rem;
|
120 | 137 | }
|
121 | 138 |
|
122 | 139 | .checkbox-group label {
|
123 | 140 | width: fit-content;
|
| 141 | + text-transform: capitalize; |
124 | 142 | }
|
125 | 143 |
|
126 |
| - .checkbox-group label { |
127 |
| - text-transform: capitalize; |
| 144 | + .hide { |
| 145 | + display: none; |
128 | 146 | }
|
129 | 147 | </style>
|
0 commit comments