Skip to content

Commit

Permalink
✨ 替换主题图标引用为fontawesome
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Oct 7, 2022
1 parent c41e209 commit a46299c
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 114 deletions.
2 changes: 1 addition & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h3 class="mt20"><?php _e('你访问的资源不存在!', PUOCK) ?></h3>
<h5 class="mt20"><span id="time-count-down">3</span><?php _e('秒后即将跳转至首页', PUOCK) ?></h5>
<div class="text-center mt20">
<a class="a-link" href="<?php echo home_url() ?>"><i class="czs-home-l"></i>&nbsp;<?php _e('返回首页', PUOCK) ?></a>
<a class="a-link" href="<?php echo home_url() ?>"><i class="fa fa-home"></i>&nbsp;<?php _e('返回首页', PUOCK) ?></a>
</div>
</div>
<script>
Expand Down
1 change: 0 additions & 1 deletion assets/dist/main.min.css

This file was deleted.

2 changes: 1 addition & 1 deletion assets/dist/puock.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/style.min.css

Large diffs are not rendered by default.

21 changes: 8 additions & 13 deletions assets/js/puock.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class Puock {
const id = menuIndex;
const pl = (item.levelInt - maxLevel) * 10
let out = `<li data-level="${item.levelInt}" style='padding-left:${pl}px'>`
out += `<a class='pk-menu-to a-link t-w-400 t-md post-menu-item' data-parent="${parent}" data-id="${id}" href='#${item.id}'><i class='${item.children.length > 0 ? 'czs-angle-right-l':'czs-doc-file-l'} t-sm c-sub mr-1'></i> ${item.name}</a>`
out += `<a class='pk-menu-to a-link t-w-400 t-md post-menu-item' data-parent="${parent}" data-id="${id}" href='#${item.id}'><i class='fa ${item.children.length > 0 ? 'fa-angle-right':'fa-file-invoice'} t-sm c-sub mr-1'></i> ${item.name}</a>`
if (item.children.length > 0) {
out += `<ul class="post-menu-sub-${id}" data-parent="${parent + 1}">`
for (let child of item.children) {
Expand Down Expand Up @@ -434,7 +434,7 @@ class Puock {
if (!el.attr("id")) {
el.attr("id", "hljs-item-" + index)
el.before("<div class='pk-code-tools' data-pre-id='hljs-item-" + index + "'><div class='dot'>" +
"<i></i><i></i><i></i></div><div class='actions'><div><i class='i czs-list-clipboard-l cp-code' data-clipboard-target='#hljs-item-" + index + "'></i></div></div></div>")
"<i></i><i></i><i></i></div><div class='actions'><div><i class='i fa fa-copy cp-code' data-clipboard-target='#hljs-item-" + index + "'></i></div></div></div>")
window.hljs.highlightBlock(block);
window.hljs.lineNumbersBlock(block);
}
Expand All @@ -444,11 +444,6 @@ class Puock {
cp.on("success", (e) => {
e.clearSelection();
this.toast('已复制到剪切板')
const el = $(e.trigger);
el.removeClass("czs-list-clipboard-l").addClass("czs-right-clipboard-l")
setTimeout(() => {
el.removeClass("czs-right-clipboard-l").addClass("czs-list-clipboard-l")
}, 1500)
})
}
}
Expand Down Expand Up @@ -533,7 +528,7 @@ class Puock {
target = $(el).find("i");
}
if(target){
target.removeClass("czs-sun-l").removeClass("czs-moon-l").addClass(isLight ? "czs-sun-l" : "czs-moon-l");
target.removeClass("fa-sun").removeClass("fa-moon").addClass(isLight ? "fa-sun" : "fa-moon");
}
})
body.removeClass(isLight ? this.data.tag + "-dark" : this.data.tag + "-light");
Expand Down Expand Up @@ -814,19 +809,19 @@ class Puock {
if (repo) {
$.get(`https://api.github.com/repos/${repo}`, (res) => {
const link_html = `class="hide-hover" href="${res.url}" target="_blank" rel="noreferrer"`;
el.html(`<div class="card-header"><i class="czs-github-logo"></i><a ${link_html}>${res.full_name}</a></div>
el.html(`<div class="card-header"><i class="fa-brands fa-github"></i><a ${link_html}>${res.full_name}</a></div>
<div class="card-body">${res.description}</div>
<div class="card-footer">
<div class="row">
<div class="col-4"><i class="czs-star"></i><a ${link_html}>${res.stargazers_count}</a></div>
<div class="col-4"><i class="czs-code-fork"></i><a ${link_html}>${res.forks}</a></div>
<div class="col-4"><i class="czs-eye"></i><a ${link_html}>${res.subscribers_count}</a></div>
<div class="col-4"><i class="fa-regular fa-star"></i><a ${link_html}>${res.stargazers_count}</a></div>
<div class="col-4"><i class="fa-solid fa-code-fork"></i><a ${link_html}>${res.forks}</a></div>
<div class="col-4"><i class="fa-regular fa-eye"></i><a ${link_html}>${res.subscribers_count}</a></div>
</div>
</div>
`);
el.addClass("loaded");
}, 'json').error((err) => {
el.html(`<div class="alert alert-danger"><i class="czs-warning"></i>&nbsp;请求Github项目详情异常:${repo}</div>`)
el.html(`<div class="alert alert-danger"><i class="fa fa-warning"></i>&nbsp;请求Github项目详情异常:${repo}</div>`)
});
}
})
Expand Down
10 changes: 2 additions & 8 deletions assets/style/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -517,18 +517,12 @@ a:hover {
}

.colorMode {
&.czs-moon-l, .czs-moon-l {
&.fa-moon, .fa-moon {
color: var(--pk-c-yellow);
}
}
}

[class^=czs-] {
position: relative;
top: 1px;
}


.carousel-control-next {
justify-content: flex-end;
padding-right: 30px;
Expand Down Expand Up @@ -1650,7 +1644,7 @@ a:hover {
background-color: var(--pk-c-primary);
text-align: center;

[class^='czs'] {
[class^='fa'] {
font-size: (@wh / 2);
color: var(--pk-c-font);
line-height: @wh;
Expand Down
10 changes: 5 additions & 5 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="p-block" id="comments">
<div>
<span class="t-lg border-bottom border-primary puock-text pb-2"><i
class="czs-write-l mr-1"></i><?php _e('评论', PUOCK) ?><?php comments_number() ?></span>
class="fa-regular fa-comments mr-1"></i><?php _e('评论', PUOCK) ?><?php comments_number() ?></span>
</div>
<?php if (comments_open()): ?>
<?php if (get_option('comment_registration', '0') == '1' && !is_user_logged_in()): //登录后才可以评论 ?>
Expand All @@ -18,7 +18,7 @@ class="czs-write-l mr-1"></i><?php _e('评论', PUOCK) ?>(<?php comments_numbe
<div>
<a data-no-instant href="<?php echo pk_oauth_url_page_ajax('qq', get_the_permalink()) ?>"
class="btn btn-danger btn-ssm ahfff"><i
class="czs-qq"></i>&nbsp;<?php _e('QQ登录', PUOCK) ?></a>
class="fa-brands fa-qq"></i>&nbsp;<?php _e('QQ登录', PUOCK) ?></a>
</div>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -89,17 +89,17 @@ class="form-control form-control-sm t-sm" name="comment-vd"
<a data-no-instant
href="<?php echo pk_oauth_url_page_ajax('qq', get_the_permalink()) ?>"
class="btn btn-danger btn-ssm ahfff"><i
class="czs-qq"></i>&nbsp;<?php _e('QQ登录', PUOCK) ?></a>
class="fa-brands fa-qq"></i>&nbsp;<?php _e('QQ登录', PUOCK) ?></a>
</div>
<?php endif; ?>
</div>
<div>
<button id="comment-cancel" type="button"
class="btn btn-outline-dark d-none btn-ssm"><?php _e('取消', PUOCK) ?></button>
<button id="comment-smiley" class="btn btn-outline-secondary btn-ssm" type="button"><i
class="czs-face-l t-md"></i></button>
class="fa-regular fa-face-grin-tongue t-md"></i></button>
<button id="comment-submit" type="submit" class="btn btn-primary btn-ssm"><i
class="czs-paper-plane-l"></i>&nbsp;<?php _e('发布评论', PUOCK) ?></button>
class="fa-regular fa-paper-plane"></i>&nbsp;<?php _e('发布评论', PUOCK) ?></button>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion error.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="text-center p-block puock-text">
<h3 class="mt20"><?php echo $error_info ?></h3>
<div class="text-center mt20">
<a class="a-link" href="<?php echo home_url() ?>"><i class="czs-home-l"></i>&nbsp;<?php _e('返回首页', PUOCK) ?>
<a class="a-link" href="<?php echo home_url() ?>"><i class="fa fa-home"></i>&nbsp;<?php _e('返回首页', PUOCK) ?>
</a>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="modal-header">
<h5 class="modal-title puock-text" id="infoToastTitle"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="czs-close-l t-md"></i></span>
<span aria-hidden="true"><i class="fa fa-close t-md"></i></span>
</button>
</div>
<div class="modal-body puock-text t-md" id="infoToastText">
Expand All @@ -16,24 +16,24 @@
<?php if (pk_is_checked('use_post_menu')) get_template_part('templates/module', 'menus') ?>
<!--返回顶部和底部-->
<div id="return-top-bottom">
<div data-to="top" class="p-block"><i class="czs-arrow-up-l puock-text"></i></div>
<div data-to="bottom" class="p-block"><i class="czs-arrow-down-l puock-text"></i></div>
<div data-to="top" class="p-block"><i class="fa fa-arrow-up puock-text"></i></div>
<div data-to="bottom" class="p-block"><i class="fa fa-arrow-down puock-text"></i></div>
</div>
<footer id="footer">
<div class="container">
<div class="row row-cols-md-1">
<?php if (!empty(pk_get_option('footer_about_me_title', ''))): ?>
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-about-l"></i> <?php echo pk_get_option('footer_about_me_title', '') ?></span>
class="fa-regular fa-bell"></i> <?php echo pk_get_option('footer_about_me_title', '') ?></span>
</div>
<p class="mt20 t-md"><?php echo pk_get_option('footer_about_me', '') ?></p>
</div>
<?php endif; ?>
<?php if (!empty(pk_get_option('footer_copyright_title', ''))): ?>
<div class="col-md-6">
<div><span class="t-md pb-2 d-inline-block border-bottom border-primary"><i
class="czs-network-l"></i> <?php echo pk_get_option('footer_copyright_title', '') ?></span>
class="fa-regular fa-copyright"></i> <?php echo pk_get_option('footer_copyright_title', '') ?></span>
</div>
<p class="mt20 t-md"><?php echo pk_get_option('footer_copyright', '') ?></p>
</div>
Expand All @@ -44,7 +44,7 @@ class="czs-network-l"></i> <?php echo pk_get_option('footer_copyright_title', ''
<div class="info">
<?php echo pk_get_option('footer_info') ?>
<?php /* 请遵守开源协议,保留主题底部(此处)的署名,以支持本主题更好的发展,谢谢合作 */ ?>
<p class="fs12 mt10"><i class="czs-wordpress"></i>&nbsp;Theme by <a target="_blank" title="Puock"
<p class="fs12 mt10"><i class="fa-brands fa-wordpress"></i>&nbsp;Theme by <a target="_blank" title="Puock v<?php echo PUOCK_CUR_VER_STR; ?>"
href="https://github.com/Licoy/wordpress-theme-puock">Puock</a>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function pk_the_author_class_out($count)
default:
return '';
}
return '<span class="t-sm c-sub"><i class="czs-diamond-l mr-1"></i>' . __('评论达人', PUOCK) . ' LV.' . $level . '</span>';
return '<span class="t-sm c-sub"><i class="fa-regular fa-gem mr-1"></i>' . __('评论达人', PUOCK) . ' LV.' . $level . '</span>';
}

function pk_the_author_class($echo = true, $in_comment = null){
Expand All @@ -92,7 +92,7 @@ function pk_the_author_class($echo = true, $in_comment = null){
$comment = $in_comment;
}
if ($comment->user_id == '1') {
$res = '<span class="t-sm text-danger"><i class="czs-diamond-l mr-1"></i>' . __('博主', PUOCK) . '</span>';
$res = '<span class="t-sm text-danger"><i class="fa-regular fa-gem mr-1"></i>' . __('博主', PUOCK) . '</span>';
} else {
$comment_author_email = $comment->comment_author_email;
$cache_key = sprintf(PKC_AUTHOR_COMMENTS, md5($comment_author_email));
Expand Down
19 changes: 9 additions & 10 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<?php if (is_single() || is_page()): ?>
<?php endif; ?>
</head>
<body class="puock-<?php echo pk_theme_light() ? 'light' : 'dark'; echo current_theme_supports('custom-background') ? ' custom-background':''; ?>">
<body class="puock-<?php echo pk_theme_light() ? 'light' : 'dark';
echo current_theme_supports('custom-background') ? ' custom-background' : ''; ?>">
<div>
<?php if (is_single()): ?>
<div class="progress" id="page-read-progress">
Expand Down Expand Up @@ -57,13 +58,12 @@ class="<?php pk_open_box_animated('animated fadeInDown') ?> <?php if (pk_is_chec
<div id="menus" class="t-md ">
<?php echo pk_get_main_menu() ?>
</div>
</div>
<div class="mobile-menus d-block d-lg-none p-1 puock-text">
<i class="czs-menu-l t-xl mr-2 mobile-menu-s"></i>
<?php if(pk_is_checked('theme_mode_s')): ?>
<i class="colorMode czs-<?php echo (pk_theme_light() ? 'sun':'moon'); ?>-l t-xl mr-2"></i>
<i class="fa fa-bars t-xl mr-2 mobile-menu-s"></i>
<?php if (pk_is_checked('theme_mode_s')): ?>
<i class="fa-regular fa-<?php echo(pk_theme_light() ? 'sun' : 'moon'); ?> colorMode t-xl mr-2"></i>
<?php endif; ?>
<i class="search-modal-btn czs-search-l t-md"></i>
<i class="search-modal-btn fa fa-search t-md"></i>
</div>
</div>
</div>
Expand All @@ -79,11 +79,10 @@ class="<?php pk_open_box_animated('animated fadeInDown') ?> <?php if (pk_is_chec
</div>
<div class="search-start">
<button type="submit" class="btn-dark btn"><i
class="czs-search-l mr-1"></i><?php _e('搜索', PUOCK) ?></button>
class="fa fa-search mr-1"></i><?php _e('搜索', PUOCK) ?></button>
</div>
<div class="search-close-btn">
<button type="button" class="btn-danger btn ml-1 search-modal-btn"><i
class="czs-close-l"></i></button>
<button type="button" class="btn-danger btn ml-1 search-modal-btn"><i class="fa fa-close"></i></button>
</div>
</div>
</form>
Expand All @@ -93,7 +92,7 @@ class="czs-close-l"></i></button>
<div id="mobile-menu" class="d-none">
<div class="menus">
<div class="p-block">
<div class="text-right"><i class="czs-close-l t-xl puock-link mobile-menu-close ta3"></i></div>
<div class="text-right"><i class="fa fa-close t-xl puock-link mobile-menu-close ta3"></i></div>
<nav>
<?php echo pk_get_main_menu(true) ?>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion inc/fun/comment-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function pk_comment_ajax()
$comment_approved_str = '';

if ($comment->comment_approved == '0') {
$comment_approved_str = '<p class="c-sub mt-1"><i class="czs-warning-l mr-1"></i>您的评论正在等待审核!</p>';
$comment_approved_str = '<p class="c-sub mt-1"><i class="fa fa-warning mr-1"></i>您的评论正在等待审核!</p>';
}

wp_set_comment_cookies($comment, $user);
Expand Down
6 changes: 3 additions & 3 deletions inc/fun/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class="avatar avatar-64 photo md-avatar lazyload" width="60" height="60">
<?php if ($comment->comment_approved == '1' && (!$author_cat_comment || $is_author)) : ?>
<a id="comment-reply-<?php comment_ID() ?>" data-id="<?php comment_ID() ?>"
class="hide-info animated bounceIn c-sub-a t-sm ml-1 comment-reply"
href="javascript:void(0)" title="回复此评论"><i class="czs-share"></i>
href="javascript:void(0)" title="回复此评论"><i class="fa fa-share-from-square"></i>
<span class="comment-reply-text">回复</span></a>
<?php endif; ?>
</div>
Expand All @@ -52,9 +52,9 @@ class="hide-info animated bounceIn c-sub-a t-sm ml-1 comment-reply"
echo 'style="margin-left:0"';
} ?>>
<?php if (!$author_cat_comment || $is_author): comment_text(); else: ?>
<?php echo "<span><i class='czs-lock-l'></i>&nbsp;此评论仅对作者可见</span>";endif; ?>
<?php echo "<span><i class='fa fa-lock'></i>&nbsp;此评论仅对作者可见</span>";endif; ?>
<?php if ($comment->comment_approved == '0') : ?>
<p class="c-sub mt-1"><i class="czs-warning-l mr-1"></i>您的评论正在等待审核!</p>
<p class="c-sub mt-1"><i class="fa fa-warning mr-1"></i>您的评论正在等待审核!</p>
<?php endif; ?>

<div class="comment-os c-sub">
Expand Down
8 changes: 4 additions & 4 deletions inc/fun/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ function pk_get_main_menu($mobile = false)
}
if (!$mobile) {
if (pk_is_checked('theme_mode_s')) {
$out .= '<li><a class="colorMode" data-toggle="tooltip" title="模式切换" href="javascript:void(0)"><i class="czs-' . (pk_theme_light() ? 'sun' : 'moon') . '-l"></i></a></li>';
$out .= '<li><a class="colorMode" data-toggle="tooltip" title="模式切换" href="javascript:void(0)"><i class="fa-regular fa-' . (pk_theme_light() ? 'sun' : 'moon') . '"></i></a></li>';
}
$out .= '<li><a class="search-modal-btn" data-toggle="tooltip" title="搜索" href="javascript:void(0)"><i class="czs-search-l"></i></a></li>';
$out .= '<li><a class="search-modal-btn" data-toggle="tooltip" title="搜索" href="javascript:void(0)"><i class="fa fa-search"></i></a></li>';
}
$out .= '</ul>';
return $out;
Expand Down Expand Up @@ -657,9 +657,9 @@ function pk_get_menu_obj_to_html($menus, &$out, $mobile = false, $dpath_cur = 1,
}
if (count($menu->children) > 0) {
if ($mobile) {
$out .= '<a href="#menu-sub-' . $menu->ID . '" data-toggle="collapse"><i class="czs-angle-down-l t-sm ml-1 menu-sub-icon"></i></a>';
$out .= '<a href="#menu-sub-' . $menu->ID . '" data-toggle="collapse"><i class="fa fa-chevron-down t-sm ml-1 menu-sub-icon"></i></a>';
} else {
$out .= '<i class="czs-angle-down-l t-sm ml-1 menu-sub-icon"></i>';
$out .= '<i class="fa fa-chevron-down t-sm ml-1 menu-sub-icon"></i>';
}
}
if ($mobile) {
Expand Down
Loading

0 comments on commit a46299c

Please sign in to comment.