Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature page study #1098

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ menu:
archives: /archives
tags: /tags
#commonweal: /404.html
study: study


# Enable/Disable menu icons.
Expand All @@ -50,6 +51,33 @@ menu_icons:
tags: tags
archives: archive
commonweal: heartbeat
study: graduation-cap

# ---------------------------------------------------------------
# extensions feature Settings
# ---------------------------------------------------------------
# study 读书页面
study:
enable: true
readed:
我的第一本漫画炒股书:
url: https://img3.doubanio.com/lpic/s26717372.jpg
ASP.NET 4.0 动态网站开发实用教程:
url: https://img3.doubanio.com/lpic/s9078940.jpg
HTML5+CSS3精致范例辞典:
url: https://img1.doubanio.com/lpic/s24559317.jpg
番茄工作法图解:
url: https://img3.doubanio.com/lpic/s4599081.jpg
reading:
nodejs深入浅出:
url: https://img3.doubanio.com/lpic/s27269296.jpg
JavaScript:
url: https://img3.doubanio.com/lpic/s8958650.jpg
从你的全世界路过:
url: https://img3.doubanio.com/lpic/s27102925.jpg
want:
四步创业法:
url: https://img3.doubanio.com/lpic/s11171520.jpg



Expand Down
1 change: 1 addition & 0 deletions languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ menu:
tags: Tags
about: About
search: Search
study: Study

sidebar:
overview: Overview
Expand Down
1 change: 1 addition & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ menu:
tags: Tags
about: About
search: Search
study: Study

sidebar:
overview: Overview
Expand Down
1 change: 1 addition & 0 deletions languages/zh-Hans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ menu:
about: 关于
search: 搜索
commonweal: 公益404
study: 读书


sidebar:
Expand Down
2 changes: 2 additions & 0 deletions layout/_layout.swig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<head>
{% include '_partials/head.swig' %}
<title>{% block title %}{% endblock %}</title>
{% block css_extra%}{% endblock %}
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="{{ config.language }}">
Expand Down Expand Up @@ -62,6 +63,7 @@
{% include scheme_script %}

{% block script_extra %}{% endblock %}
{% block script_extra %}{% endblock %}

{% include '_scripts/boostrap.swig' %}

Expand Down
29 changes: 29 additions & 0 deletions layout/extensions/study/study.swig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div class="welcome">欢迎来到我的读书空间!欢迎留言!</div>
<div class="head">
<p id="error">阅<span>读</span></p>
<p id="code">R<span>E</span>A<span>D</span>IN<span>G</span></p>
</div>
<ul id="tab-head">
<li class="tab-block">已读</li>
<li class="tab-block">正读</li>
<li class="tab-block">想读</li>
<li class="slider"></li>
</ul>
<div class="tab-content">
<div id="tab-content-1">
{% for card in theme.study.readed %}
<div class="card f" style="background: url({{ card.url }}) no-repeat"></div>
{% endfor %}
</div>
<div id="tab-content-2">
{% for card in theme.study.reading %}
<div class="card f" style="background: url({{ card.url }}) no-repeat"></div>
{% endfor %}
</div>
<div id="tab-content-3">
{% for card in theme.study.want %}
<div class="card f" style="background: url({{ card.url }}) no-repeat"></div>
{% endfor %}
</div>
</div>

22 changes: 22 additions & 0 deletions layout/page.swig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
</div>
</div>
{% else %}
{% elif page.type === 'study' %}
{% if theme.study.enable %}
{% include 'extensions/study/study.swig' %}
{% else %}
<div style="text-align: center;color: #dddddd">信息:可能你需要在配置文件中设置study: enable:true</div>
{% endif %}
{{ page.content }}
{% endif %}
</div>
Expand All @@ -45,3 +51,19 @@
{% block sidebar %}
{{ sidebar_template.render(false) }}
{% endblock %}

{% block css_extra %}
{% if theme.study.enable and page.type === 'study' %}
<link href='{{ url_for(theme.extensions) }}/study/study.css?v={{ theme.version }}'
rel="stylesheet"
type="text/css">
{% endif %}
{% endblock %}

{% block script_extra %}
{% if theme.study.enable and page.type === 'study' %}
<script src='{{ url_for(theme.extensions) }}/study/study.js?v={{ theme.version }}'
type="text/javascript"></script>
{% endif %}
{% endblock %}

2 changes: 1 addition & 1 deletion source/css/_schemes/Mist/outline/outline.styl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.main-inner { margin-top: 80px; }
.main-inner { margin-top: 50px; }
215 changes: 215 additions & 0 deletions source/extensions/study/study.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
/*region 遮罩效果*/
.welcome {
-webkit-animation: demo-an 2.5s ease-out infinite;
border-radius: .4em;
color: #000;
font: bold 14px/normal \5FAE\8F6F\96C5\9ED1, tahoma, arial, \5b8b\4f53, sans-serif;
margin: 1em;
-webkit-mask: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 1%, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 20%) -500px 0 no-repeat content;
text-align: center;
text-shadow: 1px 1px 0 #ccc;
-webkit-animation-duration: 20s;
}

@-webkit-keyframes demo-an {
to {
-webkit-mask-position: 500px 0;
}
}

/*endregion*/

/*region 霓虹灯*/
.head {
font-size: 2rem;
text-align: center;
text-transform: uppercase;
text-shadow: 0 0 80px red, 0 0 30px FireBrick, 0 0 6px DarkRed;
color: red;
}

#error {
font-family: 'Orbitron', sans-serif;
}

.head p {
margin: 0;
}

#error span:hover {
text-shadow: 0 0 200px #ffffff, 0 0 80px #1e90ff, 0 0 6px #1e90ff;
opacity: 1
}

#code span:hover {
text-shadow: 0 0 100px red, 0 0 40px FireBrick, 0 0 8px DarkRed;
opacity: 1
}

#error {
color: dodgerblue;
text-shadow: 0 0 80px #ffffff, 0 0 30px #1e90ff, 0 0 6px #1e90ff;
}

#error span {
-webkit-animation: upper 6s linear infinite;
}

#code span:nth-of-type(3) {
-webkit-animation: lower 5s linear infinite;
}

#code span:nth-of-type(2) {
-webkit-animation: lower 10s linear infinite;
}

#code span:nth-of-type(1) {
text-shadow: none;
opacity: .4;
}

@keyframes upper {
0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
opacity: .99;
text-shadow: 0 0 80px #ffffff, 0 0 30px #1e90ff, 0 0 6px #1e90ff;
}
20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
opacity: 0.4;
text-shadow: none;
}
}

@keyframes lower {
0%, 12%, 18.999%, 23%, 31.999%, 37%, 44.999%, 46%, 49.999%, 51%, 58.999%, 61%, 68.999%, 71%, 85.999%, 96%, 100% {
opacity: 0.99;
text-shadow: 0 0 80px red, 0 0 30px FireBrick, 0 0 6px DarkRed;
}
19%, 22.99%, 32%, 36.999%, 45%, 45.999%, 50%, 50.99%, 59%, 60.999%, 69%, 70.999%, 86%, 95.999% {
opacity: 0.4;
text-shadow: none;
}
}

/*endregion*/

/*region Tab*/

#tab-head {
font-size: 0;
position: relative;
padding: 0;
width: 100%;
margin: 0 auto;
user-select: none;
text-align: center;
}

#tab-head > .tab-block {
display: inline-block;
width: 32%;
height: 60px;
/*background: #E95546;*/
font-size: 16px;
text-align: center;
line-height: 60px;
color: #000;
text-transform: uppercase;
position: relative;
overflow: hidden;
cursor: pointer;
z-index: 10;
}

.slider {
width: 32%;
display: block;
position: absolute;
bottom: 0;
left: 0;
height: 4px;
background: #4FC2E5;
transition: all 0.5s;
margin-left: 2%;
}

.ripple {
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.4);
-webkit-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
opacity: 1;
}

.rippleEffect {
-webkit-animation: rippleDrop .4s linear;
animation: rippleDrop .4s linear;
background-color: #00aced;
}

@-webkit-keyframes rippleDrop {
100% {
-webkit-transform: scale(2);
transform: scale(2);
opacity: 0;
}
}

@keyframes rippleDrop {
100% {
-webkit-transform: scale(2);
transform: scale(2);
opacity: 0;
}
}

#tab-content-2, #tab-content-3 {
display: none;
}

/*endregion*/
/*region 书卡*/
.tab-content {
text-align: center;
}

.tab-content .card {
display: inline-block;
width: 30%;
height: 100%;
background: #fff;
margin: 15px 0;
position: relative;
overflow: hidden;
font-size: 0;
/*padding:1px;*/
/*border:4px solid rgba(0,0,0,0.85);*/
/*border-radius:15px;*/
transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
}

.f {
transform: scale(1) rotate(0deg);
-webkit-transform: scale(1) rotate(0deg);
-moz-transform: scale(1) rotate(0deg);
-o-transform: scale(1) rotate(0deg);
}

.f:hover {
transform: scale(1.5) rotate(-360deg);
-webkit-transform: scale(1.5) rotate(-360deg);
-moz-transform: scale(1.5) rotate(-360deg);
-o-transform: scale(1.5) rotate(-360deg);
z-index: 20;
}
.tab-content .card {
background-size: cover!important;
}

/*endregion*/
Loading