列表
文章
css
/***
第一部分:所有的模板都使用的公共样式。公告样式是为了更好的向前和向后兼容。
如果不符合你皮肤的要求,你可以在后面通过更高的优先级覆盖着这些样式,但是
你不能删除这些样式。
**************************************************/
/*https://fontawesome.dashgame.com*/
@charset "utf-8";
@import url(https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css);
@import url(https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css);
@import url(https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.css);
@import url(//cdnjs.cloudflare.com/ajax/libs/mdui/0.4.3/css/mdui.min.css);
@import url(https://blog-static.cnblogs.com/files/gshang/notiflix-2.0.0.min.css);
#ad_c1,
#ad_c2,
#cnblogs_t5,
.blogStats,
.c_ad_block {
display: none
}
/*****第一部分结束*******************************/
/**************************************************
第二部:公共样式(全局样式)。公共会对所有页面的标签都起作用。这个部分你
可以随意的更改,并不会牵扯到其他的皮肤模板。但是每次更改都要注意你的皮肤
模板所有页面的变化。因为它们是全局的。
**************************************************/
:root {
--text-h4: 16px;
--text-h5: 15px;
}
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
height: 100%;
background: #fff;
color: #555;
font-family: 'pingfang SC', 'helvetica neue', arial, 'hiragino sans gb', 'microsoft yahei ui', 'microsoft yahei', simsun, sans-serif;
font-size: 11pt;
line-height: 2;
margin: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,
img {
border: 0;
}
ul {
word-break: break-all;
}
li {
list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
font-weight: normal;
}
a:link {
color: #555;
text-decoration: none;
}
a:visited {
color: #555;
text-decoration: none;
}
a:hover {
color: #399ab2;
text-decoration: none;
}
a:active {
color: #555;
text-decoration: none;
}
.clear {
clear: both;
}
:before,
:after {
font-family: fontawesome, element-icons;
}
/*****第二部分结束*******************************/
/*****布局开始**************************/
@media screen and (min-width:0) {
/*布局*/
div#main {
padding-top: 57px;
max-width: 1234px;
width: 85%;
}
div#mainContent {
order: 1;
width: 70%;
min-width: 760px;
margin: auto;
text-align: justify;
padding-bottom: 20px;
}
div#sideBar {
order: 2;
width: 20%;
}
div#main>.clear {
order: 0;
width: 10%;
}
/*样式*/
div#main {
animation-duration: 1s;
animation-name: fade-in;
margin: auto;
display: flex;
align-items: flex-start;
}
div#sideBar {
margin: 0 8px;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
border-radius: 0 0 2px 2px;
-box-shadow: 0 4px 10px rgb(0 0 0 / 5%), 0 0 1px rgb(0 0 0 / 10%);
}
}
/*****头部和页脚开始**************************/
@media screen and (min-width:0px) {
div#top_nav {
animation-duration: .5s;
animation-name: fade-in;
z-index: 10;
box-shadow: 0 1px 0 #f0f0f0;
height: unset;
padding: 12px 0;
display: block;
/*overflow: hidden;*/
transition: transform 300ms;
background: #fffffff5;
backdrop-filter: blur(2px);
position: fixed;
width: -webkit-fill-available;
}
.navbar>nav .navbar-branding {
width: 117px;
}
.navbar>nav #navbar_login_status {
min-width: 170px;
}
nav#nav_main {
margin: auto;
max-width: 1218px;
width: 85%;
}
ul#nav_left {
margin-right: 30px;
}
a#nme:after {
content: '';
display: inline-block;
vertical-align: middle;
height: 16px;
width: 1px;
margin-left: 13px;
background: #ddd;
}
ul#nav_left li a:hover {
color: #000;
}
ul#nav_left li a {
color: #555;
cursor: pointer;
text-decoration: none;
}
li#nlist:after {
content: "\f107";
font-family: fontawesome, element-icons;
margin: 0 15px 0 5px;
}
li#nlist:hover ul {
max-height: 1000px;
}
li#nlist ul li a:hover {
-transition: background 0.1s;
background: #f5f5f5;
}
li#nlist ul li a {
display: block;
padding: 2px 20px;
}
li#nlist ul li {
font-size: 14px;
color: #444;
min-width: 95px;
}
li#nlist ul li:first-child {
padding-top: 10px;
}
li#nlist ul li:last-child {
padding-bottom: 10px;
}
li#nlist ul {
margin-left: -16px;
padding: 0;
-webkit-transition: all .5s ease, max-height .5s ease;
-o-transition: all .5s ease, max-height .5s ease;
transition: max-height .3s ease;
max-height: 0;
overflow: hidden;
position: absolute;
min-width: 5em;
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 30%);
background-color: #ffffff;
}
.medium-zoom-overlay,
.medium-zoom-image--opened {
z-index: 11;
}
.dropdown>.dropdown-menu {
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 10%);
background: white;
min-width: auto;
}
}
@media screen and (min-width:0) {
/*头与菜单*/
#header {
background: #222;
height: 2.8px;
-border-top: 3px solid black;
}
#blogTitle,
.navbar-custom,
#navigator {
height: 0;
display: none;
}
/*页脚*/
#footer {
text-align: center;
padding: 80px 14px 20px;
font-size: 14px;
}
#poweredby {
display: none;
}
/*分页*/
div#homepage_top_pager {
visibility: hidden;
margin: 0;
height: 20px;
}
.pager {
font-size: 14px;
font-weight: bold;
color: #399ab2;
word-spacing: 15px;
}
.pager a {
border: 0;
border-radius: 2px;
font-weight: normal;
margin: 0px -5px;
padding: 5px 7px;
color: #959595;
background-color: #f4f4f6;
}
.topicListFooter {
font-size: 14px;
margin: 35px;
}
}
/*****主页文章列表开始**************************/
@media screen and (min-width:0) {
/*列表*/
.day {
animation-name: fadeInUp;
animation-duration: 1s;
background: white;
padding: 20px 40px 0;
}
.day:first-child {
padding-top: 50px;
}
/*文章标题*/
.day .postTitle {
font-size: 1.3em;
font-weight: 500;
}
/*置顶*/
.day .postTitle2 span {
display: flex;
flex-wrap: wrap;
align-items: center;
font-size: 19px;
font-weight: 500;
}
.day .postTitle2 span span {
order: 1;
font-size: 0;
}
.day .postTitle2 span span:after {
content: "置顶";
margin-left: 10px;
color: #f56c6c;
background: rgba(255, 77, 77, .1);
padding: 0 4px;
height: 16px;
font-size: 12px;
font-weight: 400;
line-height: 16px;
border-radius: 2px;
margin-right: 4px;
}
/*日期标题与日内分隔线*/
.dayTitle {
display: none;
}
.day .postSeparator {
margin-bottom: 20px;
}
/*摘要内容*/
.postCon {
clear: both;
padding: 10px 0 0;
}
.c_b_p_desc {
word-break: break-all;
margin-top: 5px;
line-height: 24px;
color: #666;
word-wrap: break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
max-height: 48px;
}
.MathJax .noError {
display: none !important;
}
/*阅读全文*/
a.c_b_p_desc_readmore:after {
content: '...';
font-size: 10pt;
}
a.c_b_p_desc_readmore {
font-size: 0px;
text-decoration: none !important;
}
/*首页的文章信息条*/
.day .postDesc {
text-align: right;
padding-bottom: 20px;
border-bottom: 1px solid #f5f5f5;
padding-top: 5px;
font-size: 0px;
}
.day .postDesc a[rel="nofollow"] {
display: none;
}
.postDesc span {
font-size: 14px;
margin-left: 20px;
color: #9d9d9d;
}
span.post-date {
float: left;
margin-left: unset !important;
}
.postDesc span:before {
margin-right: 4px;
}
span.post-date:before {
content: "\e78e";
}
span.post-comment-count:before {
content: "\f0e6";
content: "\e72e";
}
span.post-view-count:before {
/*content: "\f0db";
transform: rotate(180deg);
display: inline-block;*/
content: "\e769";
}
span.post-digg-count:before {
content: "\f087";
}
}
/*****文章标签开始**************************/
@media screen and (min-width:0) {
/*我的标签*/
@media screen and (min-width: 0) {
small {
float: unset !important;
font-size: 14px;
}
#taglist_main {
margin: 50px 30px;
min-height: 500px;
}
#taglist_title {
padding: 10px;
font-size: 24px;
font-weight: 400;
margin-bottom: 10px;
text-align: left;
}
}
/*标签列表*/
@media screen and (min-width:0) {
#myposts .PostList {
border-bottom: unset;
padding: unset;
margin-left: 30px;
}
#myposts .postDesc2 {
display: none;
}
.postTitl2,
.postDesc2 {
display: inline-block;
padding: 0 !important;
font-size: 15px !important;
}
}
}
/*****侧边内容开始********************************/
@media screen and (min-width:0) {
/* 侧边栏链接 */
@media screen and (min-width: 0) {
div#sideBarMain {
visibility: hidden;
height: 0;
}
div#item {
padding-bottom: 20px;
}
a#light:after {
/* content: "\f0eb"; */
}
#user a {
color: #fff;
font-size: 20px;
text-align: center;
display: block;
padding: 15px 0 30px;
background: rgba(0, 0, 0, 0.25);
}
#user a:hover {
color: #399ab2;
}
#user {
background: linear-gradient(180deg, #222, #222);
margin-bottom: 15px;
}
.listTitle {
padding: 5px 12px;
}
#blog-sidecolumn {
display: none;
}
.listTitle:before {
margin-right: 12px;
}
#myhome:before {
content: "\f015";
}
#newtext:before {
content: "\f040"
}
#search:before {
content: "\f002";
}
#textlist:before {
content: "\f02d";
}
#item ul {
padding: 9px 2px 9px 36px;
}
#item ul li a {
display: block;
color: #b4b4b4;
font-family: fangsong;
}
}
/* 导航目录 */
@media screen and (min-width: 0px) {
.scroller-offset1 a:before {
content: "";
padding-left: 0px;
}
.scroller-offset2 a:before {
content: "";
padding-left: 20px;
}
.scroller-offset3 a:before {
content: "";
padding-left: 30px;
}
.scroller-offset4 a:before {
content: "";
padding-left: 40px;
}
.nav .active a {
color: #888 !important;
/*border-left: 2px solid #b4b4b4;
margin-left: -15px;
padding-left: 15px;*/
}
.nav .active a:hover {
color: #555 !important;
}
.isStuck {
width: 171px;
padding-bottom: 30px;
border-radius: 0 0 2px 2px;
-box-shadow: 0 4px 10px rgb(0 0 0 / 5%), 0 0 1px rgb(0 0 0 / 10%);
}
}
}
/****查看文章页面开始*************************/
@media screen and (min-width:0) {
/* 布局 */
@media screen and (min-width: 0) {
.postBody {
order: 1;
}
.post {
display: flex;
flex-direction: column;
grid-template-columns: 100%;
width: 100%;
}
div#post_detail {
background: #fff;
margin-bottom: 20px;
padding: 25px 40px;
margin-top: 10px;
}
}
/*背景*/
.post-bg {
background: rgb(245, 246, 247);
}
/*大标题*/
.post .postTitle {
font-size: 1.8em;
font-weight: 600;
overflow-wrap: break-word;
word-wrap: break-word;
/*text-align: center;*/
}
/*链接*/
div#cnblogs_post_body a,
div#cnblogs_post_body a:link {
color: #399ab2;
}
/*图片*/
#cnblogs_post_body img {
border-radius: 4px;
overflow: hidden;
}
/*版权声明*/
#blog_post_info_block {
margin-top: 40px;
}
div#blog_post_info_block:before {
content: "©版权声明:本文为博主原创作品,转载请附上原文出处链接和本声明";
color: #999;
font-size: 13px;
display: block;
padding-bottom: 15px;
font-family: auto;
}
/*点赞分享收藏*/
@media screen and (min-width:0) {
div#green_channel a:hover {
box-shadow: 0px 2px 10px #fff !important;
transition: all 200ms;
}
div#green_channel a:after {
display: flex !important;
transition: all 300ms;
position: absolute;
/*left: -41px;*/
right: 48px;
word-break: keep-all;
background: #fff;
border-radius: 4px;
color: #555;
font-size: 13px;
text-shadow: 0 0 white;
padding: 0 9px;
margin-top: 2px;
}
a#green_channel_digg:hover:after {
content: "点赞";
}
a#green_channel_follow:hover:after {
content: "+关注";
}
a#green_channel_favorite:hover:after {
content: "收藏";
}
div#green_channel,
div#blog_post_info {
display: unset !important;
border: unset;
}
#author_profile,
#div_digg,
#green_channel_weibo,
#green_channel_wechat {
display: none !important;
}
div#green_channel {
position: fixed;
top: 68%;
margin-left: -120px;
width: 50px;
}
div#green_channel a {
border-radius: 50%;
box-shadow: 0 2px 4px 0 rgb(12 13 15 / 6%) !important;
background: #fff !important;
font-size: 0;
font-weight: unset;
width: 21px;
height: 31px;
margin: 10px 0 0 0 !important;
}
#green_channel_favorite:before {
background-position: 96.6% 92.8%;
background-size: 3200% 3200%;
}
#green_channel_follow:before {
background-position: -12.6% -5.7%;
background-size: 2950% 2950%;
-transform: rotate(45deg);
background-position: 8.4% 59.3%;
background-size: 2345% 2208%;
}
#green_channel_digg:before {
background-position: 93.2% 62.8%;
background-size: 3200% 3200%;
}
#green_channel a:before {
content: " ";
background-image: url(https://imgcache.qq.com/open_proj/proj_qcloud_v2/community-pc/build/base/sprite/base-202101281937.svg);
position: absolute;
left: 17px;
width: 18px;
height: 18px;
margin: 6px 0 0 -0.3px;
}
}
/*文章信息条*/
@media screen and (min-width:0) {
#topics .postDesc {
border-bottom: 1px solid #eeeeee;
padding-bottom: 10px;
margin-bottom: 25px;
font-family: 'Lato', "PingFang SC", "Microsoft YaHei", sans-serif;
/* text-align: center;
display: flex;*/
font-size: 0;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
#topics .postDesc a {
display: none;
}
.post .postDesc span,
.post .postDesc a {
font-size: 13px;
margin: 0 18px 0 0;
border: none;
/* display: inline-table; */
}
.post .postDesc span:before,
.post .postDesc a:before {
margin-right: 4px;
}
#post-date:before {
content: "\e71f";
font-family: element-icons;
}
#post_view_count:before {
content: "\e769";
font-family: element-icons;
}
#post_comment_count:before {
content: "\e72e";
font-family: element-icons;
}
.post .postDesc a[href^="https://www.cnblogs.com/"]:before {
content: "\e6e3";
font-family: element-icons;
}
.post .postDesc a[href="https://www.cnblogs.com/gshang/"] {
order: -1;
/* width:100%; */
content: "\e6e3";
font-family: element-icons;
/* color: black; */
}
.post .postDesc a[target="_blank"]:before {
content: "\e786";
font-family: element-icons;
}
.post .postDesc a[rel="nofollow"]:before {
content: "\e764";
font-family: element-icons;
}
.post .postDesc a[href="javascript:void(0)"] {
margin-right: 0;
}
.post .postDesc a[href="javascript:void(0)"]:before {
content: "\e765";
font-family: element-icons;
}
}
/*文章标签*/
@media screen and (min-width:0) {
#BlogPostCategory,
#EntryTag {
font-family: element-icons;
font-size: 0;
display: table-cell;
}
#BlogPostCategory,
#EntryTag {
margin-bottom: 0px !important;
padding-bottom: 10px;
-border-bottom: 1px solid#f2f6fc;
}
#BlogPostCategory a,
#EntryTag a {
transition: all .2s ease-in-out;
margin-right: 10px;
font-size: 13px;
padding: 4px 15px 4px 9px;
border-radius: 10px;
background: #f3f4f4;
color: #777;
}
div#BlogPostCategory a:hover,
div#EntryTag a:hover {
background: #555;
color: #fff;
}
.postBody #BlogPostCategory a:before {
content: "\e784";
font-size: var(--text-h5) !important;
}
.postBody #EntryTag a:before {
content: "\e744";
content: "\e754";
font-size: var(--text-h5) !important;
}
#BlogPostCategory a:before,
#EntryTag a:before {
margin-right: 4px;
}
#BlogPostCategory a:before {
-content: "\e784";
}
}
/*上下篇*/
@media screen and (min-width:0) {
#post_next_prev {
font-size: 13px;
text-overflow: ellipsis;
width: 100% !important;
display: grid;
padding: 20px 0;
border-radius: 6px;
grid-template-columns: 0 auto 1fr 14px auto 1fr;
justify-content: space-between;
overflow: hidden;
color: #777;
}
#post_next_prev a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #777;
}
#post_next_prev br {
width: 0 !important;
display: none;
margin: 0 7px !important;
}
.p_n_p_prefix {
font-size: 0;
}
}
/* 文章评论 */
@media screen and (min-width:0) {
div#comment_form {
margin-left: 0 !important;
}
div#comment_form_container {
background: white;
padding: 25px 40px;
}
/*刷新评论,快捷键提示,退出,评论框预览*/
/*评论赞成反对,自动补全*/
#comment_nav,
#comment_form_container p:nth-child(7),
#commentbox_opt a,
.commentbox_title,
.comment_vote,
.commentbox_footer {
display: none;
}
/*评论框*/
.commentbox_main.comment_textarea {
width: calc(100%) !important;
border-color: #efefef !important;
margin: 10px auto 20px;
}
textarea#tbCommentBody::-webkit-input-placeholder {
color: #fff;
}
div.commentform textarea {
height: 200px;
}
/*提交按钮*/
#btn_comment_submit {
background: #555;
transition: all .2s ease-in-out;
border-radius: 2px;
border: none;
color: #fff;
cursor: pointer;
outline: none;
font-size: 13px;
}
#btn_comment_submit:hover {
background: #222;
}
/*标题*/
#commentform_title,
.feedback_area_title {
margin: 0;
font-size: var(--text-h4);
font-weight: 500;
padding: 10px 0;
position: relative;
background: none;
}
#commentform_title:before,
.feedback_area_title:before {
content: "";
border-left: solid 4px #222222;
margin-right: 10px;
width: fit-content;
}
/*相关博文
.recomm-block b {
display: block;
width: 80px;
overflow: hidden;
}
.recomm-block b + br {
display: none;
}*/
}
div#cnblogs_c1,
#cnblogs_c2,
#under_post_card1,
#under_post_card2,
#HistoryToday {
display: none;
}
/* 评论内容 */
@media screen and (min-width:0) {
div#blog-comments-placeholder {
background: #fff;
padding: 40px;
margin-bottom: 20px;
}
div#blog-comments-placeholder br,
#comment_pager_top {
display: none;
}
.feedbackItem {
border-bottom: 1px solid #f5f5f5;
padding: 20px 0;
box-sizing: border-box;
position: relative;
}
.feedbackListSubtitle {
display: flex;
color: #909399;
font-size: 0;
white-space: nowrap;
overflow-x: auto;
flex-wrap: wrap;
}
.comment_vote {
color: #909399;
font-size: var(--text-h5) !important;
}
.feedbackListSubtitle a {
font-size: var(--text-h5);
}
.layer {
order: 1;
margin-right: 10px;
}
.feedbackManage {
order: 2;
position: absolute;
-left: 20px;
bottom: 20px;
}
.comment_date {
order: 3;
width: 100%;
font-size: var(--text-h5);
}
.feedbackListSubtitle a[id^="a_comment_author"] {
order: 2;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: var(--color-text-regular);
}
.louzhu {
order: 3;
}
.louzhu:before {
content: "\f058";
margin-left: 4px;
color: #399ab2;
font-family: fontawesome;
font-size: var(--text-h5) !important;
}
.feedbackCon {
margin-bottom: 30px;
}
.feedbackCon p {
font-size: var(--text-h5);
padding: 10px 0;
}
.feedbackCon a {
color: #409eff;
}
.feedbackCon p br {
display: none;
}
}
/*园子推荐*/
@media screen and (min-width:0) {
#ad_t2 a:nth-last-child(2) {
padding-bottom: 35px;
}
#ad_t2 a:first-child {
padding-top: 35px;
margin-top: 20px;
}
div#ad_t2>a {
padding-left: 32px;
padding-right: 20px;
margin-right: 0;
background: white;
-webkit-line-clamp: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}
div#ad_t2>br {
display: none;
}
}
}
/****列表页面开始******************************/
@media screen and (min-width:0) {
/*列表标签*/
.entrylist ul {
overflow: auto;
padding: 20px 0;
margin: 0 40px;
border-bottom: 1px solid #f5f5f5;
}
.entrylist ul li {
float: left;
}
.entrylist ul li a:hover {
transition: 0.3s;
background: #303030;
color: #fff !important;
}
.entrylist ul li a:hover {
color: unset;
}
.entrylist ul li a {
white-space: pre-wrap;
background: #f3f4f4;
color: #555;
border-radius: 4px;
padding: 4px 7px;
margin-right: 10px;
}
/*分类标题*/
.entrylist .entrylistTitle {
padding: 0;
}
.entrylistTitle,
.PostListTitle {
padding: 35px 0 20px;
margin: 0 40px;
font-size: 24px;
font-weight: 400;
}
/*列表项*/
#myposts {
min-height: 500px;
margin-left: unset;
}
#myposts .PostList {
margin-right: unset;
margin-top: unset;
font-size: unset;
margin-left: 40px;
}
.entrylistItem,
.PostList {
padding: 20px 0;
margin: 0 40px;
border-bottom: 1px solid #f5f5f5;
}
.entrylistItem {
-animation-name: fadeInUp;
-animation-duration: 1s;
}
.entrylistItem:hover {
-background: #fafafa;
transition: 0.2s;
}
/*文章标题*/
.entrylistPosttitle,
.postTitl2 {
font-size: 1.3em;
padding-bottom: 5px;
}
/*信息条*/
.entrylistItemPostDesc {
text-align: right;
color: #666;
}
}
/****相册页面开始******************************/
.divPhoto {
border: 1px solid #ccc;
padding: 2px;
margin-right: 10px;
}
.thumbDescription {
color: #666;
text-align: right;
padding-top: 5px;
padding-bottom: 5px;
padding-right: 10px;
margin-bottom: 10px;
}
/*****留言页面开始*****************************/
/*留言查看页面的个人信息*/
.personInfo {
margin-bottom: 20px;
}
/*留言分页区域*/
.pages {
text-align: right;
}
/*****留言页面结束*****************************/
/*****第三部分结束*******************************/
/**************************************************
第四部分:文章内容常用标签格式。这个部分是设置作者写作内容的部分。例如:
如果作者的文章用有p标签,则可通过这个对这些文章中的p标签进行设置。前面
的“.postBody”明确的指出了这里样式的作用范围。仅仅适用于文章主体部分。
建议这个不要设置过于详细的细节。因为,一些样式,一篇文章比较适合的话,
并不能保证所有的文章都适合。
**************************************************/
/************** github markdown 开始 ***************/
@media screen and (min-width:0) {
#cnblogs_post_body ol {
padding-left: 16px;
}
#cnblogs_post_body ol li {
padding-left: 4px;
}
.cnblogs-markdown {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji !important;
font-size: 15.6px !important;
line-height: 1.8 !important;
/* word-wrap: break-word !important; */
}
.cnblogs-markdown kbd {
display: inline-block !important;
padding: 3px 5px !important;
font: 11px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace !important;
line-height: 10px !important;
color: #444d56 !important;
vertical-align: middle !important;
background-color: #fafbfc !important;
border: 1px solid #d1d5da !important;
border-radius: 3px !important;
box-shadow: inset 0 -1px 0 #d1d5da !important;
}
.cnblogs-markdown:after,
.cnblogs-markdown:before {
display: table !important;
content: "" !important;
}
.cnblogs-markdown:after {
clear: both !important;
}
.cnblogs-markdown>:first-child {
margin-top: 0 !important
}
.cnblogs-markdown>:last-child {
margin-bottom: 0 !important
}
.cnblogs-markdown a:not([href]) {
color: inherit !important;
text-decoration: none !important;
}
.cnblogs-markdown .absent {
color: #cb2431 !important;
}
.cnblogs-markdown .anchor {
float: left !important;
padding-right: 4px !important;
margin-left: -20px !important;
line-height: 1 !important;
}
.cnblogs-markdown .anchor:focus {
outline: none !important;
}
.cnblogs-markdown blockquote,
.cnblogs-markdown details,
.cnblogs-markdown dl,
.cnblogs-markdown ol,
.cnblogs-markdown p,
.cnblogs-markdown pre,
.cnblogs-markdown ul {
margin-top: 0 !important;
margin-bottom: 16px !important;
}
.cnblogs-markdown hr {
height: .25em !important;
padding: 0 !important;
margin: 24px 0 !important;
background-color: #e1e4e8 !important;
border: 0 !important;
}
.cnblogs-markdown blockquote {
padding: 0 1em !important;
color: #6a737d !important;
border-left: .25em solid #dfe2e5 !important;
}
.cnblogs-markdown blockquote>:first-child {
margin-top: 0 !important;
}
.cnblogs-markdown blockquote>:last-child {
margin-bottom: 0 !important;
}
.cnblogs-markdown h1,
.cnblogs-markdown h2,
.cnblogs-markdown h3,
.cnblogs-markdown h4,
.cnblogs-markdown h5,
.cnblogs-markdown h6 {
margin-top: 24px !important;
margin-bottom: 16px !important;
font-weight: 500 !important;
line-height: 1.8 !important;
}
.cnblogs-markdown h1 .octicon-link,
.cnblogs-markdown h2 .octicon-link,
.cnblogs-markdown h3 .octicon-link,
.cnblogs-markdown h4 .octicon-link,
.cnblogs-markdown h5 .octicon-link,
.cnblogs-markdown h6 .octicon-link {
color: #1b1f23 !important;
vertical-align: middle !important;
visibility: hidden !important;
}
.cnblogs-markdown h1:hover .anchor,
.cnblogs-markdown h2:hover .anchor,
.cnblogs-markdown h3:hover .anchor,
.cnblogs-markdown h4:hover .anchor,
.cnblogs-markdown h5:hover .anchor,
.cnblogs-markdown h6:hover .anchor {
text-decoration: none !important;
}
.cnblogs-markdown h1:hover .anchor .octicon-link,
.cnblogs-markdown h2:hover .anchor .octicon-link,
.cnblogs-markdown h3:hover .anchor .octicon-link,
.cnblogs-markdown h4:hover .anchor .octicon-link,
.cnblogs-markdown h5:hover .anchor .octicon-link,
.cnblogs-markdown h6:hover .anchor .octicon-link {
visibility: visible !important;
}
.cnblogs-markdown h1 code,
.cnblogs-markdown h1 tt,
.cnblogs-markdown h2 code,
.cnblogs-markdown h2 tt,
.cnblogs-markdown h3 code,
.cnblogs-markdown h3 tt,
.cnblogs-markdown h4 code,
.cnblogs-markdown h4 tt,
.cnblogs-markdown h5 code,
.cnblogs-markdown h5 tt,
.cnblogs-markdown h6 code,
.cnblogs-markdown h6 tt {
font-size: inherit !important;
}
.cnblogs-markdown h1 {
font-size: 1.6em !important;
}
.cnblogs-markdown h1,
.cnblogs-markdown h2 {
padding-bottom: .3em !important;
/* border-bottom: 1px solid var(--border-color-extra-linght) !important; */
}
.cnblogs-markdown h2 {
font-size: 1.5em !important;
}
.cnblogs-markdown h3 {
font-size: 1.25em !important;
}
.cnblogs-markdown h4 {
font-size: 1em !important;
}
.cnblogs-markdown h5 {
font-size: .875em !important;
}
.cnblogs-markdown h6 {
font-size: .85em !important;
color: #6a737d !important;
}
.cnblogs-markdown ol.no-list,
.cnblogs-markdown ul.no-list {
padding: 0 !important;
list-style-type: none !important;
}
.cnblogs-markdown ol ol,
.cnblogs-markdown ol ul,
.cnblogs-markdown ul ol,
.cnblogs-markdown ul ul {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.cnblogs-markdown li {
word-wrap: break-all !important;
}
.cnblogs-markdown li>p {
margin-top: 16px !important;
}
.cnblogs-markdown dl {
padding: 0 !important;
}
.cnblogs-markdown dl dt {
padding: 0 !important;
margin-top: 16px !important;
font-size: 1em !important;
font-style: italic !important;
font-weight: 600 !important;
}
.cnblogs-markdown dl dd {
padding: 0 16px !important;
margin-bottom: 16px !important;
}
.cnblogs-markdown table {
display: table !important;
width: 100% !important;
overflow-x: auto !important;
margin: 0 auto;
font-size: 15px !important
}
.cnblogs-markdown table th {
font-weight: 600 !important;
}
.cnblogs-markdown table td,
.cnblogs-markdown table th {
padding: 6px 13px !important;
border: 1px solid #dfe2e5 !important;
background: transparent !important;
}
.cnblogs-markdown table thead {
border-top: 2px solid var(--color-text-primary) !important;
border-bottom: 2px solid var(--color-text-primary) !important;
background: var(--BackgroundColor) !important;
}
.cnblogs-markdown table thead tr {
background-color: #eee;
}
.cnblogs-markdown table tr {
background-color: var(--color-white);
border-top: 1px solid var(--color-text-primary) !important;
}
.cnblogs-markdown table tbody tr:last-child {
border-bottom: 2px solid var(--color-text-primary) !important;
}
.cnblogs-markdown table img {
background-color: initial !important;
}
.cnblogs-markdown .emoji {
max-width: none !important;
vertical-align: text-top !important;
background-color: initial !important;
}
.cnblogs-markdown span.frame {
display: block !important;
overflow: hidden !important;
}
.cnblogs-markdown span.frame>span {
display: block !important;
float: left !important;
width: auto !important;
padding: 7px !important;
margin: 13px 0 0 !important;
overflow: hidden !important;
border: 1px solid #dfe2e5 !important;
}
.cnblogs-markdown span.frame span img {
display: block !important;
float: left !important;
}
.cnblogs-markdown span.frame span span {
display: block !important;
padding: 5px 0 0 !important;
clear: both !important;
color: #24292e !important;
}
.cnblogs-markdown span.align-center {
display: block !important;
overflow: hidden !important;
clear: both !important;
}
.cnblogs-markdown span.align-center>span {
display: block !important;
margin: 13px auto 0 !important;
overflow: hidden !important;
text-align: center !important;
}
.cnblogs-markdown span.align-center span img {
margin: 0 auto !important;
text-align: center !important;
}
.cnblogs-markdown span.align-right {
display: block !important;
overflow: hidden !important;
clear: both !important;
}
.cnblogs-markdown span.align-right>span {
display: block !important;
margin: 13px 0 0 !important;
overflow: hidden !important;
text-align: right !important;
}
.cnblogs-markdown span.align-right span img {
margin: 0 !important;
text-align: right !important;
}
.cnblogs-markdown span.float-left {
display: block !important;
float: left !important;
margin-right: 13px !important;
overflow: hidden !important;
}
.cnblogs-markdown span.float-left span {
margin: 13px 0 0 !important;
}
.cnblogs-markdown span.float-right {
display: block !important;
float: right !important;
margin-left: 13px !important;
overflow: hidden !important;
}
.cnblogs-markdown span.float-right>span {
display: block !important;
margin: 13px auto 0 !important;
overflow: hidden !important;
text-align: right !important;
}
.cnblogs-markdown code,
.cnblogs-markdown tt {
padding: 0.2em .4em !important;
margin: 0 4px !important;
/* font-size: 85% !important; */
display: inline;
border: none !important;
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
background-color: rgba(27, 31, 35, .05) !important;
border-radius: 3px !important;
}
.cnblogs-markdown code br,
.cnblogs-markdown tt br {
display: none !important;
}
.cnblogs-markdown del code {
text-decoration: inherit !important;
}
.cnblogs-markdown pre>code {
padding: 0 !important;
margin: 8 !important;
/* font-size: 100% !important; */
/*word-break: normal !important;
white-space: pre !important;*/
background: transparent !important;
border: 0 !important;
}
.cnblogs-markdown .highlight {
margin-bottom: 16px !important;
}
.cnblogs-markdown .highlight pre {
margin-bottom: 0 !important;
/*word-break: normal !important;*/
}
.cnblogs-markdown .highlight pre,
.cnblogs-markdown pre {
-padding: 16px !important;
overflow-x: auto !important;
font-size: 85% !important;
width: 100%;
background-color: #f7f7f7;
border-radius: 3px !important;
max-height: 460px;
}
.cnblogs-markdown .csv-data td,
.cnblogs-markdown .csv-data th {
padding: 5px !important;
overflow: hidden !important;
font-size: 12px !important;
line-height: 1 !important;
text-align: left !important;
white-space: nowrap !important;
}
.cnblogs-markdown .csv-data .blob-num {
padding: 10px 8px 9px !important;
text-align: right !important;
background: #fff !important;
border: 0 !important;
}
.cnblogs-markdown .csv-data tr {
border-top: 0 !important;
}
.cnblogs-markdown .csv-data th {
font-weight: 600 !important;
background: #f6f8fa !important;
border-top: 0 !important;
}
}
/************** github markdown 结束 ***************/
@media screen and (max-width: 767px) {
#mainContent {
min-width: unset !important;
}
#sideBar {
width: 100% !important;
margin: unset !important;
position: absolute;
z-index: 999;
}
}
@media screen and (max-width: 991px) {
/*小屏布局*/
#main {
padding: 0 !important;
display: flex;
flex-direction: column;
width: 100% !important;
min-width: initial;
}
form#zzk_search {
display: none;
}
div#blog-comments-placeholder {
padding: 20px;
}
div#mainContent {
margin-top: 60px;
}
.post-bg {
background: #fff;
}
div#comment_form_container {
padding: 20px;
}
div#ad_t2>a {
padding: 0 20px;
}
/*菜单按钮*/
#menu {
/*position: absolute;*/
background: #000;
color: #f7f7f7;
padding: 28px 25px;
}
#menu:before {
content: "\f0c9";
}
div#menu~.listTitle {
display: none;
}
#footer,
#scroller {
display: none !important;
}
.postDesc span {
margin-left: 12px;
}
.day,
div#post_detail {
padding: 20px;
}
div#item {
background: #fff;
}
}
@media screen and (min-width:0px) {
/* -------------------------------------------------------------------
* search wrap - (_layout.css)
* ------------------------------------------------------------------- */
.search-wrap {
display: block;
text-align: center;
background: white;
opacity: 0;
visibility: hidden;
z-index: 900;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.search-wrap .search-form {
width: 100%;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.search-wrap .search-form::after {
content: "Press Enter to begin your search.";
display: block;
letter-spacing: 0.6px;
-font-size: 1.6rem;
margin-top: 3rem;
text-align: center;
color: #999999;
}
.search-wrap .search-form ::-webkit-input-placeholder {
color: #000;
text-align: center !important;
opacity: 1;
}
.search-wrap .search-form :-moz-placeholder {
color: #000;
text-align: center !important;
opacity: 1;
}
.search-wrap .search-form ::-moz-placeholder {
color: #000;
text-align: center !important;
opacity: 1;
}
.search-wrap .search-form :-ms-input-placeholder {
color: #000;
text-align: center !important;
opacity: 1;
}
.search-wrap .search-form .placeholder {
color: #000;
text-align: center !important;
opacity: 1;
}
.search-wrap input[type="text"] {
background-color: transparent;
border: none;
color: #000;
height: auto;
width: 95%;
font-family: "montserrat-bold", sans-serif;
font-size: 2.3rem;
line-height: 1.523;
letter-spacing: 0.02rem;
border-bottom: 1px solid #dedede;
max-width: 680px;
padding-top: .6rem !important;
padding-bottom: .6rem !important;
margin: 0 auto;
}
.search-wrap input[type="text"]:focus {
outline: none;
}
.search-wrap .close-btn {
cursor: pointer;
position: fixed;
display: block;
width: 45px;
height: 45px;
top: 21px;
left: 50%;
margin-left: -23px;
font: 0/0 a;
text-shadow: none;
color: transparent;
}
.search-wrap .close-btn::before,
.search-wrap .close-btn::after {
content: '';
position: absolute;
display: inline-block;
width: 2px;
height: 20px;
top: 12px;
left: 22px;
background-color: #333333;
}
.search-wrap .close-btn::before {
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.search-wrap .close-btn::after {
-webkit-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.search-visible {
opacity: 1;
visibility: visible;
}
.embed-visible {
margin-top: 85px;
width: 767px;
height: 80%;
border: 1px solid #ccc;
margin-right: 1px;
max-width: 1100px;
}
@media only screen and (max-width: 767px) {
.embed-visible {
width: 100% !important;
}
}
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
.animated.hinge {
-webkit-animation-duration: 2s;
animation-duration: 2s;
}
.animated.bounceIn,
.animated.bounceOut,
.animated.flipOutX,
.animated.flipOutY {
-webkit-animation-duration: .75s;
animation-duration: .75s;
}
@-webkit-keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
-webkit-transform: none;
transform: none;
}
}
.fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fade-in {
0% {
opacity: 0;
}
/*初始状态 透明度为0*/
40% {
opacity: 0;
}
/*过渡状态 透明度为0*/
100% {
opacity: 1;
}
/*结束状态 透明度为1*/
}
@-webkit-keyframes fade-in {
/*针对webkit内核*/
0% {
opacity: 0;
}
40% {
opacity: 0;
}
100% {
opacity: 1;
}
}
}
/*代码高亮*/
/** Atom OneDark**/
@media screen and (min-width:0px) {
#home .hljs,
#home pre code,
#home pre xmp {
display: block;
white-space: pre;
word-break: keep-all;
overflow-x: auto!important;
padding: 15px 0 15px 15px!important;
color: #abb2bf;
color: #878A96;
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace!important;
font-size: 14px !important;
border: none!important;
background: inherit!important;
}
#home .hljs-comment,
#home .hljs-quote {
color: #5c6370;
font-style: italic
}
#home .hljs-doctag,
#home .hljs-formula,
#home .hljs-keyword {
color: #c678dd
}
#home .hljs-deletion,
#home .hljs-name,
#home .hljs-section,
#home .hljs-selector-tag,
#home .hljs-subst {
color: #e06c75
}
#home .hljs-literal {
color: #56b6c2
}
#home .hljs-addition,
#home .hljs-attribute,
#home .hljs-meta-string,
#home .hljs-regexp,
#home .hljs-string {
color: #98c379
}
#home .hljs-built_in,
#home .hljs-class .hljs-title {
color: #e6c07b
}
#home .hljs-attr,
#home .hljs-number,
#home .hljs-selector-attr,
#home .hljs-selector-class,
#home .hljs-selector-pseudo,
#home .hljs-template-variable,
#home .hljs-type,
#home .hljs-variable {
color: #d19a66;
}
#home .hljs-bullet,
#home .hljs-link,
#home .hljs-meta,
#home .hljs-selector-id,
#home .hljs-symbol,
#home .hljs-title {
color: #61aeee
}
#home .hljs-emphasis {
font-style: italic
}
#home .hljs-strong {
font-weight: 700
}
#home .hljs-link {
text-decoration: underline
}
#home .hljs-tag {
color: #abb2bf
}
}
@media screen and (min-width:750px) {
/****/
div#scroller {
z-index: 0;
overflow: hidden;
padding-top: 80px;
min-width: 200px;
color: #888;
}
div#user,
#myhome,
#search,
#textlist,
#newtext {
display: none;
}
#item ul.nav {
margin-left: 10px;
padding: 6px 2px 6px 16px;
position: unset;
}
#item ul {
position: fixed;
height: 100%;
padding-top: 50px;
}
div#header {
overflow: hidden;
transition: top .8s;
background: #fffffff5;
position: fixed;
height: 56px;
height: 0;
width: 100%;
box-shadow: 0 2px 10px rgb(0 0 0 / 5%);
box-shadow: 0 1px 0 #f0f0f0;
}
}
html
<div id="item">
<div id="menu"></div>
<div id="user"></div>
<div class="listTitle" id="myhome">首页</div>
<div class="listTitle" id="newtext">新随笔</div>
<div class="listTitle" id="search">搜索</div>
<div class="listTitle" id="textlist">分类</div>
<div class="listTitle" id="scroller" style="display: none;">
<div id="sidebar_scroller">
<ul class="nav"></ul>
</div>
</div>
</div>
<ul id="path">
<li><a id="nme" href="https://home.cnblogs.com/u/llil">派大海星</a></li>
<li><a id="nhome" href="https://www.cnblogs.com/llil/">首页</a></li>
<li><a id="ntag" href="https://www.cnblogs.com/llil/tag/">标签</a></li>
<li id="nlist"><a>分类</a></li>
</ul>
<div id="search-box" class="search-wrap">
<div id="search1" class="search-form">
<input type="text" class="search-field" id="scinput" onkeydown="return formLoad(event)" placeholder=" Keywords">
</div>
<a id="close-search" class="close-btn"></a>
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<!--导航目录-->
<script src="http://files.cnblogs.com/files/ctxsdhy/scrollspy.js" type="text/javascript"></script>
<script src="http://files.cnblogs.com/files/ctxsdhy/stickUp.min.js" type="text/javascript"></script>
<!--图片查看-->
<script src="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.js"></script>
<script src="https://cdn.bootcss.com/clipboard.js/2.0.4/clipboard.min.js"></script>
<script>
updatePostStats(
$(".post-view-count").map(function() {
return this.dataset.postId
}).get(),
function(id, count) {
$(".post-view-count[data-post-id=" + id + "]").text(count)
},
function(id, count) {
$(".post-comment-count[data-post-id=" + id + "]").text(count)
},
function(id, count) {
$(".post-digg-count[data-post-id=" + id + "]").text(count)
});
function customTimer(inpId, fn) {
if ($(inpId).length) {
fn();
} else {
var intervalId = setInterval(function() {
if ($(inpId).length) {
clearInterval(intervalId);
customTimer(inpId, fn);
}
}, 100);
}
}
function ssCustomTimer(inpId, fn, ms) {
customTimer(inpId, function() {
setTimeout(fn, ms)
});
}
//加载搜索
function formLoad(e) {
if (e.keyCode === 13) {
var key = document.getElementById('scinput').value;
if (key != "") {
var str = '<embed class="embed-visible" src="https://zzk.cnblogs.com/my/s/blogpost-p?Keywords=' + key + '"/>';
$('.search-wrap').append(str);
$('.search-wrap .search-form').css('display', 'none');
$("body").parent().css("overflow-y", "hidden");
return !1;
}
}
}
//所有页
var pageAll = {
//搜索
addSearch: function() {
$('#header').append($('#search-box'));
$('#search').click(function() {
$('.search-wrap').addClass('search-visible');
});
$('#close-search').click(function() {
$('.search-wrap').removeClass('search-visible');
$("body").parent().css("overflow-y", "auto");
$('.search-wrap .search-form').css('display', 'block');
$('.embed-visible').remove();
$('#scinput').val("");
});
},
addMinTitle: function() {
$('#menu').click(function() {
$('div#menu ~ .listTitle').slideToggle()
})
},
addItem: function() {
$('#sideBar').prepend($('#item'))
$(".navbar>nav .navbar-left>*:not(:first-child)").remove()
$("#nav_left").append($("#path").children());
$("#nlist a").after($("#sidebar_postcategory ul"))
},
init: function() {
this.addSearch()
this.addMinTitle()
this.addItem()
}
};
//首页
var pageDay = {
//列表添加链接
ssLoadHref: function() {
$(".c_b_p_desc").hover(function() {
var ptitle = this.getElementsByTagName("a")
var hrefstr = 'location\.href=\'' + $(ptitle).attr("href") + '\';'
$(this).attr('onclick', hrefstr)
$(this).css('cursor', 'pointer')
});
},
//初始化
init: function() {
this.ssLoadHref()
}
};
//帖子页
var pagePost = {
//滚动监听
scrollListen: function(windowTop, timeId) {
$(window).scroll(function() {
var scrolls = $(this).scrollTop();
if (scrolls >= windowTop) {
//当scrolls>windowTop时,表示页面在向下滑动
$("#top_nav").css('transform', 'translatey(-100%)');
windowTop = scrolls;
} else {
$("#top_nav").css('transform', 'translatey(0%)');
clearTimeout(timeId)
timeId = setTimeout(function() {
if (windowTop != 0 && $(".dropdown>.dropdown-menu").height() == 0 && $("#nlist ul").height() == 0) {
$("#top_nav").css('transform', 'translatey(-100%)');
}
}, 1200);
windowTop = scrolls;
}
});
},
//文章目录
sidebarScroller: function() {
//先获取第一个h标签, 之后循环时作为上一个h标签
var $ph = $('#cnblogs_post_body :header:eq(0)');
if ($ph.length > 0) {
//设置层级为1
$ph.attr('offset', '1');
//添加导航目录的内容
//$('#sideBar').after($('#scroller'))
$('#scroller').css('display', 'block');
//让导航目录停留在页面顶端
$('#scroller').stickUp();
//遍历文章里每个h标签
$('#cnblogs_post_body :header').each(function(i) {
var $h = $(this);
//设置h标签的id, 编号从0开始
$h.attr('id', 'scroller-' + i);
//比上一个h标签层级小, 级数加1
if ($h[0].tagName > $ph[0].tagName) {
$h.attr('offset', parseInt($ph.attr('offset')) + 1);
} //比上一个h标签层级大, 级数减1
else if ($h[0].tagName < $ph[0].tagName) {
var h = parseInt($h[0].tagName.substring(1));
var ph = parseInt($ph[0].tagName.substring(1));
var offset = parseInt($ph.attr('offset')) - (ph - h);
if (offset < 1) {
offset = 1
};
$h.attr('offset', offset);
} //和上一个h标签层级相等时, 级数不变
else {
$h.attr('offset', $ph.attr('offset'));
}
//添加h标签的目录内容
$('#sidebar_scroller ul').append('<li class="scroller-offset' + $h.attr('offset') + '"><a href="#scroller-' +
i +
'">' + $h.text() + '</a></li>');
//最后设置自己为上一个h标签
$ph = $h;
});
//开启滚动监听, 监听所有在.nav类下的li
$('body').scrollspy();
//让页面的滚动更平滑
$('#sidebar_scroller a').on('click', function() {
var targetOffset = $(this.hash).offset().top;
$('html, body').animate({
scrollTop: targetOffset
}, 400);
return false;
});
/*当前目录激活监听*/
$(window).scroll(function() {
var now = $('#sidebar_scroller').find('.active');
var prevNum = now.prevAll().length - 1;
var basicHeight = now.outerHeight();
$('#sideBarContent').scrollTop(prevNum * basicHeight)
});
}
},
//初始化
init: function() {
var timeId, windowTop = 0;
this.scrollListen(windowTop, timeId)
//添加目录,计算stickUp时会包括ul这个隐藏元素的高度,要先设0
$('#textlist ul').css('height', '0');
this.sidebarScroller();
$('#textlist ul').css('height', 'auto');
//调暗背景
//$("body").css('background', '#f5f6f7')
$('#home').addClass('post-bg');
//编辑链接
if ($(".dropdown-button").attr('href') == "https://home.cnblogs.com/u/llil") {
$('.navbar-blog').attr('href', $('div.postDesc a:nth-last-child(2)').attr("href"));
}
// 表格滚动
$("table").each(function() {
$(this).css('cssText', 'width:100%!important;display:table;');
$(this).wrapAll('<div class="tablebox"></div>');
$(".tablebox").css('overflow', 'auto');
});
//分类折叠
$('#search').css('display', 'none');
$('#textlist ul').css('display', 'none');
$("#textlist").hover(function() {
$("#textlist ul").toggle(200);
}, function() {
$("#textlist ul").toggle(200);
});
/*分类标签*/
$("#EntryTag a").each(function() {
$(this).text(function(i, origText) {
return origText.split("-")[1]
})
});
}
};
//分类页
var pageList = {
//帖子信息
ssDayInfo: function() {
var name = $("#Header1_HeaderTitle").text()
$(".entrylistItemPostDesc").text(function(i, origText) {
origText = origText.replace('posted @ ', '')
origText = origText.replace(name, '')
origText = origText.replace('编辑', '')
// origText = origText.replace('阅读', "")
origText = origText.replace('评论', "讨论")
origText = origText.replace(/\(/g, '').replace(/\)/g, '').replace(/\|/g, '')
// origText = origText.substring(0, origText.length - 1)
return origText
});
},
//标签处理
ssTag: function() {
/*分类标签去前缀*/
$(".catListTag a").each(function() {
$(this).text(function(i, origText) {
//var tile = $('.entrylistTitle').text().split(" ")[2].toLowerCase();
tile = document.querySelector(".entrylistTitle").innerText
tile = tile.split(" ")[2].toLowerCase();
if (origText.indexOf(tile) == -1) {
$(this).css('display', 'none');
} else {
var arr1 = origText.split("-");
origText = arr1[1];
origText = origText.replace(/\(/g, ' \(')
}
return origText
})
});
/*添加标签*/
$(".entrylist .entrylistTitle").after($("#sidebar_toptags ul"))
},
//初始化
init: function() {
this.ssDayInfo()
this.ssTag()
}
};
$(function() {
$('textarea-s').each(function() {
$(this).css('display', 'none');
eval($(this).text());
});
$("#app img").each(function() {
var a = this.parentNode;
$(this).attr("src", $(a).attr("src"));
});
$(".day .postDesc").each(function() {
$(this).prepend("<span class='post-date'>" + $(this).text().substring(9, 25) + "</span>")
});
$(".medium-zoom--opened").each(function() {
$("#top_nav").css('transform', 'translatey(-100%)');
});
});
$(document).ready(function() {
pageAll.init()
if ($('.day').length > 0) {
pageDay.init()
} else if ($('#post_detail').length > 0) {
pagePost.init()
} else if ($('.entrylistItem').length > 0) {
pageList.init()
}
});
</script>