Skip to content

Commit

Permalink
Optimize post-reward style
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jun 24, 2020
1 parent 7d25c16 commit 3535527
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
6 changes: 3 additions & 3 deletions layout/_partials/post/post-reward.njk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="reward-container">
<div>{{ page.reward_settings.comment }}</div>
<button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
<button onclick="document.getElementById('post-reward').classList.toggle('active');">
{{ __('reward.donate') }}
</button>
<div id="qr" style="display: none;">
<div id="post-reward">

{%- for name, image in theme.reward %}
{%- set builtin = ['wechatpay', 'alipay', 'paypal', 'bitcoin'] %}
Expand All @@ -12,7 +12,7 @@
{% else %}
{%- set translation = name %}
{%- endif %}
<div style="display: inline-block;">
<div>
<img src="{{ url_for(image) }}" alt="{{ author }} {{ translation }}">
<p>{{ translation }}</p>
</div>
Expand Down
39 changes: 25 additions & 14 deletions source/css/_common/components/post/post-reward.styl
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,40 @@
}
}

#qr {
#post-reward {
padding-top: 20px;
display: none;

&.active {
display: block;
}

div {
display: inline-block;

if (hexo-config('reward_settings.animation')) {
&:hover p {
animation: roll .1s infinite linear;
// The animation may affect :hover of img in dark mode
pointer-events: none;
}
}
}

img {
display: inline-block;
margin: .8em 2em 0 2em;
max-width: 100%;
width: 180px;
}
}

if (hexo-config('reward_settings.animation')) {
div:hover p {
animation: roll .1s infinite linear;
}

@keyframes roll {
from {
transform: rotateZ(30deg);
}
@keyframes roll {
from {
transform: rotateZ(30deg);
}

to {
transform: rotateZ(-30deg);
}
}
to {
transform: rotateZ(-30deg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
padding: 0;

.popular-posts-item {
// list-style: none;
margin-left: 2em;

.popular-posts-title {
Expand Down
1 change: 0 additions & 1 deletion source/css/_common/outline/sidebar/sidebar-toc.styl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
line-height: 1.8;
overflow: hidden;
text-overflow: ellipsis;
// text-align: justify;

if (!hexo-config('toc.wrap')) {
white-space: nowrap;
Expand Down
1 change: 0 additions & 1 deletion source/css/_schemes/Mist/_posts-expand.styl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
text-align: left;

.btn {
// color: $grey-dim;
background: none;
border: 0;
border-bottom: 2px solid var(--btn-default-border-color);
Expand Down
2 changes: 0 additions & 2 deletions source/css/_schemes/Pisces/_sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
}

.links-of-blogroll-item {
//padding: 0;

if (hexo-config('links_settings.layout') == 'inline') {
display: inline-block;
sidebar-inline-links-item();
Expand Down

0 comments on commit 3535527

Please sign in to comment.