Skip to content

Commit c54cb48

Browse files
committed
webui: fix some issue
fab position in rtl language, some styling issue
1 parent 2c436bb commit c54cb48

4 files changed

Lines changed: 40 additions & 15 deletions

File tree

webui/index.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@
135135
<div class="module-list content-padding fab-padding" id="kpm-list"></div>
136136
<div class="empty-list" id="kpm-empty-msg" data-i18n="msg_no_module_loaded">No module loaded</div>
137137
</div>
138-
<md-fab variant="primary" aria-label="load" id="load">
139-
<md-icon slot="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"/></svg></md-icon>
140-
</md-fab>
138+
<div class="fab-container">
139+
<md-fab variant="primary" aria-label="load" id="load">
140+
<md-icon slot="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"/></svg></md-icon>
141+
</md-fab>
142+
</div>
141143
</div>
142144
<!-- Exclude -->
143145
<div id="exclude-page" class="page">
@@ -153,7 +155,9 @@
153155
<div class="list-item" id="clear-superkey">
154156
<md-ripple></md-ripple>
155157
<md-icon><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M280-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 120q-100 0-170-70T40-480q0-100 70-170t170-70q81 0 141.5 46T506-560h335l79 79-140 160-100-79-80 80-80-80h-14q-25 72-87 116t-139 44Z" /></svg></md-icon>
156-
<div slot="headline" data-i18n="title_clear_superkey">Clear SuperKey</div>
158+
<div class="list-item-content">
159+
<div slot="headline" data-i18n="title_clear_superkey">Clear SuperKey</div>
160+
</div>
157161
</div>
158162
<div class="list-item" id="language">
159163
<md-ripple></md-ripple>
@@ -202,9 +206,11 @@
202206
<div class="output-terminal content-padding" id="patch-terminal"></div>
203207
<div class="keyboard-inset" id="patch-keyboard-inset"></div>
204208
</div>
205-
<md-fab variant="primary" class="hide" aria-label="reboot" id="reboot-fab">
206-
<md-icon slot="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M480-80q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-440h80q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440q0-117-81.5-198.5T480-720h-6l62 62-56 58-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-440q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80Z"/></svg></md-icon>
207-
</md-fab>
209+
<div class="fab-container">
210+
<md-fab variant="primary" aria-label="reboot" id="reboot-fab">
211+
<md-icon slot="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M480-80q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-440h80q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440q0-117-81.5-198.5T480-720h-6l62 62-56 58-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-440q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80Z"/></svg></md-icon>
212+
</md-fab>
213+
</div>
208214
</div>
209215
</div>
210216

webui/language.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ async function generateLanguageMenu() {
183183
const radio = label.querySelector('md-radio');
184184

185185
const currentLang = localStorage.getItem('kp-next_language') || 'default';
186-
if (currentLang === lang) radio.checked = true;
186+
if (currentLang === lang) {
187+
radio.checked = true;
188+
document.getElementById('current-language').textContent = name;
189+
}
187190

188191
radio.addEventListener('change', () => {
189192
if (radio.checked) setLanguage(lang);

webui/public/locales/strings/zh-CN.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<string name="info_version">版本: %1$s</string>
5454
<string name="info_time">时间: %1$s</string>
5555
<string name="info_config">配置: %1$s</string>
56-
<string name="info_slot">插槽: %1$s</string>
56+
<string name="info_slot">槽位: %1$s</string>
5757
<string name="info_device">设备: %1$s</string>
5858
<string name="info_device_unknown">设备: 未知</string>
5959
<string name="info_author">作者: %1$s</string>

webui/styles.css

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,24 @@ body {
339339
color: var(--md-sys-color-on-surface-variant);
340340
}
341341

342-
md-fab {
342+
.fab-container {
343343
position: absolute;
344-
bottom: 16px;
345-
right: 16px;
344+
bottom: 0;
345+
left: 0;
346+
padding: 16px;
347+
box-sizing: border-box;
348+
width: 100%;
349+
display: flex;
350+
justify-content: flex-end;
351+
pointer-events: none;
352+
z-index: 1;
353+
}
354+
355+
md-fab {
346356
transform: scale(1);
347357
opacity: 1;
348358
transition: all 0.2s ease;
359+
pointer-events: auto;
349360
}
350361

351362
md-fab.hide,
@@ -388,22 +399,26 @@ md-outlined-text-field {
388399
align-items: center;
389400
position: relative;
390401
width: 100%;
391-
padding: 20px 16px;
402+
padding: 0 16px;
392403
box-sizing: border-box;
393404
}
394405

395406
.list-item-content {
396407
display: flex;
397408
flex-direction: column;
409+
justify-content: center;
398410
flex-grow: 1;
411+
min-height: 64px;
412+
padding: 8px 0;
413+
box-sizing: border-box;
399414
}
400415

401416
.list-item-content [slot="headline"] {
402417
font-size: 1.1em;
403418
}
404419

405420
.list-item-content [slot="detail"] {
406-
font-size: 0.9em;
421+
font-size: 0.8em;
407422
color: var(--md-sys-color-outline);
408423
}
409424

@@ -450,7 +465,8 @@ md-menu-item label {
450465

451466
.icon-container {
452467
position: relative;
453-
padding: 12px 4px;
468+
padding: 4px;
469+
margin: 8px 0;
454470
width: 40px;
455471
height: 40px;
456472
flex-shrink: 0;

0 commit comments

Comments
 (0)