Merge pull request #58 from imsyy/dev

fix 当域名较长时样式出现错误
This commit is contained in:
底层用户 2023-02-01 20:18:12 +08:00 committed by GitHub
commit 50adca44e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 110 additions and 29 deletions

2
.env
View File

@ -10,7 +10,7 @@ VITE_DESC_HELLO_OTHER = "Oops !"
VITE_DESC_TEXT_OTHER = "哎呀,这都被你发现了( 再点击一次可关闭 " VITE_DESC_TEXT_OTHER = "哎呀,这都被你发现了( 再点击一次可关闭 "
# 社交链接 # 社交链接
## 请在目录下的 socialLinks.json 文件中配置 ## 请在 public 目录下的 socialLinks.json 文件中配置
# 网站链接 # 网站链接
## 请在 src/components/Links/index.vue 文件中配置 ## 请在 src/components/Links/index.vue 文件中配置

View File

@ -4,7 +4,7 @@
"github": "https://github.com/imsyy/home", "github": "https://github.com/imsyy/home",
"home": "https://imsyy.top", "home": "https://imsyy.top",
"private": true, "private": true,
"version": "4.0.1", "version": "4.0.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@ -12,7 +12,7 @@
"name": "QQ", "name": "QQ",
"icon": "/images/icon/qq.png", "icon": "/images/icon/qq.png",
"tip": "有什么事吗", "tip": "有什么事吗",
"url": "https://wpa.qq.com/msgrd?v=3&uin=1539250352&site=qq&menu=yes" "url": "https://res.abeim.cn/api/qq/?qq=1539250352"
}, { }, {
"name": "Email", "name": "Email",
"icon": "/images/icon/email.png", "icon": "/images/icon/email.png",

View File

@ -41,6 +41,7 @@ import {
} from "@vicons/fa"; } from "@vicons/fa";
// //
// 6
let linksData = [ let linksData = [
{ {
icon: Blog, icon: Blog,

View File

@ -4,7 +4,7 @@
<!-- Logo --> <!-- Logo -->
<div class="logo"> <div class="logo">
<img class="logo-img" :src="siteLogo" alt="logo" /> <img class="logo-img" :src="siteLogo" alt="logo" />
<div class="name"> <div class="name text-hidden">
<span class="bg">{{ siteUrl[0] }}</span> <span class="bg">{{ siteUrl[0] }}</span>
<span class="sm">.{{ siteUrl[1] }}</span> <span class="sm">.{{ siteUrl[1] }}</span>
</div> </div>
@ -91,6 +91,7 @@ watch(
} }
.name { .name {
width: 100%; width: 100%;
height: 142px;
margin-left: 12px; margin-left: 12px;
transform: translateY(-8px); transform: translateY(-8px);
font-family: "Pacifico-Regular"; font-family: "Pacifico-Regular";
@ -112,6 +113,7 @@ watch(
width: 100px; width: 100px;
} }
.name { .name {
height: 128px;
.bg { .bg {
font-size: 4.5rem; font-size: 4.5rem;
} }
@ -151,5 +153,28 @@ watch(
pointer-events: none; pointer-events: none;
} }
} }
@media (max-width: 390px) {
.logo {
flex-direction: column;
.logo-img {
display: none;
}
.name {
margin-left: 0;
height: auto;
transform: none;
text-align: center;
.bg {
font-size: 3.5rem;
}
.sm {
font-size: 1.4rem;
}
}
}
.description {
margin-top: 2.5rem;
}
}
} }
</style> </style>

View File

@ -65,6 +65,7 @@ onMounted(() => {
backdrop-filter: blur(0); backdrop-filter: blur(0);
animation: fade; animation: fade;
-webkit-animation: fade 0.5s; -webkit-animation: fade 0.5s;
transition: all 0.5s;
@media (max-width: 840px) { @media (max-width: 840px) {
max-width: 100%; max-width: 100%;
justify-content: center; justify-content: center;
@ -95,7 +96,10 @@ onMounted(() => {
.tip { .tip {
display: none; display: none;
margin-right: 12px; margin-right: 12px;
animation: fade;
-webkit-animation: fade 0.5s;
} }
@media (min-width: 768px) {
&:hover { &:hover {
background-color: #00000040; background-color: #00000040;
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
@ -104,4 +108,5 @@ onMounted(() => {
} }
} }
} }
}
</style> </style>

View File

@ -76,6 +76,13 @@ p {
transform: scale(0.98); transform: scale(0.98);
} }
// 文字超出
.text-hidden {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
// 弹窗样式 // 弹窗样式
.el-message { .el-message {
--el-message-bg-color: #00000040 !important; --el-message-bg-color: #00000040 !important;

View File

@ -14,7 +14,8 @@ const store = mainStore();
<style lang="scss" scoped> <style lang="scss" scoped>
.left { .left {
flex: 1 0 0%; // flex: 1 0 0%;
width: 50%;
margin-right: 10px; margin-right: 10px;
transform: translateY(20px); transform: translateY(20px);
&.hidden { &.hidden {
@ -22,6 +23,7 @@ const store = mainStore();
} }
@media (max-width: 720px) { @media (max-width: 720px) {
margin-right: 0; margin-right: 0;
width: 100%;
} }
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="store.mobileOpenState ? 'right' : 'right hidden'"> <div :class="store.mobileOpenState ? 'right' : 'right hidden'">
<!-- 移动端 Logo --> <!-- 移动端 Logo -->
<div class="logo" @click="store.mobileFuncState = !store.mobileFuncState"> <div class="logo text-hidden" @click="store.mobileFuncState = !store.mobileFuncState">
<span class="bg">{{ siteUrl[0] }}</span> <span class="bg">{{ siteUrl[0] }}</span>
<span class="sm">.{{ siteUrl[1] }}</span> <span class="sm">.{{ siteUrl[1] }}</span>
</div> </div>
@ -26,16 +26,17 @@ let siteUrl = import.meta.env.VITE_SITE_URL.split(".");
<style lang="scss" scoped> <style lang="scss" scoped>
.right { .right {
flex: 1 0 0%; // flex: 1 0 0%;
width: 50%;
margin-left: 0.75rem; margin-left: 0.75rem;
.logo { .logo {
width: 80%;
font-family: "Pacifico-Regular"; font-family: "Pacifico-Regular";
font-size: 1.75rem; font-size: 1.75rem;
position: fixed; position: fixed;
width: 140px; top: 6%;
text-align: center; left: 50%;
top: 8%; transform: translateX(-50%);
left: calc(50% - 70px);
transition: all 0.3s; transition: all 0.3s;
animation: fade; animation: fade;
-webkit-animation: fade 0.5s; -webkit-animation: fade 0.5s;
@ -48,6 +49,7 @@ let siteUrl = import.meta.env.VITE_SITE_URL.split(".");
} }
@media (max-width: 720px) { @media (max-width: 720px) {
margin-left: 0; margin-left: 0;
width: 100%;
&.hidden { &.hidden {
display: none; display: none;
} }

View File

@ -1,19 +1,39 @@
<template> <template>
<div class="set" @mouseenter="closeShow = true" @mouseleave="closeShow = false" @click.stop> <div
class="set"
@mouseenter="closeShow = true"
@mouseleave="closeShow = false"
@click.stop
>
<transition name="el-fade-in-linear"> <transition name="el-fade-in-linear">
<close-one class="close" theme="filled" size="28" fill="#ffffff60" v-show="closeShow" <close-one
@click="store.setOpenState = false" /> class="close"
theme="filled"
size="28"
fill="#ffffff60"
v-show="closeShow"
@click="store.setOpenState = false"
/>
</transition> </transition>
<el-row :gutter="40"> <el-row :gutter="40">
<el-col :span="12" class="left"> <el-col :span="12" class="left">
<div class="logo"> <div class="logo text-hidden">
<span class="bg">{{ siteUrl[0] }}</span> <span class="bg">{{ siteUrl[0] }}</span>
<span class="sm">.{{ siteUrl[1] }}</span> <span class="sm">.{{ siteUrl[1] }}</span>
</div> </div>
<div class="version"> <div class="version">
<div class="num">v&nbsp;{{ config.version }}</div> <div class="num">v&nbsp;{{ config.version }}</div>
<el-tooltip content="Github 源代码仓库" placement="right" :show-arrow="false"> <el-tooltip
<github-one class="github" theme="outline" size="24" @click="jumpTo(config.github)" /> content="Github 源代码仓库"
placement="right"
:show-arrow="false"
>
<github-one
class="github"
theme="outline"
size="24"
@click="jumpTo(config.github)"
/>
</el-tooltip> </el-tooltip>
</div> </div>
<el-card class="update"> <el-card class="update">
@ -47,10 +67,16 @@
<script setup> <script setup>
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { CloseOne, SettingTwo, GithubOne, AddOne, Bug } from "@icon-park/vue-next"; import {
CloseOne,
SettingTwo,
GithubOne,
AddOne,
Bug,
} from "@icon-park/vue-next";
import { mainStore } from "@/store"; import { mainStore } from "@/store";
import Set from "@/components/Set/index.vue"; import Set from "@/components/Set/index.vue";
import config from '@/../package.json'; import config from "@/../package.json";
const store = mainStore(); const store = mainStore();
let closeShow = ref(false); let closeShow = ref(false);
@ -60,9 +86,19 @@ let siteUrl = import.meta.env.VITE_SITE_URL.split(".");
// //
let upData = reactive({ let upData = reactive({
new: ["采用 Vue 进行重构", "音乐歌单支持快速自定义", "壁纸支持个性化设置", "音乐播放器支持音量控制"], new: [
fix: ["修复天气 API", "时光胶囊显示错误", "移动端动画及细节", "图标更换为 IconPark"], "采用 Vue 进行重构",
}) "音乐歌单支持快速自定义",
"壁纸支持个性化设置",
"音乐播放器支持音量控制",
],
fix: [
"修复天气 API",
"时光胶囊显示错误",
"移动端动画及细节",
"图标更换为 IconPark",
],
});
// //
const jumpTo = (url) => { const jumpTo = (url) => {
@ -115,6 +151,8 @@ const jumpTo = (url) => {
transform: translateY(-8%); transform: translateY(-8%);
font-family: "Pacifico-Regular"; font-family: "Pacifico-Regular";
// line-height: 5rem; // line-height: 5rem;
width: 100%;
height: 260px;
.bg { .bg {
font-size: 5rem; font-size: 5rem;
@ -133,7 +171,7 @@ const jumpTo = (url) => {
.num { .num {
font-size: 2rem; font-size: 2rem;
font-family: 'Pacifico-Regular'; font-family: "Pacifico-Regular";
} }
.github { .github {

View File

@ -42,7 +42,8 @@ export default ({
VitePWA({ VitePWA({
registerType: 'autoUpdate', registerType: 'autoUpdate',
devOptions: { devOptions: {
enabled: true enabled: true,
navigateFallbackAllowlist: [/^index.html$/]
}, },
workbox: { workbox: {
runtimeCaching: [{ runtimeCaching: [{