mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-17 01:30:44 +08:00
✨ 添加卡片与列表的切换设置,优化相关样式
This commit is contained in:
parent
9d301b9681
commit
efbf38738f
@ -5,12 +5,13 @@ window.$$nazhuaConfig = {
|
|||||||
// buyBtnText: '购买', // 购买按钮文案
|
// buyBtnText: '购买', // 购买按钮文案
|
||||||
// customBackgroundImage: '', // 自定义的背景图片地址
|
// customBackgroundImage: '', // 自定义的背景图片地址
|
||||||
// lightBackground: true, // 启用了浅色系背景图,会强制关闭点点背景
|
// lightBackground: true, // 启用了浅色系背景图,会强制关闭点点背景
|
||||||
|
// listServerItemTypeToggle: true, // 服务器列表项类型切换
|
||||||
// listServerItemType: 'row', // 服务器列表项类型 card/row row列表模式移动端自动切换至card
|
// listServerItemType: 'row', // 服务器列表项类型 card/row row列表模式移动端自动切换至card
|
||||||
// listServerStatusType: 'progress', // 服务器状态类型--列表
|
// listServerStatusType: 'progress', // 服务器状态类型--列表
|
||||||
// listServerRealTimeShowLoad: false, // 列表显示服务器实时负载
|
// listServerRealTimeShowLoad: false, // 列表显示服务器实时负载
|
||||||
// detailServerStatusType: 'progress', // 服务器状态类型--详情页
|
// detailServerStatusType: 'progress', // 服务器状态类型--详情页
|
||||||
// serverStatusLinear: true, // 服务器状态渐变线性显示
|
// serverStatusLinear: true, // 服务器状态渐变线性显示
|
||||||
// disableSarasaTermSC: false, // 禁用Sarasa Term SC字体
|
// disableSarasaTermSC: true, // 禁用Sarasa Term SC字体
|
||||||
// hideWorldMap: false, // 隐藏地图
|
// hideWorldMap: false, // 隐藏地图
|
||||||
// hideHomeWorldMap: false, // 隐藏首页地图
|
// hideHomeWorldMap: false, // 隐藏首页地图
|
||||||
// hideDetailWorldMap: false, // 隐藏详情地图
|
// hideDetailWorldMap: false, // 隐藏详情地图
|
||||||
|
|||||||
@ -335,6 +335,10 @@ const dashboardUrl = computed(() => config.nazhua.v1DashboardUrl || '/dashboard'
|
|||||||
color: #ddd;
|
color: #ddd;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
&.server-count--total {
|
&.server-count--total {
|
||||||
.value {
|
.value {
|
||||||
color: #70f3ff;
|
color: #70f3ff;
|
||||||
|
|||||||
@ -212,6 +212,9 @@
|
|||||||
v-for="(tag, index) in tagList"
|
v-for="(tag, index) in tagList"
|
||||||
:key="`${tag}_${index}`"
|
:key="`${tag}_${index}`"
|
||||||
class="server-info-tag-item"
|
class="server-info-tag-item"
|
||||||
|
:class="{
|
||||||
|
'has-sarasa-term': $hasSarasaTerm && config.nazhua.disableSarasaTermSC !== true,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
{{ tag }}
|
{{ tag }}
|
||||||
</span>
|
</span>
|
||||||
@ -605,12 +608,16 @@ const processCount = computed(() => props.info?.State?.ProcessCount);
|
|||||||
.server-info-tag-item {
|
.server-info-tag-item {
|
||||||
height: 18px;
|
height: 18px;
|
||||||
padding: 0 5px 0 6px;
|
padding: 0 5px 0 6px;
|
||||||
line-height: 20px;
|
line-height: 18px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--public-note-tag-color);
|
color: var(--public-note-tag-color);
|
||||||
background: var(--public-note-tag-bg);
|
background: var(--public-note-tag-bg);
|
||||||
text-shadow: 1px 1px 2px rgba(#000, 0.2);
|
text-shadow: 1px 1px 2px rgba(#000, 0.2);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
||||||
|
&.has-sarasa-term {
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
:key="`${tagItem}_${index}`"
|
:key="`${tagItem}_${index}`"
|
||||||
class="tag-item"
|
class="tag-item"
|
||||||
:class="{
|
:class="{
|
||||||
'has-sarasa-term': $hasSarasaTerm,
|
'has-sarasa-term': $hasSarasaTerm && config.nazhua.disableSarasaTermSC !== true,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ tagItem }}
|
{{ tagItem }}
|
||||||
|
|||||||
@ -156,6 +156,7 @@ function openDetail() {
|
|||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@ -90,6 +90,7 @@ defineProps({
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--list-gap-size);
|
gap: var(--list-gap-size);
|
||||||
width: var(--list-container-width);
|
width: var(--list-container-width);
|
||||||
|
padding: 0 var(--list-padding);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,12 +10,22 @@
|
|||||||
:key="item.key"
|
:key="item.key"
|
||||||
class="server-option-item"
|
class="server-option-item"
|
||||||
:class="{
|
:class="{
|
||||||
|
'has-icon': item.icon,
|
||||||
active: activeValue === item.value,
|
active: activeValue === item.value,
|
||||||
}"
|
}"
|
||||||
:title="item?.title || false"
|
:title="item?.title || false"
|
||||||
@click="toggleModelValue(item)"
|
@click="toggleModelValue(item)"
|
||||||
>
|
>
|
||||||
<span class="option-label">{{ item.label }}</span>
|
<i
|
||||||
|
v-if="item.icon"
|
||||||
|
class="option-icon"
|
||||||
|
:class="item.icon"
|
||||||
|
:title="item.label"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="option-label"
|
||||||
|
>{{ item.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -85,13 +95,28 @@ function toggleModelValue(item) {
|
|||||||
background: rgba(#000, 0.3);
|
background: rgba(#000, 0.3);
|
||||||
transition: all 0.3s linear;
|
transition: all 0.3s linear;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.has-icon {
|
||||||
|
padding: 0 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 768px) {
|
||||||
|
height: 30px;
|
||||||
|
padding: 0 10px;
|
||||||
|
border-radius: 3px;
|
||||||
background-color: rgba(#000, 0.8);
|
background-color: rgba(#000, 0.8);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.option-icon {
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.option-label {
|
.option-label {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
transition: all 0.3s linear;
|
transition: all 0.3s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,12 @@
|
|||||||
v-model="filterFormData.online"
|
v-model="filterFormData.online"
|
||||||
:options="onlineOptions"
|
:options="onlineOptions"
|
||||||
/>
|
/>
|
||||||
|
<server-option-box
|
||||||
|
v-if="config.nazhua.listServerItemTypeToggle"
|
||||||
|
v-model="listType"
|
||||||
|
:options="listTypeOptions"
|
||||||
|
:accpet-empty="false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<server-list-warp
|
<server-list-warp
|
||||||
@ -97,6 +103,8 @@ const store = useStore();
|
|||||||
const worldMapWidth = ref();
|
const worldMapWidth = ref();
|
||||||
const windowWidth = ref(window.innerWidth);
|
const windowWidth = ref(window.innerWidth);
|
||||||
|
|
||||||
|
const listType = ref(config.nazhua.listServerItemType || 'card');
|
||||||
|
|
||||||
const showTransition = computed(() => {
|
const showTransition = computed(() => {
|
||||||
// 强制开启
|
// 强制开启
|
||||||
if (config.nazhua.forceTransition) {
|
if (config.nazhua.forceTransition) {
|
||||||
@ -107,12 +115,18 @@ const showTransition = computed(() => {
|
|||||||
});
|
});
|
||||||
const showListRow = computed(() => {
|
const showListRow = computed(() => {
|
||||||
if (windowWidth.value > 1024) {
|
if (windowWidth.value > 1024) {
|
||||||
|
if (config.nazhua.listServerItemTypeToggle) {
|
||||||
|
return listType.value === 'row';
|
||||||
|
}
|
||||||
return config.nazhua.listServerItemType === 'row';
|
return config.nazhua.listServerItemType === 'row';
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
const showListCard = computed(() => {
|
const showListCard = computed(() => {
|
||||||
if (windowWidth.value > 1024) {
|
if (windowWidth.value > 1024) {
|
||||||
|
if (config.nazhua.listServerItemTypeToggle) {
|
||||||
|
return listType.value !== 'row';
|
||||||
|
}
|
||||||
return config.nazhua.listServerItemType !== 'row';
|
return config.nazhua.listServerItemType !== 'row';
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -164,6 +178,18 @@ const onlineOptions = computed(() => {
|
|||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const listTypeOptions = computed(() => [{
|
||||||
|
key: 'card',
|
||||||
|
label: '卡片',
|
||||||
|
value: 'card',
|
||||||
|
icon: 'ri-gallery-view-2',
|
||||||
|
}, {
|
||||||
|
key: 'row',
|
||||||
|
label: '列表',
|
||||||
|
value: 'row',
|
||||||
|
icon: 'ri-list-view',
|
||||||
|
}]);
|
||||||
|
|
||||||
const filterServerList = computed(() => {
|
const filterServerList = computed(() => {
|
||||||
const fields = {};
|
const fields = {};
|
||||||
const locationMap = {};
|
const locationMap = {};
|
||||||
@ -334,10 +360,15 @@ onActivated(() => {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 10px 20px;
|
gap: 10px 20px;
|
||||||
width: var(--list-container-width);
|
width: var(--list-container-width);
|
||||||
|
padding: 0 20px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
&.list-is-card {
|
.left-box {
|
||||||
padding: 0 20px;
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-box {
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user