Skip to content

Commit

Permalink
feat: 博客更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivomo committed Mar 29, 2023
1 parent 4d331d7 commit a241d6d
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 76 deletions.
9 changes: 1 addition & 8 deletions _layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,14 @@
}
}
</script>
<link href="/static/css/main.css?r=123" rel="stylesheet">
<link href="/static/blog-index/css/main.6157513c.css" rel="stylesheet">
</head>
<body>
<ol class="post-list" style="display: none;">
{% for post in site.posts %}
<li><a href="{{ post.url }}" target="_blank">{{ post.title }}</a></li>
{% endfor %}
</ol>
<textarea style="display: none" id="postTitleUrlMap">
{
{% for post in site.posts %}
"{{ post.title }}": "{{ post.url }}",
{% endfor %}
}
</textarea>

{{content}}
</body>
Expand Down
17 changes: 10 additions & 7 deletions app/blog-index/src/Blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ const Blog = () => {
const tag = e.target.tagName.toLowerCase();
let li;
switch (tag) {
case 'ul':
return;
case 'li':
li = e.target;
break;
default:
li = e.target.parentNode;
}
const category = li.className.split('-')[1];
const titles = window.BlogTags[category];
const titles = window.BlogTags[category].reverse();
setFilteredPosts(titles.map((title) => ({
title: title,
url: blogUrlMapRef.current[title]
Expand All @@ -50,6 +52,12 @@ const Blog = () => {
<div className="blog-wrap">
<h1 className="blog-title">帷幕的博客</h1>
<ul className="blog-category-list" onClick={handleClick}>
<li className="category-game">
<i className="blog-icon">
<GameIcon/>
</i>
<p>小游戏</p>
</li>
<li className="category-algorithm">
<i className="blog-icon">
<AlgorithmIcon/>
Expand Down Expand Up @@ -92,12 +100,7 @@ const Blog = () => {
</i>
<p>Javascript</p>
</li>
<li className="category-game">
<i className="blog-icon">
<GameIcon/>
</i>
<p>小游戏</p>
</li>

<li className="category-math">
<i className="blog-icon">
<MathIcon/>
Expand Down
30 changes: 30 additions & 0 deletions app/blog-index/src/Blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ $theme1 : #1EEDFF;

.blog-wrap {
position: absolute;
display: flex;
flex-direction: column;
top: 60px;
bottom: 60px;
left: 60px;
Expand Down Expand Up @@ -105,4 +107,32 @@ $theme1 : #1EEDFF;

.category-util {
color: #0be879;
}

.blog-list {
flex: 1;
margin: 60px;
padding: 2em;
border: 1px solid $theme1;
border-radius: 8px;
overflow: auto;

&::-webkit-scrollbar {
width: 4px;
}

&::-webkit-scrollbar-thumb {
border-radius: 4px;
background: $theme1;
}

li {
padding: 0.5em 0;
}

a {
font-size: 18px;
color: #dddddd;
text-decoration: none;
}
}
63 changes: 2 additions & 61 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,5 @@
layout: index
---
<div id="root"></div>
<script crossOrigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossOrigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script>!function (e) {
function r(r) {
for (var n, i, l = r[0], f = r[1], a = r[2], c = 0, s = []; c < l.length; c++) i = l[c], Object.prototype.hasOwnProperty.call(o, i) && o[i] && s.push(o[i][0]), o[i] = 0;
for (n in f) Object.prototype.hasOwnProperty.call(f, n) && (e[n] = f[n]);
for (p && p(r); s.length;) s.shift()();
return u.push.apply(u, a || []), t()
}

function t() {
for (var e, r = 0; r < u.length; r++) {
for (var t = u[r], n = !0, l = 1; l < t.length; l++) {
var f = t[l];
0 !== o[f] && (n = !1)
}
n && (u.splice(r--, 1), e = i(i.s = t[0]))
}
return e
}

var n = {}, o = {1: 0}, u = [];

function i(r) {
if (n[r]) return n[r].exports;
var t = n[r] = {i: r, l: !1, exports: {}};
return e[r].call(t.exports, t, t.exports, i), t.l = !0, t.exports
}

i.m = e, i.c = n, i.d = function (e, r, t) {
i.o(e, r) || Object.defineProperty(e, r, {enumerable: !0, get: t})
}, i.r = function (e) {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
}, i.t = function (e, r) {
if (1 & r && (e = i(e)), 8 & r) return e;
if (4 & r && "object" == typeof e && e && e.__esModule) return e;
var t = Object.create(null);
if (i.r(t), Object.defineProperty(t, "default", {
enumerable: !0,
value: e
}), 2 & r && "string" != typeof e) for (var n in e) i.d(t, n, function (r) {
return e[r]
}.bind(null, n));
return t
}, i.n = function (e) {
var r = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return i.d(r, "a", r), r
}, i.o = function (e, r) {
return Object.prototype.hasOwnProperty.call(e, r)
}, i.p = "/";
var l = this["webpackJsonpmy-kingdom"] = this["webpackJsonpmy-kingdom"] || [], f = l.push.bind(l);
l.push = r, l = l.slice();
for (var a = 0; a < l.length; a++) r(l[a]);
var p = f;
t()
}([])</script>
<script src="/static/js/main.js"></script>
<script src="/static/js/tags.js"></script>
<script src="/static/blog-index/js/main.6de6f6dc.js"></script>
2 changes: 2 additions & 0 deletions static/blog-index/css/main.6157513c.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/blog-index/css/main.6157513c.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/blog-index/css/main.ee625ed4.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions static/blog-index/js/787.b2920fc2.chunk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a241d6d

Please sign in to comment.