增加后台管理,支持docker部署

This commit is contained in:
ageer
2024-05-17 02:00:31 +08:00
parent ef7434ed04
commit 7fe89a931b
59 changed files with 3911 additions and 1501 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
@font-face {font-family: "Engravers' Old English BT";
src: url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot"); /* IE9*/
src: url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff2") format("woff2"), /* chrome firefox */
url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.woff") format("woff"), /* chrome firefox */
url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.ttf") format("truetype"), /* chrome firefox opera Safari, Android, iOS 4.2+*/
url("https://unpkg.com/dmego-home-page@latest/assets/fonts/d571b52b60b5617399ce8eab62bf3eb3.svg#Engravers' Old English BT") format("svg"); /* iOS 4.1- */
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@@ -0,0 +1,38 @@
const https = require('https')
const fs = require('fs')
const options = {
hostname: 'www.bing.com',
port: 443,
path: '/HPImageArchive.aspx?format=js&idx=0&n=8',
method: 'GET'
}
const req = https.request(options, bing_res => {
let bing_body = [], bing_data = {};
bing_res.on('data', (chunk) => {
bing_body.push(chunk);
});
bing_res.on('end', () => {
bing_body = Buffer.concat(bing_body);
bing_data = JSON.parse(bing_body.toString());
let img_array = bing_data.images;
let img_url = [];
img_array.forEach(img => {
img_url.push(img.url);
});
var jsonpStr = "getBingImages(" + JSON.stringify(img_url) + ")";
fs.writeFile('./assets/json/images.json', jsonpStr, (err) => {
if (err) {
throw err;
}
console.log("JSON data is saved: " + jsonpStr);
});
});
})
req.on('error', error => {
console.error(error)
})
req.end()

View File

@@ -0,0 +1,104 @@
var iUp = (function () {
var time = 0,
duration = 150,
clean = function () {
time = 0;
},
up = function (element) {
setTimeout(function () {
element.classList.add("up");
}, time);
time += duration;
},
down = function (element) {
element.classList.remove("up");
},
toggle = function (element) {
setTimeout(function () {
element.classList.toggle("up");
}, time);
time += duration;
};
return {
clean: clean,
up: up,
down: down,
toggle: toggle
};
})();
function getBingImages(imgUrls) {
/**
* 获取Bing壁纸
* 先使用 GitHub Action 每天获取 Bing 壁纸 URL 并更新 images.json 文件
* 然后读取 images.json 文件中的数据
*/
var indexName = "bing-image-index";
var index = sessionStorage.getItem(indexName);
var panel = document.querySelector('#panel');
if (isNaN(index) || index == 7) index = 0;
else index++;
var imgUrl = imgUrls[index];
var url = "https://www.cn.bing.com" + imgUrl;
panel.style.background = "url('" + url + "') center center no-repeat #666";
panel.style.backgroundSize = "cover";
sessionStorage.setItem(indexName, index);
}
function decryptEmail(encoded) {
var address = atob(encoded);
window.location.href = "mailto:" + address;
}
document.addEventListener('DOMContentLoaded', function () {
// 获取一言数据
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var res = JSON.parse(this.responseText);
document.getElementById('description').innerHTML = res.hitokoto + "<br/> -「<strong>" + res.from + "</strong>」";
}
};
xhr.open("GET", "https://v1.hitokoto.cn", true);
xhr.send();
var iUpElements = document.querySelectorAll(".iUp");
iUpElements.forEach(function (element) {
iUp.up(element);
});
var avatarElement = document.querySelector(".js-avatar");
avatarElement.addEventListener('load', function () {
avatarElement.classList.add("show");
});
});
var btnMobileMenu = document.querySelector('.btn-mobile-menu__icon');
var navigationWrapper = document.querySelector('.navigation-wrapper');
btnMobileMenu.addEventListener('click', function () {
if (navigationWrapper.style.display == "block") {
navigationWrapper.addEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
navigationWrapper.classList.toggle('visible');
navigationWrapper.classList.toggle('animated');
navigationWrapper.classList.toggle('bounceOutUp');
navigationWrapper.removeEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', arguments.callee);
});
navigationWrapper.classList.toggle('animated');
navigationWrapper.classList.toggle('bounceInDown');
navigationWrapper.classList.toggle('animated');
navigationWrapper.classList.toggle('bounceOutUp');
} else {
navigationWrapper.classList.toggle('visible');
navigationWrapper.classList.toggle('animated');
navigationWrapper.classList.toggle('bounceInDown');
}
btnMobileMenu.classList.toggle('social');
btnMobileMenu.classList.toggle('iconfont');
btnMobileMenu.classList.toggle('icon-list');
btnMobileMenu.classList.toggle('social');
btnMobileMenu.classList.toggle('iconfont');
btnMobileMenu.classList.toggle('icon-angleup');
btnMobileMenu.classList.toggle('animated');
btnMobileMenu.classList.toggle('fadeIn');
});

View File

@@ -0,0 +1 @@
getBingImages(["/th?id=OHR.TheRoachesPeakDistrict_EN-US9733115206_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.SanMiguelAllende_EN-US9621237021_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.JediMonastery_EN-US9398447907_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.SonoranSpring_EN-US9207877073_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.CratersOfTheMoon_EN-US6516727783_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.HawaiianLei_EN-US6290126556_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.CheetahRain_EN-US6179670004_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp","/th?id=OHR.TulouFujian_EN-US6009679228_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp"])

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1714852590465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1571" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M263.1 844.8h497.7c22.9 0 41.5 18.6 41.5 41.5s-18.6 41.5-41.5 41.5H263.1c-22.9 0-41.5-18.6-41.5-41.5s18.6-41.5 41.5-41.5zM138.7 98.2h746.6c22.9 0 41.5 18.6 41.5 41.5v580.7c0 11-4.4 21.6-12.1 29.3-7.8 7.8-18.3 12.1-29.3 12.1H138.7c-11 0-21.6-4.4-29.3-12.1-7.8-7.8-12.1-18.3-12.1-29.3V139.7c-0.1-22.9 18.5-41.5 41.4-41.5z m331.8 478.9v60.4h83v-60.3c8.5-5.8 17.4-12.8 26.5-20.5l49.4 49.4 58.7-58.7-49.5-49.4c7.7-9 14.6-18 20.5-26.5h60.3v-83h-60.3c-6.4-9.1-13.3-18-20.5-26.5l49.4-49.4-58.7-58.6-49.4 49.4c-8.5-7.3-17.3-14.1-26.5-20.5v-60.3h-83V283c-8.5 5.8-17.4 12.8-26.5 20.5l-49.4-49.4-58.5 58.6 49.4 49.4c-7.2 8.5-14.1 17.3-20.5 26.5h-60.3v83h60.3c5.8 8.5 12.8 17.4 20.5 26.5L336 547.3l58.7 58.7 49.4-49.4c9.1 7.7 18 14.6 26.4 20.5z m0 0" p-id="1572"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff