Skip to content

Commit

Permalink
💄 优化分类及正文内关联图标展示
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Nov 13, 2022
1 parent 80373a5 commit 6c475a7
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 32 deletions.
2 changes: 1 addition & 1 deletion assets/dist/common.min.css

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions assets/dist/libs.min.css

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.

19 changes: 18 additions & 1 deletion assets/style/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,23 @@ a {
background: var(--pk-c-border);
max-width: 16%;
height: 1px;
margin: 0 5px;
margin: 0 10px;
}
}

.pk-badge{
display: inline-block;
padding: 5px 10px;
cursor: pointer;
border-radius: 2px;
background-color: var(--pk-bg-box-content);
color: #808695 !important;
&:hover{
background-color: var(--pk-c-primary);
color: var(--pk-c-light) !important;
}
&.pk-badge-sm{
padding: 3px 6px;
font-size: 12px;
}
}
24 changes: 18 additions & 6 deletions assets/style/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ a:hover {
color: var(--pk-c-font);
border-radius: 2px;
}

.form-control:disabled, .form-control[readonly] {
background-color: var(--pk-c-input-bg);
opacity: .8;
Expand All @@ -594,14 +595,16 @@ a:hover {
-webkit-backdrop-filter: blur(10px);
}

&#header{
&>.navbar>.container{
&#header {
& > .navbar > .container {
flex-wrap: nowrap;
#menus{
&>ul{

#menus {
& > ul {
display: flex;
flex-wrap: nowrap;
&>li{

& > li {
flex-shrink: 0;
}
}
Expand Down Expand Up @@ -686,7 +689,7 @@ a:hover {
flex-shrink: 0;
overflow: hidden;

&>figure{
& > figure {
overflow: hidden;
}

Expand Down Expand Up @@ -958,6 +961,15 @@ a:hover {
&.p-indent > p {
text-indent: 2rem;
}
a:not(.btn,.fancybox){
&:before {
content: "\f0c1";
font-family: var(--fa-style-family,"Font Awesome 6 Free");
margin-right: 3px;
font-weight: var(--fa-style,900);
font-size: 12px;
}
}
}

.p-block {
Expand Down
10 changes: 5 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function get_post_category_link_exec($all = true, $class = '', $icon = '', $cid
if ($all) {
$out = "";
foreach ($cats as $cate) {
$out .= '<a ' . pk_link_target(false) . ' class="' . $class . '" href="' . get_category_link($cate) . '">' . $icon . $cate->name . '</a>';
$out .= '<a ' . pk_link_target(false) . ' class="' . $class . ' mr5" href="' . get_category_link($cate) . '"><i class="fa-regular fa-folder-open"></i> ' . $icon . $cate->name . '</a> ';
}
$out = mb_substr($out, 0, mb_strlen($out) - 1);
return $out;
Expand All @@ -154,7 +154,7 @@ function get_post_category_link_exec($all = true, $class = '', $icon = '', $cid
} else {
$cate = get_category($cat);
}
return '<a ' . pk_link_target(false) . ' class="' . $class . '" href="' . get_category_link($cate) . '">' . $icon . $cate->name . '</a>';
return '<a ' . pk_link_target(false) . ' class="' . $class . '" href="' . get_category_link($cate) . '"><i class="fa-regular fa-folder-open"></i> ' . $icon . $cate->name . '</a>';
}
}
}
Expand All @@ -170,8 +170,8 @@ function get_post_tags($class = '')
if ($tags && count($tags) > 0) {
$out .= '<div class="' . $class . '">';
foreach ($tags as $tag) {
$color_index = mt_rand(0, count($puock_colors_name) - 1);
$out .= '<a href="' . get_tag_link($tag) . '" class="ahfff curp mr-1 badge badge-' . $puock_colors_name[$color_index] . '"># ' . $tag->name . '</a>';
// $color_index = mt_rand(0, count($puock_colors_name) - 1);
$out .= '<a href="' . get_tag_link($tag) . '" class="pk-badge pk-badge-sm mr5"><i class="fa-solid fa-tag"></i> ' . $tag->name . '</a>';
}
$out .= '</div>';
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ function pk_get_color_tag($ex = array())
if (!in_array($c, $ex)) {
return $c;
}
};
}
}


Expand Down
13 changes: 7 additions & 6 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class="fa-regular fa-pen-to-square mr-1"></i><?php _e('编辑', PUOCK) ?></div>
</ul>
</div>
<?php endif; ?>
<div class="t-separator c-sub t-sm mt30">正文结束</div>
<?php if (pk_is_checked('post_foot_qrcode_open')): ?>
<div class="post-foot-qrcode">
<div class="title"><?php echo pk_get_option('post_foot_qrcode_title', '无说明') ?></div>
Expand All @@ -67,17 +68,17 @@ class="fa-regular fa-pen-to-square mr-1"></i><?php _e('编辑', PUOCK) ?></div>
</div>
<?php endif; ?>
<div class="footer-info puock-text mt20">
<div class="p-flex-sbc mt20 t-sm">
<div class="mt20">
<div>
<span><?php _e('发表至:', PUOCK) ?></span><?php echo get_post_category_link_exec(true) ?>
<?php echo get_post_tags('mt20 tags') ?>
</div>
</div>
<div class="p-flex-sbc mt20 t-sm">
<div>
<span class="c-sub"><?php pk_get_post_date() ?></span>
<span><?php _e('发表至:', PUOCK) ?></span><?php echo get_post_category_link_exec(true) ?>
</div>
</div>
<div class="mt20">
<div>
<?php echo get_post_tags('mt20 tags') ?>
<span class="c-sub"><i class="fa-solid fa-calendar-days"></i> <?php pk_get_post_date() ?></span>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/module-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class="t-sm d-none d-sm-inline-block">个评论</span></a>
</div>
<div>
<?php echo get_post_category_link('c-sub-a t-sm ml-md-2 line-h-20 d-inline-block d-md-none', '<i class="fa fa-tags mr-1"></i>') ?>
<span class="t-sm ml-md-2 c-sub line-h-20 d-none d-md-inline-block"><?php pk_get_post_date() ?></span>
<span class="t-sm ml-md-2 c-sub line-h-20 d-none d-md-inline-block"><i class="fa-solid fa-calendar-days"></i> <?php pk_get_post_date() ?></span>
</div>
</div>
</div>
Expand Down Expand Up @@ -84,7 +84,7 @@ class="t-sm d-none d-sm-inline-block">个评论</span></a>
</div>
<div>
<?php echo get_post_category_link('c-sub-a t-sm ml-md-2 line-h-20 d-inline-block d-md-none', '<i class="fa fa-tags mr-1"></i>') ?>
<span class="t-sm ml-md-2 c-sub line-h-20 d-none d-md-inline-block"><?php pk_get_post_date() ?></span>
<span class="t-sm ml-md-2 c-sub line-h-20 d-none d-md-inline-block"><i class="fa-solid fa-calendar-days"></i> <?php pk_get_post_date() ?></span>
</div>
</div>
</div>
Expand Down

0 comments on commit 6c475a7

Please sign in to comment.