Skip to content

Commit 5417bef

Browse files
committed
style: improve some parts of the design
1 parent d766410 commit 5417bef

File tree

9 files changed

+323
-118
lines changed

9 files changed

+323
-118
lines changed

src/app.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<link rel="preconnect" href="https://fonts.googleapis.com">
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9+
<link href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Unbounded:[email protected]&display=swap" rel="stylesheet">
710
<link rel="stylesheet" href="style.css">
811
%sveltekit.head%
912
</head>

src/lib/comp/Content.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@
1313
<style>
1414
#content {
1515
flex-grow: 1;
16-
margin: 0 2.5vw;
16+
margin: 0 2.5rem 1.5rem;
17+
display: flex;
18+
flex-direction: column;
1719
}
1820
@media screen and (max-width: 1480px){
1921
#content {
20-
margin: 0 1vw;
22+
margin: 0 1.5rem 1.5rem;
23+
}
24+
25+
}
26+
@media screen and (max-width: 1024px){
27+
#content {
28+
margin: 0 1rem 1rem;
2129
}
2230
2331
}

src/lib/comp/DarkModeSwitch.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
place-items: center;
4646
cursor: pointer;
4747
}
48-
span {
49-
margin-right: 1em;
50-
}
5148
5249
.light-mode {
5350
display: none;
@@ -58,11 +55,4 @@
5855
:global(#darkMode:checked ~ main .dark-mode) {
5956
display: none;
6057
}
61-
62-
63-
@media screen and (max-width: 820px) {
64-
span {
65-
display: none;
66-
}
67-
}
6858
</style>

src/lib/comp/MainMenu.svelte

Lines changed: 151 additions & 49 deletions
Large diffs are not rendered by default.

src/lib/comp/Module.svelte

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@
4747
}
4848
</script>
4949

50-
<label class="module rounded" class:highlighted={highlighted} for={module.name} class:required id={module.id}>
50+
<label class="module rounded" class:highlighted={highlighted} for={module.name} class:required class:recommended id={module.id}>
5151
<input
5252
type="checkbox"
5353
name={module.name}
5454
id={module.name}
5555
class="module-selector"
5656
on:change={toggle}
5757
/>
58+
<span class="checkmark"></span>
5859
{#if required}
5960
<div class="required overlay highlight">Required</div>
6061
{:else if recommended}
@@ -125,31 +126,59 @@
125126
position: relative;
126127
outline: var(--border-width) solid transparent;
127128
background-color: var(--background-color-lighter);
128-
margin: 1rem;
129129
display: flex;
130130
flex-direction: column;
131-
width: 300px;
132-
height: 400px;
133-
filter: drop-shadow(0 0.5rem 0.1rem var(--background-color-darker));
134-
transition:
135-
filter 0.5s,
136-
color 0.5s,
137-
background-color 0.5s;
131+
height: 375px;
132+
filter: drop-shadow(0.15rem 0.35rem 0.1rem var(--background-color-darker));
133+
cursor: pointer;
138134
}
139135
140136
.module:has(input:checked),
141137
.module.required {
142138
outline-color: var(--highlight-color);
143139
}
140+
.module.recommended {
141+
outline-color: #bbb;
142+
}
144143
145144
.module.highlighted {
146145
outline-color: var(--highlight-secondary-color) !important;
147146
}
148147
149148
.module-selector {
149+
display: none;
150+
}
151+
152+
.checkmark {
150153
position: absolute;
151-
top: 5%;
152-
right: 5%;
154+
display: block;
155+
right: 10px;
156+
top: 10px;
157+
width: 25px;
158+
height: 25px;
159+
border-radius: 50%;
160+
background: #fff;
161+
border: 2px solid #00000033;
162+
}
163+
164+
.module-selector:checked ~ .checkmark {
165+
border-color: var(--highlight-color);
166+
background: var(--highlight-color);
167+
}
168+
169+
.checkmark:after {
170+
content: "";
171+
position: absolute;
172+
}
173+
174+
.module-selector:checked ~ .checkmark:after {
175+
left: 7px;
176+
top: 3px;
177+
width: 7px;
178+
height: 13px;
179+
border: solid white;
180+
border-width: 0 2px 2px 0;
181+
transform: rotate(38deg);
153182
}
154183
155184
.module-img {
@@ -186,6 +215,9 @@
186215
display: flex;
187216
align-items: center;
188217
}
218+
.module-doc:hover {
219+
text-decoration: underline;
220+
}
189221
190222
.overlay {
191223
position: absolute;
@@ -194,18 +226,19 @@
194226
padding: 0.25em;
195227
border-top-left-radius: 0.375rem;
196228
}
197-
.recommended {
229+
230+
.overlay.recommended {
198231
filter: grayscale(1);
199232
}
200233
201234
.module-tag,
202235
.module-dependency {
203236
background-color: var(--background-color-darker);
204237
padding: 0.2em 0.5em;
205-
margin: 0.2em;
206238
font-size: smaller;
207239
border-radius: 0.2em;
208240
text-decoration: none;
241+
margin-right: .25rem;
209242
}
210243
211244
.module-dependencies-wrapper {
@@ -215,21 +248,9 @@
215248
font-weight: bold;
216249
}
217250
218-
@media screen and (max-width: 1480px) {
219-
.module {
220-
max-width: 30%;
221-
margin: 1.5%;
222-
}
223-
.module-body {
224-
padding: 5%;
225-
}
226-
}
227-
228251
@media screen and (max-width: 1024px) {
229252
.module {
230-
font-size: max(2vw, 0.9em);
231-
max-width: 45%;
232-
margin: 2.5%;
253+
font-size: 0.9em;
233254
}
234255
}
235256
</style>

src/lib/comp/ModuleSelector.svelte

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,30 @@
132132
#module-selector {
133133
display: flex;
134134
flex-direction: column;
135+
position: absolute;
136+
left: 0;
137+
top: 0;
138+
bottom: 0;
139+
right: 0;
140+
135141
}
136142
137143
.module-wrapper {
138-
display: flex;
139-
flex-direction: row;
140-
flex-wrap: wrap;
144+
display: grid;
145+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
146+
gap: 1.5rem;
147+
padding: 1.5rem;
148+
}
149+
@media screen and (max-width: 1024px) {
150+
.module-wrapper {
151+
gap: 1rem;
152+
padding: 1rem;
153+
grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
154+
}
155+
}
156+
@media screen and (max-width: 820px) {
157+
#module-selector {
158+
position: relative;
159+
}
141160
}
142161
</style>

src/lib/comp/VersionSelector.svelte

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,14 @@
134134
disabled={$selectedModules.size === 0}
135135
on:click={download}
136136
>
137-
Download</button
137+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
138+
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
139+
</svg>
140+
<div>
141+
<div class="dl-title">Download</div>
142+
<div>All in one datapack</div>
143+
</div>
144+
</button
138145
>
139146
</div>
140147
<div id="modules" class="rounded">
@@ -159,26 +166,57 @@
159166
display: flex;
160167
flex-direction: row;
161168
justify-content: space-between;
162-
background-color: var(--background-color);
169+
background-color: var(--background-color-lighter);
163170
border-bottom-left-radius: 0;
164171
border-bottom-right-radius: 0;
165-
border-bottom: 1px solid var(--divider-color);
172+
align-items: center;
173+
border-bottom: 1px solid #77777733;
166174
}
167175
#controlbar-inner {
168176
padding: 1rem;
169177
}
170178
button.dl {
171-
height: 4em;
172-
width: 10vw;
179+
height: 100%;
173180
border-radius: 0;
181+
padding: .5rem 1.5rem;
174182
border-top-right-radius: 0.375rem;
183+
display: flex;
184+
align-items: center;
185+
justify-content: center;
186+
font-size: 0.7em;
187+
font-family: Unbounded;
188+
}
189+
button.dl .dl-title {
190+
font-size: 1.6em;
191+
font-weight: 700;
192+
text-align: left;
193+
margin-bottom: -.2em;
194+
}
195+
button.dl:not(:disabled):hover svg {
196+
transform: translateY(3px);
197+
}
198+
button.dl:not(:disabled):active svg {
199+
transform: translateY(4px);
200+
}
201+
button.dl:disabled {
202+
background-color: #92979c82;
203+
cursor: not-allowed;
204+
}
205+
button.dl svg {
206+
height: 1.8em;
207+
transition: transform 0.1s;
208+
}
209+
button.dl > div {
210+
padding: 0 1rem;
175211
}
176212
177213
#modules {
178-
padding: 1rem;
179214
border-top-left-radius: 0;
180215
border-top-right-radius: 0;
181216
background-color: var(--background-color);
217+
overflow: auto;
218+
position: relative;
219+
flex-grow: 1;
182220
}
183221
184222
@media screen and (max-width: 820px) {
@@ -195,10 +233,6 @@
195233
width: 100%;
196234
}
197235
198-
#search {
199-
display: none;
200-
}
201-
202236
button.dl {
203237
width: 100%;
204238
border-radius: 0;

static/favicon.png

10.5 KB
Loading

0 commit comments

Comments
 (0)