Skip to content

Commit

Permalink
Merge pull request #245 from xzhuz/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
xzhuz authored Apr 7, 2022
2 parents 0830ac3 + 0948c47 commit 815d228
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 163 deletions.
8 changes: 3 additions & 5 deletions category.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
<@layout title="分类:${category.name} | ${options.blog_title!} ">
<main class="mx-auto" id="container">
<header class="bg-gray-900 table fade-down relative w-full opacity-95 z-10 h-1/2">
<#if settings.categories_patternimg?? && settings.categories_patternimg!=''>
<#if category.thumbnail?? && category.thumbnail != ''>
<div class="cover-bg bottom-0 left-0 right-0 top-0 opacity-30 absolute">
<img src="${settings.categories_patternimg!}"
<img src="${category.thumbnail!}"
class="h-full w-full left-0 object-cover absolute top-0 dark:filter-60 no-zoom"
alt="${category.name}">
</div>
<#else>
<div class="placeholder-bg">
</div>
<div class="placeholder-bg"></div>
</#if>
<div class="h-96 align-middle table-cell relative w-full index flex justify-center">
<h2 class="text-white mb-5 mt-4 leading-loose relative w-full text-4xl text-center dark:text-gray-300">
${category.name} <sup>${posts.totalElements}</sup>
</h2>
<#-- <hr class="text-center bg-red-300 h-0.5 border-none w-20 mx-auto -mt-5 mb-3"/>-->
</div>
</header>
<div class="mx-auto fade-up pt-4 <#if settings.posts_style!true>px-5 md:px-0 max-w-xl sm:max-w-2xl md:max-w-3xl lg:max-w-5xl <#else> px-5 max-w-4xl</#if>">
Expand Down
2 changes: 1 addition & 1 deletion dist/style.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions journals.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
</div>
<div class="flex space-x-5 pt-3 text-gray-500 border-t border-gray-300 dark:border-gray-700">
<div class="flex space-x-2">
<span class="iconfont icon-heart icon-${journal.id} w-6 h-6 hover:text-red-300 cursor-pointer like-btn"
style="font-size: 1.5rem;line-height: 1.7rem;"
data-index="${journal.id}"
<span class="iconfont icon-heart relative inline-block h-full cursor-pointer like-btn"
style="font-size: 1.5rem;line-height: 1.6rem;"
data-path="${blog_url!}/api/content/journals/${journal.id}/likes"
data-count="${journal.likes}"
fill="currentColor"
>
</span>
<span class="like-count-${journal.id}">${journal.likes}</span>
<#-- <span class="like-count-${journal.id}">${journal.likes}</span>-->
</div>
<div class="flex space-x-2">
<svg viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6 cursor-pointer hover:text-red-300 comment-btn" data-index="${journal.id}">
Expand Down
2 changes: 1 addition & 1 deletion module/pjax.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
xueContext.createTimeAgo()
}
// alipay
// arrow down
if ($("#container").find('.arrow-down').length > 0) {
xueContext.arrowDown()
}
Expand Down
5 changes: 4 additions & 1 deletion module/plugins.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@
<#--相册-->
<script src="${theme_base!}/source/js/plugins/isotope.pkgd.min.js"></script>

<#--相册-->
<#--复制按钮-->
<script src="${theme_base!}/source/js/plugins/clipboard.min.js"></script>

<#--消息弹出框-->
<script src="${theme_base!}/source/js/plugins/qmsg.js"></script>

<#--导航栏-->
<script src="${theme_base!}/source/js/plugins/simply-nav.js"></script>

Expand Down
1 change: 1 addition & 0 deletions module/styles.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<link href="${theme_base!}/source/css/heti.min.css" rel="stylesheet">
<link href="${theme_base!}/source/css/katex.min.css" rel="stylesheet">
<link href="${theme_base!}/source/css/jquery.fancybox.min.css" rel="stylesheet">
<link href="${theme_base!}/source/css/qmsg.css" rel="stylesheet">
<link rel="stylesheet" href="${theme_base!}/dist/style.css?ver=${theme.version!}">
Expand Down
12 changes: 6 additions & 6 deletions post.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
<div class="mx-auto md-content mt-8 text-center max-w-4xl tracking-wider md:leading-relaxed sm:leading-normal">
<#include "module/widget/sponsor.ftl">
<div class="inline-block text-center my-4 " >
<div role="button" class="icon relative inline-block bg-red-600 hover:bg-red-500 rounded-full py-3 z-50 w-28 h-full cursor-pointer like-btn"
data-index="${post.id}"
data-path="${blog_url!}/api/content/posts/${post.id}/likes">
<span class="iconfont icon-heart h-0 icon-${post.id} text-white z-10" ></span>
<span class="like-count inline-block h-0 text-white z-10 like-count-${post.id}">${post.likes}</span>
</div>
<span role="button" class="iconfont icon-heart text-white relative inline-block bg-red-600 hover:bg-red-500 rounded-full py-3 z-50 w-28 h-full cursor-pointer like-btn"
style="font-size: 1.5rem; line-height: 1.7rem;padding-top: 15px;"
data-path="${blog_url!}/api/content/posts/${post.id}/likes"
data-count="${post.likes}"
>
</span>
</div>
<hr class="bg-gray-100 dark:bg-gray-700 ">
</div>
Expand Down
1 change: 1 addition & 0 deletions source/css/qmsg.css

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

23 changes: 13 additions & 10 deletions source/js/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
const slideUp = {
distance: '2rem',
origin: 'bottom',
// opacity: 1,
// delay:100,
interval: 50,
duration: 500,
reset: false,
// easing: 'ease-in'
};

// 主题相关函数
Expand All @@ -26,6 +23,10 @@ const xueContext = {
xueContext.handleNavTheme()
// 检查本地缓存
xueContext.checkLocalStorage()

if (document.body.clientWidth <= 800) {
toggleNavCheckBox();
}

$('script[data-pjax-comment]').each(function () {
const commentParent = $(this).parent();
Expand Down Expand Up @@ -211,7 +212,6 @@ const xueContext = {
});
},


// 处理首页 arrow-down
arrowDown: function () {
$('.arrow-down').click(function () {
Expand Down Expand Up @@ -245,7 +245,12 @@ const xueContext = {
toggleSearchBox: function () {
$('.search-btn').click(function () {
$('#searchBox').toggleClass('hidden');

if (document.body.clientWidth <= 800) {
toggleNavCheckBox();
}
});

},

// 分页信息
Expand Down Expand Up @@ -302,13 +307,11 @@ const xueContext = {
contentType: "application/json",
dataType: "json",
success: function () {
var $count = $('.like-count-' + index)
var likeCount = parseInt($count.html());
$count.html(likeCount + 1);
var count = $e.attr('data-count')
$e.attr('data-count', parseInt(count) + 1)
$e.removeClass('icon-heart')
$e.addClass('icon-heart-fill')
xueContext.likeBtn()
var $icon = $('.icon-' + index)
$icon.removeClass('icon-heart')
$icon.addClass('icon-heart-fill')
},
error: function (msg) {
xueContext.likeBtn();
Expand Down
1 change: 1 addition & 0 deletions source/js/plugins/qmsg.js

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

Loading

0 comments on commit 815d228

Please sign in to comment.