Skip to content

Commit 0bb13e7

Browse files
committed
feat: 添加【在线工具】菜单项
1 parent 3c8f17d commit 0bb13e7

File tree

7 files changed

+92
-0
lines changed

7 files changed

+92
-0
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ exclude:
4141
- README.md
4242
- COPYING
4343
- vendor
44+
- minify.cmd
4445
sass:
4546
style: compressed
4647
lang: zh_CN

_includes/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
</li>
105105
<li><a class="waves-effect" href="/"><i class="material-icons">home</i>Home - 主页</a></li>
106106
<li><a class="waves-effect" href="/projects"><i class="material-icons">description</i>Github - 项目</a></li>
107+
<li><a class="waves-effect" href="/tools"><i class="material-icons">build</i>Tools - 在线工具</a></li>
107108
<li><a class="waves-effect" href="/categories"><i class="material-icons">sort</i>Categories - 目录</a></li>
108109
<li><a class="waves-effect" href="/tags"><i class="material-icons">label</i>Tags - 标签</a></li>
109110
<li><a class="waves-effect" href="/feed.xml" target="_blank"><i class="material-icons">rss_feed</i>RSS - 订阅</a></li>

_includes/tools.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% if site.github.public_repositories %}
2+
{% assign sorted_repos = (site.github.public_repositories | sort: 'pushed_at') | reverse %}
3+
4+
{% for repo in sorted_repos %}
5+
{% if repo.homepage != nil and repo.homepage != '' and repo.fork == false %}
6+
<div class="col s12">
7+
<div class="card hoverable">
8+
<div class="card-image waves-effect waves-block waves-light geopattern activator"
9+
data-pattern-id="{{repo.name}}">
10+
<a href="{{repo.html_url}}" class="card-image-icon" target="_blank">
11+
<i class="material-icons waves-effect waves-block waves-light tooltipped" data-position="right"
12+
data-tooltip="Github:&lt;br&gt;{{repo.html_url}}">code</i>
13+
</a>
14+
<a class="card-title center-align valign-wrapper tooltipped" href="{{repo.homepage}}" data-position="right"
15+
data-tooltip="{{repo.homepage}}" target="_blank">
16+
{{repo.name}}
17+
</a>
18+
</div>
19+
<div class="card-content valign-wrapper center-align activator">
20+
<span class="activator grey-text text-darken-1">{{repo.description}}</span>
21+
</div>
22+
</div>
23+
</div>
24+
{% endif %}
25+
{% endfor %}
26+
27+
{% endif %}

assets/css/tools.sass

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
---
3+
.card
4+
display: flex
5+
flex-wrap: wrap
6+
margin-bottom: 2em
7+
overflow: auto
8+
9+
.card-image
10+
overflow-x: hidden
11+
flex: 3
12+
min-width: 300px
13+
14+
.card-image-icon
15+
position: absolute
16+
top: 0
17+
right: 0
18+
i
19+
padding: 10px
20+
color: #fff
21+
font-size: 20px
22+
&:hover
23+
color: #2196F3
24+
border-radius: 50%
25+
border: 1px outset #26a69a
26+
a.card-title
27+
position: unset
28+
font-weight: bold
29+
color: #fff
30+
width: 100%
31+
height: 100%
32+
line-height: 100%
33+
justify-content: center
34+
word-break: break-all
35+
z-index: -1
36+
37+
.card-content
38+
flex: 2
39+
min-width: 200px
40+
overflow: hidden
41+
font-size: 14px
42+
line-height: 110%
43+
44+
span
45+
width: 100%

assets/js/min/tools.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/normal/tools.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
document.addEventListener('DOMContentLoaded', () => {
2+
document.querySelectorAll('.geopattern').forEach(el => {
3+
var pattern = GeoPattern.generate(el.dataset.patternId).toDataUrl();
4+
el.style.backgroundImage = pattern;
5+
});
6+
});

tools.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: page
3+
title: "Online Tools"
4+
css: ["tools.css"]
5+
js: [
6+
"https://cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js",
7+
"tools.min.js"
8+
]
9+
---
10+
11+
{% include tools.html %}

0 commit comments

Comments
 (0)