Merge pull request #50 from Aewait/master

env新增站点logo设置,社交链接添加gitee
This commit is contained in:
底层用户 2023-01-30 11:17:24 +08:00 committed by GitHub
commit d5fc31ee83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 93 deletions

2
.env
View File

@ -1,6 +1,7 @@
# 站点名称 # 站点名称
VITE_SITE_NAME = "無名の主页" VITE_SITE_NAME = "無名の主页"
VITE_SITE_URL = "imsyy.top" VITE_SITE_URL = "imsyy.top"
VITE_SITE_LOGO = "/images/icon/logo.png"
# 简介文本 # 简介文本
VITE_DESC_HELLO = "Hello World !" VITE_DESC_HELLO = "Hello World !"
@ -10,6 +11,7 @@ VITE_DESC_TEXT_OTHER = "哎呀,这都被你发现了( 再点击一次可关
# 社交链接 # 社交链接
VITE_SOCIAL_GITHUB = "imsyy" VITE_SOCIAL_GITHUB = "imsyy"
VITE_SOCIAL_GITEE = "oschina"
VITE_SOCIAL_QQ = "1539250352" VITE_SOCIAL_QQ = "1539250352"
VITE_SOCIAL_EMAIL = "one@imsyy.top" VITE_SOCIAL_EMAIL = "one@imsyy.top"
VITE_SOCIAL_TELEGRAM = "bottom_user" VITE_SOCIAL_TELEGRAM = "bottom_user"

View File

@ -1,92 +1 @@
/** if(!self.define){let e,s={};const t=(t,i)=>(t=new URL(t+".js",i).href,s[t]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=s,document.head.appendChild(e)}else e=t,importScripts(t),s()})).then((()=>{let e=s[t];if(!e)throw new Error(`Module ${t} didnt register its module`);return e})));self.define=(i,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let r={};const c=e=>t(e,o),l={module:{uri:o},exports:r,require:c};s[o]=Promise.all(i.map((e=>l[e]||c(e)))).then((e=>(n(...e),r)))}}define(["./workbox-082d0e8a"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"3ca0b8505b4bec776b69afdba2768812"},{revision:null,url:"index.html"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{allowlist:[/^\/$/]})),e.registerRoute(/(.*?)\.(js|css|woff2|woff|ttf)/,new e.CacheFirst({cacheName:"js-css-cache",plugins:[]}),"GET"),e.registerRoute(/(.*?)\.(png|jpe?g|svg|gif|bmp|psd|tiff|tga|eps)/,new e.CacheFirst({cacheName:"image-cache",plugins:[]}),"GET")}));
* Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// If the loader is already loaded, just stop.
if (!self.define) {
let registry = {};
// Used for `eval` and `importScripts` where we can't get script URL by other means.
// In both cases, it's safe to use a global var because those functions are synchronous.
let nextDefineUri;
const singleRequire = (uri, parentUri) => {
uri = new URL(uri + ".js", parentUri).href;
return registry[uri] || (
new Promise(resolve => {
if ("document" in self) {
const script = document.createElement("script");
script.src = uri;
script.onload = resolve;
document.head.appendChild(script);
} else {
nextDefineUri = uri;
importScripts(uri);
resolve();
}
})
.then(() => {
let promise = registry[uri];
if (!promise) {
throw new Error(`Module ${uri} didnt register its module`);
}
return promise;
})
);
};
self.define = (depsNames, factory) => {
const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
if (registry[uri]) {
// Module is already loading or loaded.
return;
}
let exports = {};
const require = depUri => singleRequire(depUri, uri);
const specialDeps = {
module: { uri },
exports,
require
};
registry[uri] = Promise.all(depsNames.map(
depName => specialDeps[depName] || require(depName)
)).then(deps => {
factory(...deps);
return exports;
});
};
}
define(['./workbox-148cb7e5'], (function (workbox) { 'use strict';
self.skipWaiting();
workbox.clientsClaim();
/**
* The precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
workbox.precacheAndRoute([{
"url": "registerSW.js",
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"revision": null,
"url": "index.html"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
allowlist: [/^\/$/]
}));
}));

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -3,7 +3,7 @@
<div class="message"> <div class="message">
<!-- Logo --> <!-- Logo -->
<div class="logo"> <div class="logo">
<img class="logo-img" src="/images/icon/logo.png" alt="logo" /> <img class="logo-img" :src="siteLogo" alt="logo" />
<div class="name"> <div class="name">
<span class="bg">{{ siteUrl[0] }}</span> <span class="bg">{{ siteUrl[0] }}</span>
<span class="sm">.{{ siteUrl[1] }}</span> <span class="sm">.{{ siteUrl[1] }}</span>
@ -35,6 +35,8 @@ import { Error } from "@icon-park/vue-next";
import { mainStore } from "@/store"; import { mainStore } from "@/store";
const store = mainStore(); const store = mainStore();
// logo
let siteLogo = import.meta.env.VITE_SITE_LOGO;
// //
let siteUrl = import.meta.env.VITE_SITE_URL.split("."); let siteUrl = import.meta.env.VITE_SITE_URL.split(".");

View File

@ -13,6 +13,17 @@
<Github /> <Github />
</Icon> </Icon>
</a> </a>
<a
id="gitee"
:href="socialLinks.gitee"
target="_blank"
@mouseenter="changeTip"
@mouseleave="leaveTip"
>
<span class="xicon" style="font-size: 24px;">
<img src="/images/icon/gitee.png" height="24"/>
</span>
</a>
<a <a
id="qq" id="qq"
:href="socialLinks.qq" :href="socialLinks.qq"
@ -72,6 +83,7 @@ let socialHover = ref(false);
let socialTip = ref("通过这里联系我吧"); let socialTip = ref("通过这里联系我吧");
let socialTipData = { let socialTipData = {
github: "去 Github 看看", github: "去 Github 看看",
gitee: "去 Gitee 看看",
qq: "有什么事吗", qq: "有什么事吗",
email: "来封 Email", email: "来封 Email",
telegram: "你懂的 ~", telegram: "你懂的 ~",
@ -81,6 +93,7 @@ let socialTipData = {
// //
const socialLinks = reactive({ const socialLinks = reactive({
github: "https://github.com/" + import.meta.env.VITE_SOCIAL_GITHUB, github: "https://github.com/" + import.meta.env.VITE_SOCIAL_GITHUB,
gitee: "https://gitee.com/" + import.meta.env.VITE_SOCIAL_GITEE,
qq: qq:
"https://wpa.qq.com/msgrd?v=3&uin=" + "https://wpa.qq.com/msgrd?v=3&uin=" +
import.meta.env.VITE_SOCIAL_QQ + import.meta.env.VITE_SOCIAL_QQ +
@ -97,6 +110,9 @@ const changeTip = (e) => {
case "github": case "github":
socialTip.value = socialTipData.github; socialTip.value = socialTipData.github;
return true; return true;
case "gitee":
socialTip.value = socialTipData.gitee;
return true;
case "qq": case "qq":
socialTip.value = socialTipData.qq; socialTip.value = socialTipData.qq;
return true; return true;