summaryrefslogtreecommitdiff
path: root/src/components/ConnectionTable.module.scss
diff options
context:
space:
mode:
authorLarvan2 <[email protected]>2025-12-27 23:09:56 +0800
committerLarvan2 <[email protected]>2025-12-27 23:09:56 +0800
commite3f02d21a942dbab75a50bf91c9ed257b9d24971 (patch)
tree6c017fbaa70063406a9c296c37d0b7eabdcec90b /src/components/ConnectionTable.module.scss
parente041c1975376247a1d43b650e68289ec974a182c (diff)
chore: adjust style
Diffstat (limited to 'src/components/ConnectionTable.module.scss')
-rw-r--r--src/components/ConnectionTable.module.scss171
1 files changed, 153 insertions, 18 deletions
diff --git a/src/components/ConnectionTable.module.scss b/src/components/ConnectionTable.module.scss
index 1f1a48c..1a47c81 100644
--- a/src/components/ConnectionTable.module.scss
+++ b/src/components/ConnectionTable.module.scss
@@ -1,18 +1,34 @@
.tr {
- // display: flex;
- // align-items: center;
- // justify-content: flex-start;
- /* grid-template-columns: repeat(11, minmax(max-content, 1fr)); */
- // grid-template-columns: repeat(13, minmax(max-content, auto));
+ transition: all 0.2s ease;
+ cursor: pointer;
+
+ &:hover {
+ // hover 作用到每个 td,避免 odd 行背景覆盖
+ .td {
+ background: rgba(66, 133, 244, 0.08);
+ }
+
+ .odd {
+ background: rgba(66, 133, 244, 0.08);
+ }
+ }
}
.th {
- height: 50px;
+ height: 48px;
background: var(--color-background);
top: 0;
- font-size: 1em;
+ font-size: 0.85em;
+ font-weight: 600;
user-select: none;
text-align: center;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ color: var(--color-text-secondary);
+ border-bottom: 2px solid var(--bg-near-transparent);
+ position: sticky;
+ z-index: 20;
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
&:hover {
color: var(--color-text-highlight);
@@ -33,15 +49,15 @@
}
.td {
- /* 上边下边 | 左边右边 */
- padding: 10px 5px;
- font-size: 0.9em;
- // max-width: 14em;
+ padding: 12px 8px;
+ font-size: 0.875em;
min-width: 9em;
- cursor: default;
+ cursor: pointer;
text-align: left;
vertical-align: middle;
white-space: nowrap;
+ border-bottom: 1px solid var(--bg-near-transparent);
+ transition: color 0.15s ease;
&:hover {
color: var(--color-text-highlight);
@@ -56,11 +72,127 @@
.modal {
background-color: var(--bg-modal);
- // color: var(--color-text);
}
.table {
- border-collapse: collapse;
+ border-collapse: separate;
+ border-spacing: 0;
+ width: 100%;
+ background: var(--color-background);
+
+ @media (max-width: 768px) {
+ display: none;
+ }
+}
+
+.tableWrapper {
+ margin-top: 6px;
+ border-radius: 12px;
+ overflow: visible; // sticky 需要避免中间层成为 scroll container
+ background: var(--color-background);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+
+ @media (max-width: 768px) {
+ background: transparent;
+ box-shadow: none;
+ }
+}
+
+.cardsView {
+ display: none;
+
+ @media (max-width: 768px) {
+ display: block;
+ padding: 0 4px;
+ }
+}
+
+.mobileSortToolbar {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 0;
+ margin-bottom: 20px;
+}
+
+.sortSelectWrapper {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex: 1;
+ background: var(--color-bg-card);
+ padding: 10px 16px;
+ border-radius: 12px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ color: var(--color-focus-blue);
+ position: relative;
+ border: 1px solid var(--color-bg-card-border, rgba(0, 0, 0, 0.05));
+
+ select {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ cursor: pointer;
+ z-index: 2;
+ }
+
+ .selectedValue {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 0.95rem;
+ font-weight: 600;
+ color: var(--color-text);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+}
+
+.selectArrow {
+ opacity: 0.5;
+ color: var(--color-text-secondary);
+ flex-shrink: 0;
+}
+
+.sortDirBtn {
+ background: var(--color-bg-card);
+ border: 1px solid var(--color-bg-card-border, rgba(0, 0, 0, 0.05));
+ color: var(--color-focus-blue);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 44px;
+ height: 44px;
+ border-radius: 12px;
+ cursor: pointer;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
+ transition: all 0.2s ease;
+
+ &:active {
+ transform: scale(0.95);
+ background: var(--color-bg-secondary);
+ }
+}
+
+.table thead tr:first-child th:first-child {
+ border-top-left-radius: 12px;
+}
+
+.table thead tr:first-child th:last-child {
+ border-top-right-radius: 12px;
+}
+
+.table tbody tr:last-child td:first-child {
+ border-bottom-left-radius: 12px;
+}
+
+.table tbody tr:last-child td:last-child {
+ border-bottom-right-radius: 12px;
}
.td.odd {
@@ -74,10 +206,13 @@
}
.sortIconContainer {
- float: right;
- // margin-left: 0.5em;
- width: 1em;
- height: 1em;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ margin-left: 4px;
+ width: 16px;
+ height: 16px;
+ opacity: 0.7;
}
.rotate180 {