Browse Source

Fix bug when path is not "/"

pull/1/head
186526 1 year ago
parent
commit
1f1ac3f5c9
14 changed files with 283 additions and 270 deletions
  1. 2
      config.json
  2. 7
      index.html
  3. 1
      post/About.md
  4. 1
      src/js/main-min.js
  5. 304
      src/js/main.js
  6. 10
      theme/classic/html/200.html
  7. 2
      theme/classic/html/404.html
  8. 8
      theme/classic/html/archive.html
  9. 8
      theme/classic/html/home.html
  10. 32
      theme/classic/src/archive.js
  11. 1
      theme/classic/src/intro-min.js
  12. 96
      theme/classic/src/intro.js
  13. 1
      theme/classic/src/main-min.css
  14. 80
      theme/classic/src/main.css

2
config.json

@ -6,7 +6,7 @@
},
"theme_config": {
"author": "186526",
"avatar": "https://cdn.jsdelivr.net/gh/186526/[email protected]master/avatar.jpg",
"avatar": "https://cdn.jsdelivr.net/gh/186526/[email protected]1.1.0/avatar.jpg",
"introduction": "啥都不会的屑"
},
"post": [

7
index.html

@ -1,9 +1,10 @@
<!DOCTYPE html>
<html lang="zh_cn">
<html lang="zh-cn">
<head>
<script src="./src/js/marked.min.js"></script>
<script src="./src/js/main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>
<link rel="stylesheet" href="./theme/classic/src/main-min.css">
<script src="./src/js/main-min.js"></script>
</head>
<body>

1
post/About.md

@ -1,4 +1,5 @@
<div align="center">
<h1>About me</h1>
<a href="https://github.com/186526"><img src='https://github-readme-stats.vercel.app/api?username=186526&hide_border=true' alt='github stats' /></a>
<h3>A developer who develop with love & bug</h3>
</div>

1
src/js/main-min.js

@ -0,0 +1 @@
function getpar(t){for(var e=window.location.search.substring(1).split("&"),n=0;n<e.length;n++){var s=e[n].split("=");if(s[0]==t&&null==s[1])return!0;if(s[0]==t)return s[1]}return!1}if(getpar("p"))settings={par:"p"};else if(getpar("url"))var settings={par:"url"};else if(getpar("page"))var settings={par:"page"};else window.location.search="?page=home";let t="/";for(let e of window.location.pathname.split("/").slice(1,-1))t=t+e+"/";var config,mdcontent;settings.domain=window.location.protocol+"//"+window.location.host+t,fetch("config.json").then(t=>{if(t.status>=200&&t.status<300)return t;document.all[0].innerHTML="<h1>Error fetch config.json<br>Status Code="+t.status+"</h1>",console.log(t.status)}).then(t=>t.json()).then((function(t){config=t,settings.themeUrl=settings.domain+config.file.theme+config.theme+"/",settings.post=settings.domain+config.file.post})).then((function(){"url"===settings.par?(settings.content={url:decodeURIComponent(getpar(settings.par))},fetch(settings.content.url).then(t=>{if(settings.content.status=t.status,settings.date=new Date,t.status>=200&&t.status<300)return t;fetch(settings.themeUrl+"html/404.html").then(t=>t.text()).then((function(t){settings.content.success=!1,settings.content.preview={response:null,mdcontent:null},document.write(t)}))}).then(t=>t.text()).then(t=>(settings.content.preview={response:t},settings.content.preview.mdcontent=marked(t),marked(t))).then(t=>{fetch(settings.themeUrl+"html/200.html").then(t=>t.text()).then((function(t){settings.content.success=!0,document.write(t)}))}).catch((function(t){return settings.content.preview.mdcontent=t.message,document.write(t.message),t.message}))):"p"===settings.par?(settings.content={url:decodeURIComponent(settings.post+getpar(settings.par)+".md")},fetch(settings.content.url).then(t=>{if(settings.content.status=t.status,settings.date=new Date,t.status>=200&&t.status<300)return t;fetch(settings.themeUrl+"html/404.html").then(t=>t.text()).then((function(t){settings.content.success=!1,settings.content.preview={response:null,mdcontent:null},document.write(t)}))}).then(t=>t.text()).then(t=>(settings.content.preview={response:t},settings.content.preview.mdcontent=marked(t),marked(t))).then(t=>{fetch(settings.themeUrl+"html/200.html").then(t=>t.text()).then((function(t){settings.content.success=!0,document.write(t)}))}).catch((function(t){return settings.content.preview.mdcontent=t.message,document.write(t.message),t.message}))):"page"===settings.par&&(settings.content={url:settings.themeUrl+"html/"+getpar(settings.par)+".html"},fetch(settings.content.url).then(t=>{if(settings.content.status=t.status,settings.date=new Date,t.status>=200&&t.status<300)return t;fetch(settings.themeUrl+"html/404.html").then(t=>t.text()).then((function(t){settings.content.success=!1,settings.content.preview={response:null,mdcontent:null},document.write(t)}))}).then(t=>t.text()).then(t=>{settings.content.success=!0,settings.content.preview={response:t},document.write(t)}))})),console.log(settings);

304
src/js/main.js

@ -5,165 +5,171 @@
* Build with Love & bug
*/
function getpar(r) {
for (
var n = window.location.search.substring(1).split("&"), t = 0;
t < n.length;
t++
) {
var i = n[t].split("=");
if (i[0] == r && null == i[1]) return !0;
if (i[0] == r) return i[1];
}
return !1;
for (
var n = window.location.search.substring(1).split("&"), t = 0;
t < n.length;
t++
) {
var i = n[t].split("=");
if (i[0] == r && null == i[1]) return !0;
if (i[0] == r) return i[1];
}
return !1;
}
if (!getpar("p")) {
if (!getpar("url")) {
if (!getpar("page")) {
window.location.search = "?page=home"; //check if user didn't give a param
}
else {
var settings = { par : "page" };
}
if (!getpar("url")) {
if (!getpar("page")) {
window.location.search = "?page=home"; //check if user didn't give a param
} else {
var settings = { par: "url" };
var settings = { par: "page" };
}
} else {
var settings = { par: "url" };
}
} else {
var settings = { par: "p" };
var settings = { par: "p" };
}
let t = "/";
for (let i of window.location.pathname.split("/").slice(1, -1)) {
t = t + i + "/";
}
settings.domain = window.location.protocol + "//" + window.location.host;
settings.domain = window.location.protocol + "//" + window.location.host + t;
var config, mdcontent;
fetch("config.json")
.then((res) => {
if (res.status >= 200 && res.status < 300) {
.then((res) => {
if (res.status >= 200 && res.status < 300) {
return res;
} else {
document.all[0].innerHTML =
"<h1>Error fetch config.json<br>Status Code=" + res.status + "</h1>";
console.log(res.status);
}
})
.then((res) => res.json())
.then(function (resconfig) {
config = resconfig;
settings.themeUrl =
settings.domain + config.file.theme + config.theme + "/";
settings.post = settings.domain + config.file.post;
})
.then(function () {
if (settings.par === "url") {
settings.content = { url: decodeURIComponent(getpar(settings.par)) };
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
fetch(settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = false;
settings.content.preview = {
response: null,
mdcontent: null,
};
document.write(text);
});
}
})
.then((res) => res.text())
.then((content) => {
settings.content.preview = {
response: content,
};
settings.content.preview.mdcontent = marked(content);
return marked(content);
})
.then((mdcontent) => {
fetch(settings.themeUrl + "html/" + "200.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = true;
document.write(text);
});
})
.catch(function (t) {
settings.content.preview.mdcontent = t.message;
document.write(t.message);
return t.message;
});
} else if (settings.par === "p") {
settings.content = {
url: decodeURIComponent(settings.post + getpar(settings.par) + ".md"),
};
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
document.all[0].innerHTML =
"<h1>Error fetch config.json<br>Status Code=" + res.status + "</h1>";
console.log(res.status);
}
})
.then((res) => res.json())
.then(function (resconfig) {
config = resconfig;
settings.themeUrl =
settings.domain + "/" + config.file.theme + config.theme + "/";
settings.post = settings.domain + "/" + config.file.post;
})
.then(function () {
if (settings.par === "url") {
settings.content = { url: decodeURIComponent(getpar(settings.par)) };
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
fetch(settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = false;
settings.content.preview = {
response: null,
mdcontent: null,
};
document.write(text);
});
}
})
.then((res) => res.text())
.then((content) => {
settings.content.preview = {
response: content,
};
settings.content.preview.mdcontent = marked(content);
return marked(content);
})
.then((mdcontent) => {
fetch(settings.themeUrl + "html/" + "200.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = true;
document.write(text);
});
})
.catch(function (t) {
settings.content.preview.mdcontent = t.message;
document.write(t.message);
return t.message;
});
} else if (settings.par === "p") {
settings.content = {
url: decodeURIComponent(settings.post + getpar(settings.par) + ".md"),
};
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
fetch(settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = false;
settings.content.preview = {
response: null,
mdcontent: null,
};
document.write(text);
});
}
})
.then((res) => res.text())
.then((content) => {
settings.content.preview = {
response: content,
};
settings.content.preview.mdcontent = marked(content);
return marked(content);
})
.then((mdcontent) => {
fetch(settings.themeUrl + "html/" + "200.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = true;
document.write(text);
});
})
.catch(function (t) {
settings.content.preview.mdcontent = t.message;
document.write(t.message);
return t.message;
});
} else if (settings.par === "page") {
settings.content={url:settings.themeUrl+"html/"+getpar(settings.par)+".html"};
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
fetch (settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text){
settings.content.success = false;
settings.content.preview = {
response: null,
mdcontent: null,
};
document.write(text);
});
}
}).then((content) => content.text())
.then(content =>{
settings.content.success = true;
} else {
fetch(settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = false;
settings.content.preview = {
response: content,
response: null,
mdcontent: null,
};
document.write(content);
document.write(text);
});
}
})
.then((res) => res.text())
.then((content) => {
settings.content.preview = {
response: content,
};
settings.content.preview.mdcontent = marked(content);
return marked(content);
})
.then((mdcontent) => {
fetch(settings.themeUrl + "html/" + "200.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = true;
document.write(text);
});
}
});
})
.catch(function (t) {
settings.content.preview.mdcontent = t.message;
document.write(t.message);
return t.message;
});
} else if (settings.par === "page") {
settings.content = {
url: settings.themeUrl + "html/" + getpar(settings.par) + ".html",
};
fetch(settings.content.url)
.then((res) => {
settings.content.status = res.status;
settings.date = new Date();
if (res.status >= 200 && res.status < 300) {
return res;
} else {
fetch(settings.themeUrl + "html/" + "404.html")
.then((response) => response.text())
.then(function (text) {
settings.content.success = false;
settings.content.preview = {
response: null,
mdcontent: null,
};
document.write(text);
});
}
})
.then((content) => content.text())
.then((content) => {
settings.content.success = true;
settings.content.preview = {
response: content,
};
document.write(content);
});
}
});
console.log(settings);

10
theme/classic/html/200.html

@ -16,7 +16,8 @@
<h1 id="intro-text-intro"></h1>
</span>
</span>
<p><a href="/?page=home" style="vertical-align: middle;"><i class="material-icons arrow_back" style="vertical-align: middle;"></i>Back</a></p>
<p><a href="?page=home" style="vertical-align: middle;"><i class="material-icons arrow_back"
style="vertical-align: middle;"></i>Back</a></p>
<div id="content">
</div>
<footer>
@ -46,13 +47,12 @@
document.getElementById("content").innerHTML = settings.content.preview.mdcontent;
try {
debugtext.content.title = document.getElementsByTagName("h1")[2].innerHTML;
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main.css'><title> " + document.getElementsByTagName("h1")[2].innerHTML + " -- " + config.theme_config.author + "'s Blog</title>";
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main-min.css'><title> " + document.getElementsByTagName("h1")[2].innerHTML + " -- " + config.theme_config.author + "'s Blog</title>";
} catch (e) {
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main.css'><title> " + config.theme_config.author + "'s Blog</title>";
console.log(e);
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main-min.css'><title> " + config.theme_config.author + "'s Blog</title>";
}
}
document.getElementById("intro_js").src = settings.themeUrl + "src/intro.js"
document.getElementById("intro_js").src = settings.themeUrl + "src/intro-min.js"
console.log(debugtext);
</script>

2
theme/classic/html/404.html

@ -41,7 +41,7 @@
//document.getElementById("bugcode").innerHTML = JSON.stringify(debugtext);
}
console.log(debugtext);
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main.css'><title> 404 Not Found -- "+ config.theme_config.author +"'s Blog</title>"
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main-min.css'><title> 404 Not Found -- "+ config.theme_config.author +"'s Blog</title>"
</script>
</html>

8
theme/classic/html/archive.html

@ -20,9 +20,9 @@
</span>
</span>
<ul class="head">
<li class="h2"><a href="/?page=home">Home</a></li>
<li class="h2"><a href="?page=home">Home</a></li>
<li class="h1">Archive</li>
<li class="h3 display_none"><a href="/?p=About">About</a></li>
<li class="h3 display_none"><a href="?p=About">About</a></li>
</ul>
<div id="content">
<div class="post" id="post">
@ -50,9 +50,9 @@
document.all[0].innerHTML = "<pre><xmp>" + JSON.stringify(debugtext) + "</xmp></pre>";
console.log("Debug ON");
} else {
document.getElementById("intro_js").src = settings.themeUrl + "src/archive.js"
document.getElementById("intro_js").src = settings.themeUrl + "src/intro-min.js"
document.getElementById("aboutme").innerHTML = "Copyright " + settings.date.getFullYear() + " <a class='hoverlink' href=" + settings.domain + ">" + config.theme_config.author + "'s Blog. </a>All Rights Reserved.";
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main.css'><title> Home -- " + config.theme_config.author + "'s Blog</title>";
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main-min.css'><title> Home -- " + config.theme_config.author + "'s Blog</title>";
}
console.log(debugtext);
</script>

8
theme/classic/html/home.html

@ -21,8 +21,8 @@
</span>
<ul class="head">
<li class="h1"> Home </li>
<li class="h3"><a href="/?page=archive">Archive</a></li>
<li class="h3 display_none"><a href="/?p=About">About</a></li>
<li class="h3"><a href="?page=archive">Archive</a></li>
<li class="h3 display_none"><a href="?p=About">About</a></li>
</ul>
<div id="content">
<div class="post" id="post">
@ -50,9 +50,9 @@
document.all[0].innerHTML = "<pre><xmp>" + JSON.stringify(debugtext) + "</xmp></pre>";
console.log("Debug ON");
} else {
document.getElementById("intro_js").src = settings.themeUrl + "src/intro.js"
document.getElementById("intro_js").src = settings.themeUrl + "src/intro-min.js"
document.getElementById("aboutme").innerHTML = "Copyright " + settings.date.getFullYear() + " <a class='hoverlink' href=" + settings.domain + ">" + config.theme_config.author + "'s Blog. </a>All Rights Reserved.";
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main.css'><title> Home -- " + config.theme_config.author + "'s Blog</title>";
document.getElementById("head").innerHTML = "<link rel='stylesheet' href='" + settings.themeUrl + "src/main-min.css'><title> Home -- " + config.theme_config.author + "'s Blog</title>";
}
console.log(debugtext);
</script>

32
theme/classic/src/archive.js

@ -1,32 +0,0 @@
document.getElementById('avatar').src = config.theme_config.avatar;
document.getElementById('intro-text-title').innerHTML = config.theme_config.author + "'s Blog";
document.getElementById('intro-text-intro').innerHTML = "—— " + config.theme_config.introduction;
async function init_post_container() {
let post_container = "";
for(let x=0;x<config.post.length;x++){
const post = {};
post.url = settings.post+config.post[x].url+".md";
await fetch(post.url)
.then(response => response.text())
.then(content => {
post.preview = {
response: content,
};
post.preview.mdcontent = marked(content);
return marked(content);
})
.then(content => {
document.getElementsByClassName("none")[0].innerHTML = content;
}).then(function(){
post.preview.title=document.getElementsByClassName("none")[0].getElementsByTagName("h1")[0].innerText;
post.preview.intro=config.post[x].introduction;
})
.then(function(){
post.container = '<div class="post-container"><h1>'+post.preview.title+'</h1><div class="post-info">'+post.preview.mdcontent+'</div><p><a href="/?p='+config.post[x].url+'">Reading<i class="material-icons arrow_forward"></i></a></p></div>';
post_container = post_container+post.container;
});
}
return post_container;
}
init_post_container().then(content => {document.getElementById("post").innerHTML = content;});

1
theme/classic/src/intro-min.js

@ -0,0 +1 @@
async function init_post_container(){let e="";for(let t=0;t<config.post.length;t++){const n={};n.url=settings.post+config.post[t].url+".md",await fetch(n.url).then(e=>e.text()).then(e=>(n.preview={response:e},n.preview.mdcontent=marked(e),marked(e))).then(e=>{document.getElementsByClassName("none")[0].innerHTML=e}).then((function(){n.preview.title=document.getElementsByClassName("none")[0].getElementsByTagName("h1")[0].innerText,n.preview.intro=config.post[t].introduction})).then((function(){"?page=archive"==window.location.search?n.container='<div class="post-container"><h1>'+n.preview.title+'</h1><div class="post-info">'+n.preview.mdcontent+'</div><p><a href="?p='+config.post[t].url+'">Reading<i class="material-icons arrow_forward"></i></a></p></div>':n.container='<div class="post-container"><h1>'+n.preview.title+'</h1><p class="post-intro">'+n.preview.intro+'</p><p><a href="?p='+config.post[t].url+'">Reading<i class="material-icons arrow_forward"></i></a></p></div>',e+=n.container}))}return e}document.getElementById("avatar").src=config.theme_config.avatar,document.getElementById("intro-text-title").innerHTML=config.theme_config.author+"'s Blog",document.getElementById("intro-text-intro").innerHTML="—— "+config.theme_config.introduction,add_pic=function(){for(var e=document.getElementsByTagName("img"),t=0;t<e.length;t++)e[t].loading="lazy"},getpar("page")&&init_post_container().then(e=>{document.getElementById("post").innerHTML=e}),add_pic();

96
theme/classic/src/intro.js

@ -1,36 +1,66 @@
document.getElementById('avatar').src = config.theme_config.avatar;
document.getElementById('intro-text-title').innerHTML = config.theme_config.author + "'s Blog";
document.getElementById('intro-text-intro').innerHTML = "—— " + config.theme_config.introduction;
document.getElementById("avatar").src = config.theme_config.avatar;
document.getElementById("intro-text-title").innerHTML =
config.theme_config.author + "'s Blog";
document.getElementById("intro-text-intro").innerHTML =
"—— " + config.theme_config.introduction;
async function init_post_container() {
let post_container = "";
for(let x=0;x<config.post.length;x++){
const post = {};
post.url = settings.post+config.post[x].url+".md";
await fetch(post.url)
.then(response => response.text())
.then(content => {
post.preview = {
response: content,
};
post.preview.mdcontent = marked(content);
return marked(content);
})
.then(content => {
document.getElementsByClassName("none")[0].innerHTML = content;
}).then(function(){
post.preview.title=document.getElementsByClassName("none")[0].getElementsByTagName("h1")[0].innerText;
post.preview.intro=config.post[x].introduction;
})
.then(function(){
post.container = '<div class="post-container"><h1>'+post.preview.title+'</h1><p class="post-intro">'+post.preview.intro+'</p><p><a href="/?p='+config.post[x].url+'">Reading<i class="material-icons arrow_forward"></i></a></p></div>';
post_container = post_container+post.container;
});
}
return post_container;
let post_container = "";
for (let x = 0; x < config.post.length; x++) {
const post = {};
post.url = settings.post + config.post[x].url + ".md";
await fetch(post.url)
.then((response) => response.text())
.then((content) => {
post.preview = {
response: content,
};
post.preview.mdcontent = marked(content);
return marked(content);
})
.then((content) => {
document.getElementsByClassName("none")[0].innerHTML = content;
})
.then(function () {
post.preview.title = document
.getElementsByClassName("none")[0]
.getElementsByTagName("h1")[0].innerText;
post.preview.intro = config.post[x].introduction;
})
.then(function () {
if (window.location.search == "?page=archive") {
post.container =
'<div class="post-container"><h1>' +
post.preview.title +
'</h1><div class="post-info">' +
post.preview.mdcontent +
'</div><p><a href="?p=' +
config.post[x].url +
'">Reading<i class="material-icons arrow_forward"></i></a></p></div>';
} else {
post.container =
'<div class="post-container"><h1>' +
post.preview.title +
'</h1><p class="post-intro">' +
post.preview.intro +
'</p><p><a href="?p=' +
config.post[x].url +
'">Reading<i class="material-icons arrow_forward"></i></a></p></div>';
}
post_container = post_container + post.container;
});
}
return post_container;
}
if (window.location.search==="?page=home"){
init_post_container().then(content => {
document.getElementById("post").innerHTML = content;
});
}
add_pic = function () {
var imgs = document.getElementsByTagName("img");
for (var i = 0; i < imgs.length; i++) {
imgs[i].loading = "lazy";
}
};
if (getpar("page")) {
init_post_container().then((content) => {
document.getElementById("post").innerHTML = content;
});
}
add_pic();

1
theme/classic/src/main-min.css

@ -0,0 +1 @@
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");*{padding:0;margin:0;font-family:"PingFang SC","Sarasa UI SC","Helvetica Neue","Microsoft YaHei New",STHeiti Light,sans-serif;--dark-text:#efefef;--dark-background:#000;--dark-background-darker:#111;--dark-text-darker:#aaa;--highlight:#a81900;--white-text:#111111;--white-background:#fff;--white-background-darker:#efefef;--white-text-darker:#626262;line-height:150%}.hoverlink:hover{color:var(--highlight)}.hoverlink{color:var(--white-text-darker)}h1{padding-top:5%;padding-bottom:3%;font-size:49.5px}h2{padding-top:5%;padding-bottom:3%;font-size:38.5px}h3{padding-top:5%;padding-bottom:3%;font-size:32.5px}h4{padding-top:5%;padding-bottom:3%;font-size:30.5px}h5{padding-top:5%;padding-bottom:3%;font-size:25px}hr{height:1.5px;background-color:#767676;border-color:#767676;border-radius:200px;margin:16px}table,ol{padding-top:5%;padding-bottom:3%}.siteinfo{bottom:-100px;position:absolute;font-size:15.6444px;left:0;right:0;margin:1.5% 10%}a{color:var(--highlight);text-decoration:none}#aboutme{float:right}p,ul,li{font-size:22px}footer{color:var(--white-text-darker)}pre{white-space:pre-wrap;overflow:auto;margin-top:5%;margin-bottom:3%;padding:20px;border-radius:20px;border:2px solid var(--white-background-darker);background-color:var(--white-background-darker)}code{white-space:pre-wrap;overflow:auto;font-family:Sarasa Mono SC,Cascadia Code,Fira Code,Menlo,Consolas,monaco,monospace}.post-container{margin:5% 0%;border-radius:20px;border:2px solid var(--white-background-darker);background-color:var(--white-background-darker)}.post-container *{padding:0%;margin:0%}.post-container h1{padding:3% 5%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.post-container p{padding:3% 5%;color:var(--white-text-darker)}.post-container a{vertical-align:middle}.post-container i{vertical-align:middle;padding:0% 1%}i{vertical-align:middle;padding:0% 1%}.post-info *{color:var(--white-text-darker);font-size:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:15px}.arrow_forward::before{content:"arrow_forward"}.arrow_back::before{content:"arrow_back"}#container{position:relative;height:auto;margin:5% 10%}.head *{display:inline;padding:5%}.head .h1{font-size:40px}.head .h3{font-size:30px;white-space:nowrap}.intro{display:inline-block;margin-bottom:4%}.intro *{vertical-align:middle;display:inline}.intro span{display:inline-block}.intro h1{margin-left:10px;font-size:40px;padding:0}#intro-text-intro{font-size:25px;color:var(--dark-text-darker)}.intro #avatar{padding:0%;border-radius:50px;height:96px;width:96px}img{max-width:100%;padding-top:5%;padding-bottom:3%;left:0;right:0;position:relative}table{padding-top:5%;padding-bottom:3%}.none{display:none}@media (prefers-color-scheme:dark){body{color:var(--dark-text);background-color:var(--dark-background)}footer{color:var(--dark-text-darker)}pre{border:2px solid var(--dark-background-darker);background-color:var(--dark-background-darker)}.post-container{border:2px solid var(--dark-background-darker);background-color:var(--dark-background-darker)}.hoverlink{color:var(--dark-text-darker)}.post-info *,.post-container p{color:var(--dark-text-darker)}}@media screen and (max-width:1150px){#blogginginfo{opacity:0}#aboutme{float:right}}@media screen and (max-width:790px){.head *{padding:4%}.intro{display:block;text-align:center}}@media screen and (max-width:700px){h1{font-size:40px}#aboutme{font-size:14px}.head .display_none{display:none}.intro h1{display:block}.post-container .post-intro{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}@media screen and (max-width:480px){.head *{padding:1%}}

80
theme/classic/src/main.css

@ -2,8 +2,8 @@
* {
padding: 0;
margin: 0;
font-family: "PingFang SC","Sarasa UI SC","Helvetica Neue", "Microsoft YaHei New",
STHeiti Light, sans-serif;
font-family: "PingFang SC", "Sarasa UI SC", "Helvetica Neue",
"Microsoft YaHei New", STHeiti Light, sans-serif;
--dark-text: #efefef;
--dark-background: #000;
--dark-background-darker: #111;
@ -16,12 +16,12 @@
line-height: 150%;
}
.hoverlink:hover{
color: var(--highlight)
.hoverlink:hover {
color: var(--highlight);
}
.hoverlink{
color: var(--white-text-darker)
.hoverlink {
color: var(--white-text-darker);
}
h1 {
@ -62,7 +62,8 @@ hr {
margin: 16px;
}
table,ol {
table,
ol {
padding-top: 5%;
padding-bottom: 3%;
}
@ -87,7 +88,8 @@ a {
}
p,
ul,li {
ul,
li {
font-size: 22px;
}
@ -109,7 +111,8 @@ pre {
code {
white-space: pre-wrap;
overflow: auto;
font-family: Sarasa Mono SC,Cascadia Code,Fira Code,Menlo,Consolas,monaco,monospace;
font-family: Sarasa Mono SC, Cascadia Code, Fira Code, Menlo, Consolas, monaco,
monospace;
}
.post-container {
@ -125,10 +128,10 @@ code {
}
.post-container h1 {
padding:3% 5%;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
padding: 3% 5%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.post-container p {
@ -136,26 +139,26 @@ code {
color: var(--white-text-darker);
}
.post-container a{
.post-container a {
vertical-align: middle;
}
.post-container i {
vertical-align:middle;
vertical-align: middle;
padding: 0% 1%;
}
i {
vertical-align:middle;
vertical-align: middle;
padding: 0% 1%;
}
.post-info *{
.post-info * {
color: var(--white-text-darker);
font-size: 20px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 15px;
}
@ -173,7 +176,7 @@ i {
margin: 5% 10%;
}
.head *{
.head * {
display: inline;
padding: 5%;
}
@ -184,11 +187,11 @@ i {
.head .h3 {
font-size: 30px;
white-space:nowrap;
white-space: nowrap;
}
.intro {
display:inline-block;
display: inline-block;
margin-bottom: 4%;
}
@ -198,13 +201,13 @@ i {
}
.intro span {
display:inline-block;
display: inline-block;
}
.intro h1 {
margin-left: 10px;
font-size: 40px;
padding:0;
padding: 0;
}
#intro-text-intro {
@ -229,8 +232,8 @@ img {
}
table {
padding-top: 5%;
padding-bottom: 3%;
padding-top: 5%;
padding-bottom: 3%;
}
.none {
@ -253,17 +256,18 @@ table {
border: 2px solid var(--dark-background-darker);
background-color: var(--dark-background-darker);
}
.hoverlink{
.hoverlink {
color: var(--dark-text-darker);
}
.post-info *,.post-container p {
.post-info *,
.post-container p {
color: var(--dark-text-darker);
}
}
@media screen and (max-width: 1150px) {
#blogginginfo {
opacity: 0;
display: none;
}
#aboutme {
float: right;
@ -271,7 +275,7 @@ table {
}
@media screen and (max-width: 790px) {
.head *{
.head * {
padding: 4%;
}
.intro {
@ -280,28 +284,28 @@ table {
}
}
@media screen and (max-width:700px) {
@media screen and (max-width: 700px) {
h1 {
font-size: 40px;
}
#aboutme {
font-size: 14px;
}
.head .display_none{
.head .display_none {
display: none;
}
.intro h1 {
display: block;
}
.post-container .post-intro {
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
@media screen and (max-width:480px) {
@media screen and (max-width: 480px) {
.head * {
padding: 1%;
}
Loading…
Cancel
Save