GeezerVison is showing github.com — feat: Pro版本更新4.4.9,修复一些问题。 · pigadmin/SKRoot-linuxKernelRoot@4aeaec0
File tree
Expand file treeCollapse file tree
Open diff view settings
Pro(众测开放中)/src/testModule/module_hide_data_dir/webroot
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/testModule/module_hide_data_dir/webroot/main.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ const $btnOpenAdd = document.getElementById('btnOpenAdd'); |
15 | 15 | const $sheetLayer = document.getElementById('sheetLayer'); |
16 | 16 | const $sheetBackdrop = document.getElementById('sheetBackdrop'); |
17 | 17 | const $btnCloseSheet = document.getElementById('btnCloseSheet'); |
| 18 | +const $modeSwitch = document.querySelector('.mode-switch'); |
18 | 19 | const $modeButtons = Array.from(document.querySelectorAll('.mode-option')); |
19 | 20 | const $inputLabel = document.getElementById('inputLabel'); |
20 | 21 | const $ruleInput = document.getElementById('ruleInput'); |
@@ -242,6 +243,8 @@ function setMode(mode) { |
242 | 243 | clearError(); |
243 | 244 | $ruleInput.value = ''; |
244 | 245 |
|
| 246 | + $modeSwitch.classList.toggle('path-active', mode === RULE_TYPE.PATH); |
| 247 | + |
245 | 248 | $modeButtons.forEach(button => { |
246 | 249 | const active = button.dataset.mode === mode; |
247 | 250 | button.classList.toggle('active', active); |
|
Collapse file
Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/testModule/module_hide_data_dir/webroot/style.css +24-3Lines changed: 24 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -406,16 +406,39 @@ body.sheet-open { |
406 | 406 | } |
407 | 407 |
|
408 | 408 | .mode-switch { |
| 409 | + position: relative; |
409 | 410 | display: grid; |
410 | 411 | grid-template-columns: 1fr 1fr; |
411 | 412 | gap: 6px; |
412 | 413 | margin-top: 14px; |
413 | 414 | padding: 4px; |
| 415 | + overflow: hidden; |
414 | 416 | background: #f1f3f7; |
415 | 417 | border-radius: 14px; |
416 | 418 | } |
417 | 419 |
|
| 420 | +/* 选中项底部滑块:从左向右平移,而不是切换背景淡入淡出 */ |
| 421 | +.mode-switch::before { |
| 422 | + position: absolute; |
| 423 | + top: 4px; |
| 424 | + bottom: 4px; |
| 425 | + left: 4px; |
| 426 | + width: calc((100% - 14px) / 2); |
| 427 | + content: ""; |
| 428 | + background: #fff; |
| 429 | + border-radius: 11px; |
| 430 | + box-shadow: 0 2px 8px rgba(15, 23, 42, .10); |
| 431 | + transform: translateX(0); |
| 432 | + transition: transform .28s cubic-bezier(.22, .82, .28, 1); |
| 433 | +} |
| 434 | + |
| 435 | +.mode-switch.path-active::before { |
| 436 | + transform: translateX(calc(100% + 6px)); |
| 437 | +} |
| 438 | + |
418 | 439 | .mode-option { |
| 440 | + position: relative; |
| 441 | + z-index: 1; |
419 | 442 | display: flex; |
420 | 443 | min-width: 0; |
421 | 444 | height: 58px; |
@@ -429,13 +452,11 @@ body.sheet-open { |
429 | 452 | border: 0; |
430 | 453 | border-radius: 11px; |
431 | 454 | text-align: center; |
432 | | - transition: color .16s ease, background .16s ease, box-shadow .16s ease; |
| 455 | + transition: color .18s ease; |
433 | 456 | } |
434 | 457 |
|
435 | 458 | .mode-option.active { |
436 | 459 | color: var(--text); |
437 | | - background: #fff; |
438 | | - box-shadow: 0 2px 8px rgba(15, 23, 42, .10); |
439 | 460 | } |
440 | 461 |
|
441 | 462 | .mode-title { |
|