Skip to content

Commit 0abc818

Browse files
feat: redesign settings screen using Material Design principles (#1263)
1 parent d96dabc commit 0abc818

File tree

15 files changed

+144
-388
lines changed

15 files changed

+144
-388
lines changed

src/_locales/en/messages.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@
153153
"initialSetup": {
154154
"message": "Initial Setup - Shadowban Scanner"
155155
},
156-
"shadowbanScannerHasBeenInstalled": {
157-
"message": "Shadowban Scanner has been installed."
158-
},
159156
"letsStartWithASimpleInitialSetup": {
160157
"message": "Let's begin with a simple initial setup."
161158
},
@@ -181,7 +178,7 @@
181178
"message": "Next"
182179
},
183180
"initialSetupCompleted": {
184-
"message": "Initial setup completed!<br>Would you like to open the usage instructions?"
181+
"message": "Initial setup completed! Would you like to open the usage instructions?"
185182
},
186183
"open": {
187184
"message": "Open"

src/_locales/ja/messages.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@
153153
"initialSetup": {
154154
"message": "初期設定 - Shadowban Scanner"
155155
},
156-
"shadowbanScannerHasBeenInstalled": {
157-
"message": "Shadowban Scannerがインストールされました"
158-
},
159156
"letsStartWithASimpleInitialSetup": {
160157
"message": "簡単な初期設定を始めましょう"
161158
},
@@ -181,7 +178,7 @@
181178
"message": "次へ"
182179
},
183180
"initialSetupCompleted": {
184-
"message": "初期設定が完了しました!<br>使い方の説明を開きますか?"
181+
"message": "初期設定が完了しました!使い方の説明を開きますか?"
185182
},
186183
"open": {
187184
"message": "開く"

src/_locales/ko/messages.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@
153153
"initialSetup": {
154154
"message": "초기 설정 - Shadowban Scanner"
155155
},
156-
"shadowbanScannerHasBeenInstalled": {
157-
"message": "Shadowban Scanner가 설치되었습니다."
158-
},
159156
"letsStartWithASimpleInitialSetup": {
160157
"message": "간단한 초기 설정을 시작해 보겠습니다."
161158
},
@@ -181,7 +178,7 @@
181178
"message": "다음"
182179
},
183180
"initialSetupCompleted": {
184-
"message": "초기 설정 완료!<br>사용 설명서를 열까요?"
181+
"message": "초기 설정 완료! 사용 설명서를 열까요?"
185182
},
186183
"open": {
187184
"message": "열기"

src/_locales/zh_TW/messages.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@
159159
"initialSetup": {
160160
"message": "初始設定 - Shadowban Scanner"
161161
},
162-
"shadowbanScannerHasBeenInstalled": {
163-
"message": "已安裝 Shadowban Scanner"
164-
},
165162
"letsStartWithASimpleInitialSetup": {
166163
"message": "先從簡單的初始設定開始吧"
167164
},
@@ -187,7 +184,7 @@
187184
"message": "下一步"
188185
},
189186
"initialSetupCompleted": {
190-
"message": "已完成初始設定!<br>是否要開啟使用說明?"
187+
"message": "已完成初始設定!是否要開啟使用說明?"
191188
},
192189
"open": {
193190
"message": "開啟"

src/css/initialSetup.css

Lines changed: 60 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* {
1+
@import url("./theme.css");
2+
3+
*:not(md-filled-button, md-text-button) {
24
margin: 0;
35
padding: 0;
46
box-sizing: border-box;
@@ -10,22 +12,31 @@ body {
1012
height: 100%;
1113
font-family: sans-serif;
1214
font-size: 100%;
13-
background: radial-gradient(#1c1f63, #111 50%);
14-
color: white;
15+
background: var(--md-surface-container);
16+
color: var(--md-on-surface);
1517
}
1618

1719
body {
1820
display: flex;
21+
justify-content: center;
22+
align-items: center;
23+
}
24+
25+
#logo {
26+
height: 2rem;
1927
}
2028

2129
main {
2230
width: max-content;
31+
height: max-content;
2332
max-width: 100%;
24-
height: 80%;
25-
padding: 2rem;
26-
display: flex;
27-
gap: 3rem;
28-
margin: auto;
33+
gap: 5rem;
34+
margin: 2rem;
35+
background: var(--md-surface);
36+
border-radius: 1rem;
37+
display: grid;
38+
grid-template-columns: 1fr auto auto 1fr;
39+
grid-template-rows: 1fr auto 1fr;
2940
}
3041

3142
#shadowban-scanner-installed {
@@ -34,143 +45,90 @@ main {
3445

3546
h1 {
3647
line-height: 110%;
37-
font-size: 4rem;
38-
text-align: center;
39-
background: linear-gradient(to bottom, white, #a2a5b0);
40-
background-clip: border-box;
41-
background-clip: border-box;
42-
-webkit-background-clip: text;
43-
-webkit-text-fill-color: transparent;
48+
font-size: 2.5rem;
49+
}
50+
51+
#text-container {
52+
display: flex;
53+
flex-direction: column;
54+
align-items: flex-start;
55+
gap: 1rem;
56+
grid-column: 2;
57+
grid-row: 2;
4458
}
4559

46-
#text-container,
4760
#button-container {
4861
display: flex;
4962
flex-direction: column;
5063
justify-content: center;
64+
grid-column: 3;
65+
grid-row: 2;
5166
}
5267

5368
#instruction {
54-
text-align: center;
5569
font-size: 1.3rem;
5670
font-weight: bold;
71+
margin-top: 0.5rem;
5772
}
5873

5974
#settings-buttons {
60-
margin: 1rem 0;
61-
height: 100%;
62-
max-height: 20rem;
6375
display: flex;
64-
max-width: 50rem;
76+
flex-direction: column;
6577
gap: 1rem;
78+
margin-top: 1rem;
6679
}
6780

68-
.settings-button-item {
69-
--button-margin: 1rem;
70-
--button-padding: 0.5rem;
71-
--button-default-border-width: 0.1rem;
72-
73-
width: calc(100% - var(--button-margin) * 2);
74-
background: rgb(255, 255, 255, 20%);
75-
backdrop-filter: blur(3rem);
76-
border-radius: 0.5rem;
77-
border: var(--button-default-border-width) solid rgb(255, 255, 255, 30%);
81+
.settings-button-item label {
7882
cursor: pointer;
79-
color: white;
80-
font-size: 1.5rem;
81-
font-weight: bold;
82-
padding: var(--button-padding);
83-
transition:
84-
background 0.3s,
85-
transform 0.3s,
86-
border-color 0.3s;
87-
aspect-ratio: 1 / 1;
8883
}
8984

9085
@media (orientation: portrait) {
91-
h1 {
92-
font-size: 3rem;
93-
margin-top: 1rem;
86+
#logo {
87+
height: 1.5rem;
9488
}
9589

96-
body {
97-
height: max-content;
90+
h1 {
91+
font-size: 1.75rem;
92+
margin-top: 1rem;
9893
}
9994

10095
main {
101-
min-height: 100%;
102-
max-width: 100%;
10396
width: 100%;
97+
height: max-content;
98+
margin: 1rem;
99+
display: flex;
104100
flex-direction: column;
101+
padding: 1.5rem;
102+
gap: 2rem;
105103
}
106104

107-
#shadowban-scanner-installed {
108-
font-size: 1rem;
105+
#text-container {
106+
align-items: center;
107+
gap: 0;
109108
}
110109

111-
#settings-buttons {
112-
max-height: none;
113-
margin: 2rem 0;
114-
max-width: 100%;
115-
flex-direction: column;
110+
#instruction {
111+
font-size: 1.1rem;
112+
font-weight: normal;
116113
}
117114

118-
.settings-button-item {
119-
width: 100%;
115+
#button-container {
116+
grid-column: 2;
117+
grid-row: 3;
120118
}
121-
}
122-
123-
.settings-button-item:hover,
124-
.settings-button-item:focus {
125-
background: rgb(255, 255, 255, 30%);
126-
border-color: rgb(255, 255, 255, 40%);
127-
transform: scale(1.01);
128-
}
129119

130-
.settings-button-item.selected {
131-
--button-selected-border-width: 0.3rem;
132-
border: solid var(--button-selected-border-width) #bedfec;
133-
padding: calc(var(--button-padding) - var(--button-selected-border-width) + var(--button-default-border-width));
120+
#shadowban-scanner-installed {
121+
font-size: 1rem;
122+
}
134123
}
135124

136-
.settings-button-item img {
137-
display: block;
138-
margin: auto;
139-
height: 50%;
140-
width: auto;
141-
max-width: 100%;
142-
filter: invert();
125+
md-list-item {
126+
--md-list-item-label-text-color: var(--md-on-surface);
143127
}
144128

145129
#navigation-buttons {
146130
display: flex;
147131
justify-content: flex-end;
148132
gap: 1rem;
149-
margin-top: 1rem;
150-
}
151-
152-
.basic-secondary-button,
153-
.basic-primary-button {
154-
cursor: pointer;
155-
color: white;
156-
font-size: 100%;
157-
padding: 0.5em 2em;
158-
border-radius: 2em;
159-
}
160-
161-
.basic-secondary-button:disabled,
162-
.basic-primary-button:disabled {
163-
opacity: 0.5;
164-
cursor: not-allowed;
165-
}
166-
167-
.basic-secondary-button {
168-
background: rgba(255, 255, 255, 0.2);
169-
border: 0.1rem solid rgba(255, 255, 255, 0.2);
170-
}
171-
172-
.basic-primary-button {
173-
background: white;
174-
color: #333;
175-
border: none;
133+
margin-top: 2rem;
176134
}

src/css/theme.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:root {
22
--md-surface-container: #f2f3f6;
33
--md-surface: white;
4+
--md-sys-color-surface: var(--md-surface);
45
--md-surface-variant: #fafafc;
56
--md-on-surface: #36373a;
67
--md-on-surface-variant: #768098;

src/html/initialSetup.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@
1010
<body>
1111
<main>
1212
<div id="text-container">
13-
<div id="shadowban-scanner-installed" data-sb-translation="shadowbanScannerHasBeenInstalled"></div>
13+
<img src="../image/logo.svg" alt="Shadowban Scanner Icon" id="logo" />
1414
<h1 data-sb-translation="letsStartWithASimpleInitialSetup"></h1>
1515
</div>
1616
<div id="button-container">
1717
<div id="instruction" data-sb-translation="pleaseSelectOneOfThem"></div>
18-
<div id="settings-buttons">
19-
<!-- The contents of this element are dynamically generated. -->
20-
</div>
18+
<form id="settings-buttons">
19+
<md-list>
20+
<!-- The contents of this element are dynamically generated. -->
21+
</md-list>
22+
</form>
2123
<div id="navigation-buttons">
22-
<button id="back-button" class="basic-secondary-button" data-sb-translation="back"></button>
23-
<button id="next-button" class="basic-primary-button" data-sb-translation="next"></button>
24+
<md-text-button id="back-button" data-sb-translation="back"></md-text-button>
25+
<md-filled-button id="next-button" data-sb-translation="next"></md-filled-button>
2426
</div>
2527
</div>
2628
</main>

src/image/materialSymbols/close.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/image/materialSymbols/done_all.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/image/materialSymbols/group.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)