1.2.5原版
@@ -0,0 +1,111 @@
|
||||
.gallery-photos span img {
|
||||
margin: 0 !important;
|
||||
border-radius: 0;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.gallery-photos {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.gallery-photo {
|
||||
min-height: 5rem;
|
||||
width: 33.3%;
|
||||
padding: 4px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.gallery-photo span {
|
||||
border-radius: 8px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gallery-photo img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
animation: fadeIn 1s;
|
||||
cursor: pointer;
|
||||
transition: all .4s ease-in-out !important;
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-title,
|
||||
.gallery-photo span.photo-time {
|
||||
max-width: calc(100% - 7px);
|
||||
line-height: 1.8;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
font-size: 14px;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
padding: 0px 8px;
|
||||
color: #fff;
|
||||
animation: fadeIn 1s;
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-title {
|
||||
bottom: 4px;
|
||||
border-radius: 0 8px 0 8px;
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-time {
|
||||
top: 4px;
|
||||
border-radius: 8px 0 8px 0;
|
||||
}
|
||||
|
||||
.gallery-photo:hover img {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1100px) {
|
||||
.gallery-photo {
|
||||
width: 33.3%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.gallery-photo {
|
||||
width: 49.9%;
|
||||
padding: 3px
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-time {
|
||||
display: none
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-title {
|
||||
font-size: 12px
|
||||
}
|
||||
|
||||
.gallery-photo span.photo-title {
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadmore {
|
||||
width: 40%;
|
||||
max-width: 810px;
|
||||
height: 30px;
|
||||
margin: auto;
|
||||
border-radius: 12px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: 1px solid #000;
|
||||
box-shadow: 0 8px 16px -4px #2c2d300c;
|
||||
background: #f4f4f4
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
:root {
|
||||
--pix-style-border-always: 1px solid var(--card-border);
|
||||
--pix-secondbg: #f7f7f9;
|
||||
--dark-body-bg: #d0dada;
|
||||
--card-border: #e3e8f7;
|
||||
}
|
||||
/*黑夜模式*/
|
||||
.dark {
|
||||
--pix-secondbg: #21232a;
|
||||
--dark-bg: #111324;
|
||||
--dark-medium-bg: #161829;
|
||||
--dark-light-bg: #2e325c;
|
||||
--light-color: #dedede;
|
||||
--text-color: #a5a9c3;
|
||||
--dark-border: #1e2036;
|
||||
--dark-ac-btn: #2b48ff;
|
||||
--dark-icon: #8c92b3;
|
||||
--text-light: #5b5f80;
|
||||
--normal-btn: #292c45;
|
||||
--btn-normal: #1e2139;
|
||||
--dark-body-bg: #0a0c19;
|
||||
--dark-body-gay-bg: #0a0c19;
|
||||
--card-border: #42444a;
|
||||
--code-color: var(--normal-btn);
|
||||
|
||||
|
||||
|
||||
--halo-comment-widget-ava-content-background: #292c45;
|
||||
--halo-comment-widget-component-comment-author-info-input: var(--dark-medium-bg);
|
||||
--halo-comment-widget-a-color: #dedede;
|
||||
--halo-comment-widget-time-color: #5b5f80;
|
||||
--halo-comment-widget-parents_at-color: #7786e7;
|
||||
--halo-comment-widget-text-color: var(--text-color);
|
||||
--halo-comment-widget-textarea-comment-color: #dedede;
|
||||
--halo-comment-widget-component-form-button-submit-pix-bg-color: #2b48ff;
|
||||
--halo-comment-widget-component-form-button-submit-pix-color: #fff;
|
||||
--halo-comment-widget-component-pagination-button-pix-bg-color-hover: #3b3eff;
|
||||
--halo-comment-widget-component-pagination-button-pix-bg-color-active: #1e2139;
|
||||
--halo-comment-widget-component-pagination-button-pix-border-color-active: #8c92b3;
|
||||
--halo-comment-widget-component-form-input-pix-bg-color: var(--dark-medium-bg);
|
||||
--halo-comment-widget-component-form-input-color: #dedede;
|
||||
--halo-comment-widget-component-form-input-border-color: #1e2036;
|
||||
--halo-comment-widget-component-webkit-box-shadow: #d0dada00;
|
||||
--halo-comment-widget-component-box-shadow: #d0dada00;
|
||||
--halo-comment-widget-component-border-bottom-color: var(--dark-border);
|
||||
--halo-comment-widget-component-btn-active-color: #3b3eff;
|
||||
--halo-comment-widget-parents_at-color: #3b3eff;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.dark .left_nav_inner , .dark .entry-footer , .dark .topic_comments_wrap , .dark #create_post_box .modal_inner , .dark #topic-title ,.dark input#set_local
|
||||
, .dark .t_cat_box li , .dark .single_content .comments-area , .dark #commentform textarea#comment , .dark .single_wrap .comments-area, .dark .page_content .comments-area
|
||||
, .dark .column_inner , .dark #login_form_box .modal_inner , .dark #link_modal .uk-modal-dialog , .dark #msg_modal .uk-modal-dialog , .dark .moment_card_item a
|
||||
, .dark .post_control_list , .dark .sidebar_right , .dark .right_admin_tool , .dark .top_set_box a.active , .dark .single-content blockquote, .dark .entry-content blockquote
|
||||
, .dark .footer_main .inner ,.dark .m_offcanvas .inner {
|
||||
background: var(--dark-bg);
|
||||
}
|
||||
|
||||
.dark #ava-content {
|
||||
background-color: #292c45;
|
||||
}
|
||||
|
||||
.dark .unread_box .vi_reply_item {
|
||||
background: #2f325545;
|
||||
}
|
||||
|
||||
.dark .blog_list_inner, .dark .normal_list_inner, .dark .single_wrap , .dark .top_bar , .dark .left_menu_box ul li a:hover, .dark .link_group .item:hover
|
||||
, .dark #t_commentform , .dark textarea#comment , .dark .field textarea , .dark .single_content, .dark .page_content, .dark .page_wrap , .dark #topic_content , .dark .t_cat_box
|
||||
, .dark .local_box , .dark input#add_cat , .dark .show_media_box, .dark .show_cdn_media , .dark input#img_link_up , .dark .com_smile_show .inner
|
||||
, .dark #commentform , .dark #login_form_box input#username, .dark #login_form_box input#password , .dark #comment-author-info input , .dark .field input , .dark .archive_main
|
||||
, .dark .page_main , .dark .loacl_audio .audio_right input,.dark .loacl_audio input, .dark .netease_audio input, .dark .tencent_audio input, .dark .kugou_audio input, .dark .kuwo_audio input , .dark .loacl_audio .audio_left , .dark .edit_card_box .edit_content input
|
||||
, .dark input#moment_video_url, .dark input#moment_video_bili , .dark .m_media_left , .dark .widget_tag_cloud a , .dark .cst_widget_comment ul li .right .body
|
||||
,.dark .nodata_main , .dark .s_main , .dark .musci_list_box , .dark .volume_box , .dark .top_set_box , .dark .sw_qrcode {
|
||||
background: var(--dark-medium-bg);
|
||||
}
|
||||
|
||||
.dark .main_wrap, .dark .top_ava img , .dark .left_menu_box ul li a:hover, .dark .link_group .item:hover , .dark .t_cat_box
|
||||
, .dark .local_box , .dark .com_smile_show , .dark #ava-content , .dark .moment_card_item.loop_card_item a:hover , .dark .post_control_list
|
||||
, .dark .widget_tag_cloud a , .dark .single_music_header .mu_img img , .dark .sw_qrcode{
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dark .left_menu_box ul li a , .dark .normal_card_content .entry-title a , .dark .list_user_meta .name , .dark .post_footer_meta span.comnum , .dark .p_title a , .dark .avatar_title a
|
||||
, .dark textarea#comment , .dark .field textarea , .dark .p_title ,.dark .avatar_title , .dark #topic_content , .dark #topic-title , .dark input#add_cat , .dark input#set_local
|
||||
, .dark input#img_link_up , .dark .comment-list li .com_right .left h4 a , .dark .post-single .entry-title , .dark .page_content .entry-title
|
||||
, .dark .page_content .entry-header i , .dark p.log_title , .dark #login_form_box input#username, .dark #login_form_box input#password , .dark #comment-author-info input
|
||||
, .dark .links_count , .dark .link_cat_name , .dark .link_group .item .info .name a , .dark .msg_title , .dark .archive_main .cat_title h1
|
||||
, .dark .normal_content .entry-title a, .dark .normal_grid_content .entry-title a , .dark .player_meta .title , .dark .moment_card_item .right h4
|
||||
, .dark .loacl_audio .audio_right input, .dark .netease_audio input , .dark .edit_card_box .edit_content input , .dark input#moment_video_url, .dark input#moment_video_bili
|
||||
, .dark .post_control_list a , .dark .t_dark a i , .dark .player_mod .m_info h2 , .dark .posts_mu_list li , .dark .posts_mu_list .s_play_btn, .dark .signup span,.dark #login_form_box [for="loginRemember"] {
|
||||
color: var(--light-color);
|
||||
}
|
||||
|
||||
.dark .normal_content .entry-content p, .dark .normal_card_content .entry-content p , .dark .normal_content .post_footer_meta span.comnum
|
||||
, .dark .normal_card_content .post_footer_meta span.comnum, .dark .normal_grid_content .post_footer_meta span.comnum , .dark .post_footer_meta span
|
||||
, .dark .t_content p , .dark .t_content ,.dark .up_img_btn i , .dark .t_cat_box li , .dark .show_cdn_media span , .dark .form_footer .admin_tool a
|
||||
, .dark .comment-list li .com_right .body p , .dark .comment-list p.nodata , .dark .single-content p , .dark ul.column_lists li a
|
||||
, .dark .page_content .entry-content , .dark blockquote , .dark .link_group .item .info .description , .dark .vi_reply_item .content
|
||||
, .dark .vi_reply_item .target_comment , .dark .msg_log , .dark .post_footer_meta span i , .dark .edit_audio_box .tips, .dark .edit_video_box .tips
|
||||
, .dark span.ip_loca , .dark .posts_show_widget ul li .title a , .dark .cst_widget_comment ul li .right a , .dark .pix_widget_tongji ul li small
|
||||
, .dark .top_s_box input.s_input , .dark .top_menu_box ul li a , .dark .top_menu_box ul li a i , .dark .pl_btn a i {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.dark .posts_show_widget ul li .title a:hover,.dark .cst_widget_comment ul li .right a:hover,.dark .normal_card_content .entry-title a:hover, .dark .post-categories a:hover,.dark .sf_item a:hover{
|
||||
color: var(--dark-ac-btn);
|
||||
}
|
||||
|
||||
.dark .moment_cat_nav, .dark .posts_cat_nav ,.dark .photos_cat_nav, .dark .left_menu_box ul, .dark textarea#comment , .dark .field textarea , .dark .tool_box, .dark .smile_show, .dark .form_footer, .dark .set_cat, .dark #commentform textarea#comment
|
||||
, .dark .p_item , .dark .footer_nav_box , .dark #t_pagination, .dark #pagination , .dark #p_pagination,.dark input#set_local , .dark input#img_link_up , .dark .comments-area ul.comment-list li
|
||||
, .dark .commentnav , .dark #t_commentform , .dark #commentform , .dark .single-inner , .dark .page_content .entry-header , .dark #login_form_box input#username, .dark #login_form_box input#password
|
||||
, .dark #comment-author-info input , .dark .field input , .dark .vi_reply_item , .dark #topic_content , .dark .archive_main .page-header , .dark .widget_inner .widget , .dark .moment_card_item.loop_card_item a
|
||||
, .dark .edit_card_box .edit_content input , .dark .post_control_list , .dark .link_group_content , .dark .set_text , .dark .s_tips , .dark .single-content blockquote, .dark .entry-content blockquote,.dark .entry-content ol li{
|
||||
border-color: var(--dark-border);
|
||||
}
|
||||
|
||||
.dark .left_menu_box li[class*=current-] a , .dark .moment_cat_nav ul li a.active, .dark .posts_cat_nav ul li a.active ,.dark .photos_cat_nav ul li a.active , .dark .normal_cat , .dark #t_pagination a, .dark #pagination a, .dark .arc_pagenav a , .dark #p_pagination a
|
||||
, .dark a.go_top , .dark input#push_comment , .dark .up_cat_btn , .dark a.set_local_btn , .dark a.img_link_btn
|
||||
, .dark .push_item , .dark .de_cat , .dark .commentnav span.page-numbers.current , .dark input.submit_button , .dark #post_pager a
|
||||
, .dark .edit_card_box .edit_content a.push_card , .dark span.de_card i , .dark .post_control_list a:hover , .dark .t_dark a , .dark .left_menu_box li[class*=current-] a:hover
|
||||
,.dark a.bg_music , .dark a.bg_lrc, .dark .vo_size ,.dark .footer_menu .inner .center .mobile_edit {
|
||||
background: var(--dark-ac-btn);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dark ::-webkit-scrollbar-thumb{
|
||||
background-color: var(--dark-ac-btn);
|
||||
}
|
||||
|
||||
.dark .uk-dropdown{
|
||||
background: var(--dark-border);
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.dark .user_pannel .inner a {
|
||||
background: var(--normal-btn);
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.dark .user_pannel .inner a:hover {
|
||||
background: var(--dark-ac-btn);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dark .t_dark a i , .dark .top_tool i , .dark .normal_content .post_footer_meta span.comnum i
|
||||
, .dark .normal_card_content .post_footer_meta span.comnum i, .dark .normal_grid_content .post_footer_meta span.comnum i , .dark a.up_like i
|
||||
, .dark .footer_nav_box ul li a , .dark .comment_smile_box a i , .dark #login_form_box label i , .dark .ad_info .name , .dark .top_s_box form i {
|
||||
color: var(--dark-icon);
|
||||
}
|
||||
|
||||
.dark a.up_like.done i {
|
||||
color: #ff5d49;
|
||||
}
|
||||
|
||||
.dark .normal_content .entry_meta, .dark .normal_card_content .entry_meta, .dark .normal_grid_content .entry_meta , .dark #post_pager .c_paged , .dark .comment-list li .com_right .left time
|
||||
, .dark a.comment-reply-link , .dark span.single_time , .dark ul.column_lists li span , .dark .page_content .entry-header .right time
|
||||
, .dark a.beian , .dark footer#colophon , .dark .ad_info p , .dark .ad_info a , .dark .widget_tag_cloud a , .dark .cst_widget_comment ul li .right .body
|
||||
, .dark .cst_widget_comment ul li .right .meta , .dark .posts_show_widget ul li .meta , .dark .pix_widget_tongji ul li span ,.dark .set_text
|
||||
, .dark .top_s_box input::-webkit-input-placeholder , .dark .mu_des , .dark .s_tips , .dark .top_set_box a {
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.dark .moment_cat_nav ul li a, .dark .posts_cat_nav ul li a , .dark .photos_cat_nav ul li a , .dark .link_group .item:hover {
|
||||
background: var(--normal-btn);
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
.dark .moment_cat_nav ul li a:hover,.dark .posts_cat_nav ul li a:hover,.dark .photos_cat_nav ul li a:hover {
|
||||
background-color: var(--dark-ac-btn);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dark .top_bar.uk-sticky-fixed.uk-active , .dark .footer_nav_box , .dark .top_menu_box {
|
||||
background: rgb(27 29 48 / 80%);
|
||||
}
|
||||
|
||||
.dark .footer_nav_box , .dark .top_menu_box {
|
||||
border: none;
|
||||
color: var(--light-color);
|
||||
}
|
||||
|
||||
.dark .footer_nav_box ul li a:hover , .dark .ad_info a:hover , .dark .audio_choose li.uk-active a , .dark .video_choose li.uk-active a, .dark .s_tips span
|
||||
, .dark .posts_mu_list li:hover div, .dark .posts_mu_list li:hover a, .dark .posts_mu_list li.active, .dark .posts_mu_list li.active .s_play_btn , .dark .s_set_box a.active
|
||||
, .dark .search_box .s_set_box a:hover , .dark .posts_show_widget .no_img li a:before {
|
||||
color: var(--dark-ac-btn);
|
||||
}
|
||||
|
||||
.dark .loca i , .dark a.up_img_btn , .dark .up_from_media a, .dark .up_from_cdn a , .dark .attch_nav a i
|
||||
, .dark a.img_link_cancel , .dark .push_close , .dark .commentnav a , .dark .post-categories a , .dark .link_group .item{
|
||||
background: var(--btn-normal);
|
||||
color: var(--dark-icon);
|
||||
}
|
||||
|
||||
.dark .up_img_type {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dark .t_cat_box li span i {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.dark .t_cat_box li span {
|
||||
color: var(--text-color) !important;
|
||||
}
|
||||
|
||||
.dark #topic_content:focus {
|
||||
box-shadow: 0 0 0 0.12rem rgb(84 96 155);
|
||||
}
|
||||
|
||||
.dark input#img_link_up:focus , .dark input#set_local:focus , .dark #t_commentform:focus-within , .dark #commentform:focus-within , .dark #login_form_box input#username:focus
|
||||
, .dark #login_form_box input#password:focus , .dark #comment-author-info input:focus , .dark .field input:focus , .dark .audio_choose li.uk-active a , .dark .video_choose li.uk-active a , .dark .player_dot{
|
||||
border-color: var(--dark-ac-btn);
|
||||
}
|
||||
|
||||
.dark a.parents_at , .dark ul.column_lists li a:hover , .dark .single-content a, .dark .page_content .entry-content a , .dark a.mo_link , .dark .t_content a , .dark .show-more-btn , .dark .vi_reply_item .name span
|
||||
, .dark .vi_reply_item .meta a , .dark .copyright a {
|
||||
color: #7786e7;
|
||||
}
|
||||
|
||||
.dark .single-content ul li ,.dark .entry-content ul li, .dark .single-content ol li {
|
||||
border-bottom: 1px solid #282a40;
|
||||
color: #bdbfff;
|
||||
}
|
||||
|
||||
.dark .single-content h1 , .dark .single-content h2 , .dark .single-content h3 , .dark .single-content h4 {
|
||||
color: #e5e8ff;
|
||||
}
|
||||
|
||||
.dark .page_content pre {
|
||||
border: 1px solid #111324;
|
||||
background: #111324;
|
||||
color: #fff8f8;;
|
||||
}
|
||||
|
||||
.dark .post_footer_meta span.sticky_icon {
|
||||
background: #ff4731;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dark .post_footer_meta span.sticky_icon i , .dark .post_footer_meta span.comnum i{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.dark .moment_type_btn i , .dark .smile_box i, .dark .simi i, .dark .t_cat i , .dark span.moment_btn_line , .dark .simi i.ri-lock-unlock-line {
|
||||
color: #6674c1 !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.dark .pix_player.loacl_audio {
|
||||
background: rgb(59 59 59);
|
||||
}
|
||||
|
||||
.dark .pix_player {
|
||||
background: rgb(43 43 43 / 75%);
|
||||
}
|
||||
|
||||
.dark .player_bar {
|
||||
background: #585858;
|
||||
}
|
||||
|
||||
.dark .local_video {
|
||||
background: #2b2d40;
|
||||
}
|
||||
|
||||
.dark .show_card {
|
||||
background: #1f2136;
|
||||
border: 1px dashed #4c5985;
|
||||
}
|
||||
|
||||
.dark .pix_widget_tongji ul li {
|
||||
box-shadow: 0px 8px 4px 0px rgb(15 17 33);
|
||||
background: linear-gradient(90deg,#161829,#816bff00);
|
||||
}
|
||||
|
||||
.dark .top_s_box input.s_input{
|
||||
background: rgb(13 15 35 / 65%);
|
||||
}
|
||||
|
||||
.dark .single_music_header .mu_img img {
|
||||
border: 1px solid #0a0c19;
|
||||
}
|
||||
|
||||
.dark .posts_mu_list {
|
||||
background: #111324;
|
||||
border: 1px solid #0a0c19;
|
||||
}
|
||||
|
||||
.dark .posts_mu_list li:nth-of-type(odd) {
|
||||
background: #161829;
|
||||
}
|
||||
|
||||
.dark .left_menu_box li[class*=current-] ul a {
|
||||
background: inherit;
|
||||
color: var(--light-color);
|
||||
}
|
||||
|
||||
.dark .single_footer_box {
|
||||
background: linear-gradient(90deg,#262841,#816bff00);
|
||||
}
|
||||
|
||||
.dark .footer_menu .inner {
|
||||
background: #0d0f1e;
|
||||
border-top: 1px solid #0d0f1e;
|
||||
}
|
||||
|
||||
.dark .bgm_box {
|
||||
border-bottom: 1px solid #0d0f1e;
|
||||
}
|
||||
|
||||
.dark .footer_menu li a , .dark .footer_menu li a i , .dark .m_offcanvas ul li a , .dark .m_offcanvas ul li a i {
|
||||
color: #c7caff;
|
||||
}
|
||||
|
||||
.dark .current-line {
|
||||
color: #9098a7;
|
||||
}
|
||||
|
||||
.dark .current-line .active {
|
||||
color: var(--light-color);
|
||||
}
|
||||
|
||||
/**豆瓣插件*/
|
||||
.dark .doulist-item .doulist-subject .db--viewTime {
|
||||
color: var(--light-color);
|
||||
background :#2f2f2f
|
||||
}
|
||||
.dark .doulist-item {
|
||||
border-color: var(--dark-border);
|
||||
}
|
||||
.dark .doulist-item .doulist-subject .abstract,.dark .doulist-item .doulist-subject .rating_nums {
|
||||
color: #909090;
|
||||
}
|
||||
|
||||
.dark .msg_modal_inner .body p{
|
||||
color: var(--light-color);
|
||||
}
|
||||
.dark .msg_modal_inner .body pre{
|
||||
background: var(--dark-medium-bg);
|
||||
border: var(--dark-medium-bg);
|
||||
color: var(--light-color);
|
||||
}
|
||||
@@ -0,0 +1,712 @@
|
||||
/**
|
||||
* 1440px
|
||||
*/
|
||||
@media only screen and (max-width:1440px) {
|
||||
.footer_top , .footer_text {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.land_content {
|
||||
max-width: 960px;
|
||||
height: 550px;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
padding: 60px;
|
||||
padding-top: 150px;
|
||||
}
|
||||
|
||||
.land_logo {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
padding-top: 40px;
|
||||
}
|
||||
|
||||
.land_right .title {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.land_right .land_des {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.land_right .footer {
|
||||
padding: 0 60px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:1920px) {
|
||||
.main_wrap , .footer_nav , .go_top_box {
|
||||
max-width: 860px;
|
||||
}
|
||||
|
||||
.land_content {
|
||||
max-width: 1080px;
|
||||
height: 607px;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
padding: 40px;
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.land_logo {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.land_right .title {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.land_right .land_des {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.land_right .footer {
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
body.mod_third .main_wrap , body.mod_third .go_top_box {
|
||||
max-width: 1180px;
|
||||
}
|
||||
|
||||
body.mod_third .footer_nav {
|
||||
max-width: 885px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width:1366px) {
|
||||
|
||||
.land_content {
|
||||
max-width: 860px;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
padding: 30px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.land_logo {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.land_right .title {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.land_right .land_des {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.land_right .footer {
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
.land_nav a span , .land_nav a i {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
body.mod_third .main_wrap , body.mod_third .go_top_box , body.mod_third .footer_nav {
|
||||
max-width: 860px;
|
||||
}
|
||||
|
||||
body.mod_third .main_sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.mod_third #top_third{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
body.mod_third .left_nav {
|
||||
width: calc(100% * 1 / 3.001);
|
||||
}
|
||||
|
||||
body.mod_third .page_main {
|
||||
width: calc(100% * 2 / 3.001);
|
||||
}
|
||||
|
||||
body.mod_third .top_bar {
|
||||
border-top-right-radius: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:1200px) {
|
||||
.land_page {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.land_content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
height: max-content;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.land_left {
|
||||
min-height: calc(100vh);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
width: 94%;
|
||||
position: absolute;
|
||||
background: rgb(243 245 255 / 78%);
|
||||
border-radius: 18px;
|
||||
top: 5%;
|
||||
backdrop-filter: blur(0.5rem);
|
||||
-webkit-backdrop-filter: blur(0.5rem);
|
||||
padding: 30px 30px 50px;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
.land_logo {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.land_logo img {
|
||||
height: 42px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.land_right .title {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.land_right .footer {
|
||||
position: relative;
|
||||
bottom: auto;
|
||||
margin-top: 40px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.land_nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.land_nav a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
border-radius: 12px;
|
||||
background: #1d1d1d;
|
||||
margin-bottom: 8px;
|
||||
width: 22%;
|
||||
}
|
||||
|
||||
.land_nav a i {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.land_right .beian , .land_right .copyright {
|
||||
color: #293563;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width:960px) {
|
||||
.main_wrap , .top_bar , .footer_nav {
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
.main_wrap {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.lbc .page_main , .lbc .footer_nav_box .right {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.top_logo {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.land_nav a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
footer#colophon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.mod_third .main_wrap, body.mod_third .go_top_box, body.mod_third .footer_nav {
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
body.mod_third .page_main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body.mod_third_s .sidebar_right {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.mod_third_s #top_third{
|
||||
display: block;
|
||||
}
|
||||
|
||||
body.mod_third_s .page_main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.top_menu_box {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width:540px) {
|
||||
|
||||
body.mod_third_s #top_third,body.mod_third #top_third{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.top_right {
|
||||
margin-right: 15px;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.user_info .avatar {
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
}
|
||||
|
||||
.moment_cat_nav, .posts_cat_nav, .photos_cat_nav {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
#post_item,#photos_item {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.p_item {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.t_content p {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.normal_card_content .feature {
|
||||
width: 100px;
|
||||
min-width: 100px;
|
||||
height: 120px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.normal_content .entry-content p, .normal_card_content .entry-content p {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.normal_card_content .entry-title {
|
||||
font-size: 16px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.normal_card_content .card_right {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.entry-footer {
|
||||
padding: 5px 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.normal_content .entry-content .feature {
|
||||
margin-top: 8px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.normal_cat {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.single_wrap {
|
||||
padding: 15px;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.single_wrap .comments-area, .page_content .comments-area , .single_content .comments-area {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.list_user_meta .avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
.blog_content {
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
.comments-area ul.comment-list li .profile , .comments-area ul.comment-list li .profile a {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.img_show {
|
||||
width: calc(83px*3);
|
||||
}
|
||||
|
||||
/*.img_list a {*/
|
||||
/* width: 30%;*/
|
||||
/* margin: 2px;*/
|
||||
/*}*/
|
||||
|
||||
.t_media_item , a.up_img_btn{
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.single_content, .page_content, .page_wrap {
|
||||
padding: 0 15px;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.page_wrap {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.user_info {
|
||||
bottom: 18%;
|
||||
}
|
||||
|
||||
.blog_list_inner , .single_content, .page_content, .page_wrap , .normal_list_inner , .single_wrap {
|
||||
border-radius: 12px;
|
||||
position: relative;
|
||||
z-index: 199;
|
||||
top: -18px;
|
||||
}
|
||||
|
||||
.top_left {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.top_left .top_logo {
|
||||
display: block;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.top_bar , .dark .top_bar {
|
||||
height: 64px;
|
||||
width: 100% !important;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.top_logo img {
|
||||
height: 40px !important;
|
||||
}
|
||||
|
||||
.footer_nav_box ul li a i {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.footer_nav_box .inner {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.footer_nav_box ul li a {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.t_login {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.go_top {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.mobile_edit {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.index_banner {
|
||||
margin-top: -64px;
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
.top_bar.uk-sticky-fixed.uk-active , .dark .top_bar.uk-sticky-fixed.uk-active {
|
||||
background: transparent;
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
}
|
||||
|
||||
.top_bar.uk-sticky-fixed.uk-active.mobile_active {
|
||||
backdrop-filter: blur(0.5rem);
|
||||
-webkit-backdrop-filter: blur(0.5rem);
|
||||
background: rgb(255 255 255 / 80%);
|
||||
}
|
||||
|
||||
.dark .top_bar.uk-sticky-fixed.uk-active.mobile_active {
|
||||
background: rgb(27 29 48 / 80%);
|
||||
}
|
||||
|
||||
.top_tool i , .dark .top_tool i , .dark .mobile_active .top_tool i , .t_dark a i , .dark .t_dark a i {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mobile_active .top_tool i {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.top_tool input.s_input:focus ~ [class*=ri-] {
|
||||
color: #4f4f4f;
|
||||
}
|
||||
|
||||
.land_page {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.land_content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0;
|
||||
height: max-content;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.land_left {
|
||||
min-height: calc(100vh);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.land_right {
|
||||
width: 94%;
|
||||
position: absolute;
|
||||
background: rgb(243 245 255 / 78%);
|
||||
border-radius: 18px;
|
||||
top: 5%;
|
||||
backdrop-filter: blur(0.5rem);
|
||||
-webkit-backdrop-filter: blur(0.5rem);
|
||||
padding: 30px 30px 50px;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
.land_logo {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.land_logo img {
|
||||
height: 42px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.land_right .title {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.land_right .footer {
|
||||
position: relative;
|
||||
bottom: auto;
|
||||
margin-top: 40px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.land_nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.land_nav a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
border-radius: 12px;
|
||||
background: #1d1d1d;
|
||||
margin-bottom: 8px;
|
||||
width: 22%;
|
||||
}
|
||||
|
||||
.land_nav a i {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.land_right .beian , .land_right .copyright {
|
||||
color: #293563;
|
||||
}
|
||||
|
||||
.sim .land_content {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.sim .land_nav a {
|
||||
width: 22%;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.sim .land_meta {
|
||||
left: 40px;
|
||||
}
|
||||
|
||||
.darkl .land_right .title p {
|
||||
color: #323232;
|
||||
}
|
||||
|
||||
.darkl .land_right .land_des {
|
||||
color: #222433;
|
||||
}
|
||||
|
||||
.darkl .land_right .land_des a {
|
||||
color: #00935a;
|
||||
}
|
||||
|
||||
.land_nav a span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.archive_main .page-header {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
.post_footer_meta span.sticky_icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.t_form {
|
||||
padding: 0 15px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.topic_tool {
|
||||
padding: 0px 15px 40px;
|
||||
}
|
||||
|
||||
.uk-modal {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.t_search.top_tool.icon_color {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.top_s_box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.bg_music , .dark a.bg_music {
|
||||
background: transparent;
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
a.bg_music i {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.player_mod .tool , a.m_prev , a.m_next , .timer , a.m_volume , .player_hand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player_mod .m_cover {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
min-width: 32px;
|
||||
}
|
||||
|
||||
.player_mod .m_cover img {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
a.m_play {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.bgm_box {
|
||||
padding: 6px 10px;
|
||||
border-bottom: 1px solid #f4f4f4;
|
||||
}
|
||||
|
||||
.footer_nav_box .footer_player {
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.player_mod .pl_btn {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.footer_nav_box {
|
||||
top: 56px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.footer_menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.player_mod .m_info small {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.single_music_header .mu_img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.footer_main {
|
||||
position: relative;
|
||||
padding-bottom: 110px;
|
||||
}
|
||||
|
||||
.mobile_logo {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/*.img_list a:nth-child(1):nth-last-child(4), .img_list a:nth-child(3):nth-last-child(2), .img_list a:nth-child(4):nth-last-child(1) {*/
|
||||
/* width: 30%;*/
|
||||
/*}*/
|
||||
|
||||
.admin_ava a.mobile_edit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.mod_third_s .nav_title {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
body.mod_third_s .footer_nav_box .right {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
/*基佬紫主题*/
|
||||
:root {
|
||||
--pix-theme: #3b3eff;
|
||||
--body-bg-color: #e8e8f1;
|
||||
--withe-bg-color: #fff;
|
||||
--light-bg-color: #f6f7ff;
|
||||
--linear-color:linear-gradient(90deg,#4832ff,#816bff);
|
||||
--shadow-bg: 0px 7px 20px 1px #d7ceff30;
|
||||
--btn-active-color: var(--pix-theme);
|
||||
--btn-light-color:#e9ecfe;
|
||||
--big-shadow: 0 28px 50px rgb(212 221 255);
|
||||
--hilight-color: var(--pix-theme);
|
||||
--light-text-color: #9498cd;
|
||||
--heave-text-color: #44507b;
|
||||
--border-color: #f7f7ff;
|
||||
--icon-color : #44507b;
|
||||
--box-bg: #eff1ff;
|
||||
--box-light: #b1b3d2;
|
||||
--dark-color : #2f2f2f;
|
||||
--dark-body-gay-bg: linear-gradient(117deg,#f3efff,#e7f1ff);
|
||||
|
||||
--halo-comment-widget-component-form-button-submit-pix-bg-color:linear-gradient(90deg,#4832ff,#816bff);
|
||||
--halo-comment-widget-component-form-input-pix-bg-color: #fff;
|
||||
--halo-comment-widget-component-comment-author-info-input: #f6f7ff;
|
||||
--halo-comment-widget-component-pagination-button-pix-bg-color-hover: #3b3eff;
|
||||
--halo-comment-widget-component-pagination-button-pix-bg-color-active: #e9ecfe;
|
||||
--halo-comment-widget-component-pagination-button-pix-border-color-active: #9498cd;
|
||||
--halo-comment-widget-component-btn-active-color: #3b3eff;
|
||||
--halo-comment-widget-parents_at-color: #3b3eff;
|
||||
|
||||
}
|
||||
|
||||
.uk-link-toggle:hover .uk-link, .uk-link:hover, a:hover , .footer_nav_box ul li a:hover , .copyright a , a.mo_link , .show-more-btn , .page_content .entry-header i
|
||||
, .link_group .item:hover .name a , a.comment-reply-link:hover , .s_set_box a.active , .search_box .s_set_box a:hover , .ad_info a:hover , .audio_choose li.uk-active a, .video_choose li.uk-active a
|
||||
, .posts_show_widget .no_img li a:before , .posts_mu_list li:hover div, .posts_mu_list li:hover a, .posts_mu_list li.active, .posts_mu_list li.active .s_play_btn
|
||||
, .pl_btn a i:hover{
|
||||
color: var(--hilight-color);
|
||||
}
|
||||
|
||||
input#img_link_up:focus , .top_tool input.s_input:focus , #t_commentform:focus-within , #commentform:focus-within , .vi_reply_item .target_comment , #comment-author-info input:focus , .field input:focus
|
||||
, #login_form_box input#username:focus , #login_form_box input#password:focus , .s_set_box a.active , .search_box input.s_input:focus , .edit_card_box .edit_content input:focus
|
||||
, .audio_choose li.uk-active a , .video_choose li.uk-active a {
|
||||
border-color: var(--hilight-color);
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--dark-body-gay-bg);
|
||||
}
|
||||
|
||||
.up_from_media a, .up_from_cdn a {
|
||||
background: var(--body-bg-color);
|
||||
}
|
||||
|
||||
.push_close , .attch_nav a i , a.img_link_cancel {
|
||||
background: var(--box-light);
|
||||
}
|
||||
|
||||
.unread_box .vi_reply_item {
|
||||
background: #ebeeff;
|
||||
}
|
||||
|
||||
a.img_link_btn , a.img_link_cancel , #post_pager a:hover , a.go_top{
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.blog_list_inner, .normal_list_inner, .single_wrap , #t_commentform , textarea#comment , .field textarea , .single_content, .page_content, .page_wrap , #commentform , .top_bar
|
||||
, .archive_main , .page_main , .posts_mu_list {
|
||||
background: var(--withe-bg-color);
|
||||
}
|
||||
|
||||
.left_nav_inner , #commentform textarea#comment , .top_tool input.s_input:focus , .post_control_list , .right_admin_tool , .sidebar_right , .posts_mu_list li:nth-of-type(odd) {
|
||||
background: var(--light-bg-color);
|
||||
}
|
||||
|
||||
.single_wrap .comments-area, .page_content .comments-area , .topic_comments_wrap , .column_inner {
|
||||
background: #fafbff;
|
||||
}
|
||||
|
||||
.left_menu_box li[class*=current-] a , .left_menu_box li[class*=current-] a:hover , input#push_comment , input.submit_button {
|
||||
background: var(--linear-color);
|
||||
color: var(--light-bg-color);
|
||||
}
|
||||
|
||||
.main_wrap , .top_ava img , .widget_tag_cloud a {
|
||||
box-shadow: var(--shadow-bg);
|
||||
}
|
||||
|
||||
.moment_cat_nav ul li a.active, .posts_cat_nav ul li a.active , .photos_cat_nav ul li a.active , #t_pagination a, #pagination a , #p_pagination a , .up_cat_btn , a.set_local_btn , .push_item , a.img_link_btn , .commentnav span.page-numbers.current
|
||||
, ::-webkit-scrollbar-thumb , #post_pager a:hover , a.go_top , .edit_card_box .edit_content a.push_card , a.play_btn , .post_control_list a:hover , .top_set_box a.active , .vo_size {
|
||||
background-color: var(--btn-active-color);
|
||||
}
|
||||
|
||||
.moment_cat_nav ul li a:hover, .posts_cat_nav ul li a:hover, .photos_cat_nav ul li a:hover {
|
||||
background-color: var(--btn-active-color);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a.set_local_btn , .top_set_box a.active , .top_set_box a.active:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.left_menu_box ul li a:hover, .link_group .item:hover {
|
||||
box-shadow: var(--big-shadow);
|
||||
background: var(--btn-light-color);
|
||||
color: var(--hilight-color);
|
||||
}
|
||||
|
||||
.moment_cat_nav ul li a, .posts_cat_nav ul li a ,.photos_cat_nav ul li a, .cancel-comment-reply a , .commentnav a , #post_pager a {
|
||||
background: var(--btn-light-color);
|
||||
color: var(--light-text-color);
|
||||
}
|
||||
|
||||
textarea#comment , .field textarea , .tool_box , .smile_show , .form_footer , .set_cat , #commentform textarea#comment , .p_item
|
||||
, .moment_cat_nav, .posts_cat_nav, .photos_cat_nav {
|
||||
border-color: var(--border-color);
|
||||
}
|
||||
|
||||
.left_menu_box ul , .widget_inner .widget {
|
||||
border-color: #eeefff
|
||||
}
|
||||
|
||||
.list_user_meta .name , .comment-list p.nodata , .t_cat_box li , .show_cdn_media span , .vi_reply_item .name span , .vi_reply_item .meta a , .msg_log , .links_count , .link_cat_name , #post_pager .c_paged
|
||||
, .p_title a ,.avatar_title a , .ad_info p , .ad_info a , .top_set_box a {
|
||||
color: var(--heave-text-color);
|
||||
}
|
||||
|
||||
.user_pannel .inner a {
|
||||
background: var(--btn-light-color);
|
||||
color: var(--light-text-color);
|
||||
}
|
||||
|
||||
.user_pannel .inner a:hover {
|
||||
background: var(--btn-active-color);
|
||||
}
|
||||
|
||||
.t_dark a i , .top_tool i , .normal_content .post_footer_meta span.comnum i, .normal_card_content .post_footer_meta span.comnum i, .normal_grid_content .post_footer_meta span.comnum i
|
||||
, a.up_like i , .footer_nav_box ul li a , a.music_btn , .post_footer_meta span i , .comment_smile_box a i , a.bg_music i , a.bg_lrc i, .top_s_box form i , .pix_widget_tongji ul li small , .posts_mu_list .s_play_btn {
|
||||
color: var(--icon-color);
|
||||
}
|
||||
|
||||
.entry-footer , .t_cat_box li , input#set_local , .show_media_box, .show_cdn_media , .single_content .comments-area {
|
||||
background: var(--light-bg-color);
|
||||
}
|
||||
|
||||
.bottom_tool .inner , .links_page .link_group .item , .link_group .item {
|
||||
background: var(--box-bg);
|
||||
}
|
||||
|
||||
#topic_content {
|
||||
background: #f6f7ff;
|
||||
border: 1px solid #cccdf0;
|
||||
}
|
||||
|
||||
.normal_cat , .de_cat {
|
||||
background: var(--dark-color);
|
||||
}
|
||||
|
||||
.normal_content .entry_meta, .normal_card_content .entry_meta, .normal_grid_content .entry_meta , a.beian , footer#colophon , .page_content .entry-header .right time , a.comment-reply-link
|
||||
, .ad_info .name , .set_text , .widget_tag_cloud a , .cst_widget_comment ul li .right .meta , .posts_show_widget ul li .meta , .pix_widget_tongji ul li span
|
||||
, .pl_btn a i {
|
||||
color: var(--light-text-color);
|
||||
}
|
||||
|
||||
.normal_content .entry-title a, .normal_grid_content .entry-title a {
|
||||
color: var(--dark-color);
|
||||
}
|
||||
|
||||
a.up_like.done i {
|
||||
color: #ff4040;
|
||||
}
|
||||
|
||||
.show-more-btn:hover {
|
||||
color: #5457ff;
|
||||
}
|
||||
|
||||
.smile_box i, .simi i, .t_cat i, .loca i , .post-categories a {
|
||||
background: var(--box-bg);
|
||||
color: var(--box-light);
|
||||
}
|
||||
|
||||
#topic_content:focus {
|
||||
box-shadow: 0 0 0 0.12rem rgb(182 190 255);
|
||||
}
|
||||
|
||||
.up_img_btn i {
|
||||
color: var(--box-light);
|
||||
}
|
||||
|
||||
.t_cat_box li span {
|
||||
color: var(--heave-text-color) !important;
|
||||
}
|
||||
|
||||
.form_footer .admin_tool a {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.top_bar.uk-sticky-fixed.uk-active {
|
||||
background: rgb(245 246 255 / 80%);
|
||||
}
|
||||
|
||||
#comment-author-info input , .field textarea ,.field input , #login_form_box input#username, #login_form_box input#password {
|
||||
border-color: #d9dfee;
|
||||
background: var(--light-bg-color);
|
||||
}
|
||||
|
||||
.post_footer_meta span.sticky_icon {
|
||||
background: #ff5252;
|
||||
}
|
||||
|
||||
.pix_player {
|
||||
background: rgb(234 234 255 / 81%);
|
||||
}
|
||||
|
||||
.moment_type_btn i , .smile_box i, .simi i, .t_cat i, .loca i{
|
||||
color: #746de2;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.loacl_audio input, .netease_audio input , .tencent_audio input , .kugou_audio input , .kuwo_audio input , .edit_card_box .edit_content input , .local_video , input#moment_video_bili {
|
||||
background: #f1f3ff;
|
||||
}
|
||||
|
||||
.loacl_audio .audio_right input , input#moment_video_url {
|
||||
background: #dfe3f6;
|
||||
}
|
||||
|
||||
.moment_card_item a {
|
||||
background: #ebeeff;
|
||||
}
|
||||
|
||||
.moment_card_item.loop_card_item a:hover {
|
||||
box-shadow: 0px 8px 13px 0px rgb(229 226 255);
|
||||
}
|
||||
|
||||
.top_s_box input.s_input {
|
||||
background: rgb(237 239 254 / 59%);
|
||||
}
|
||||
|
||||
.widget_tag_cloud a , .cst_widget_comment ul li .right .body {
|
||||
background: #e9ecfe;
|
||||
}
|
||||
|
||||
.pix_widget_tongji ul li {
|
||||
background: linear-gradient(90deg,#e9ecfe,#816bff00);
|
||||
box-shadow: 0px 8px 9px 0px rgb(234 235 255 / 47%);
|
||||
}
|
||||
|
||||
.t_dark a , a.bg_music, a.bg_lrc{
|
||||
background: #c4d0e6;
|
||||
}
|
||||
|
||||
.single_footer_box {
|
||||
background: linear-gradient(90deg,#f0f2ff,#816bff00);
|
||||
}
|
||||
|
||||
.footer_main .inner {
|
||||
background: #f6f7ff;
|
||||
}
|
||||
|
||||
.sf_item a {
|
||||
color: #7e85ad;
|
||||
}
|
||||
|
||||
a.m_play i , a.m_play i:hover {
|
||||
color: var(--hilight-color);
|
||||
}
|
||||
|
||||
.player_dot {
|
||||
border-color: var(--hilight-color);;
|
||||
}
|
||||
|
||||
.player_bar .progress {
|
||||
background: linear-gradient(90deg,var(--pix-theme),#5c7fff);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,933 @@
|
||||
:root {
|
||||
--font-family: eafont,HarmonyOS_M,PingFang SC,Hiragino Sans GB,Microsoft YaHei,STHeiti,WenQuanYi Micro Hei,Helvetica,Arial,sans-serif;
|
||||
--halo-comment-widget-base-font-family: var(--font-family);
|
||||
/* 搜索 */
|
||||
--halo-search-widget-base-font-size: 1.04rem;
|
||||
--halo-search-widget-base-font-family: var(--font-family);
|
||||
--halo-search-widget-primary-color: #3451b2;
|
||||
}
|
||||
|
||||
html {
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
overflow-y:scroll;
|
||||
overflow-x: hidden;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers.
|
||||
*/
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the `main` element consistently in IE.
|
||||
*/
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
pre {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57-
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
abbr[title] {
|
||||
border-bottom: none;
|
||||
text-decoration: underline;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10.
|
||||
*/
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers.
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: var(--font-family);
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
[type="reset"]:-moz-focusring,
|
||||
[type="submit"]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
button.null {
|
||||
background: 0 0;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
fieldset {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
legend {
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
display: table;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE 10+.
|
||||
*/
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10.
|
||||
* 2. Remove the padding in IE 10.
|
||||
*/
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.vditor-task input {
|
||||
margin: 0 0.2em 0.25em -1.6em;
|
||||
font-size: 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||
*/
|
||||
details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Misc
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10+.
|
||||
*/
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10.
|
||||
*/
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Box sizing
|
||||
--------------------------------------------- */
|
||||
|
||||
/* Inherit box-sizing to more easily change it's value on a component level.
|
||||
@link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Base
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
/* Typography
|
||||
--------------------------------------------- */
|
||||
body,
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
color: #404040;
|
||||
font-family: var(--font-family);
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.dark body{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
dfn,
|
||||
cite,
|
||||
em,
|
||||
i {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 1.5em;
|
||||
}
|
||||
|
||||
address {
|
||||
margin: 0 0 1.5em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #eee;
|
||||
font-family: "Courier 10 Pitch", courier, monospace;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 1.6em;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
padding: 1.6em;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
tt,
|
||||
var {
|
||||
font-family: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
|
||||
}
|
||||
|
||||
abbr,
|
||||
acronym {
|
||||
border-bottom: 1px dotted #666;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
mark,
|
||||
ins {
|
||||
background: #fff9c0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
big {
|
||||
font-size: 125%;
|
||||
}
|
||||
|
||||
/* Elements
|
||||
--------------------------------------------- */
|
||||
body {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
hr {
|
||||
background-color: #ccc;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin: 0 0 1.5em 3em;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: disc;
|
||||
}
|
||||
|
||||
ol {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
li > ul,
|
||||
li > ol {
|
||||
margin-bottom: 0;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0 1.5em 1.5em;
|
||||
}
|
||||
|
||||
/* Make sure embeds and iframes fit their containers. */
|
||||
embed,
|
||||
iframe,
|
||||
object {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: 0 0 1.5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Links
|
||||
--------------------------------------------- */
|
||||
a {
|
||||
color: #4169e1;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #252525;
|
||||
}
|
||||
|
||||
a:hover,
|
||||
a:focus,
|
||||
a:active {
|
||||
color: #191970;
|
||||
}
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
a:hover,
|
||||
a:active {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
--------------------------------------------- */
|
||||
button,
|
||||
input[type="button"],
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
border: 1px solid;
|
||||
border-color: #ccc #ccc #bbb;
|
||||
border-radius: 3px;
|
||||
background: #e6e6e6;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
line-height: 1;
|
||||
padding: 0.6em 1em 0.4em;
|
||||
}
|
||||
|
||||
button:hover,
|
||||
input[type="button"]:hover,
|
||||
input[type="reset"]:hover,
|
||||
input[type="submit"]:hover {
|
||||
border-color: #ccc #bbb #aaa;
|
||||
}
|
||||
|
||||
button:active,
|
||||
button:focus,
|
||||
input[type="button"]:active,
|
||||
input[type="button"]:focus,
|
||||
input[type="reset"]:active,
|
||||
input[type="reset"]:focus,
|
||||
input[type="submit"]:active,
|
||||
input[type="submit"]:focus {
|
||||
border-color: #aaa #bbb #bbb;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="url"],
|
||||
input[type="password"],
|
||||
input[type="search"],
|
||||
input[type="number"],
|
||||
input[type="tel"],
|
||||
input[type="range"],
|
||||
input[type="date"],
|
||||
input[type="month"],
|
||||
input[type="week"],
|
||||
input[type="time"],
|
||||
input[type="datetime"],
|
||||
input[type="datetime-local"],
|
||||
input[type="color"],
|
||||
textarea {
|
||||
color: #666;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
input[type="text"]:focus,
|
||||
input[type="email"]:focus,
|
||||
input[type="url"]:focus,
|
||||
input[type="password"]:focus,
|
||||
input[type="search"]:focus,
|
||||
input[type="number"]:focus,
|
||||
input[type="tel"]:focus,
|
||||
input[type="range"]:focus,
|
||||
input[type="date"]:focus,
|
||||
input[type="month"]:focus,
|
||||
input[type="week"]:focus,
|
||||
input[type="time"]:focus,
|
||||
input[type="datetime"]:focus,
|
||||
input[type="datetime-local"]:focus,
|
||||
input[type="color"]:focus,
|
||||
textarea:focus {
|
||||
color: #111;
|
||||
}
|
||||
|
||||
select {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Layouts
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Components
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
/* Navigation
|
||||
--------------------------------------------- */
|
||||
.main-navigation {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-navigation ul {
|
||||
display: none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.main-navigation ul ul {
|
||||
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
|
||||
float: left;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: -999em;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.main-navigation ul ul ul {
|
||||
left: -999em;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.main-navigation ul ul li:hover > ul,
|
||||
.main-navigation ul ul li.focus > ul {
|
||||
display: block;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.main-navigation ul ul a {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.main-navigation ul li:hover > ul,
|
||||
.main-navigation ul li.focus > ul {
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.main-navigation li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.main-navigation a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Small menu. */
|
||||
.menu-toggle,
|
||||
.main-navigation.toggled ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 37.5em) {
|
||||
|
||||
.menu-toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-navigation ul {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.site-main .comment-navigation,
|
||||
.site-main
|
||||
.posts-navigation,
|
||||
.site-main
|
||||
.post-navigation {
|
||||
margin: 0 0 1.5em;
|
||||
}
|
||||
|
||||
.comment-navigation .nav-links,
|
||||
.posts-navigation .nav-links,
|
||||
.post-navigation .nav-links {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.comment-navigation .nav-previous,
|
||||
.posts-navigation .nav-previous,
|
||||
.post-navigation .nav-previous {
|
||||
flex: 1 0 50%;
|
||||
}
|
||||
|
||||
.comment-navigation .nav-next,
|
||||
.posts-navigation .nav-next,
|
||||
.post-navigation .nav-next {
|
||||
text-align: end;
|
||||
flex: 1 0 50%;
|
||||
}
|
||||
|
||||
/* Posts and pages
|
||||
--------------------------------------------- */
|
||||
.sticky {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.post,
|
||||
.page {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.updated:not(.published) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-content,
|
||||
.entry-content,
|
||||
.entry-summary {
|
||||
margin: 1.5em 0 0;
|
||||
}
|
||||
|
||||
.page-links {
|
||||
clear: both;
|
||||
margin: 0 0 1.5em;
|
||||
}
|
||||
|
||||
/* Comments
|
||||
--------------------------------------------- */
|
||||
.comment-content a {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.bypostauthor {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Widgets
|
||||
--------------------------------------------- */
|
||||
.widget {
|
||||
margin: 0 0 1.5em;
|
||||
}
|
||||
|
||||
.widget select {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Media
|
||||
--------------------------------------------- */
|
||||
.page-content .wp-smiley,
|
||||
.entry-content .wp-smiley,
|
||||
.comment-content .wp-smiley {
|
||||
border: none;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Make sure logo link wraps around logo image. */
|
||||
.custom-logo-link {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Captions
|
||||
--------------------------------------------- */
|
||||
.wp-caption {
|
||||
margin-bottom: 1.5em;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.wp-caption img[class*="wp-image-"] {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.wp-caption .wp-caption-text {
|
||||
margin: 0.8075em 0;
|
||||
}
|
||||
|
||||
.wp-caption-text {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Galleries
|
||||
--------------------------------------------- */
|
||||
.gallery {
|
||||
margin-bottom: 1.5em;
|
||||
display: grid;
|
||||
grid-gap: 1.5em;
|
||||
}
|
||||
|
||||
.gallery-item {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.gallery-columns-2 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-3 {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-4 {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-5 {
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-6 {
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-7 {
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-8 {
|
||||
grid-template-columns: repeat(8, 1fr);
|
||||
}
|
||||
|
||||
.gallery-columns-9 {
|
||||
grid-template-columns: repeat(9, 1fr);
|
||||
}
|
||||
|
||||
.gallery-caption {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Plugins
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
/* Jetpack infinite scroll
|
||||
--------------------------------------------- */
|
||||
|
||||
/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */
|
||||
.infinite-scroll .posts-navigation,
|
||||
.infinite-scroll.neverending .site-footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Re-display the Theme Footer when Infinite Scroll has reached its end. */
|
||||
.infinity-end.neverending .site-footer {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Utilities
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
/* Accessibility
|
||||
--------------------------------------------- */
|
||||
|
||||
/* Text meant only for screen readers. */
|
||||
.screen-reader-text {
|
||||
border: 0;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute !important;
|
||||
width: 1px;
|
||||
word-wrap: normal !important;
|
||||
}
|
||||
|
||||
.screen-reader-text:focus {
|
||||
background-color: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||
clip: auto !important;
|
||||
clip-path: none;
|
||||
color: #21759b;
|
||||
display: block;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 700;
|
||||
height: auto;
|
||||
left: 5px;
|
||||
line-height: normal;
|
||||
padding: 15px 23px 14px;
|
||||
text-decoration: none;
|
||||
top: 5px;
|
||||
width: auto;
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
/* Do not show the outline on the skip link target. */
|
||||
#primary[tabindex="-1"]:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* Alignments
|
||||
--------------------------------------------- */
|
||||
.alignleft {
|
||||
|
||||
/*rtl:ignore*/
|
||||
float: left;
|
||||
|
||||
/*rtl:ignore*/
|
||||
margin-right: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
|
||||
/*rtl:ignore*/
|
||||
float: right;
|
||||
|
||||
/*rtl:ignore*/
|
||||
margin-left: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
.aligncenter {
|
||||
clear: both;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 303 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 1l8.217 1.826a1 1 0 0 1 .783.976v9.987a6 6 0 0 1-2.672 4.992L12 23l-6.328-4.219A6 6 0 0 1 3 13.79V3.802a1 1 0 0 1 .783-.976L12 1zm0 2.049L5 4.604v9.185a4 4 0 0 0 1.781 3.328L12 20.597l5.219-3.48A4 4 0 0 0 19 13.79V4.604L12 3.05zM12 7a2 2 0 0 1 1.001 3.732L13 15h-2v-4.268A2 2 0 0 1 12 7z" fill="rgba(255,255,255,1)"/></svg>
|
||||
|
After Width: | Height: | Size: 456 B |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 383 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zM9 9v6h2V9H9zm4 0v6h2V9h-2z"/></svg>
|
||||
|
After Width: | Height: | Size: 238 B |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zM10.622 8.415a.4.4 0 0 0-.622.332v6.506a.4.4 0 0 0 .622.332l4.879-3.252a.4.4 0 0 0 0-.666l-4.88-3.252z"/></svg>
|
||||
|
After Width: | Height: | Size: 313 B |
|
After Width: | Height: | Size: 6.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M8 11.333l10.223-6.815a.5.5 0 0 1 .777.416v14.132a.5.5 0 0 1-.777.416L8 12.667V19a1 1 0 0 1-2 0V5a1 1 0 1 1 2 0v6.333z"/></svg>
|
||||
|
After Width: | Height: | Size: 256 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16 12.667L5.777 19.482A.5.5 0 0 1 5 19.066V4.934a.5.5 0 0 1 .777-.416L16 11.333V5a1 1 0 0 1 2 0v14a1 1 0 0 1-2 0v-6.333z"/></svg>
|
||||
|
After Width: | Height: | Size: 259 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 331 B |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 331 B |
|
After Width: | Height: | Size: 320 B |
|
After Width: | Height: | Size: 388 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18"><path fill="none" d="M0 0h24v24H0z"/><path d="M2 19h20v2H2v-2zM2 5l5 3.5L12 2l5 6.5L22 5v12H2V5zm2 3.841V15h16V8.841l-3.42 2.394L12 5.28l-4.58 5.955L4 8.84z" fill="rgba(255,193,116,1)"/></svg>
|
||||
|
After Width: | Height: | Size: 275 B |
@@ -0,0 +1,561 @@
|
||||
main_content = $('.moment_type_main');
|
||||
function remove_image_temp(){
|
||||
if(!$('.image_edit_temp .add_img_box').length > 0){
|
||||
var temp = $('.add_img_box');
|
||||
$('.image_edit_temp').html(temp);
|
||||
}
|
||||
main_content.empty();
|
||||
}
|
||||
|
||||
function back_image_temp(){
|
||||
var temp = $('.add_img_box');
|
||||
main_content.html(temp);
|
||||
$('.image_edit_temp').empty();
|
||||
}
|
||||
|
||||
//发布卡片
|
||||
$('body').on('click', '.moment_card_type a', function () {
|
||||
$('.push_item').attr('type', 'card');
|
||||
main_content = $('.moment_type_main');
|
||||
if ($('.add_card_box').length > 0) {
|
||||
return false;
|
||||
}
|
||||
remove_image_temp();
|
||||
main_content.html('<div class="loading_box"><div uk-spinner></div></div>');
|
||||
$('.moment_type_main .loading_box').remove();
|
||||
main_content.append(
|
||||
`<div class="add_card_box">
|
||||
<div class="edit_card_box">
|
||||
<div class="card_choose" uk-switcher="animation: uk-animation-fade">
|
||||
<li><a class="card_c_btn post" c_type="post">文章</a></li>
|
||||
<li><a class="card_c_btn page" c_type="page">页面</a></li>
|
||||
</div>
|
||||
<div class="tips"># 输入别名或者标题,自动生成链接卡片 <span>支持文章, 页面等网址</span></div>
|
||||
<div class="edit_content">
|
||||
<input type="text" placeholder="别名或者标题" name="moment_card_link" id="moment_card_link" required="required">
|
||||
<a class="push_card">生成</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show_card"><div class="card_sortble" uk-sortable="handle: .moment_card_item"></div></div>
|
||||
</div>`);
|
||||
});
|
||||
$('body').on('click', '.edit_content .push_card', function () {
|
||||
var card_url = $('.edit_card_box .edit_content input').val();
|
||||
var num = $('.card_sortble .moment_card_item').length;
|
||||
if (num > 2) {
|
||||
cocoMessage.error('最多插入3个卡片');
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
return false;
|
||||
}
|
||||
var c_type = $('.card_choose .uk-active a').attr('c_type');
|
||||
switch (c_type) {
|
||||
case "post":
|
||||
card_post(card_url);
|
||||
break;
|
||||
case "page":
|
||||
edit_page(card_url);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
function card_post(card_url){
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/api.console.halo.run/v1alpha1/posts?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('生成中...');
|
||||
},
|
||||
success: function (data) {
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
if (data.total > 0) {
|
||||
if(data.total>1){
|
||||
cocoMessage.error('当前搜索的文章有多个无法选择');
|
||||
}else{
|
||||
var item = data.items[0]
|
||||
$('.show_card').show();
|
||||
$('.card_sortble').append(getcard(item.post.metadata.name,item.post.spec.cover,item.post.spec.title,'post'));
|
||||
cocoMessage.success('已生成卡片');
|
||||
}
|
||||
|
||||
} else {
|
||||
cocoMessage.error('文章不存在');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function edit_page(card_url){
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/api.console.halo.run/v1alpha1/singlepages?keyword=${card_url}&labelSelector=content.halo.run%2Fdeleted%3Dfalse&page=1&size=20`,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('生成中...');
|
||||
},
|
||||
success: function (data) {
|
||||
$('.edit_card_box .edit_content input').val('');
|
||||
if (data.total > 0) {
|
||||
if(data.total>1){
|
||||
cocoMessage.error('当前搜索的页面有多个无法选择');
|
||||
}else{
|
||||
var item = data.items[0]
|
||||
$('.show_card').show();
|
||||
$('.card_sortble').append(getcard(item.page.metadata.name,item.page.spec.cover,item.page.spec.title,'page'));
|
||||
cocoMessage.success('已生成卡片');
|
||||
}
|
||||
|
||||
} else {
|
||||
cocoMessage.error('页面不存在');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getcard(name,cover,title,type){
|
||||
|
||||
return `<div class="moment_card_item" pid="${name}" type="${type}">
|
||||
<a>
|
||||
<div class="left"><img src="${cover}"></div>
|
||||
<div class="right">
|
||||
<h4>${title}</h4>
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
<span class="de_card"><i class="ri-close-line"></i></span>
|
||||
</a>
|
||||
</div>`
|
||||
}
|
||||
|
||||
$(document).on('click', '.de_card', function() {
|
||||
var msg = "确认删除此卡片?";
|
||||
var num = $('.moment_card_item').length;
|
||||
if (confirm(msg)==true){
|
||||
$(this).parents('.moment_card_item').remove();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(num == 1){
|
||||
$(".show_card").hide();
|
||||
}
|
||||
});
|
||||
|
||||
//图文编辑 返回图文编辑区域
|
||||
$('body').on('click', '.moment_image_type a', function() {
|
||||
back_image_temp();
|
||||
$('.push_item').attr('type','image');
|
||||
});
|
||||
|
||||
//发布音乐--------------------------------------------------------------
|
||||
$('body').on('click', '.moment_audio_type a', function() {
|
||||
$('.push_item').attr('type','audio');
|
||||
main_content = $('.moment_type_main');
|
||||
if($('.add_audio_box').length > 0){
|
||||
return false;
|
||||
}
|
||||
remove_image_temp();
|
||||
main_content.append(
|
||||
`<div class="add_audio_box">
|
||||
<div class="edit_audio_box">
|
||||
<div class="audio_choose" uk-switcher="animation: uk-animation-fade">
|
||||
<li class="local"><a href="#" class="audio_c_btn" au_type="local">本地</a></li>
|
||||
<li class="netease"><a href="#" class="audio_c_btn" au_type="netease">网易云</a></li>
|
||||
<li class="tencent"><a href="#" class="audio_c_btn" au_type="tencent">QQ音乐</a></li>
|
||||
<li class="kugou"><a href="#" class="audio_c_btn" au_type="kugou">酷狗</a></li>
|
||||
<li class="kuwo"><a href="#" class="audio_c_btn" au_type="kuwo">酷我</a></li>
|
||||
</div>
|
||||
<div class="tips"># 请插入歌曲外链 <span></span></div>
|
||||
<div class="edit_content audio_type uk-switcher">
|
||||
<div class="loacl_audio">
|
||||
<input type="text" placeholder="歌曲外链" name="moment_audio_url" id="moment_audio_url" class="required" required="required">
|
||||
</div>
|
||||
<div class="netease_audio type_audio_text"></div>
|
||||
<div class="tencent_audio type_audio_text"></div>
|
||||
<div class="kugou_audio type_audio_text"></div>
|
||||
<div class="kuwo_audio type_audio_text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
});
|
||||
|
||||
//音乐和视频上传
|
||||
$(document).on('change','#moment_img_up',function(){
|
||||
if($('#moment_img_up').val() == '')
|
||||
return;
|
||||
var f = this.files[0];
|
||||
var formData = new FormData();
|
||||
formData.append('file',f);
|
||||
const policyName = Theme.moments.policy_name;
|
||||
const groupName = Theme.moments.group_name;
|
||||
policyName && formData.append('policyName',policyName)
|
||||
groupName && formData.append('groupName',groupName)
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: `${Theme.moments.attachments_upload_api}`,
|
||||
dataType: 'json',
|
||||
data: formData,
|
||||
processData : false,
|
||||
contentType : false,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('上传中...');
|
||||
$('.m_media_left i').remove();
|
||||
$('.m_media_left').append("<div class='up_loading' uk-spinner='ratio: .6'></div>");
|
||||
var imged = $('.m_media_left img');
|
||||
if(imged.length > 0){
|
||||
imged.remove();
|
||||
}
|
||||
},
|
||||
success: function(data){
|
||||
var thum = data.metadata.annotations["storage.halo.run/uri"] || data.metadata.annotations["storage.halo.run/external-link"]
|
||||
$('.m_media_left .up_loading').remove();
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+thum+'">');
|
||||
cocoMessage.success('上传成功');
|
||||
$('input#moment_video_url').val(thum)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', '.audio_choose a', function() {
|
||||
var text = '# 请插入封面,歌名以及歌曲外链';
|
||||
var type = $(this).attr('au_type');
|
||||
if(type != 'local'){
|
||||
var text = '# 请输入歌曲ID';
|
||||
}
|
||||
$('.edit_audio_box .tips').text(text);
|
||||
});
|
||||
|
||||
//发布视频--------------------------------------------------------------
|
||||
$('body').on('click', '.moment_video_type a', function() {
|
||||
$('.push_item').attr('type','video');
|
||||
main_content = $('.moment_type_main');
|
||||
if($('.add_video_box').length > 0){
|
||||
return false;
|
||||
}
|
||||
remove_image_temp();
|
||||
main_content.html('<div class="loading_box"><div uk-spinner></div></div>');
|
||||
$('.moment_type_main .loading_box').remove();
|
||||
main_content.append(
|
||||
`<div class="add_video_box">
|
||||
<div class="edit_video_box">
|
||||
<div class="video_choose" uk-switcher="animation: uk-animation-fade">
|
||||
<li><a href="#" class="video_c_btn local" vi_type="local">本地</a></li>
|
||||
<li><a href="#" class="video_c_btn bili" vi_type="bili">B站</a></li>
|
||||
</div>
|
||||
<div class="tips"># 请上传视频或填写视频外链 <span></span></div>
|
||||
<div class="edit_content video_type uk-switcher">
|
||||
<div class="local_video">
|
||||
<div class="video_left m_media_left">
|
||||
<i class="ri-add-line"></i>
|
||||
<input type="file" name="moment_img_up" id="moment_img_up" accept="video/mp4,video/ogg,video/webm,video/3gpp,video/flv,video/avi,video/mov,video/wmv,video/rm,video/rmvb,video/3gp,video/3g2,video/asf,video/mkv,video/mpg,video/mpeg,video/ts" multiple="multiple" title="上传视频">
|
||||
</div>
|
||||
<div class="video_right">
|
||||
<div class="video_meta">
|
||||
<input type="text" placeholder="视频外链" name="moment_video_url" id="moment_video_url" class="required" required="required">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bili_video">
|
||||
<input type="text" placeholder="B站视频bvid" name="moment_video_bili" id="moment_video_bili" class="required" required="required">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
|
||||
});
|
||||
|
||||
$('body').on('click', '.video_choose a', function() {
|
||||
var text = '# 请上传视频或填写视频外链';
|
||||
var type = $(this).attr('vi_type');
|
||||
if(type == 'bili'){
|
||||
var text = '# 请输入B站视频bvid';
|
||||
}
|
||||
$('.edit_video_box .tips').text(text);
|
||||
});
|
||||
|
||||
//图文类型
|
||||
//$('body').on('click', '.moment_video_type a', function() {
|
||||
|
||||
//});
|
||||
|
||||
//删除片刻文章
|
||||
$('body').on('click', '.control_delete_post', function() {
|
||||
var pid = $(this).parent().attr('pid');
|
||||
|
||||
var msg = "确定删除瞬间?";
|
||||
if (confirm(msg)==true){
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
dataType: 'json',
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
||||
contentType: "application/json",
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('处理中..');
|
||||
},
|
||||
success: function (data) {
|
||||
cocoMessage.success('删除成功');
|
||||
setTimeout(()=>{
|
||||
$(`#post-${pid}`)[0].remove()
|
||||
},1000)
|
||||
},
|
||||
error: function (request) {
|
||||
if(request.status){
|
||||
cocoMessage.error('瞬间不存在或已删除');
|
||||
}else{
|
||||
cocoMessage.error('删除失败');
|
||||
}
|
||||
console.log(request)
|
||||
},
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//置顶片刻
|
||||
$('body').on('click', '.sticky_btn', function() {
|
||||
var pid = $(this).parent().attr('pid');
|
||||
var stick = $(this).hasClass('stick');
|
||||
if(stick){
|
||||
var state = 'stick';
|
||||
} else {
|
||||
var state = 'unstick';
|
||||
}
|
||||
var msg = "确定执行此操作?";
|
||||
if (confirm(msg)==true){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: Theme.ajaxurl,
|
||||
data: {
|
||||
'action':'stick_moment',
|
||||
pid:pid,
|
||||
state:state
|
||||
},
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('处理中..');
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.state == '1'){
|
||||
cocoMessage.success(data.msg);
|
||||
if(data.type == 'stick'){
|
||||
var post_item = $('#post-'+pid+'.moment_item');
|
||||
post_item.remove();
|
||||
$('.moment_list').prepend(post_item.prop('outerHTML'));
|
||||
$('#post-'+pid+'.moment_item').find('.post_footer_meta .right').prepend('<span class="sticky_icon"><i class="ri-fire-line"></i> TOP</span>');
|
||||
$('#post-'+pid+'.moment_item').find('.post_control').remove();
|
||||
} else {
|
||||
$('#post-'+pid+'.moment_item').find('.sticky_icon').remove();
|
||||
}
|
||||
|
||||
} else {
|
||||
cocoMessage.error('操作失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//编辑片刻
|
||||
$('body').on('click', '.control_edit_post', function() {
|
||||
$('.t_media_item').remove();
|
||||
$('#moment_audio_api').remove();
|
||||
var pid = $(this).parent().attr('pid');
|
||||
$('.push_item').html('<i class="ri-edit-box-line"></i>更新');
|
||||
$('.push_item').attr('pid',pid).attr('action','update')
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: `/apis/${Theme.moments.api}/v1alpha1/moments/`+pid,
|
||||
beforeSend: function () {
|
||||
cocoMessage.info('数据拉取中');
|
||||
//$('.t_form').before('<div class="edit_overlay"></div>');
|
||||
},
|
||||
success: function (data) {
|
||||
$('.push_item').attr('version',data.metadata.version)
|
||||
$('.push_item').attr('owner',data.spec.owner)
|
||||
$('.push_item').attr('releaseTime',data.spec.releaseTime)
|
||||
//发布状态
|
||||
if(data.spec.visible == 'PRIVATE'){
|
||||
$(".simi a").html('<i class="ri-lock-line"></i>').attr('visible','PRIVATE');
|
||||
$(".simi a").children().css({"background":"#ddd","color":"#c6c6c6"});
|
||||
} else {
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
||||
}
|
||||
var medium = data.spec.content.medium;
|
||||
var tags = data.spec.tags
|
||||
if(medium.length > 0){
|
||||
var type = medium[0].type;
|
||||
}
|
||||
let content = data.spec.content.html;
|
||||
if(content == null){
|
||||
content = '';
|
||||
}else{
|
||||
|
||||
// 创建一个新的HTML解析器对象
|
||||
var parser = new DOMParser();
|
||||
// 解析HTML字符串并获取根元素
|
||||
var doc = parser.parseFromString(content, 'text/html');
|
||||
// 获取根元素下的所有子元素
|
||||
var elements = doc.body.childNodes;
|
||||
// 需要删除的链接元素的条件
|
||||
var conditions = doc.querySelectorAll('p > a.tag');
|
||||
// 遍历子元素并删除特定段落元素和链接元素
|
||||
for (var i = 0; i < conditions.length; i++) {
|
||||
for (var j = 0; j < elements.length; j++) {
|
||||
if (elements[j].nodeName === 'P' && elements[j].querySelector('a.tag')) {
|
||||
elements[j].parentNode.removeChild(elements[j]);
|
||||
}
|
||||
}
|
||||
content = doc.body.innerHTML;
|
||||
}
|
||||
}
|
||||
|
||||
$('#topic_content').val(content);
|
||||
if(tags.length > 0){
|
||||
$('.t_cat_toogle span').text(tags[0]);
|
||||
}
|
||||
|
||||
if(data.metadata.annotations?.mylocal!=null && data.metadata.annotations?.mylocal!='') {
|
||||
$('.loca_text').text(data.metadata.annotations?.mylocal);
|
||||
}
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case "PHOTO":
|
||||
//if(data.moment_data.length > 0){ 文字片刻没有数据
|
||||
edit_image(data);
|
||||
//}
|
||||
break;
|
||||
case "POST":
|
||||
edit_card(data);
|
||||
break;
|
||||
case "AUDIO":
|
||||
edit_audio(data);
|
||||
break;
|
||||
case "VIDEO":
|
||||
edit_video(data);
|
||||
break;
|
||||
}
|
||||
cocoMessage.success('拉取完成');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//发布片刻重置
|
||||
$('body').on('click', '.normal_edit,.center .mobile_edit', function() {
|
||||
$('.push_item').attr('action','push').html('<i class="ri-send-plane-2-line"></i>发布');
|
||||
$('.moment_image_type a').click();
|
||||
$(".simi a").html('<i class="ri-lock-unlock-line"></i>').attr('visible','PUBLIC');
|
||||
$(".simi a").children().css({"background":"#e3efe7","color":"#66c187"});
|
||||
$('#topic_content').val('');
|
||||
const mylocalValue = getCookie('mylocal');
|
||||
$(".loca_text").html(mylocalValue).attr("state",'1');
|
||||
$('.t_media_item').remove();
|
||||
});
|
||||
|
||||
//编辑片刻类型------------------------------------------------------------------------------
|
||||
function edit_image(data){
|
||||
var m_data = data.spec.content.medium;
|
||||
$('.t_media_item').remove();
|
||||
$('.moment_image_type a').click();
|
||||
if(m_data.length > 0){
|
||||
var new_data = m_data.reverse();
|
||||
$.each(new_data, function(index, value) {
|
||||
var thum = value.url;
|
||||
var src = value.url;
|
||||
var type = value.originType;
|
||||
var media = `<div class="t_media_item" data-type="${type}" data-src="${src}" data-thum="${thum}">`;
|
||||
media += '<a class="topic-img-de"><i class="ri-subtract-line"></i></a>';
|
||||
media += '<img src="'+thum+'">';//图片预览
|
||||
media += '</div>';
|
||||
$(".img_show").prepend(media);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function edit_video(data){
|
||||
var m_data = data.spec.content.medium[0];
|
||||
var type = m_data.originType;
|
||||
//var url = m_data.url;
|
||||
$('.moment_video_type a').click();
|
||||
|
||||
var add = setInterval(function() {
|
||||
if(type != 'video/bili'){
|
||||
var url = m_data.url;
|
||||
|
||||
$('input#moment_video_url').val(url);
|
||||
if(url !== ''){
|
||||
$('.m_media_left i').remove();
|
||||
$('.m_media_left').append('<img src="/themes/theme-pix/assets/img/video.png" data="'+url+'">');
|
||||
}
|
||||
|
||||
} else if(type == 'video/bili') {
|
||||
if($('.video_choose').length > 0){
|
||||
var bvid = m_data.url;
|
||||
UIkit.switcher('.video_choose').show(1);
|
||||
$('input#moment_video_bili').val(bvid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($('.edit_video_box').length == 1){
|
||||
clearInterval(add);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function edit_audio(data){
|
||||
var m_data = data.spec.content.medium[0];
|
||||
var type = m_data.originType;
|
||||
$('.moment_audio_type a').click();
|
||||
var add = setInterval(function() {
|
||||
if(type == 'audio/netease' || type == 'audio/tencent' || type == 'audio/kugou' || type == 'audio/kuwo'){
|
||||
var result = type.substring(type.indexOf("audio/") + 6);
|
||||
if($('.audio_choose').length > 0){
|
||||
var n_id = m_data.url;
|
||||
var index = $('.audio_choose li.'+result+'').index();
|
||||
UIkit.switcher('.audio_choose').show(index);
|
||||
$('.edit_audio_box .tips').text('# 请输入歌曲ID');
|
||||
$('.'+result+'_audio').append('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
||||
$('input#moment_audio_api').val(n_id);
|
||||
}
|
||||
} else {
|
||||
var index = $('.audio_choose li.local').index();
|
||||
UIkit.switcher('.audio_choose').show(index);
|
||||
var url = m_data.url;
|
||||
$('.edit_audio_box .tips').text('# 请插入歌曲外链');
|
||||
$('input#moment_audio_url').val(url);
|
||||
}
|
||||
if($('.edit_audio_box').length == 1){
|
||||
clearInterval(add);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function edit_card(data) {
|
||||
var m_data = data.spec.content.medium;
|
||||
$('.card_sortble .moment_card_item').remove();
|
||||
$('.moment_card_type a').click();
|
||||
var pid = data.metadata.name;
|
||||
var card_list = $("#post-"+pid+"").find('.moment_card_item');
|
||||
var add = setInterval(function() {
|
||||
$('.show_card').show();
|
||||
$.each(m_data, function(index, value) {
|
||||
var srcValue = card_list.eq(index).find('img').attr('src');
|
||||
var h4Text = card_list.eq(index).find('h4').text();
|
||||
$('.card_sortble').append(getcard(value.url,srcValue,h4Text,value.originType));
|
||||
});
|
||||
if($('.edit_card_box').length == 1){
|
||||
clearInterval(add);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
var pix = {
|
||||
|
||||
|
||||
/**
|
||||
* 页面運行時間
|
||||
*/
|
||||
addRuntime: function () {
|
||||
const $runtimeCount = document.getElementById('runtimeshow');
|
||||
if ($runtimeCount) {
|
||||
var s1 = $runtimeCount.innerText;//建站时间
|
||||
if (s1) {
|
||||
s1 = new Date(s1.replace(/-/g, "/"));
|
||||
s2 = new Date();
|
||||
var days = s2.getTime() - s1.getTime();
|
||||
var number_of_days = parseInt(days / (1000 * 60 * 60 * 24));
|
||||
$runtimeCount.innerText = number_of_days + '天';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
loadLightbox: function () {
|
||||
/**
|
||||
* fancybox
|
||||
*/
|
||||
const addFancybox = function (ele) {
|
||||
const runFancybox = (ele) => {
|
||||
ele.each(function (i, o) {
|
||||
const $this = $(o)
|
||||
const lazyloadSrc = $this.attr('data-src') || $this.attr('src')
|
||||
const dataCaption = $this.attr('alt') || ''
|
||||
$this.wrap(`<a href="${lazyloadSrc}" data-fancybox="images" class="fancybox" data-srcset="${lazyloadSrc}"></a>`)
|
||||
})
|
||||
}
|
||||
|
||||
runFancybox($(ele))
|
||||
}
|
||||
const $fancyboxEle = document.querySelectorAll('.single-content :not(a) > img,.single-content > img')
|
||||
if ($fancyboxEle.length > 0) {
|
||||
addFancybox($fancyboxEle)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
initTopBar: function () {
|
||||
let topBar = $('#masthead .top_bar');
|
||||
var placeholder = document.querySelector('#masthead .uk-sticky-placeholder');
|
||||
var width = $('#masthead').width();
|
||||
var height = '71.9979px;'
|
||||
if (window.innerWidth < 960) {
|
||||
if (window.innerWidth <= 540) {
|
||||
height = '63.9957px'
|
||||
}
|
||||
topBar.addClass('uk-sticky-fixed').css({ "width": width, "top": '0px', "position": "fixed" });
|
||||
$('#masthead .uk-sticky-placeholder').css({ "width": width, "height": height, "margin": "0px" });
|
||||
placeholder.hidden = false;
|
||||
} else {
|
||||
topBar.removeAttr("style");
|
||||
$('#masthead .uk-sticky-placeholder').css({ "width": width, "height": '71.9979px;', "margin": "0px" });
|
||||
placeholder.hidden = true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getMsg: function () {
|
||||
var com_msg_btn = $('.com_msg_btn')
|
||||
var msg_modal_inner = $('.msg_modal_inner')
|
||||
let username = Theme.username
|
||||
var f_unread_num = 0;
|
||||
if (com_msg_btn.length > 0) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: `/apis/api.notification.halo.run/v1alpha1/userspaces/${username}/notifications?fieldSelector=spec.unread=true`,
|
||||
success: function (res) {
|
||||
if (res.total == 0) {
|
||||
$('.f_unread_num').remove();
|
||||
}else {
|
||||
f_unread_num = res.total
|
||||
com_msg_btn.append(`<small class="f_unread_num">${res.total}</small>`);
|
||||
}
|
||||
if (msg_modal_inner.length > 0) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: `/apis/api.notification.halo.run/v1alpha1/userspaces/${username}/notifications?page=1&size=10`,
|
||||
success: function (res) {
|
||||
var data = res.items
|
||||
if (data.length > 0) {
|
||||
var unread_box = `
|
||||
<div class="unread_box">
|
||||
<div class="unread_tip"># 您有${f_unread_num}条未读消息 #
|
||||
<a href="/uc/notifications" target="_blank">查看全部</a>
|
||||
</div>
|
||||
`
|
||||
var read_box = `
|
||||
<div class="read_box">
|
||||
`
|
||||
var unreadSum = 0
|
||||
data.forEach((e => {
|
||||
if (e.spec.unread) {
|
||||
unreadSum = unreadSum + 1;
|
||||
unread_box += `
|
||||
<div class="vi_reply_item">
|
||||
<div class="box" msg-name="${e.metadata.name}">
|
||||
<span class="mark_read">标记为已读</span>
|
||||
<div class="avatar_top"><img alt=""
|
||||
src="https://cravatar.cn/avatar/?d=mp"
|
||||
class="avatar avatar-50 photo" height="50" width="50" decoding="async"></div>
|
||||
${e.spec.htmlContent}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
} else {
|
||||
read_box += `
|
||||
<div class="vi_reply_item">
|
||||
<div class="box">
|
||||
<div class="avatar_top"><img alt=""
|
||||
src="https://cravatar.cn/avatar/?d=mp"
|
||||
class="avatar avatar-50 photo" height="50" width="50" decoding="async"></div>
|
||||
${e.spec.htmlContent}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
}
|
||||
))
|
||||
unread_box += `</div>`
|
||||
read_box += `</div><p class="msg_limit">只显示最新10条未读和已读信息</p> `
|
||||
msg_modal_inner.html(unread_box + read_box)
|
||||
|
||||
} else {
|
||||
msg_modal_inner.html(`
|
||||
<p class="no_posts"><small># 暂无消息 #</small><img class="s_nodata"
|
||||
src="/themes/theme-pix/assets/img/nodata.png"></p>
|
||||
<p class="msg_limit">只显示最新10条未读和已读信息</p>
|
||||
`)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
msg_modal_inner.html(`
|
||||
<p class="no_posts"><small># 暂无消息 #</small><img class="s_nodata"
|
||||
src="/themes/theme-pix/assets/img/nodata.png"></p>
|
||||
<p class="msg_limit">只显示最新10条未读和已读信息</p>
|
||||
`)
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
initGalleryPhotos: function () {
|
||||
var galleryPhotos = document.querySelectorAll('.gallery-photos .gallery-photo');
|
||||
if (galleryPhotos.length > 0) {
|
||||
// 瀑布流排版
|
||||
imgStatus.watch('.photo-img', () => {
|
||||
waterfall('.gallery-photos');
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
topCategoriesBarScroll: function () {
|
||||
if (document.getElementById("cat_nav_items")) {
|
||||
let xscroll = document.getElementById("cat_nav_items");
|
||||
xscroll.addEventListener("mousewheel", function (e) {
|
||||
//计算鼠标滚轮滚动的距离
|
||||
let v = -e.wheelDelta / 2;
|
||||
xscroll.scrollLeft += v;
|
||||
//阻止浏览器默认方法
|
||||
e.preventDefault();
|
||||
}, false);
|
||||
}
|
||||
},
|
||||
|
||||
topTableBarScroll: function () {
|
||||
var tables = document.querySelectorAll('.single-content table')
|
||||
if (tables.length>0) {
|
||||
tables.forEach(function (xscroll) {
|
||||
xscroll.addEventListener("mousewheel", function (e) {
|
||||
//计算鼠标滚轮滚动的距离
|
||||
let v = -e.wheelDelta / 2;
|
||||
xscroll.scrollLeft += v;
|
||||
//阻止浏览器默认方法
|
||||
e.preventDefault();
|
||||
}, false);
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//处理瞬间权限
|
||||
roleMoments: async function () {
|
||||
const response = await fetch(`/apis/api.console.halo.run/v1alpha1/users/-`);
|
||||
const data = await response.json();
|
||||
var roles = data.roles;
|
||||
|
||||
if(roles.length>0) {
|
||||
var name = roles[0].metadata.name
|
||||
if(name != 'super-role') {
|
||||
let dependencies = roles[0].metadata.annotations["rbac.authorization.halo.run/dependencies"]
|
||||
if(dependencies != undefined) {
|
||||
var targetRoles = ["role-template-uc-moments-approved","role-template-uc-moments-publish"]
|
||||
const result = targetRoles.some(r => dependencies.includes(r));
|
||||
if(!result) {
|
||||
$('.normal_edit').remove();
|
||||
}
|
||||
}else {
|
||||
$('.normal_edit').remove();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,662 @@
|
||||
/*
|
||||
* pix主题音乐播放器
|
||||
*/
|
||||
|
||||
var rem=[];
|
||||
rem.audio = $('<audio id="pix_player"></audio>');
|
||||
|
||||
var audiobox = $('<audio id="pix_player"></audio>');
|
||||
var au = $('#pix_player');
|
||||
var volume = 1;
|
||||
var loop = Theme.play.m_loop;
|
||||
var playlist = [];
|
||||
var post_playlist = [];
|
||||
var Paused = true;
|
||||
var playLrc = '';
|
||||
|
||||
var m_cover = $('.player_mod .m_cover img');
|
||||
var m_title = $('.player_mod .m_info h2');
|
||||
var m_artist = $('.player_mod .m_info small');
|
||||
|
||||
|
||||
$(document).on('click','.play_btn',function(){
|
||||
$('.player_box').append(audiobox);
|
||||
$('.pix_player').removeClass('playing');
|
||||
$(this).parents('.pix_player').addClass('playing');
|
||||
var url = $(this).attr('data');
|
||||
var lrc = $(this).attr('lrc');
|
||||
var audio_s = $('#pix_player').attr('src');
|
||||
//var play = new Audio(url);
|
||||
|
||||
var meta = $(this).siblings('.player_meta').find('.title');
|
||||
playLrc = lrc;
|
||||
m_title.text(meta.find('.name').text());
|
||||
m_artist.text(meta.find('.author').text());
|
||||
m_cover.attr('src',$('.pix_player.playing .player_thum img').attr('src'));
|
||||
|
||||
if(audio_s == '' || audio_s !== url){
|
||||
$('#pix_player').attr('src',url);
|
||||
audiobox[0].play();
|
||||
} else {
|
||||
pasued();
|
||||
}
|
||||
|
||||
$(".play_btn").html("<i class='ri-play-line'></i>");
|
||||
|
||||
initAudio();
|
||||
});
|
||||
|
||||
// 初始化函数
|
||||
function initAudio(){
|
||||
|
||||
// 给音乐标签绑定事件之后所触发的函数
|
||||
audiobox[0].addEventListener("play",audioplay);
|
||||
audiobox[0].addEventListener("pause",audiopause);
|
||||
// timeupdate,代表音乐播放过程中只要发生变化就触发updateProcess
|
||||
audiobox[0].addEventListener("timeupdate",updateProcess);
|
||||
if(Theme.bgm_open == true){
|
||||
audiobox[0].addEventListener("ended",endplay);
|
||||
}
|
||||
}
|
||||
|
||||
//音乐结束触发
|
||||
function endplay(){
|
||||
var index = $('.musci_list_box li.active').index() + 1;
|
||||
var max = $('.musci_list_box li').length;
|
||||
var new_mid = 0;
|
||||
if(loop=="one"){
|
||||
new_mid = index-1;
|
||||
}else if(loop=="none") {
|
||||
new_mid = (Math.floor(Math.random() * max) + 1)-1;
|
||||
}else if(loop=="all") {
|
||||
new_mid = index > (max - 1) ? 0 : index;
|
||||
}
|
||||
mulist_play(new_mid);
|
||||
}
|
||||
|
||||
// 当音乐标签加载完成之后所触发的函数
|
||||
audiobox[0].oncanplay=function(){
|
||||
// 音乐的总时间
|
||||
var duration=handleTime(this.duration);
|
||||
// 音乐播放的当前时间
|
||||
var currenttime=handleTime(this.currentTime);
|
||||
$(".timer .total_time").text(duration);
|
||||
$(".timer .current_time").text(currenttime);
|
||||
initAudio();
|
||||
}
|
||||
|
||||
// 音乐播放暂停的函数
|
||||
function pasued(){
|
||||
// paused,保存音乐播放和暂停的状态
|
||||
if(Paused === false){//音乐是一个播放状态
|
||||
audiobox[0].pause();
|
||||
}else{
|
||||
audiobox[0].play();
|
||||
}
|
||||
}
|
||||
|
||||
// 音乐播放之后触发的函数
|
||||
function audioplay(){
|
||||
//var height = $('.footer_menu').height();
|
||||
var mheight = $('.footer_nav_box').height();
|
||||
$('.footer_nav_box').animate({top:-mheight},200,'linear');
|
||||
//music_bar.lock(false);//取消进度条的锁定
|
||||
Paused=false;//更新音乐的播放状态(暂停)
|
||||
$(".pix_player.playing .play_btn").html("<i class='ri-pause-line'></i>");//暂停按钮
|
||||
$('.m_play').html('<i class="ri-pause-circle-fill"></i>');
|
||||
}
|
||||
|
||||
// 音乐暂停之后触发的函数
|
||||
function audiopause(){
|
||||
//music_bar.lock(true);//添加进度条的锁定
|
||||
Paused=true; //播放的状态
|
||||
$(".pix_player.playing .play_btn").html("<i class='ri-play-line'></i>");
|
||||
$('.m_play').html('<i class="ri-play-circle-fill"></i>');
|
||||
}
|
||||
|
||||
// 更新进度条
|
||||
function updateProcess(){
|
||||
// 如果音乐不是暂停状态,则继续执行函数的代码块
|
||||
if(Paused!==false) return true;
|
||||
// 音乐的总时间
|
||||
var duration = handleTime(this.duration);
|
||||
// 音乐播放的当前时间
|
||||
var currenttime = handleTime(this.currentTime);
|
||||
var percent = audiobox[0].currentTime/audiobox[0].duration;
|
||||
$(".player_mod .player_bar .progress").css('width',(percent)*100+"%");
|
||||
$(".timer .total_time").text(duration);
|
||||
$(".timer .current_time").text(currenttime);
|
||||
}
|
||||
|
||||
//循环歌曲 m_loop
|
||||
$(document).on('click','.m_loop',function(){
|
||||
if($(this).hasClass('all')){ // 如果当前是循环
|
||||
$(this).removeClass('all');
|
||||
$(this).addClass('one');
|
||||
$(this).html('<i class="ri-repeat-one-line"></i>');
|
||||
loop = 'one';
|
||||
}else if(($(this).hasClass('one'))){ // 如果当前是单曲循环
|
||||
$(this).removeClass('one');
|
||||
$(this).addClass('none');
|
||||
$(this).html('<i class="ri-shuffle-line"></i>');
|
||||
loop = 'none';
|
||||
}else {
|
||||
$(this).removeClass('none');
|
||||
$(this).addClass('all');
|
||||
$(this).html('<i class="ri-repeat-line"></i>');
|
||||
loop = 'all';
|
||||
}
|
||||
});
|
||||
|
||||
// 时间处理的函数
|
||||
function handleTime(seconedTime){
|
||||
// 定义一个变量保存分钟
|
||||
var minute=parseInt(seconedTime/60,10);
|
||||
if(minute<10){minute="0"+minute};
|
||||
//console.log(minute);
|
||||
// 定义变量存放秒数
|
||||
var second=(seconedTime-minute*60).toFixed(2).split(".")[0];
|
||||
//console.log(second);
|
||||
if(second<10){second="0"+second};
|
||||
var Time=minute+":"+second;
|
||||
// 返回最终的时间数值
|
||||
return Time;
|
||||
}
|
||||
|
||||
//视频播放
|
||||
var video = $('#pix_video_player');
|
||||
$(document).on('click','.video_play_btn',function(){
|
||||
var video = $(this).siblings('#pix_video_player');
|
||||
video.attr('controls','controls'); //显示控制条
|
||||
$(this).remove(); //去除覆盖层
|
||||
video[0].play();
|
||||
});
|
||||
|
||||
function stopOtherMedia(element) {
|
||||
|
||||
$("video").not(element).each(function(index, video) {
|
||||
video.pause();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//背景音乐
|
||||
function autoload_music() {
|
||||
var state = Theme.bgm_open;
|
||||
var api = `${Theme.play.pix_mu_api || 'https://api.i-meto.com/meting/api'}?server=:server&type=:type&id=:id&r=:r`
|
||||
var meta = {
|
||||
server : Theme.play.mu_source,
|
||||
type : Theme.play.mu_type,
|
||||
id : Theme.play.play_id,
|
||||
auth : ''
|
||||
}
|
||||
if(state == true){
|
||||
let url = api.replace(":server", meta.server).replace(":type", meta.type).replace(":id", meta.id).replace(":auth", meta.auth).replace(":r", Math.random());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url:url,
|
||||
success: function (res) {
|
||||
if(res.length > 0){
|
||||
var new_mid = 0;
|
||||
if(loop=="none") {
|
||||
new_mid = (Math.floor(Math.random() * res.length) + 1)-1;
|
||||
}
|
||||
var f = res[new_mid];
|
||||
var playnum = 1;
|
||||
//$(".m_play").html('<i class="ri-pause-circle-line"></i>');
|
||||
|
||||
//默认播放第一首
|
||||
audiobox.attr('src',f.url);
|
||||
playLrc = f.lrc;
|
||||
$('.player_mod .m_cover img').attr('src',f.pic);
|
||||
$('.player_mod .m_info h2').text(f.title || f.name);
|
||||
$('.player_mod .m_info small').text(f.author || f.artist);
|
||||
$('.player_box').append(audiobox);
|
||||
|
||||
|
||||
//存储一个播放列表
|
||||
playlist.push(res);
|
||||
|
||||
//插入播放列表
|
||||
$.each(res, function(key, data) {
|
||||
$(".musci_list_box").append('<li class="item" id='+ key +'>' + playnum++ + '. ' + (data.title || data.name) + ' - ' + (data.author || data.artist) + '</li>');
|
||||
});
|
||||
|
||||
$(".musci_list_box li").removeClass('active').eq(new_mid).addClass('active');
|
||||
//console.log(playlist);
|
||||
} else {
|
||||
$(".musci_list_box").append('<div class="nodata">背景音乐未设置</div>');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//播放选中音乐
|
||||
function mulist_play(index){
|
||||
audiobox[0].removeEventListener("play",audioplay);
|
||||
audiobox[0].removeEventListener("pause",audiopause);
|
||||
$(".pix_player.playing .play_btn").html("<i class='ri-play-line'></i>");
|
||||
$(".m_play").html('<i class="ri-pause-circle-fill"></i>');
|
||||
$('.musci_list_box li').eq(index).addClass('active').siblings().removeClass('active');
|
||||
scrollToPosition(index);
|
||||
var data = playlist[0][index];
|
||||
playLrc = data.lrc;
|
||||
audiobox.attr('src',data.url);
|
||||
m_cover.attr('src',data.pic);
|
||||
m_title.text(data.title || data.name);
|
||||
m_artist.text(data.author || data.artist);
|
||||
audiobox[0].play();
|
||||
|
||||
Paused = false;
|
||||
}
|
||||
|
||||
//点击展开播放列表
|
||||
$(document).on('click', '.ri-bar-chart-horizontal-line', function () {
|
||||
var position = $('.musci_list_box li.active').index()
|
||||
// 延迟一段时间后进行滚动
|
||||
setTimeout(function () {
|
||||
if($('.m_list').attr('aria-expanded')){
|
||||
scrollToPosition(position)
|
||||
}
|
||||
}, 200); // 延迟100毫秒后执行滚动操作
|
||||
});
|
||||
|
||||
//点击列表播放
|
||||
$(document).on('click','.musci_list_box li',function(){
|
||||
$('.musci_list_box li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
var id = $(this).attr('id');
|
||||
mulist_play(id)
|
||||
});
|
||||
|
||||
//上一首
|
||||
$(document).on('click','.m_prev',function(){
|
||||
var index = $('.musci_list_box li.active').index() - 1;
|
||||
var max = $('.musci_list_box li').length;
|
||||
var new_mid = 0;
|
||||
if(loop=="none") {
|
||||
new_mid = (Math.floor(Math.random() * max) + 1)-1;
|
||||
}else {
|
||||
new_mid = index < 0 ? max - 1 : index;
|
||||
}
|
||||
mulist_play(new_mid);
|
||||
});
|
||||
|
||||
//下一首
|
||||
$(document).on('click','.m_next',function(){
|
||||
var index = $('.musci_list_box li.active').index() + 1;
|
||||
var max = $('.musci_list_box li').length;
|
||||
var new_mid = 0;
|
||||
if(loop=="none") {
|
||||
new_mid = (Math.floor(Math.random() * max) + 1)-1;
|
||||
}else{
|
||||
new_mid = index > (max - 1) ? 0 : index;
|
||||
}
|
||||
mulist_play(new_mid);
|
||||
});
|
||||
|
||||
|
||||
//播放和暂停
|
||||
function m_play() {
|
||||
|
||||
if(Paused === false){//音乐是一个播放状态
|
||||
audiobox[0].pause();
|
||||
$('.m_play').html('<i class="ri-play-circle-fill"></i>');
|
||||
Paused = true;
|
||||
}else{
|
||||
audiobox[0].play();
|
||||
$('.m_play').html('<i class="ri-pause-circle-fill"></i>');
|
||||
Paused = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//播放按钮
|
||||
$(document).on('click','.m_play',function(){
|
||||
if(!$("#pix_player").length > 0){
|
||||
cocoMessage.error('没有音乐可播放');
|
||||
return false;
|
||||
} else {
|
||||
m_play();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
document.addEventListener('click', musicPlay);
|
||||
function musicPlay() {
|
||||
audiobox[0].play();
|
||||
document.removeEventListener('click', musicPlay);
|
||||
}
|
||||
*/
|
||||
|
||||
//触发显示播放器
|
||||
var trigger;
|
||||
function mu_box_show(){
|
||||
clearTimeout(trigger);
|
||||
var mheight = $('.footer_nav_box').height();
|
||||
$('.footer_nav_box').animate({top:-mheight},200,'linear');
|
||||
}
|
||||
|
||||
function mu_box_hide(){
|
||||
$('.footer_nav_box').animate({top:"0px"},200,'linear');
|
||||
}
|
||||
|
||||
$(document).on('mouseenter', '.player_hand , .footer_nav_box', function(event) {
|
||||
mu_box_show();
|
||||
|
||||
});
|
||||
|
||||
$(document).on('mouseleave', '.footer_nav_box .right_inner', function(event) {
|
||||
|
||||
trigger = setTimeout(function(){
|
||||
mu_box_hide();
|
||||
},2000);
|
||||
|
||||
});
|
||||
|
||||
//音乐进度条跳转
|
||||
function getMousePosition(e){
|
||||
var e = e || window.event;
|
||||
var x = e.pageX;
|
||||
var y = e.pageY;
|
||||
return {'left':x,'top':y}
|
||||
}
|
||||
|
||||
$(document).on('click','.player_bar',function(){
|
||||
// 获取当前鼠标点击的位置
|
||||
// console.log(getMousePosition().left)
|
||||
// console.log($('.progress').offset())
|
||||
var long = (getMousePosition().left) - ($('.progress').offset().left);
|
||||
// console.log(long)
|
||||
// 将当前点击的长度重新给p标签
|
||||
$('.progress').width(long);
|
||||
// 获得当前点击长度的时间
|
||||
allTime = parseInt(audiobox[0].duration);
|
||||
var nowtime = (long/$('.player_bar').width()) * allTime;
|
||||
audiobox[0].currentTime = nowtime;
|
||||
});
|
||||
|
||||
|
||||
//音量调节 m_volume
|
||||
$(document).on('click','.m_volume',function(){
|
||||
if($(this).hasClass('mute')){ // 如果当前是静音
|
||||
$(this).removeClass('mute');
|
||||
$(this).html('<i class="ri-volume-down-line"></i>');
|
||||
audiobox[0].muted = false;
|
||||
}else{ // 如果当前不是静音
|
||||
$(this).addClass('mute');
|
||||
audiobox[0].muted = true;
|
||||
$(this).html('<i class="ri-volume-mute-line"></i>');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click','.vo_bar',function(){
|
||||
var long = (getMousePosition().top) - ($(this).offset().top)
|
||||
|
||||
var meter = long / $(this).height();
|
||||
var finalLong = 1 - meter;
|
||||
|
||||
$('.vo_size').height(finalLong * $(this).height());
|
||||
|
||||
// 将audio音量调整为对应的音量
|
||||
//var finalLong = volume;
|
||||
audiobox[0].volume = finalLong;
|
||||
|
||||
// 改变数字
|
||||
//$('.vol b').html(parseInt(finalLong * 100) + '%')
|
||||
|
||||
// 点击后音量调整键隐藏
|
||||
//$('.vol a').css('display','none')
|
||||
|
||||
});
|
||||
|
||||
//文章歌曲
|
||||
function autoload_posts_music() {
|
||||
post_playlist.splice(0,post_playlist.length);
|
||||
var pid = $('.posts_mu_list').attr('pid');
|
||||
var api = `${Theme.play.pix_mu_api || 'https://api.i-meto.com/meting/api'}?server=:server&type=:type&id=:id&r=:r`
|
||||
var meta = {
|
||||
server : $('.posts_mu_list').attr('mus_source'),
|
||||
type : $('.posts_mu_list').attr('mus_type'),
|
||||
id : $('.posts_mu_list').attr('plays_id'),
|
||||
mu_on: $('.posts_mu_list').attr('mu_on'),
|
||||
auth : ''
|
||||
}
|
||||
if(pid && meta.mu_on=='true'){
|
||||
let url = api.replace(":server", meta.server).replace(":type", meta.type).replace(":id", meta.id).replace(":auth", meta.auth).replace(":r", Math.random());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url:url,
|
||||
beforeSend: function () {
|
||||
$('.posts_mu_list').html('<div class="loading_box"><div uk-spinner></div></div>');
|
||||
},
|
||||
success: function (res) {
|
||||
|
||||
if(res.length > 0){
|
||||
$('.posts_mu_list .loading_box').remove();
|
||||
|
||||
var playnum = 1;
|
||||
|
||||
if(!$('#pix_player').length > 0){
|
||||
$('.player_box').append(audiobox);
|
||||
}
|
||||
|
||||
|
||||
//存储一个播放列表
|
||||
post_playlist.push(res);
|
||||
|
||||
//插入播放列表
|
||||
$.each(res, function(key, data) {
|
||||
$(".posts_mu_list").append('<li class="item" id='+ key +'><div class="mu_id">' + playnum++ + '</div><a class="s_play_btn"><i class="ri-play-circle-line"></i></a><div class="mus_info">'+ (data.title || data.name) +' <span>- ' + (data.author || data.artist) + '</span></div></li>');
|
||||
|
||||
});
|
||||
|
||||
//$(".musci_list_box li").removeClass('active').eq(0).addClass('active');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//文章歌曲播放
|
||||
$(document).on('click','.s_play_btn',function(){
|
||||
mu_box_show();
|
||||
$('.posts_mu_list li').removeClass('active');
|
||||
audiobox[0].removeEventListener("play",audioplay);
|
||||
audiobox[0].removeEventListener("pause",audiopause);
|
||||
$(".m_play").html('<i class="ri-pause-circle-fill"></i>');
|
||||
$(this).parent().addClass('active');
|
||||
|
||||
var id = $(this).parents('li').attr('id');
|
||||
var data = post_playlist[0][id];
|
||||
playLrc = data.lrc;
|
||||
audiobox.attr('src',data.url);
|
||||
m_cover.attr('src',data.pic);
|
||||
m_title.text(data.title || data.name);
|
||||
m_artist.text(data.artist || data.artist);
|
||||
audiobox[0].play();
|
||||
|
||||
Paused = false;
|
||||
});
|
||||
|
||||
//播放器按钮
|
||||
$(document).on('click','a.bg_music',function(){
|
||||
mu_box_show();
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
autoload_music();
|
||||
autoload_posts_music();
|
||||
});
|
||||
|
||||
//播放类型切换
|
||||
$(document).on('click','.audio_c_btn',function(){
|
||||
var type = $(this).attr('au_type');
|
||||
var input = $('<input type="text" placeholder="歌曲ID" name="moment_audio_api" id="moment_audio_api" class="required" required="required">');
|
||||
$('.type_audio_text').empty();
|
||||
$('.'+type+'_audio.type_audio_text').append(input);
|
||||
});
|
||||
|
||||
|
||||
$('.bg_lrc').click(function () {
|
||||
if (lyricsContainer.css('display') === 'none') {
|
||||
lyricsContainer.css('display', 'block');
|
||||
$('a.bg_lrc i').css({
|
||||
"color": "",
|
||||
});
|
||||
$('a.bg_lrc').css({
|
||||
"background": "",
|
||||
});
|
||||
} else {
|
||||
lyricsContainer.css('display', 'none');
|
||||
$('a.bg_lrc i').css({
|
||||
"color": "#aeaeae",
|
||||
});
|
||||
$('a.bg_lrc').css({
|
||||
"background": "rgb(196 208 230 / 38%)",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//创建容器
|
||||
if(Theme.play.lrc_open){
|
||||
var lyricsContainer = $('<div class="lyrics-container"></div>');
|
||||
$('.player_box').append(lyricsContainer);
|
||||
var css = $(window).width() > 767 ?
|
||||
{
|
||||
//桌面歌词css(按照下面格式自行修改)
|
||||
position: 'fixed',
|
||||
bottom: '10px',
|
||||
left: '2%',
|
||||
width: '350px',
|
||||
height: '100px',
|
||||
overflow: 'hidden',
|
||||
zIndex: '999',
|
||||
pointerEvents: 'none',
|
||||
} :
|
||||
{
|
||||
//移动端歌词css(按照下面格式自行修改)
|
||||
position: 'fixed',
|
||||
bottom: '88px',
|
||||
left: '0',
|
||||
width: '100%',
|
||||
height: '72px',
|
||||
textAlign: 'center',
|
||||
overflow: 'hidden',
|
||||
zIndex: '999',
|
||||
pointerEvents: 'none',
|
||||
};
|
||||
lyricsContainer.css(css);
|
||||
}
|
||||
|
||||
var lyricsMap = {};
|
||||
|
||||
// 获取歌词
|
||||
async function fetchLyrics(url) {
|
||||
if (!lyricsMap[url]) {
|
||||
var lrcOriginal = await $.get(url);
|
||||
lyricsMap[url] = parseLyrics(lrcOriginal);
|
||||
}
|
||||
return lyricsMap[url];
|
||||
}
|
||||
|
||||
// 解析歌词
|
||||
function parseLyrics(lrcOriginal) {
|
||||
var lyrics = [];
|
||||
var lines = lrcOriginal.split("\n");
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var line = lines[i];
|
||||
if (!line.trim()) {
|
||||
continue;
|
||||
}
|
||||
var timeAndText = line.split("]");
|
||||
var time = timeAndText[0].substr(1);
|
||||
var text = timeAndText[1];
|
||||
// 增加代码:如果歌词为空,跳过此次循环
|
||||
if (!text.trim()) {
|
||||
continue;
|
||||
}
|
||||
// 增加代码:把时间转换成秒
|
||||
var timeInSeconds = 0;
|
||||
var timeParts = time.split(":");
|
||||
timeInSeconds += parseInt(timeParts[0], 10) * 60 - 0.5;
|
||||
timeInSeconds += parseFloat(timeParts[1]);
|
||||
lyrics.push({
|
||||
time: timeInSeconds,
|
||||
text: text
|
||||
});
|
||||
}
|
||||
return lyrics;
|
||||
}
|
||||
|
||||
// 更新歌词
|
||||
function updateLyrics(currentTime, lyrics) {
|
||||
for (var i = 0; i < lyrics.length; i++) {
|
||||
if (currentTime >= lyrics[i].time && (i === lyrics.length - 1 || currentTime < lyrics[i + 1].time)) {
|
||||
// 创建4行歌词
|
||||
// 防止数组i越界
|
||||
var currentLine3 = "";
|
||||
if (i - 1 >= 0 && typeof lyrics[i - 1].text === "string") {
|
||||
currentLine3 = lyrics[i - 1].text;
|
||||
}
|
||||
var currentLine = "";
|
||||
if (typeof lyrics[i].text === "string") {
|
||||
currentLine = lyrics[i].text;
|
||||
}
|
||||
var currentLine1 = "";
|
||||
if (i + 1 < lyrics.length && typeof lyrics[i + 1].text === "string") {
|
||||
currentLine1 = lyrics[i + 1].text;
|
||||
}
|
||||
var currentLine2 = "";
|
||||
if (i + 2 < lyrics.length && typeof lyrics[i + 2].text === "string") {
|
||||
currentLine2 = lyrics[i + 2].text;
|
||||
}
|
||||
//歌词文本css(修改style内的内容即可)
|
||||
lyricsContainer.html(`
|
||||
<div class="current-line" style="font-size: 10px;opacity: .4;">${currentLine3}</div>
|
||||
<div class="current-line active" style="font-size: 14px;">${currentLine}</div>
|
||||
<div class="current-line" style="font-size: 12px;opacity: .4;">${currentLine1}</div>
|
||||
<div class="current-line" style="font-size: 10px;opacity: .1;">${currentLine2}</div>
|
||||
`);
|
||||
// 增加代码:添加从下往上线性滚动的动画
|
||||
$('.current-line').animate({
|
||||
top: '-=30px'
|
||||
}, 2000, function () {
|
||||
$(this).css({
|
||||
top: '30px'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 监听音频播放进度更新事件,更新歌词
|
||||
Theme.play.lrc_open && audiobox[0].addEventListener("timeupdate", async function () {
|
||||
var lyrics = await fetchLyrics(playLrc)
|
||||
updateLyrics(this.currentTime, lyrics);
|
||||
});
|
||||
|
||||
// 根据选择的位置定位滚动条
|
||||
function scrollToPosition(position) {
|
||||
let container = document.getElementById("musci_list");
|
||||
let items = container.getElementsByClassName("item");
|
||||
|
||||
if (position >= 0 && position < items.length) {
|
||||
items[position].scrollIntoView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,418 @@
|
||||
// 部分代码来自ZIBILL主题作者
|
||||
// canvas生成海报
|
||||
const poster = (function() {
|
||||
|
||||
const DEBUG = false
|
||||
|
||||
const WIDTH = 700
|
||||
const HEIGHT = 1160
|
||||
|
||||
function init(config) {
|
||||
const $container = document.querySelector(config.selector)
|
||||
$container.style.border = '1px solid #f0f0f0'
|
||||
const $wrapper = createDom('div', 'id', 'wrapper')
|
||||
const $canvas = createDom('canvas', 'id', 'canvas', 'block')
|
||||
const $day = createDom('canvas', 'id', 'day')
|
||||
const $date = createDom('canvas', 'id', 'date')
|
||||
const $title = createDom('canvas', 'id', 'title')
|
||||
const $content = createDom('canvas', 'id', 'content')
|
||||
const $logo = createDom('canvas', 'id', 'logo')
|
||||
const $description = createDom('canvas', 'id', 'description')
|
||||
|
||||
appendChilds($wrapper, $canvas, $day, $date, $title, $content, $logo, $description)
|
||||
$container.appendChild($wrapper)
|
||||
|
||||
const date = new Date()
|
||||
|
||||
// day
|
||||
const dayStyle = {
|
||||
font: 'bold 80px Helvetica',
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
position: 'right'
|
||||
}
|
||||
drawOneline($day, dayStyle, date.getDate());
|
||||
|
||||
// date
|
||||
const dateStyle = {
|
||||
font: '23px Helvetica',
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
position: 'right'
|
||||
}
|
||||
drawOneline($date, dateStyle, date.getFullYear() + '/' + (date.getMonth() + 1))
|
||||
|
||||
// title canvas
|
||||
const titleStyle = {
|
||||
font: '30px Helvetica',
|
||||
lineHeight: 1.5,
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
length: 2,
|
||||
position: 'left'
|
||||
}
|
||||
titleStyle.font = (config.titleStyle && config.titleStyle.font) || titleStyle.font
|
||||
titleStyle.color = (config.titleStyle && config.titleStyle.color) || titleStyle.color
|
||||
titleStyle.position = (config.titleStyle && config.titleStyle.position) || titleStyle.position
|
||||
drawMoreLines($title, titleStyle, config.title)
|
||||
|
||||
// content canvas
|
||||
const contentStyle = {
|
||||
font: '22px Helvetica',
|
||||
lineHeight: 1.5,
|
||||
position: 'left',
|
||||
color: 'rgba(236, 241, 255, 1)'
|
||||
}
|
||||
contentStyle.font = (config.contentStyle && config.contentStyle.font) || contentStyle.font
|
||||
contentStyle.color = (config.contentStyle && config.contentStyle.color) || contentStyle.color
|
||||
contentStyle.lineHeight = (config.contentStyle && config.contentStyle.lineHeight) || contentStyle.lineHeight
|
||||
contentStyle.position = (config.contentStyle && config.contentStyle.position) || contentStyle.position
|
||||
drawMoreLines($content, contentStyle, config.content);
|
||||
|
||||
// description
|
||||
const descriptionStyle = {
|
||||
font: '24px Helvetica',
|
||||
color: 'rgba(180, 180, 180, 1)',
|
||||
lineHeight: 1.2,
|
||||
position: 'left'
|
||||
}
|
||||
drawMoreLines($description, descriptionStyle, config.description)
|
||||
|
||||
|
||||
// background image
|
||||
const image = new Image();
|
||||
image.crossOrigin = "Anonymous";
|
||||
|
||||
//logo
|
||||
const logo = new Image();
|
||||
logo.crossOrigin = "Anonymous";
|
||||
logo.src = config.logo;
|
||||
|
||||
//qrcode
|
||||
const qrcode = new Image();
|
||||
qrcode.src = config.qrcode;
|
||||
|
||||
|
||||
const onload = function() {
|
||||
$canvas.width = WIDTH;
|
||||
$canvas.height = HEIGHT;
|
||||
image.src = config.banner;
|
||||
image.onload = function() {
|
||||
const ctx = $canvas.getContext('2d')
|
||||
ctx.fillStyle = 'rgba(255, 255, 255, 1)';
|
||||
ctx.fillRect(0, 0, $canvas.width, $canvas.height);
|
||||
|
||||
// banner
|
||||
imgRect = coverImg($canvas.width - 40, $canvas.height / 1.2 - 40, image.width, image.height);
|
||||
ctx.drawImage(image, imgRect.sx, imgRect.sy, imgRect.sWidth, imgRect.sHeight, 20, 20, $canvas.width - 40, $canvas.height / 1.2 - 40);
|
||||
|
||||
//覆盖层
|
||||
ctx.fillStyle="rgba(0, 0, 0, 0.3)";
|
||||
ctx.fillRect(20,20,$canvas.width - 40,$canvas.height / 1.2 - 40);
|
||||
|
||||
// 时间
|
||||
ctx.drawImage($day, -20, 50)
|
||||
ctx.drawImage($date, -21, 125)
|
||||
|
||||
//logo
|
||||
var logowidth = logo.width;
|
||||
var logoheight = logo.height;
|
||||
var scale = logowidth / logoheight;
|
||||
var logoh = 60;
|
||||
var cwidth = logoh * scale;
|
||||
ctx.drawImage(logo, 60, $canvas.height / 1.2 + 30, cwidth, logoh);
|
||||
|
||||
ctx.drawImage(qrcode, $canvas.width - 160, $canvas.height / 1.2 + 20, 120, 120);
|
||||
|
||||
//标题文字
|
||||
ctx.drawImage($title, 20, $canvas.height / 2 + 20)
|
||||
ctx.drawImage($content, 20, $canvas.height / 2 + 120)
|
||||
ctx.drawImage($description, 20, $canvas.height / 1.2 + 110)
|
||||
ctx.strokeStyle = 'rgba(122, 122, 122, 0.5)';
|
||||
|
||||
const img = new Image();
|
||||
img.crossOrigin = "Anonymous";
|
||||
img.src = $canvas.toDataURL('image/png')
|
||||
const radio = config.radio || 0.7
|
||||
img.width = WIDTH * radio
|
||||
img.height = HEIGHT * radio
|
||||
img.className = 'poster_load';
|
||||
ctx.clearRect(0, 0, $canvas.width, $canvas.height)
|
||||
$canvas.style.display = 'none'
|
||||
|
||||
if ($container.querySelector('.poster_load')) {
|
||||
$container.querySelector('.poster_load').src = img.src;
|
||||
} else {
|
||||
$container.appendChild(img);
|
||||
}
|
||||
|
||||
$container.appendChild(img);
|
||||
$container.removeChild($wrapper)
|
||||
if (config.callback) {
|
||||
config.callback($container)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onload()
|
||||
}
|
||||
|
||||
//裁切
|
||||
function containImg(sx, sy, box_w, box_h, source_w, source_h) {
|
||||
var dx = sx,
|
||||
dy = sy,
|
||||
dWidth = box_w,
|
||||
dHeight = box_h;
|
||||
if (source_w > source_h || (source_w == source_h && box_w < box_h)) {
|
||||
dHeight = source_h * dWidth / source_w;
|
||||
dy = sy + (box_h - dHeight) / 2;
|
||||
|
||||
} else if (source_w < source_h || (source_w == source_h && box_w > box_h)) {
|
||||
dWidth = source_w * dHeight / source_h;
|
||||
dx = sx + (box_w - dWidth) / 2;
|
||||
}
|
||||
return {
|
||||
dx,
|
||||
dy,
|
||||
dWidth,
|
||||
dHeight
|
||||
}
|
||||
}
|
||||
|
||||
function coverImg(box_w, box_h, source_w, source_h) {
|
||||
var sx = 0,
|
||||
sy = 0,
|
||||
sWidth = source_w,
|
||||
sHeight = source_h;
|
||||
if (source_w > source_h || (source_w == source_h && box_w < box_h)) {
|
||||
sWidth = box_w * sHeight / box_h;
|
||||
sx = (source_w - sWidth) / 2;
|
||||
} else if (source_w < source_h || (source_w == source_h && box_w > box_h)) {
|
||||
sHeight = box_h * sWidth / box_w;
|
||||
sy = (source_h - sHeight) / 2;
|
||||
}
|
||||
return {
|
||||
sx,
|
||||
sy,
|
||||
sWidth,
|
||||
sHeight
|
||||
}
|
||||
}
|
||||
|
||||
function createDom(name, key, value, display = 'none') {
|
||||
const $dom = document.createElement(name)
|
||||
$dom.setAttribute(key, value)
|
||||
$dom.style.display = display
|
||||
$dom.width = WIDTH
|
||||
return $dom
|
||||
}
|
||||
|
||||
function appendChilds(parent, ...doms) {
|
||||
doms.forEach(dom => {
|
||||
parent.appendChild(dom)
|
||||
})
|
||||
}
|
||||
|
||||
function drawOneline(canvas, style, content) {
|
||||
const ctx = canvas.getContext('2d')
|
||||
canvas.height = parseInt(style.font.match(/\d+/), 10) + 20
|
||||
ctx.font = style.font
|
||||
ctx.fillStyle = style.color
|
||||
ctx.textBaseline = 'top'
|
||||
|
||||
let lineWidth = 0
|
||||
let idx = 0
|
||||
let truncated = false
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
lineWidth += ctx.measureText(content[i]).width;
|
||||
if (lineWidth > canvas.width - 60) {
|
||||
truncated = true
|
||||
idx = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
let padding = 30
|
||||
|
||||
if (truncated) {
|
||||
content = content.substring(0, idx)
|
||||
padding = canvas.width / 2 - lineWidth / 2
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
ctx.strokeStyle = "#6fda92";
|
||||
ctx.strokeRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
if (style.position === 'center') {
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText(content, canvas.width / 2, 0)
|
||||
} else if (style.position === 'left') {
|
||||
ctx.fillText(content, padding, 0)
|
||||
} else {
|
||||
ctx.textAlign = 'right'
|
||||
ctx.fillText(content, canvas.width - padding, 0)
|
||||
}
|
||||
}
|
||||
|
||||
function drawMoreLines(canvas, style, content) {
|
||||
const ctx = canvas.getContext('2d')
|
||||
const fontHeight = parseInt(style.font.match(/\d+/), 10)
|
||||
|
||||
if (DEBUG) {
|
||||
ctx.strokeStyle = "#6fda92";
|
||||
ctx.strokeRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
ctx.font = style.font
|
||||
ctx.fillStyle = style.color
|
||||
ctx.textBaseline = 'top'
|
||||
ctx.textAlign = 'center'
|
||||
|
||||
let alignX = 0
|
||||
|
||||
if (style.position === 'center') {
|
||||
alignX = canvas.width / 2;
|
||||
} else if (style.position === 'left') {
|
||||
ctx.textAlign = 'left'
|
||||
alignX = 40
|
||||
} else {
|
||||
ctx.textAlign = 'right'
|
||||
alignX = canvas.width - 40
|
||||
}
|
||||
|
||||
let lineWidth = 0
|
||||
let lastSubStrIndex = 0
|
||||
let offsetY = 0
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
lineWidth += ctx.measureText(content[i]).width;
|
||||
if (lineWidth > canvas.width - 120) {
|
||||
ctx.fillText(content.substring(lastSubStrIndex, i), alignX, offsetY);
|
||||
offsetY += fontHeight * style.lineHeight
|
||||
lineWidth = 0
|
||||
lastSubStrIndex = i
|
||||
}
|
||||
if (i === content.length - 1) {
|
||||
ctx.fillText(content.substring(lastSubStrIndex, i + 1), alignX, offsetY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
init
|
||||
}
|
||||
})()
|
||||
|
||||
|
||||
|
||||
|
||||
//ajax生成文章海报
|
||||
$('body').on('click', '.cr_poster', function () {
|
||||
var post_id = $(this).attr('poster-data');
|
||||
var banner = $(this).attr('banner');
|
||||
var single_content = $('.single-content')
|
||||
var t_content = $('#post-'+post_id+' .t_content')
|
||||
var content = single_content.length>0 ? single_content[0].innerText : t_content[0].innerText
|
||||
var content_length = content.length
|
||||
var permalink = t_content.length>0 ? window.location.origin + '/moments/'+post_id : window.location.origin + window.location.pathname;
|
||||
var title = t_content.length>0 ? Theme.site_title+'-瞬间' : document.title;
|
||||
new QRious({ element: document.getElementById("twoCode"), value: permalink, size: 260, });
|
||||
$('.poster_box').remove();
|
||||
$('#share_modal_' + post_id + ' .poster_box_ap').append('<div class="poster_box"></div>');
|
||||
|
||||
if (content_length > 120) {
|
||||
content = content.substring(0, 80) + '...'
|
||||
}
|
||||
|
||||
function Posterdown(e) {
|
||||
if (e == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var modal = '#share_modal_' + post_id;
|
||||
|
||||
var url = $('' + modal + ' .poster_box img').attr('src');
|
||||
$('' + modal + ' .post_share_box').removeClass('hide');
|
||||
$('' + modal + ' .poster_download').attr('href', url).attr('download', 'poster_' + post_id + '.png');
|
||||
}
|
||||
|
||||
$('#share_modal_' + post_id + ' .poster_box').append('<div class="loading_box"><div uk-spinner></div></div>');
|
||||
$('.loading_box').remove();
|
||||
poster.init({
|
||||
banner: banner,
|
||||
selector: '.poster_box',
|
||||
title: title,
|
||||
content: content,
|
||||
logo: Theme.site_logo,
|
||||
qrcode: $('#twoCode').attr('src'),
|
||||
description: Theme.admin_des,
|
||||
callback: Posterdown
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function convertImgToBase64(url, callback) {
|
||||
var canvas = document.createElement('canvas');
|
||||
var img = new Image();
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.onload = function () {
|
||||
canvas.width = img.width;
|
||||
canvas.height = img.height;
|
||||
var ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(img, 0, 0);
|
||||
var ext = img.src.substring(img.src.lastIndexOf('.') + 1).toLowerCase();
|
||||
var dataURL = canvas.toDataURL('image/' + ext);
|
||||
callback(dataURL);
|
||||
canvas = null;
|
||||
};
|
||||
img.src = url;
|
||||
}
|
||||
|
||||
|
||||
function handleShare(e, pic, title,pathname) {
|
||||
var permalink = window.location.origin + pathname;
|
||||
switch (e) {
|
||||
case 'wb':
|
||||
var url = `https://service.weibo.com/share/share.php?url=${permalink}&type=button&language=zh_cn&pic=${pic}&title=${title}`
|
||||
window.open(url);
|
||||
break
|
||||
case 'qzone':
|
||||
var url = `https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=${permalink}&title=${title}&pics=${pic}`
|
||||
window.open(url);
|
||||
break
|
||||
case "qq":
|
||||
var url = `http://connect.qq.com/widget/shareqq/index.html?url=${permalink}&title=${title}&pics=${pic}`
|
||||
window.open(url);
|
||||
break;
|
||||
case "copy":
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(permalink).then(function() {
|
||||
cocoMessage.success("链接已复制到剪贴板!");
|
||||
}, function(err) {
|
||||
cocoMessage.error("复制失败,请手动复制链接");
|
||||
});
|
||||
} else {
|
||||
// 兼容旧浏览器
|
||||
var tempInput = document.createElement('input');
|
||||
tempInput.value = permalink;
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
cocoMessage.success("链接已复制到剪贴板!");
|
||||
} catch (err) {
|
||||
cocoMessage.error("复制失败,请手动复制链接");
|
||||
}
|
||||
document.body.removeChild(tempInput);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!function(){this.loaded=0,this.failed=0,this.total=0,this.watch=function(a,b){var c=document.querySelectorAll(a);if(!c.length)return console.log("[imgStatus]: Doesn't exists any images with this class!");this.total=c.length;for(var d=0;d<c.length;d++)is_cached(c[d].src)?this.ready(b):c[d].addEventListener?(c[d].addEventListener("load",this.ready.bind(this,b)),c[d].addEventListener("error",this.fail.bind(this,b))):(c[d].attachEvent("onload",this.ready.bind(this,b)),c[d].attachEvent("onerror",this.fail.bind(this,b)))},this.is_cached=function(a){var b=new Image;return b.src=a,b.complete},this.fail=function(a,b){++this.failed,"function"==typeof a&&a(this)},this.ready=function(a,b){++this.loaded,"function"==typeof a&&a(this)},this.done=function(){return this.loaded+this.failed===this.total?!0:!1},"object"==typeof window&&(window.imgStatus=this)}();
|
||||
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(jQuery)}((function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function read(s,converter){var value=config.raw?s:function(s){0===s.indexOf('"')&&(s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s=decodeURIComponent(s.replace(pluses," ")),config.json?JSON.parse(s):s}catch(e){}}(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(void 0!==value&&!$.isFunction(value)){if("number"==typeof(options=$.extend({},config.defaults,options)).expires){var days=options.expires,t=options.expires=new Date;t.setTime(+t+864e5*days)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}for(var s,result=key?void 0:{},cookies=document.cookie?document.cookie.split("; "):[],i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("="),name=(s=parts.shift(),config.raw?s:decodeURIComponent(s)),cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}key||void 0===(cookie=read(cookie))||(result[name]=cookie)}return result};config.defaults={},$.removeCookie=function(key,options){return void 0!==$.cookie(key)&&($.cookie(key,"",$.extend({},options,{expires:-1})),!$.cookie(key))}}));
|
||||
@@ -0,0 +1,306 @@
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
!function (global, factory) {
|
||||
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, global.cocoMessage = factory());
|
||||
}(void 0, function () {
|
||||
"use strict";
|
||||
|
||||
var msgWrapper = c({
|
||||
className: "coco-msg-stage"
|
||||
});
|
||||
|
||||
function c(args, children) {
|
||||
var el = document.createElement("div");
|
||||
|
||||
for (var key in args) {
|
||||
var element = args[key];
|
||||
|
||||
if (key == "className") {
|
||||
key = "class";
|
||||
el.setAttribute(key, element);
|
||||
} else if (key[0] == "_") {
|
||||
el.addEventListener(key.slice(1), element);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof children == "string") {
|
||||
el.innerHTML = children;
|
||||
} else if (_typeof(children) == "object" && children.tagName) {
|
||||
el.appendChild(children);
|
||||
} else if (children) {
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
el.appendChild(child);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
function addAnimationEnd(el, fn) {
|
||||
["a", "webkitA"].forEach(function (prefix) {
|
||||
var name = prefix + "nimationEnd";
|
||||
el.addEventListener(name, function () {
|
||||
fn();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function css(el, css) {
|
||||
for (var key in css) {
|
||||
el.style[key] = css[key];
|
||||
}
|
||||
|
||||
if (el.getAttribute("style") === "") {
|
||||
el.removeAttribute("style");
|
||||
}
|
||||
}
|
||||
|
||||
function addClass(el, s) {
|
||||
var c = el.className || "";
|
||||
|
||||
if (!hasClass(c, s)) {
|
||||
var arr = c.split(/\s+/);
|
||||
arr.push(s);
|
||||
el.className = arr.join(" ");
|
||||
}
|
||||
}
|
||||
|
||||
function hasClass(c, s) {
|
||||
return c.indexOf(s) > -1 ? !0 : !1;
|
||||
}
|
||||
|
||||
function removeClass(el, s) {
|
||||
var c = el.className || "";
|
||||
|
||||
if (hasClass(c, s)) {
|
||||
var arr = c.split(/\s+/);
|
||||
var i = arr.indexOf(s);
|
||||
arr.splice(i, 1);
|
||||
el.className = arr.join(" ");
|
||||
}
|
||||
|
||||
if (el.className === "") {
|
||||
el.removeAttribute("class");
|
||||
}
|
||||
}
|
||||
|
||||
var initArgs = {
|
||||
msg: "",
|
||||
duration: 2000,
|
||||
showClose: false
|
||||
};
|
||||
var cocoMessage = {
|
||||
info: function info() {
|
||||
initConfig(arguments, "info");
|
||||
},
|
||||
success: function success() {
|
||||
initConfig(arguments, "success");
|
||||
},
|
||||
warning: function warning() {
|
||||
initConfig(arguments, "warning");
|
||||
},
|
||||
error: function error() {
|
||||
initConfig(arguments, "error");
|
||||
},
|
||||
loading: function loading() {
|
||||
return initConfig(arguments, "loading");
|
||||
},
|
||||
destroyAll: function destroyAll() {
|
||||
_destroyAll();
|
||||
},
|
||||
config: function config(obj) {
|
||||
for (var key in obj) {
|
||||
if (Object.hasOwnProperty.call(obj, key)) {
|
||||
if (obj[key] !== undefined) {
|
||||
initArgs[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function initConfig(obj, type) {
|
||||
var args = {};
|
||||
|
||||
for (var key in initArgs) {
|
||||
args[key] = initArgs[key];
|
||||
}
|
||||
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
var it = obj[i];
|
||||
|
||||
if (it !== undefined) {
|
||||
if (typeof it == "string" || _typeof(it) == "object") {
|
||||
args.msg = it;
|
||||
} else if (typeof it == "boolean") {
|
||||
args.showClose = it;
|
||||
} else if (typeof it == "function") {
|
||||
args.onClose = it;
|
||||
} else if (typeof it == "number") {
|
||||
args.duration = it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
args.type = type;
|
||||
return createMsgEl(args);
|
||||
}
|
||||
|
||||
function createMsgEl(args) {
|
||||
var type = args.type,
|
||||
duration = args.duration,
|
||||
msg = args.msg,
|
||||
showClose = args.showClose,
|
||||
onClose = args.onClose;
|
||||
var closable = duration === 0;
|
||||
var iconObj = getIconObj();
|
||||
|
||||
if (type == "loading") {
|
||||
msg = msg === "" ? "正在加载,请稍后" : msg;
|
||||
closable = showClose;
|
||||
duration = 0;
|
||||
}
|
||||
|
||||
var el = c({
|
||||
className: "coco-msg-wrapper"
|
||||
}, [c({
|
||||
className: "coco-msg coco-msg-fade-in " + type
|
||||
}, [c({
|
||||
className: "coco-msg-icon"
|
||||
}, iconObj[type]), c({
|
||||
className: "coco-msg-content"
|
||||
}, msg), c({
|
||||
className: "coco-msg-wait " + (closable ? "coco-msg-pointer" : ""),
|
||||
_click: function _click() {
|
||||
if (closable) {
|
||||
closeMsg(el, onClose);
|
||||
}
|
||||
}
|
||||
}, getMsgRight(closable))])]);
|
||||
var anm = el.querySelector(".coco-msg__circle");
|
||||
|
||||
if (anm) {
|
||||
css(anm, {
|
||||
animation: "coco-msg_" + type + " " + duration + "ms linear"
|
||||
});
|
||||
|
||||
if ("onanimationend" in window) {
|
||||
addAnimationEnd(anm, function () {
|
||||
closeMsg(el, onClose);
|
||||
});
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
closeMsg(el, onClose);
|
||||
}, duration);
|
||||
}
|
||||
}
|
||||
|
||||
if (type == "loading" && duration !== 0) {
|
||||
setTimeout(function () {
|
||||
closeMsg(el, onClose);
|
||||
}, duration);
|
||||
}
|
||||
|
||||
if (!msgWrapper.children.length) {
|
||||
document.body.appendChild(msgWrapper);
|
||||
}
|
||||
|
||||
msgWrapper.appendChild(el);
|
||||
css(el, {
|
||||
height: el.offsetHeight + "px"
|
||||
});
|
||||
setTimeout(function () {
|
||||
removeClass(el.children[0], "coco-msg-fade-in");
|
||||
}, 300);
|
||||
|
||||
if (type == "loading") {
|
||||
return function () {
|
||||
closeMsg(el, onClose);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getMsgRight(showClose) {
|
||||
if (showClose) {
|
||||
return "\n <svg class=\"coco-msg-close\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5514\"><path d=\"M810 274l-238 238 238 238-60 60-238-238-238 238-60-60 238-238-238-238 60-60 238 238 238-238z\" p-id=\"5515\"></path></svg>\n ";
|
||||
} else {
|
||||
return "<svg class=\"coco-msg-progress\" viewBox=\"0 0 33.83098862 33.83098862\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle class=\"coco-msg__background\" cx=\"16.9\" cy=\"16.9\" r=\"15.9\"></circle>\n <circle class=\"coco-msg__circle\" stroke-dasharray=\"100,100\" cx=\"16.9\" cy=\"16.9\" r=\"15.9\"></circle>\n </svg>\n ";
|
||||
}
|
||||
}
|
||||
|
||||
function closeMsg(el, cb) {
|
||||
if (!el) return;
|
||||
css(el, {
|
||||
padding: 0,
|
||||
height: 0
|
||||
});
|
||||
addClass(el.children[0], "coco-msg-fade-out");
|
||||
cb && cb();
|
||||
setTimeout(function () {
|
||||
if (!el) return;
|
||||
var has = false;
|
||||
|
||||
for (var i = 0; i < msgWrapper.children.length; i++) {
|
||||
if (msgWrapper.children[i] === el) {
|
||||
has = true;
|
||||
}
|
||||
}
|
||||
|
||||
has && removeChild(el);
|
||||
el = null;
|
||||
|
||||
if (!msgWrapper.children.length) {
|
||||
has && removeChild(msgWrapper);
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
function getIconObj() {
|
||||
return {
|
||||
info: "\n <svg t=\"1609810636603\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3250\"><path d=\"M469.333333 341.333333h85.333334v469.333334H469.333333z\" fill=\"#ffffff\" p-id=\"3251\"></path><path d=\"M469.333333 213.333333h85.333334v85.333334H469.333333z\" fill=\"#ffffff\" p-id=\"3252\"></path><path d=\"M384 341.333333h170.666667v85.333334H384z\" fill=\"#ffffff\" p-id=\"3253\"></path><path d=\"M384 725.333333h256v85.333334H384z\" fill=\"#ffffff\" p-id=\"3254\"></path></svg>\n ",
|
||||
success: "\n <svg t=\"1609781242911\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"1807\"><path d=\"M455.42 731.04c-8.85 0-17.75-3.05-24.99-9.27L235.14 553.91c-16.06-13.81-17.89-38.03-4.09-54.09 13.81-16.06 38.03-17.89 54.09-4.09l195.29 167.86c16.06 13.81 17.89 38.03 4.09 54.09-7.58 8.83-18.31 13.36-29.1 13.36z\" p-id=\"1808\" fill=\"#ffffff\"></path><path d=\"M469.89 731.04c-8.51 0-17.07-2.82-24.18-8.6-16.43-13.37-18.92-37.53-5.55-53.96L734.1 307.11c13.37-16.44 37.53-18.92 53.96-5.55 16.43 13.37 18.92 37.53 5.55 53.96L499.67 716.89c-7.58 9.31-18.64 14.15-29.78 14.15z\" p-id=\"1809\" fill=\"#ffffff\"></path></svg>\n ",
|
||||
warning: "\n <svg t=\"1609776406944\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"18912\"><path d=\"M468.114286 621.714286c7.314286 21.942857 21.942857 36.571429 43.885714 36.571428s36.571429-14.628571 43.885714-36.571428L585.142857 219.428571c0-43.885714-36.571429-73.142857-73.142857-73.142857-43.885714 0-73.142857 36.571429-73.142857 80.457143l29.257143 394.971429zM512 731.428571c-43.885714 0-73.142857 29.257143-73.142857 73.142858s29.257143 73.142857 73.142857 73.142857 73.142857-29.257143 73.142857-73.142857-29.257143-73.142857-73.142857-73.142858z\" p-id=\"18913\" fill=\"#ffffff\"></path></svg>\n ",
|
||||
error: "\n <svg t=\"1609810716933\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5514\"><path d=\"M810 274l-238 238 238 238-60 60-238-238-238 238-60-60 238-238-238-238 60-60 238 238 238-238z\" p-id=\"5515\" fill=\"#ffffff\"></path></svg>\n ",
|
||||
loading: "\n <div class=\"coco-msg_loading\">\n <svg class=\"coco-msg-circular\" viewBox=\"25 25 50 50\">\n <circle class=\"coco-msg-path\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\"/>\n </svg>\n </div>\n "
|
||||
};
|
||||
}
|
||||
|
||||
function removeChild(el) {
|
||||
el && el.parentNode.removeChild(el);
|
||||
}
|
||||
|
||||
function _destroyAll() {
|
||||
for (var i = 0; i < msgWrapper.children.length; i++) {
|
||||
var element = msgWrapper.children[i];
|
||||
closeMsg(element);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
insertCssInHead();
|
||||
});
|
||||
|
||||
function insertCssInHead() {
|
||||
var doc = document;
|
||||
|
||||
if (doc && doc.head) {
|
||||
var head = doc.head;
|
||||
|
||||
var _css = doc.createElement('style');
|
||||
|
||||
var cssStr = "\n\n[class|=coco],[class|=coco]::after,[class|=coco]::before{box-sizing:border-box;outline:0}.coco-msg-progress{width:13px;height:13px}.coco-msg__circle{stroke-width:2;stroke-linecap:square;fill:none;transform:rotate(-90deg);transform-origin:center}.coco-msg-stage:hover .coco-msg__circle{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.coco-msg__background{stroke-width:2;fill:none}.coco-msg-stage{position:fixed;top:20px;left:50%;width:auto;transform:translate(-50%,0);z-index:3000}.coco-msg-wrapper{position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);transition:height .3s ease,padding .3s ease;padding:6px 0;will-change:transform,opacity}.coco-msg{padding:15px 21px;border-radius:3px;position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);display:flex;align-items:center}.coco-msg-content,.coco-msg-icon,.coco-msg-wait{display:inline-block}.coco-msg-icon{position:relative;width:13px;height:13px;border-radius:100%;display:flex;justify-content:center;align-items:center}.coco-msg-icon svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:11px;height:11px}.coco-msg-wait{width:20px;height:20px;position:relative;fill:#4eb127}.coco-msg-wait svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.coco-msg-close{width:14px;height:14px}.coco-msg-content{margin:0 10px;min-width:240px;text-align:left;font-size:14px;font-weight:500;font-family:-apple-system,Microsoft Yahei,sans-serif;text-shadow:0 0 1px rgba(0,0,0,.01)}.coco-msg.info{color:#0fafad;background-color:#e7fdfc;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #c0faf9}.coco-msg.info .coco-msg-icon{background-color:#0fafad}.coco-msg.success{color:#4ebb23;background-color:#f3ffe8;box-shadow:0 0 2px 0 rgba(0,1,0,.01),0 0 0 1px #d9f8bb}.coco-msg.success .coco-msg-icon{background-color:#4ebb23}.coco-msg.warning{color:#f1b306;background-color:#fff9eb;box-shadow:0 0 2px 0 rgba(1,1,0,.01),0 0 0 1px #fcf2cd}.coco-msg.warning .coco-msg-icon{background-color:#f1b306}.coco-msg.error{color:#f34b51;background-color:#fff7f7;box-shadow:0 0 2px 0 rgba(1,0,0,.01),0 0 0 1px #ffe3e3}.coco-msg.error .coco-msg-icon{background-color:#f34b51}.coco-msg.loading{color:#0fafad;background-color:#e7fdfc;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #c2faf9}.coco-msg_loading{flex-shrink:0;width:20px;height:20px;position:relative}.coco-msg-circular{-webkit-animation:coco-msg-rotate 2s linear infinite both;animation:coco-msg-rotate 2s linear infinite both;transform-origin:center center;height:18px!important;width:18px!important}.coco-msg-path{stroke-dasharray:1,200;stroke-dashoffset:0;stroke:#0fafad;-webkit-animation:coco-msg-dash 1.5s ease-in-out infinite;animation:coco-msg-dash 1.5s ease-in-out infinite;stroke-linecap:round}@-webkit-keyframes coco-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes coco-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@-webkit-keyframes coco-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes coco-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.coco-msg.info .coco-msg-wait{fill:#0fafad}.coco-msg.success .coco-msg-wait{fill:#4ebb23}.coco-msg.warning .coco-msg-wait{fill:#f1b306}.coco-msg.error .coco-msg-wait{fill:#f34b51}.coco-msg.loading .coco-msg-wait{fill:#0fafad}.coco-msg-pointer{cursor:pointer}@-webkit-keyframes coco-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@keyframes coco-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@-webkit-keyframes coco-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@keyframes coco-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@-webkit-keyframes coco-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@keyframes coco-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@-webkit-keyframes coco-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}@keyframes coco-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}.coco-msg-fade-in{-webkit-animation:coco-msg-fade .2s ease-out both;animation:coco-msg-fade .2s ease-out both}.coco-msg-fade-out{animation:coco-msg-fade .3s linear reverse both}@-webkit-keyframes coco-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes coco-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}\n ";
|
||||
_css.innerHTML = cssStr;
|
||||
|
||||
if (head.children.length) {
|
||||
head.insertBefore(_css, head.children[0]);
|
||||
} else {
|
||||
head.appendChild(_css);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cocoMessage;
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}#nprogress{pointer-events:none}#nprogress .bar{background:#172eff;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);-ms-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner 400ms linear infinite;animation:nprogress-spinner 400ms linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}
|
||||
@@ -0,0 +1,500 @@
|
||||
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
||||
* @license MIT */
|
||||
|
||||
;(function(root, factory) {
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory();
|
||||
} else {
|
||||
root.NProgress = factory();
|
||||
}
|
||||
|
||||
})(this, function() {
|
||||
var NProgress = {};
|
||||
|
||||
NProgress.version = '0.2.0';
|
||||
|
||||
var Settings = NProgress.settings = {
|
||||
minimum: 0.08,
|
||||
easing: 'linear',
|
||||
positionUsing: '',
|
||||
speed: 200,
|
||||
trickle: true,
|
||||
trickleSpeed: 200,
|
||||
showSpinner: true,
|
||||
barSelector: '[role="bar"]',
|
||||
spinnerSelector: '[role="spinner"]',
|
||||
parent: 'body',
|
||||
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates configuration.
|
||||
*
|
||||
* NProgress.configure({
|
||||
* minimum: 0.1
|
||||
* });
|
||||
*/
|
||||
NProgress.configure = function(options) {
|
||||
var key, value;
|
||||
for (key in options) {
|
||||
value = options[key];
|
||||
if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Last number.
|
||||
*/
|
||||
|
||||
NProgress.status = null;
|
||||
|
||||
/**
|
||||
* Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
|
||||
*
|
||||
* NProgress.set(0.4);
|
||||
* NProgress.set(1.0);
|
||||
*/
|
||||
|
||||
NProgress.set = function(n) {
|
||||
var started = NProgress.isStarted();
|
||||
|
||||
n = clamp(n, Settings.minimum, 1);
|
||||
NProgress.status = (n === 1 ? null : n);
|
||||
|
||||
var progress = NProgress.render(!started),
|
||||
bar = progress.querySelector(Settings.barSelector),
|
||||
speed = Settings.speed,
|
||||
ease = Settings.easing;
|
||||
|
||||
progress.offsetWidth; /* Repaint */
|
||||
|
||||
queue(function(next) {
|
||||
// Set positionUsing if it hasn't already been set
|
||||
if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS();
|
||||
|
||||
// Add transition
|
||||
css(bar, barPositionCSS(n, speed, ease));
|
||||
|
||||
if (n === 1) {
|
||||
// Fade out
|
||||
css(progress, {
|
||||
transition: 'none',
|
||||
opacity: 1
|
||||
});
|
||||
progress.offsetWidth; /* Repaint */
|
||||
|
||||
setTimeout(function() {
|
||||
css(progress, {
|
||||
transition: 'all ' + speed + 'ms linear',
|
||||
opacity: 0
|
||||
});
|
||||
setTimeout(function() {
|
||||
NProgress.remove();
|
||||
next();
|
||||
}, speed);
|
||||
}, speed);
|
||||
} else {
|
||||
setTimeout(next, speed);
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
NProgress.isStarted = function() {
|
||||
return typeof NProgress.status === 'number';
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the progress bar.
|
||||
* This is the same as setting the status to 0%, except that it doesn't go backwards.
|
||||
*
|
||||
* NProgress.start();
|
||||
*
|
||||
*/
|
||||
NProgress.start = function() {
|
||||
if (!NProgress.status) NProgress.set(0);
|
||||
|
||||
var work = function() {
|
||||
setTimeout(function() {
|
||||
if (!NProgress.status) return;
|
||||
NProgress.trickle();
|
||||
work();
|
||||
}, Settings.trickleSpeed);
|
||||
};
|
||||
|
||||
if (Settings.trickle) work();
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Hides the progress bar.
|
||||
* This is the *sort of* the same as setting the status to 100%, with the
|
||||
* difference being `done()` makes some placebo effect of some realistic motion.
|
||||
*
|
||||
* NProgress.done();
|
||||
*
|
||||
* If `true` is passed, it will show the progress bar even if its hidden.
|
||||
*
|
||||
* NProgress.done(true);
|
||||
*/
|
||||
|
||||
NProgress.done = function(force) {
|
||||
if (!force && !NProgress.status) return this;
|
||||
|
||||
return NProgress.inc(0.3 + 0.5 * Math.random()).set(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Increments by a random amount.
|
||||
*/
|
||||
|
||||
NProgress.inc = function(amount) {
|
||||
var n = NProgress.status;
|
||||
|
||||
if (!n) {
|
||||
return NProgress.start();
|
||||
} else if(n > 1) {
|
||||
return;
|
||||
} else {
|
||||
if (typeof amount !== 'number') {
|
||||
if (n >= 0 && n < 0.2) { amount = 0.1; }
|
||||
else if (n >= 0.2 && n < 0.5) { amount = 0.04; }
|
||||
else if (n >= 0.5 && n < 0.8) { amount = 0.02; }
|
||||
else if (n >= 0.8 && n < 0.99) { amount = 0.005; }
|
||||
else { amount = 0; }
|
||||
}
|
||||
|
||||
n = clamp(n + amount, 0, 0.994);
|
||||
return NProgress.set(n);
|
||||
}
|
||||
};
|
||||
|
||||
NProgress.trickle = function() {
|
||||
return NProgress.inc();
|
||||
};
|
||||
|
||||
/**
|
||||
* Waits for all supplied jQuery promises and
|
||||
* increases the progress as the promises resolve.
|
||||
*
|
||||
* @param $promise jQUery Promise
|
||||
*/
|
||||
(function() {
|
||||
var initial = 0, current = 0;
|
||||
|
||||
NProgress.promise = function($promise) {
|
||||
if (!$promise || $promise.state() === "resolved") {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (current === 0) {
|
||||
NProgress.start();
|
||||
}
|
||||
|
||||
initial++;
|
||||
current++;
|
||||
|
||||
$promise.always(function() {
|
||||
current--;
|
||||
if (current === 0) {
|
||||
initial = 0;
|
||||
NProgress.done();
|
||||
} else {
|
||||
NProgress.set((initial - current) / initial);
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
/**
|
||||
* (Internal) renders the progress bar markup based on the `template`
|
||||
* setting.
|
||||
*/
|
||||
|
||||
NProgress.render = function(fromStart) {
|
||||
if (NProgress.isRendered()) return document.getElementById('nprogress');
|
||||
|
||||
addClass(document.documentElement, 'nprogress-busy');
|
||||
|
||||
var progress = document.createElement('div');
|
||||
progress.id = 'nprogress';
|
||||
progress.innerHTML = Settings.template;
|
||||
|
||||
|
||||
|
||||
var bar = progress.querySelector(Settings.barSelector),
|
||||
perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0),
|
||||
parent = isDOM(Settings.parent)
|
||||
? Settings.parent
|
||||
: document.querySelector(Settings.parent),
|
||||
spinner
|
||||
|
||||
css(bar, {
|
||||
transition: 'all 0 linear',
|
||||
transform: 'translate3d(' + perc + '%,0,0)'
|
||||
});
|
||||
|
||||
if (!Settings.showSpinner) {
|
||||
spinner = progress.querySelector(Settings.spinnerSelector);
|
||||
spinner && removeElement(spinner);
|
||||
}
|
||||
|
||||
if (parent != document.body) {
|
||||
addClass(parent, 'nprogress-custom-parent');
|
||||
}
|
||||
|
||||
parent.appendChild(progress);
|
||||
return progress;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the element. Opposite of render().
|
||||
*/
|
||||
|
||||
NProgress.remove = function() {
|
||||
removeClass(document.documentElement, 'nprogress-busy');
|
||||
var parent = isDOM(Settings.parent)
|
||||
? Settings.parent
|
||||
: document.querySelector(Settings.parent)
|
||||
removeClass(parent, 'nprogress-custom-parent')
|
||||
var progress = document.getElementById('nprogress');
|
||||
progress && removeElement(progress);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the progress bar is rendered.
|
||||
*/
|
||||
|
||||
NProgress.isRendered = function() {
|
||||
return !!document.getElementById('nprogress');
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine which positioning CSS rule to use.
|
||||
*/
|
||||
|
||||
NProgress.getPositioningCSS = function() {
|
||||
// Sniff on document.body.style
|
||||
var bodyStyle = document.body.style;
|
||||
|
||||
// Sniff prefixes
|
||||
var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' :
|
||||
('MozTransform' in bodyStyle) ? 'Moz' :
|
||||
('msTransform' in bodyStyle) ? 'ms' :
|
||||
('OTransform' in bodyStyle) ? 'O' : '';
|
||||
|
||||
if (vendorPrefix + 'Perspective' in bodyStyle) {
|
||||
// Modern browsers with 3D support, e.g. Webkit, IE10
|
||||
return 'translate3d';
|
||||
} else if (vendorPrefix + 'Transform' in bodyStyle) {
|
||||
// Browsers without 3D support, e.g. IE9
|
||||
return 'translate';
|
||||
} else {
|
||||
// Browsers without translate() support, e.g. IE7-8
|
||||
return 'margin';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
|
||||
function isDOM (obj) {
|
||||
if (typeof HTMLElement === 'object') {
|
||||
return obj instanceof HTMLElement
|
||||
}
|
||||
return (
|
||||
obj &&
|
||||
typeof obj === 'object' &&
|
||||
obj.nodeType === 1 &&
|
||||
typeof obj.nodeName === 'string'
|
||||
)
|
||||
}
|
||||
|
||||
function clamp(n, min, max) {
|
||||
if (n < min) return min;
|
||||
if (n > max) return max;
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) converts a percentage (`0..1`) to a bar translateX
|
||||
* percentage (`-100%..0%`).
|
||||
*/
|
||||
|
||||
function toBarPerc(n) {
|
||||
return (-1 + n) * 100;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* (Internal) returns the correct CSS for changing the bar's
|
||||
* position given an n percentage, and speed and ease from Settings
|
||||
*/
|
||||
|
||||
function barPositionCSS(n, speed, ease) {
|
||||
var barCSS;
|
||||
|
||||
if (Settings.positionUsing === 'translate3d') {
|
||||
barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
|
||||
} else if (Settings.positionUsing === 'translate') {
|
||||
barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
|
||||
} else {
|
||||
barCSS = { 'margin-left': toBarPerc(n)+'%' };
|
||||
}
|
||||
|
||||
barCSS.transition = 'all '+speed+'ms '+ease;
|
||||
|
||||
return barCSS;
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) Queues a function to be executed.
|
||||
*/
|
||||
|
||||
var queue = (function() {
|
||||
var pending = [];
|
||||
|
||||
function next() {
|
||||
var fn = pending.shift();
|
||||
if (fn) {
|
||||
fn(next);
|
||||
}
|
||||
}
|
||||
|
||||
return function(fn) {
|
||||
pending.push(fn);
|
||||
if (pending.length == 1) next();
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* (Internal) Applies css properties to an element, similar to the jQuery
|
||||
* css method.
|
||||
*
|
||||
* While this helper does assist with vendor prefixed property names, it
|
||||
* does not perform any manipulation of values prior to setting styles.
|
||||
*/
|
||||
|
||||
var css = (function() {
|
||||
var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ],
|
||||
cssProps = {};
|
||||
|
||||
function camelCase(string) {
|
||||
return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
function getVendorProp(name) {
|
||||
var style = document.body.style;
|
||||
if (name in style) return name;
|
||||
|
||||
var i = cssPrefixes.length,
|
||||
capName = name.charAt(0).toUpperCase() + name.slice(1),
|
||||
vendorName;
|
||||
while (i--) {
|
||||
vendorName = cssPrefixes[i] + capName;
|
||||
if (vendorName in style) return vendorName;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function getStyleProp(name) {
|
||||
name = camelCase(name);
|
||||
return cssProps[name] || (cssProps[name] = getVendorProp(name));
|
||||
}
|
||||
|
||||
function applyCss(element, prop, value) {
|
||||
prop = getStyleProp(prop);
|
||||
element.style[prop] = value;
|
||||
}
|
||||
|
||||
return function(element, properties) {
|
||||
var args = arguments,
|
||||
prop,
|
||||
value;
|
||||
|
||||
if (args.length == 2) {
|
||||
for (prop in properties) {
|
||||
value = properties[prop];
|
||||
if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value);
|
||||
}
|
||||
} else {
|
||||
applyCss(element, args[1], args[2]);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* (Internal) Determines if an element or space separated list of class names contains a class name.
|
||||
*/
|
||||
|
||||
function hasClass(element, name) {
|
||||
var list = typeof element == 'string' ? element : classList(element);
|
||||
return list.indexOf(' ' + name + ' ') >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) Adds a class to an element.
|
||||
*/
|
||||
|
||||
function addClass(element, name) {
|
||||
var oldList = classList(element),
|
||||
newList = oldList + name;
|
||||
|
||||
if (hasClass(oldList, name)) return;
|
||||
|
||||
// Trim the opening space.
|
||||
element.className = newList.substring(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) Removes a class from an element.
|
||||
*/
|
||||
|
||||
function removeClass(element, name) {
|
||||
var oldList = classList(element),
|
||||
newList;
|
||||
|
||||
if (!hasClass(element, name)) return;
|
||||
|
||||
// Replace the class name.
|
||||
newList = oldList.replace(' ' + name + ' ', ' ');
|
||||
|
||||
// Trim the opening and closing spaces.
|
||||
element.className = newList.substring(1, newList.length - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) Gets a space separated list of the class names on the element.
|
||||
* The list is wrapped with a single space on each end to facilitate finding
|
||||
* matches within the list.
|
||||
*/
|
||||
|
||||
function classList(element) {
|
||||
return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* (Internal) Removes an element from the DOM.
|
||||
*/
|
||||
|
||||
function removeElement(element) {
|
||||
element && element.parentNode && element.parentNode.removeChild(element);
|
||||
}
|
||||
|
||||
return NProgress;
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
function waterfall(a){function b(a,b){var c=window.getComputedStyle(b);return parseFloat(c["margin"+a])||0}function c(a){return a+"px"}function d(a){return parseFloat(a.style.top)}function e(a){return parseFloat(a.style.left)}function f(a){return a.clientWidth}function g(a){return a.clientHeight}function h(a){return d(a)+g(a)+b("Bottom",a)}function i(a){return e(a)+f(a)+b("Right",a)}function j(a){a=a.sort(function(a,b){return h(a)===h(b)?e(b)-e(a):h(b)-h(a)})}function k(b){f(a)!=t&&(b.target.removeEventListener(b.type,arguments.callee),waterfall(a))}"string"==typeof a&&(a=document.querySelector(a));var l=[].map.call(a.children,function(a){return a.style.position="absolute",a});a.style.position="relative";var m=[];l.length&&(l[0].style.top="0px",l[0].style.left=c(b("Left",l[0])),m.push(l[0]));for(var n=1;n<l.length;n++){var o=l[n-1],p=l[n],q=i(o)+f(p)<=f(a);if(!q)break;p.style.top=o.style.top,p.style.left=c(i(o)+b("Left",p)),m.push(p)}for(;n<l.length;n++){j(m);var p=l[n],r=m.pop();p.style.top=c(h(r)+b("Top",p)),p.style.left=c(e(r)),m.push(p)}j(m);var s=m[0];a.style.height=c(h(s)+b("Bottom",s));var t=f(a);window.addEventListener?window.addEventListener("resize",k):document.body.onresize=k}
|
||||