初始化hugo
No files matched your search
@@ -0,0 +1,706 @@
|
||||
//首页调用
|
||||
.momos-sswrap {
|
||||
margin-top: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
||||
grid-gap: 15px; /* 中间空10px间距 */
|
||||
}
|
||||
.memos_diaoyong,.bb-list-li,.memos-random-background,.memos-search-all{
|
||||
border-radius:4px;
|
||||
background: var(--bankuai-color) !important;
|
||||
padding:20px;
|
||||
transition: all .3s cubic-bezier(0,0,.5,1);
|
||||
}
|
||||
.memos_diaoyong:hover,.bb-list-li:hover{
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.05);
|
||||
}
|
||||
.memos-diaoyong-tag .memos-tag-dg{
|
||||
cursor: auto;
|
||||
}
|
||||
.memos-diaoyong-tag .memos-tag-dg:hover{
|
||||
text-decoration: none;
|
||||
}
|
||||
.memos_diaoyong_from a{
|
||||
color: #666;
|
||||
font-family: var(--font-family-code);
|
||||
}
|
||||
.memos-logo,.memos-logo2{
|
||||
padding-top: 7px;
|
||||
}
|
||||
.memos-logo img,.memos-logo2 img{
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.talks_comments{
|
||||
margin-left: auto;
|
||||
}
|
||||
.talks_comments a{
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
cursor:pointer;
|
||||
}
|
||||
.talks_comments a:hover{
|
||||
text-decoration: underline;
|
||||
}
|
||||
.comment-s{
|
||||
margin-right: 4px;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
.talks_comments svg {
|
||||
fill: #c0c0c0;
|
||||
margin-left: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 5.5px;
|
||||
}
|
||||
.memos_diaoyong_top{
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.memos_diaoyong_from,.memos_diaoyong_time,.memos_diaoyong_laiz{
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
.memos_diaoyong_laiz a{
|
||||
color: #999;
|
||||
}
|
||||
.memos_diaoyong_info p{
|
||||
font-size: 16px;
|
||||
color: var(--text-content-color);
|
||||
line-height:1.8;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
//唠叨页
|
||||
#bber,.memos-header,.bb-load{
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
}
|
||||
.bb-list-li,.memos-search-all{
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.05);
|
||||
}
|
||||
.bb-list-ul{
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.datacont p{
|
||||
font-size:16px;
|
||||
line-height:1.6;
|
||||
/*margin:0;*/
|
||||
clear: both;
|
||||
margin-top: 32px!important;
|
||||
/*text-indent: 2em;*/
|
||||
margin-bottom:4px;
|
||||
}
|
||||
.datacont a{
|
||||
color: var(--text-highlight-color);
|
||||
}
|
||||
.resimg figure{
|
||||
margin:0;
|
||||
margin-bottom: -4px;
|
||||
}
|
||||
.resimg{
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
margin-top: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.gallery-thumbnail img{
|
||||
width: 100% !important;
|
||||
height: 170px !important;
|
||||
object-fit: cover;
|
||||
border-radius:4px;
|
||||
transition: transform 0.3s ease;
|
||||
cursor: zoom-in;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.resimg img:hover{
|
||||
transform: scale(1.03);
|
||||
}
|
||||
.grid-3,.grid-5,.grid-6,.grid-7,.grid-8,.grid-9{
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
.grid-3 img,.grid-5 img,.grid-6 img,.grid-7 img,.grid-8 img,.grid-9 img{
|
||||
height: 140px !important;
|
||||
}
|
||||
.memos-tag-wz{
|
||||
float: left;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.memos-tag-dg,.memos-tag-sc{
|
||||
display: inline;
|
||||
padding: 1px 2px 2px 4px;
|
||||
margin-right: 8px;
|
||||
color: #999;
|
||||
background: #f2f2f2;
|
||||
font-size: 14px;
|
||||
border-radius: 4px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tag-list,.memos-search-all {
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
#tag-list-all{
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.memos-tag-all{
|
||||
padding: 6px;
|
||||
color: #999;
|
||||
background: #f2f2f2;
|
||||
font-size: 16px;
|
||||
border-radius:4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.memos-tag-sc-2{
|
||||
align-items: center;
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
font-size: 16px;
|
||||
color: #999;
|
||||
}
|
||||
.memos-tag-sc{
|
||||
margin-left: 10px;
|
||||
font-size: 16px !important;
|
||||
color: #666 !important;
|
||||
background: #e5e5e5 !important;
|
||||
padding: 8px !important;
|
||||
}
|
||||
.memos-tag-sc svg{
|
||||
width: 16px;
|
||||
margin-left: 6px;
|
||||
vertical-align: middle;
|
||||
margin-top: -4px;
|
||||
}
|
||||
.memos-tag-sc:hover{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.memos-tag-dg:hover,.memos-tag-all:hover{
|
||||
text-decoration: underline;
|
||||
}
|
||||
.memos-pl{
|
||||
display: flex;
|
||||
margin-bottom: -5px;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.bb-load button{
|
||||
border: none;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
color: var(--text-highlight-color);
|
||||
border-radius:4px;
|
||||
margin-top: 20px;
|
||||
padding: 10px 30px;
|
||||
font-family: var(--font-family-title);
|
||||
font-size: 16px;
|
||||
}
|
||||
.bb-load button:hover{
|
||||
opacity: 0.8;
|
||||
transition: opacity .3s ease-in-out;
|
||||
}
|
||||
pre{
|
||||
border-radius: 4px;
|
||||
line-height: 1.8;
|
||||
background: var(--background-color);
|
||||
padding: 20px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
pre code{
|
||||
background: transparent;
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
code{
|
||||
background: #ffe9ef;
|
||||
border: 1px solid #ffd4de;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
padding: 2px 6px 2px 6px;
|
||||
font-family: var(--font-family-code);
|
||||
margin: 0 4px 0 4px;
|
||||
}
|
||||
.memos_diaoyong code{
|
||||
font-size: 14px;
|
||||
padding: 3px 6px 2px 6px;
|
||||
}
|
||||
blockquote p{
|
||||
background: var(--background-color);
|
||||
border-radius: 0 4px 4px 0;
|
||||
padding: 10px;
|
||||
font-size: 16px !important;
|
||||
line-height: 1.6 !important;
|
||||
border-left: 4px solid #bfbfbf;
|
||||
color: #666 !important;
|
||||
margin: -10px -40px 0 -40px !important;
|
||||
}
|
||||
|
||||
//memos页发布唠叨
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
.load-memos-editor{
|
||||
/*color: var(--text-content-color);*/
|
||||
/*cursor: pointer;*/
|
||||
/*font-size: 40px;*/
|
||||
/*font-family: var(--font-family-title);*/
|
||||
/*margin-bottom: 10px;*/
|
||||
/*display: inline-block;*/
|
||||
}
|
||||
.d-flex {
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
}
|
||||
.d-none {
|
||||
display: none !important;
|
||||
}
|
||||
.memos-editor-body{
|
||||
border-radius:4px;
|
||||
background: var(--bankuai-color);
|
||||
transition: all .3s cubic-bezier(0,0,.5,1);
|
||||
padding: 20px;
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.05);
|
||||
}
|
||||
.memos-editor-content .memos-editor-textarea{
|
||||
border: transparent;
|
||||
border-radius:4px;
|
||||
line-height:1.6;
|
||||
min-height: 80px;
|
||||
overflow-x:hidden;
|
||||
overflow-y:clip;
|
||||
width:100%;
|
||||
outline:0.5px solid transparent;
|
||||
resize:none;
|
||||
background: transparent;
|
||||
font-family: var(--font-family-paragraph);
|
||||
font-size: 16px;
|
||||
}
|
||||
.memos-editor-tools{
|
||||
margin-top:4px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.memos-editor-tools .action-btn{
|
||||
margin-right: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.p-2{
|
||||
margin-left: 15px;
|
||||
}
|
||||
.memos-editor-tools .memos-tag-list{
|
||||
display:flex;
|
||||
flex-wrap: wrap;//宽度显示不下自动换行
|
||||
margin-top: 15px;
|
||||
grid-gap: 15px;
|
||||
|
||||
}
|
||||
.memos-editor-tools .memos-tag{
|
||||
cursor: pointer;
|
||||
}
|
||||
.memos-editor-tools .memos-tag a{
|
||||
color: #999;
|
||||
}
|
||||
.editor-selector {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.editor-selector select {
|
||||
appearance: none; /* 隐藏原生控件样式 */
|
||||
border: 0.5px solid #dadada;
|
||||
border-radius: 4px;
|
||||
padding: 8px 20px 8px 6px;
|
||||
background: transparent;
|
||||
color: #666;
|
||||
font-family: var(--font-family-paragraph);
|
||||
font-size: 14px;
|
||||
outline:0.5px solid transparent;
|
||||
}
|
||||
.editor-selector::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 8px; /* 调整箭头的位置,这里示例将箭头靠右偏移8像素 */
|
||||
width: 0;
|
||||
border-style: solid;
|
||||
border-width: 4px 4px 0 4px; /* 控制箭头的大小和形状 */
|
||||
border-color: #999 transparent transparent transparent; /* 控制箭头的颜色 */
|
||||
transform: translateY(-50%); /* 将箭头垂直居中对齐 */
|
||||
}
|
||||
.submit-memos-btn,.edit-memos-btn{
|
||||
background: transparent;
|
||||
border: 0.5px solid #dadada;
|
||||
cursor: pointer;
|
||||
color: var(--text-highlight-color);
|
||||
border-radius:4px;
|
||||
padding: 6px 15px 6px 15px;
|
||||
}
|
||||
.cancel-edit-btn{
|
||||
padding: 6px 15px 6px 15px;
|
||||
cursor: pointer;
|
||||
border: 0.5px solid #FFF;
|
||||
margin-right: 8px;
|
||||
color: #999;
|
||||
}
|
||||
.submit-memos-btn:hover,.memos-open-api-submit:hover,.edit-memos-btn:hover,.cancel-edit-btn:hover{
|
||||
opacity: 0.8;
|
||||
transition: opacity .3s ease-in-out;
|
||||
}
|
||||
.memos-editor-footer{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
}
|
||||
.justify-content-end {
|
||||
margin-left: auto;
|
||||
}
|
||||
.memos-image-list{
|
||||
cursor: pointer;
|
||||
gap: 15px;
|
||||
color: #999;
|
||||
margin-bottom: 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.memos-img-edit{
|
||||
background: #f5f5f5;
|
||||
padding: 6px;
|
||||
border-radius:4px;
|
||||
}
|
||||
.memos-img-edit:hover{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
//填写api样式
|
||||
.memos-editor-option{
|
||||
display: flex;
|
||||
}
|
||||
.memos-open-api-input{
|
||||
border: transparent;
|
||||
padding:6px 0 6px 0;
|
||||
width:100%;
|
||||
outline:0.5px solid transparent;
|
||||
margin-right: 10px;
|
||||
background: transparent;
|
||||
font-size: 16px;
|
||||
font-family: var(--font-family-code);
|
||||
}
|
||||
.memos-open-api-submit{
|
||||
background: var(--text-highlight-color);
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
border-radius:4px;
|
||||
width: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
//随机memos
|
||||
.memos-random-background{
|
||||
margin-top: 15px;
|
||||
}
|
||||
.memos-random{
|
||||
list-style-type: none;
|
||||
}
|
||||
//唠叨编辑
|
||||
.memos-edit{
|
||||
margin-left: auto;
|
||||
}
|
||||
.memos-menu{
|
||||
margin-left: 40px;
|
||||
color: #fff;
|
||||
}
|
||||
.memos-menu-d {
|
||||
width: 60px;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
background-color: #fff;
|
||||
padding: 8px 0 8px 0;
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.15);
|
||||
text-align: center;
|
||||
border-radius:4px;
|
||||
display: none;
|
||||
}
|
||||
.memos-edit:hover .memos-menu-d {
|
||||
display: block;
|
||||
}
|
||||
.edit-btn,.archive-btn,.delete-btn {
|
||||
cursor: pointer;
|
||||
line-height: 1.8;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
.edit-btn:hover,.archive-btn:hover,.delete-btn:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.delete-btn{
|
||||
color: #c70000 !important;
|
||||
}
|
||||
.edit-memos{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
// 页面宽度小于700样式
|
||||
@media (max-width:700px){
|
||||
.resimg{
|
||||
width: 100% !important;
|
||||
}
|
||||
.gallery-thumbnail img{
|
||||
height: 140px !important;
|
||||
}
|
||||
.grid-3 img,.grid-5 img,.grid-6 img,.grid-7 img,.grid-8 img,.grid-9 img{
|
||||
height: 100px !important;
|
||||
}
|
||||
.resimg figure{
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
}
|
||||
// 页面宽度大于700样式
|
||||
//首页图片样式
|
||||
@media (min-width:700px){
|
||||
.memos_diaoyong .resimg{
|
||||
width: 100% !important;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
.memos_diaoyong .gallery-thumbnail img{
|
||||
height: 90px !important;
|
||||
}
|
||||
.memos_diaoyong .grid-3,.memos_diaoyong .grid-5,.memos_diaoyong .grid-6,.memos_diaoyong .grid-7,.memos_diaoyong grid-8,.memos_diaoyong .grid-9{
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
.memos_diaoyong .grid-3 img,.memos_diaoyong .grid-5 img,.memos_diaoyong .grid-6 img,.memos_diaoyong .grid-7 img,.memos_diaoyong .grid-8 img,.memos_diaoyong .grid-9 img{
|
||||
height: 80px !important;
|
||||
}
|
||||
.memos_diaoyong .resimg figure{
|
||||
margin-bottom: -8px;
|
||||
}
|
||||
}
|
||||
// 夜间模式页面样式
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.bb-timeline ul li {
|
||||
background: var(--background-dark-color) !important;
|
||||
}
|
||||
.memos-tag-dg,.memos-tag-sc,.memos-tag-all{
|
||||
background: #332E2F;
|
||||
}
|
||||
.memos-tag-sc-2{
|
||||
color: #666;
|
||||
}
|
||||
.memos-tag-sc{
|
||||
color: #999 !important;
|
||||
background: #332E2F !important;
|
||||
}
|
||||
.bb-load button{
|
||||
background:var(--background-dark-color);
|
||||
}
|
||||
.memos_diaoyong,.bb-list-li,.memos-random-background,.memos-search-all{
|
||||
background: var(--background-dark-color) !important;
|
||||
}
|
||||
.memos_diaoyong_from a{
|
||||
color: #999;
|
||||
}
|
||||
.memos_diaoyong_time, .memos_diaoyong_laiz a,.memos_diaoyong_from,.talks_comments a,.comment-s{
|
||||
color: #666;
|
||||
}
|
||||
.memos_diaoyong_info p, .memos_diaoyong_info a {
|
||||
color: var(--text-content-dark-color) !important;
|
||||
}
|
||||
.talks_comments svg {
|
||||
fill: #666;
|
||||
}
|
||||
.reactions {
|
||||
--start-smile-svg-fill-color: #666 !important;
|
||||
--start-smile-border-color: #393939;
|
||||
--start-smile-border-color-hover:#535353 !important;
|
||||
--start-smile-bg-color:transparent;
|
||||
}
|
||||
pre,blockquote p{
|
||||
background: #2c2829;
|
||||
}
|
||||
pre code{
|
||||
color: #999;
|
||||
}
|
||||
code{
|
||||
background: #2c2829;
|
||||
border: 1px solid #2c2829;
|
||||
color: var(--text-highlight-color);
|
||||
}
|
||||
blockquote p{
|
||||
border-left: 4px solid #5f5f5f;
|
||||
color: #888 !important;
|
||||
}
|
||||
.memos_diaoyong_info blockquote p{
|
||||
color: #888 !important;
|
||||
}
|
||||
.bb-list-li,.memos-editor-body,.memos-search-all{
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.3);
|
||||
}
|
||||
//memos页发布唠叨
|
||||
.load-memos-editor,.memos-open-api-input{
|
||||
color: var(--text-content-dark-color) !important;
|
||||
}
|
||||
.memos-editor-body{
|
||||
background: var(--background-dark-color) !important;
|
||||
}
|
||||
.editor-selector select {
|
||||
border: 0.5px solid #454545 !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
.memos-editor-content .memos-editor-textarea{
|
||||
color: var(--text-content-dark-color);
|
||||
}
|
||||
.submit-memos-btn,.edit-memos-btn{
|
||||
border: solid #454545 0.5px !important;
|
||||
}
|
||||
.memos-open-api-submit{
|
||||
background: #1A1718 !important;
|
||||
color: var(--text-highlight-color) !important;
|
||||
}
|
||||
.edit-btn,.archive-btn,.delete-btn,.cancel-edit-btn,.memos-image-list{
|
||||
color: #666;
|
||||
}
|
||||
.memos-menu{
|
||||
color: #201d1e;
|
||||
}
|
||||
.memos-menu-d,.memos-img-edit{
|
||||
background-color: #282527;
|
||||
}
|
||||
.cancel-edit-btn{
|
||||
border: 0.5px solid #201d1e;
|
||||
}
|
||||
//表情
|
||||
.emoji-item:hover{
|
||||
background: #3a3a3a !important;
|
||||
}
|
||||
// 搜索
|
||||
#memos-search-input{
|
||||
color: var(--text-content-dark-color) !important;
|
||||
}
|
||||
.memos-search ::placeholder {
|
||||
color: #666 !important;
|
||||
}
|
||||
.memos-search svg{
|
||||
color: #666 !important;
|
||||
}
|
||||
|
||||
// 标签自动补全
|
||||
#memos-tag-menu {
|
||||
background-color: #282527 !important;
|
||||
box-shadow: 2px 4px 16px rgba(0,0,0,.3) !important;
|
||||
color: #888 !important;
|
||||
}
|
||||
.tag-option.selected {
|
||||
background-color: #3e3e3e !important;
|
||||
color: #bdbdbd !important;
|
||||
}
|
||||
}
|
||||
|
||||
//表情
|
||||
.emoji-selector{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.emoji-item {
|
||||
padding: 4px;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
.emoji-item:hover{
|
||||
background: #ebebeb;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
// memoslike
|
||||
.reactions {
|
||||
--start-smile-svg-fill-color: #999;
|
||||
--start-smile-border-color-hover:#afafaf;
|
||||
}
|
||||
|
||||
// memos搜索
|
||||
.memos-search-all{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.memos-search {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
#memos-search-input{
|
||||
border: transparent;
|
||||
background: transparent;
|
||||
/*padding: 10px;*/
|
||||
font-size: 16px;
|
||||
resize: none;
|
||||
outline: 0.5px solid transparent;
|
||||
color: var(--text-content-color);
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.memos-search ::placeholder {
|
||||
color: #b8b8b8;
|
||||
}
|
||||
.memos-search svg{
|
||||
width: 20px;
|
||||
color: #b8b8b8;
|
||||
margin-left: 15px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
// 标签自动补全
|
||||
|
||||
#memos-tag-menu {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
z-index: 100;
|
||||
padding: 5px;
|
||||
box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.15);
|
||||
color: #999;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
column-count: 3; /* 每列显示的数量 */
|
||||
column-gap: 4; /* 列之间的间距 */
|
||||
}
|
||||
#memos-tag-menu:empty{
|
||||
display: none;
|
||||
}
|
||||
.tag-option {
|
||||
padding: 6px 10px 6px 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tag-option:hover{
|
||||
text-decoration: underline;
|
||||
}
|
||||
.tag-option.selected {
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 4px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.artalk.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.single-content ul li {
|
||||
line-height: 100% !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos-code-s</title><g fill="#888" fill-rule="evenodd"><path fill-rule="nonzero" d="M12.79 0C17.828 0 20 2.173 20 7.21v5.58c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h5.58Zm0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V7.209c0-4.266-1.548-5.814-5.814-5.814Z"/><path d="M11.633 7.356a.575.575 0 0 1 .83.22l2.087 4.135c.166.329.06.73-.248.933a.575.575 0 0 1-.83-.22l-2.087-4.135a.726.726 0 0 1 .248-.933ZM5.698 7.356a.575.575 0 0 1 .83.22l2.087 4.135c.166.329.059.73-.248.933a.575.575 0 0 1-.83-.22L5.45 8.288a.726.726 0 0 1 .248-.933Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 757 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos-emoji</title><g fill="none" fill-rule="evenodd"><path fill="#888" fill-rule="nonzero" d="M12.79 0C17.828 0 20 2.173 20 7.21v5.58c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h5.58Zm0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V7.209c0-4.266-1.548-5.814-5.814-5.814Z"/><path stroke="#888" stroke-dasharray="0 0" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3" d="M12.8 7.51c-.663 0-1.2-.562-1.2-1.255 0-.693.537-1.255 1.2-1.255.663 0 1.2.562 1.2 1.255 0 .693-.537 1.255-1.2 1.255ZM7.2 7.51c-.663 0-1.2-.562-1.2-1.255C6 5.562 6.537 5 7.2 5c.663 0 1.2.562 1.2 1.255 0 .693-.537 1.255-1.2 1.255ZM12.88 10.481c.4 0 .72.335.72.753C13.6 13.318 11.992 15 10 15s-3.6-1.682-3.6-3.766c0-.418.32-.753.72-.753h5.76Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 947 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos-code</title><g fill="#888" fill-rule="nonzero"><path d="M12.79 0C17.828 0 20 2.173 20 7.21v5.58c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h5.58Zm0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V7.209c0-4.266-1.548-5.814-5.814-5.814Z"/><path d="M7.274 6.688a.698.698 0 0 1 .987.987L5.945 9.99l2.316 2.325a.698.698 0 1 1-.987.987l-2.316-2.317a1.41 1.41 0 0 1 0-1.982l2.316-2.316ZM11.74 6.688a.698.698 0 0 1 .986 0l2.316 2.316a1.41 1.41 0 0 1 0 1.982l-2.316 2.317a.698.698 0 0 1-.987-.987L14.056 10l-2.317-2.325a.698.698 0 0 1 0-.987Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 758 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos_img_quote</title><g fill="#888" fill-rule="nonzero"><path d="M8 4.25a2.75 2.75 0 1 1 0 5.5 2.75 2.75 0 0 1 0-5.5Zm0 1.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5ZM14.603 9.86c.965-.813 2.482-.813 3.447 0l1.433 1.208a.75.75 0 1 1-.966 1.147l-1.434-1.208c-.407-.343-1.107-.343-1.514 0l-3.658 3.081c-.965.814-2.481.814-3.453-.005l-.284-.245c-.369-.311-1.006-.344-1.426-.068l-4.335 2.856a.75.75 0 1 1-.826-1.252l4.336-2.857c.97-.639 2.338-.568 3.224.18l.284.244c.407.343 1.107.343 1.514 0l3.658-3.08Z"/><path d="M10.93 0a.698.698 0 1 1 0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V8.14a.698.698 0 0 1 1.395 0v4.65c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h3.72Z"/><path d="M19.25 2.75a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5Z"/><path d="M16.5 0a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 16.5 0Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos_img_up</title><g fill="#888" fill-rule="nonzero"><path d="M8 4.25a2.75 2.75 0 1 1 0 5.5 2.75 2.75 0 0 1 0-5.5Zm0 1.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5ZM14.603 9.86c.965-.813 2.482-.813 3.447 0l1.433 1.208a.75.75 0 1 1-.966 1.147l-1.434-1.208c-.407-.343-1.107-.343-1.514 0l-3.658 3.081c-.965.814-2.481.814-3.453-.005l-.284-.245c-.369-.311-1.006-.344-1.426-.068l-4.335 2.856a.75.75 0 1 1-.826-1.252l4.336-2.857c.97-.639 2.338-.568 3.224.18l.284.244c.407.343 1.107.343 1.514 0l3.658-3.08Z"/><path d="M10.93 0a.698.698 0 1 1 0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V8.14a.698.698 0 0 1 1.395 0v4.65c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h3.72Z"/><path d="M15.406.987c0-.623.734-.935 1.164-.495l1.818 1.867a.713.713 0 0 1 0 .99.67.67 0 0 1-.964 0l-.655-.673v3.91a.694.694 0 0 1-.589.694l-.093.006a.691.691 0 0 1-.681-.7V.987Z"/><path d="M15.605.492a.67.67 0 0 1 .965 0 .713.713 0 0 1 0 .99L14.75 3.35a.67.67 0 0 1-.964 0 .713.713 0 0 1 0-.99L15.605.492Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos-link</title><g fill="#888" fill-rule="nonzero"><path d="M12.79 0C17.828 0 20 2.173 20 7.21v5.58c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h5.58Zm0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V7.209c0-4.266-1.548-5.814-5.814-5.814Z"/><path d="M10.045 8.969a.698.698 0 0 1 .986 0 3.733 3.733 0 0 1 0 5.286 3.738 3.738 0 0 1-5.284-5.287.698.698 0 0 1 .984.988 2.342 2.342 0 1 0 3.315 3.31 2.337 2.337 0 0 0-.001-3.31.698.698 0 0 1 0-.987Z"/><path d="M8.738 5.787a3.872 3.872 0 0 1 5.475-.003 3.871 3.871 0 0 1 .003 5.476.698.698 0 0 1-.99-.984 2.476 2.476 0 1 0-3.502-.001.698.698 0 0 1-.985.986 3.876 3.876 0 0 1-.001-5.474Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 851 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>memos_user</title><g fill="#888" fill-rule="nonzero"><path d="M12.79 0C17.828 0 20 2.173 20 7.21v5.58c0 5.037-2.173 7.21-7.21 7.21H7.21C2.172 20 0 17.827 0 12.79V7.21C0 2.172 2.173 0 7.21 0h5.58Zm0 1.395H7.21c-4.267 0-5.815 1.548-5.815 5.814v5.582c0 4.266 1.548 5.814 5.814 5.814h5.582c4.266 0 5.814-1.548 5.814-5.814V7.209c0-4.266-1.548-5.814-5.814-5.814Z"/><path d="M9.277 4c1.696 0 3.065 1.418 3.065 3.16 0 1.743-1.369 3.16-3.065 3.16S6.21 8.904 6.21 7.16C6.211 5.418 7.581 4 9.277 4Zm0 1.282c-.991 0-1.8.838-1.8 1.878s.809 1.878 1.8 1.878c.99 0 1.8-.837 1.8-1.878 0-1.04-.81-1.878-1.8-1.878ZM8.812 10.794c.563 0 1.112.083 1.631.245a.643.643 0 0 1 .42.801.631.631 0 0 1-.792.425 4.228 4.228 0 0 0-1.259-.189c-1.981 0-3.546 1.32-3.546 2.886a.637.637 0 0 1-.633.641.637.637 0 0 1-.633-.641c0-2.332 2.178-4.168 4.812-4.168ZM13.39 11.31c.633-.646 1.398-.726 2.105-.006.71.724.635 1.504 0 2.151l-2.024 2.06a1.26 1.26 0 0 1-.689.362l-.776.112c-.671.097-1.2-.442-1.104-1.124l.11-.802c.037-.237.17-.506.339-.677l2.038-2.076Zm1.411.7c-.231-.236-.262-.233-.497.006l-2.303 2.348-.089.595.569-.081c-.01.001.004-.007.012-.01l2.308-2.346c.235-.239.238-.27 0-.512Z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
"use strict";function _typeof(o){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}!function(o,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(o=o||self,o.cocoMessage=t())}(void 0,function(){function o(o,t){var e=document.createElement("div");for(var n in o){var s=o[n];"className"==n?(n="class",e.setAttribute(n,s)):"_"==n[0]&&e.addEventListener(n.slice(1),s)}if("string"==typeof t)e.innerHTML=t;else if("object"==_typeof(t)&&t.tagName)e.appendChild(t);else if(t)for(var i=0;i<t.length;i++){var r=t[i];e.appendChild(r)}return e}function t(o,t){for(var e in t)o.style[e]=t[e];""===o.getAttribute("style")&&o.removeAttribute("style")}function e(o,t){var e=o.className||"";if(!n(e,t)){var s=e.split(/\s+/);s.push(t),o.className=s.join(" ")}}function n(o,t){return o.indexOf(t)>-1}function s(o,t){var e=o.className||"";if(n(e,t)){var s=e.split(/\s+/),i=s.indexOf(t);s.splice(i,1),o.className=s.join(" ")}""===o.className&&o.removeAttribute("class")}function i(){return r(arguments,"info")}function r(o,t){var e={};for(var n in h)e[n]=h[n];for(var s=0;s<o.length;s++){var i=o[s];void 0!==i&&("string"==typeof i||"object"==_typeof(i)?e.msg=i:"boolean"==typeof i?e.showClose=i:"function"==typeof i?e.onClose=i:"number"==typeof i&&(e.duration=i))}return e.type=t,a(e)}function a(e){var n=e.type,i=e.duration,r=e.msg,a=e.showClose,d=e.onClose,g=0===i,p=l();"loading"==n&&(r=""===r?"正在加载":r,g=a,i=0);var h=o({className:"coco-msg-wrapper"},[o({className:"coco-msg coco-msg-fade-in ".concat(n)},[o({className:"coco-msg-icon"},p[n]),o({className:"coco-msg-content"},r),o({className:"coco-msg-wait ".concat(g?"coco-msg-pointer":"coco-msg-wait-hidden"),_click:function(){f(h,d)}},c(g)||"")])]);return 0!==i&&setTimeout(function(){f(h,d)},i),m.children.length||document.body.appendChild(m),m.appendChild(h),t(h,{height:h.offsetHeight+"px"}),setTimeout(function(){s(h.children[0],"coco-msg-fade-in")},300),function(){f(h,d)}}function c(o){return o?'<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>':""}function f(o,n){o&&(t(o,{padding:0,height:0}),e(o.children[0],"coco-msg-fade-out"),n&&n(),setTimeout(function(){if(o){for(var t=!1,e=0;e<m.children.length;e++)m.children[e]===o&&(t=!0);t&&d(o),o=null,m.children.length||t&&d(m)}},300))}function l(){return{info:'\n <svg 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 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 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 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 d(o){oLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function d(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r<s;){const i=e.charAt(s-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.slice(0,s-r)}function x(e,t,n,s){const r=t.href,i=t.title?c(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){s.state.inLink=!0;const e={type:"link",raw:n,href:r,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,e}return{type:"image",raw:n,href:r,title:i,text:c(l)}}class b{options;rules;lexer;constructor(t){this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",Line truncated
|
||||
@@ -0,0 +1,684 @@
|
||||
function initArtalk(){
|
||||
var memosDom = document.querySelector(memosData.dom);
|
||||
var editIcon = "";
|
||||
var memosEditorCont = `
|
||||
<div class="memos-editor animate__animated animate__fadeIn d-none col-12">
|
||||
<div class="memos-editor-body mb-3 p-3">
|
||||
<div class="memos-editor-inner animate__animated animate__fadeIn">
|
||||
<div class="memos-editor-content">
|
||||
<textarea class="memos-editor-textarea text-sm" rows="1" placeholder="唠叨点什么..."></textarea>
|
||||
</div>
|
||||
<div id="memos-tag-menu"></div>
|
||||
<div class="memos-image-list d-flex flex-fill line-xl"></div>
|
||||
<div class="memos-editor-tools pt-3">
|
||||
<div class="d-flex">
|
||||
<div class="button outline action-btn image-btn mr-2" onclick="this.lastElementChild.click()">
|
||||
<img src="${static_url}js/memos/img/memos_img_up.svg">
|
||||
<input class="memos-upload-image-input d-none" type="file" accept="image/*">
|
||||
</div>
|
||||
<div class="button outline p-2 action-btn code-btn mr-2">
|
||||
<img src="${static_url}js/memos/img/memos_code.svg">
|
||||
</div>
|
||||
<div class="button outline action-btn code-single mr-2">
|
||||
<img src="${static_url}js/memos/img/memos-code-s.svg">
|
||||
</div>
|
||||
<div class="button outline action-btn mr-2 link-btn">
|
||||
<img src="${static_url}js/memos/img/memos_link.svg">
|
||||
</div>
|
||||
<div class="button outline action-btn mr-2 link-img">
|
||||
<img src="${static_url}js/memos/img/memos_img_quote.svg">
|
||||
</div>
|
||||
<div class="button outline action-btn biao-qing mr-2">
|
||||
<img src="${static_url}js/memos/img/memos-emoji.svg">
|
||||
</div>
|
||||
<div class="button outline action-btn p-2 switchUser-btn">
|
||||
<img src="${static_url}js/memos/img/memos_user.svg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-fill">
|
||||
<div class="memos-tag-list d-none mt-2 animate__animated animate__fadeIn"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="memos-editor-footer border-t pt-3 mt-3">
|
||||
<div class="editor-selector mr-2">
|
||||
<select class="select-memos-value outline px-2 py-1">
|
||||
<option value="PUBLIC">所有人可见</option>
|
||||
<option value="PROTECTED">仅登录可见</option>
|
||||
<option value="PRIVATE">仅自己可见</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="editor-submit d-flex flex-fill justify-content-end">
|
||||
<div class="edit-memos d-none">
|
||||
<div class="primary cancel-edit-btn mr-2 px-3 py-2">取消</div>
|
||||
<div class="primary edit-memos-btn px-3 py-2">修改完成</div>
|
||||
</div>
|
||||
<div class="primary submit-memos-btn px-3 py-1">唠叨一下</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="memos-editor-option animate__animated animate__fadeIn">
|
||||
<input name="memos-api-url" class="memos-open-api-input input-text flex-fill mr-3 px-2 py-1" type="text" value="" maxlength="120" placeholder="OpenAPI">
|
||||
<div class="memos-open-api-submit">
|
||||
<div class="primary submit-openapi-btn px-3 py-1">保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="memos-random d-none"></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
const element = document.querySelector('.intro'); // 选择器是你想要操作的元素的选择器
|
||||
element.insertAdjacentHTML('afterend', editIcon);
|
||||
memosDom.insertAdjacentHTML('afterbegin',memosEditorCont);
|
||||
|
||||
|
||||
var memosEditorInner = document.querySelector(".memos-editor-inner");
|
||||
var memosEditorOption = document.querySelector(".memos-editor-option");
|
||||
var memosRadomCont = document.querySelector(".memos-random");
|
||||
|
||||
var taglistBtn = document.querySelector(".tag-btn");
|
||||
var codeBtn = document.querySelector(".code-btn");
|
||||
var codesingle = document.querySelector(".code-single");
|
||||
var linkBtn = document.querySelector(".link-btn");
|
||||
var linkimg = document.querySelector(".link-img");
|
||||
var switchUserBtn = document.querySelector(".switchUser-btn");
|
||||
var loadEditorBtn = document.querySelector(".load-memos-editor");
|
||||
var submitApiBtn = document.querySelector(".submit-openapi-btn");
|
||||
var submitMemoBtn = document.querySelector(".submit-memos-btn");
|
||||
var memosVisibilitySelect = document.querySelector(".select-memos-value");
|
||||
var openApiInput = document.querySelector(".memos-open-api-input");
|
||||
var uploadImageInput = document.querySelector(".memos-upload-image-input");
|
||||
var memosTextarea = document.querySelector(".memos-editor-textarea");
|
||||
var editMemoDom = document.querySelector(".edit-memos");
|
||||
var editMemoBtn = document.querySelector(".edit-memos-btn");
|
||||
var cancelEditBtn = document.querySelector(".cancel-edit-btn");
|
||||
var biaoqing = document.querySelector(".biao-qing");
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
getEditIcon();
|
||||
});
|
||||
|
||||
function getEditIcon() {
|
||||
var memosContent = '',memosVisibility = '',memosResource = [],memosRelation=[];
|
||||
var memosCount = window.localStorage && window.localStorage.getItem("memos-response-count");
|
||||
var memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
var memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
var getEditor = window.localStorage && window.localStorage.getItem("memos-editor-display");
|
||||
var isHide = getEditor === "hide";
|
||||
window.localStorage && window.localStorage.setItem("memos-resource-list", JSON.stringify(memosResource));
|
||||
window.localStorage && window.localStorage.setItem("memos-relation-list", JSON.stringify(memosRelation));
|
||||
memosTextarea.addEventListener('input', (e) => {
|
||||
memosTextarea.style.height = 'inherit';
|
||||
memosTextarea.style.height = e.target.scrollHeight + 'px';
|
||||
});
|
||||
|
||||
if (getEditor !== null) {
|
||||
document.querySelector(".memos-editor").classList.toggle("d-none",isHide);
|
||||
getEditor == "show" ? hasMemosOpenId() : ''
|
||||
};
|
||||
|
||||
loadEditorBtn.addEventListener("click", function () {
|
||||
if (typeof getEditor !== "function") {
|
||||
if (getEditor != "show") {
|
||||
hasMemosOpenId();
|
||||
}
|
||||
}
|
||||
document.querySelector(".memos-editor").classList.toggle("d-none");
|
||||
if (window.localStorage) {
|
||||
window.localStorage.setItem("memos-editor-display", document.querySelector(".memos-editor").classList.contains("d-none") ? "hide" : "show");
|
||||
getEditor = window.localStorage.getItem("memos-editor-display");
|
||||
}
|
||||
});
|
||||
|
||||
//标签数据
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
document.querySelector(".memos-tag-list").classList.remove("d-none");
|
||||
}
|
||||
});
|
||||
|
||||
codeBtn.addEventListener("click", function() {
|
||||
const memosPath = window.localStorage?.getItem("memos-access-path");
|
||||
const memosOpenId = window.localStorage?.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
const memoCode = '```\n\n```';
|
||||
const textareaValue = memosTextarea.value;
|
||||
const lastBacktickIndex = textareaValue.lastIndexOf('```');
|
||||
const caretPos = lastBacktickIndex !== -1 ? lastBacktickIndex : textareaValue.length; // 将光标定位到最后一个 ``` 的位置
|
||||
memosTextarea.value = textareaValue.substring(0, caretPos) + memoCode;
|
||||
memosTextarea.style.height = memosTextarea.scrollHeight + 'px';
|
||||
memosTextarea.setSelectionRange(caretPos + 4, caretPos + 4); // 将光标定位到 ``` 中间
|
||||
memosTextarea.focus();
|
||||
}
|
||||
});
|
||||
|
||||
//代码单反引号
|
||||
codesingle.addEventListener("click", function() {
|
||||
const memosPath = window.localStorage?.getItem("memos-access-path");
|
||||
const memosOpenId = window.localStorage?.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
const memoCode = '`'; // 行内代码的起始和结束标记为单个反引号
|
||||
const textareaValue = memosTextarea.value;
|
||||
const selectionStart = memosTextarea.selectionStart;
|
||||
const selectionEnd = memosTextarea.selectionEnd;
|
||||
const selectedText = textareaValue.substring(selectionStart, selectionEnd);
|
||||
const insertCode = `${memoCode}${selectedText}${memoCode}`;
|
||||
const caretPos = selectionStart !== selectionEnd ? selectionEnd + memoCode.length * 2 : selectionStart + memoCode.length;
|
||||
|
||||
memosTextarea.setRangeText(
|
||||
insertCode,
|
||||
selectionStart,
|
||||
selectionEnd,
|
||||
"end"
|
||||
);
|
||||
// 根据是否有选中内容,决定光标位置
|
||||
memosTextarea.setSelectionRange(caretPos, caretPos);
|
||||
|
||||
memosTextarea.style.height = memosTextarea.scrollHeight + 'px';
|
||||
memosTextarea.focus();
|
||||
}
|
||||
});
|
||||
|
||||
linkBtn.addEventListener("click", function() {
|
||||
const memosPath = window.localStorage?.getItem("memos-access-path");
|
||||
const memosOpenId = window.localStorage?.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
const memoLink = '[]()';
|
||||
const selectedText = memosTextarea.value.substring(memosTextarea.selectionStart, memosTextarea.selectionEnd);
|
||||
let caretPos;
|
||||
|
||||
if (selectedText) {
|
||||
// 如果有选中的文本,则插入到 [] 中
|
||||
const startText = memosTextarea.value.substring(0, memosTextarea.selectionStart);
|
||||
const endText = memosTextarea.value.substring(memosTextarea.selectionEnd);
|
||||
caretPos = startText.length + '['.length + selectedText.length + ']'.length + 1;
|
||||
memosTextarea.value = startText + '[' + selectedText + ']' + memoLink.substring(2) + endText;
|
||||
} else {
|
||||
// 如果没有选中文本,则将光标定位在 ()
|
||||
const startText = memosTextarea.value.substring(0, memosTextarea.selectionStart);
|
||||
const endText = memosTextarea.value.substring(memosTextarea.selectionEnd);
|
||||
caretPos = startText.length + memoLink.indexOf("()") + 1;
|
||||
memosTextarea.value = startText + memoLink + endText;
|
||||
}
|
||||
|
||||
memosTextarea.setSelectionRange(caretPos, caretPos);
|
||||
memosTextarea.focus();
|
||||
}
|
||||
});
|
||||
|
||||
linkimg.addEventListener("click", function() {
|
||||
const memosPath = window.localStorage?.getItem("memos-access-path");
|
||||
const memosOpenId = window.localStorage?.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
const memoLink = '![]()';
|
||||
const caretPos = memosTextarea.selectionStart + memoLink.indexOf("()") + 1;
|
||||
memosTextarea.value = memosTextarea.value.substring(0, memosTextarea.selectionStart) + memoLink + memosTextarea.value.substring(memosTextarea.selectionEnd);
|
||||
memosTextarea.setSelectionRange(caretPos, caretPos);
|
||||
memosTextarea.focus();
|
||||
}
|
||||
});
|
||||
|
||||
uploadImageInput.addEventListener('change', () => {
|
||||
memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
let filesData = uploadImageInput.files[0];
|
||||
if (uploadImageInput.files.length !== 0){
|
||||
uploadImage(filesData);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
async function uploadImage(data) {
|
||||
const imageData = new FormData();
|
||||
const blobUrl = memosPath+"/api/v1/resource/blob?openId="+memosOpenId;
|
||||
imageData.append('file', data, data.name)
|
||||
const resp = await fetch(blobUrl, {
|
||||
method: "POST",
|
||||
body: imageData
|
||||
})
|
||||
const res = await resp.json().then(res => {
|
||||
if(res.id){
|
||||
let imageList = "";
|
||||
imageList += '<div data-id="'+res.id+'" class="memos-img-edit d-flex text-xs mt-2 mr-2" onclick="deleteImage(this)"><div class="d-flex px-2 justify-content-center">'+res.filename+'</div></div>'
|
||||
document.querySelector(".memos-image-list").insertAdjacentHTML('afterbegin', imageList);
|
||||
cocoMessage.success(
|
||||
'上传成功',
|
||||
()=>{
|
||||
memosResource.push(res.id);
|
||||
window.localStorage && window.localStorage.setItem("memos-resource-list", JSON.stringify(memosResource));
|
||||
})
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
switchUserBtn.addEventListener("click", function () {
|
||||
memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
if (memosPath && memosOpenId) {
|
||||
memosEditorOption.classList.remove("d-none");
|
||||
memosEditorInner.classList.add("d-none");
|
||||
memosRadomCont.innerHTML = '';
|
||||
openApiInput.value = '';
|
||||
}
|
||||
});
|
||||
|
||||
submitApiBtn.addEventListener("click", function () {
|
||||
if(openApiInput.value == null || openApiInput.value == ''){
|
||||
cocoMessage.info('内容不能为空');
|
||||
}else{
|
||||
getMemosData(openApiInput.value);
|
||||
}
|
||||
});
|
||||
|
||||
submitMemoBtn.addEventListener("click", function () {
|
||||
memosContent = memosTextarea.value;
|
||||
memosVisibility = memosVisibilitySelect.value;
|
||||
memosResource = window.localStorage && JSON.parse(window.localStorage.getItem("memos-resource-list"));
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
let TAG_REG = /(?<=#)([^#\s!.,;:?"'()]+)(?= )/g;
|
||||
let memosTag = memosContent.match(TAG_REG);
|
||||
let hasContent = memosContent.length !== 0;
|
||||
if (memosOpenId && hasContent) {
|
||||
let memoUrl = memosPath+"/api/v1/memo?openId="+memosOpenId;
|
||||
let memoBody = {content:memosContent,relationList:memosRelation,resourceIdList:memosResource,visibility:memosVisibility}
|
||||
fetch(memoUrl, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(memoBody),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function (res) {
|
||||
if (res.status == 200) {
|
||||
if (memosTag !== null) {
|
||||
const memoTagUrl = memosPath + "/api/v1/tag?openId=" + memosOpenId;
|
||||
(async () => {
|
||||
for await (const i of memosTag) {
|
||||
const response = await fetch(memoTagUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
name: i
|
||||
})
|
||||
});
|
||||
}
|
||||
})();
|
||||
}
|
||||
cocoMessage.success(
|
||||
'唠叨成功',
|
||||
() => {
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
}else if(!hasContent){
|
||||
cocoMessage.info('内容不能为空');
|
||||
}else{
|
||||
cocoMessage.info(
|
||||
'请设置 Memos Open API',
|
||||
() => {
|
||||
memosEditorInner.classList.add("d-none");
|
||||
memosEditorOption.classList.remove("d-none");
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
function hasMemosOpenId() {
|
||||
if (!memosOpenId) {
|
||||
memosEditorInner.classList.add("d-none");
|
||||
cocoMessage.info('请设置 Memos Open API');
|
||||
}else{
|
||||
memosEditorOption.classList.add("d-none");
|
||||
// cocoMessage.success('准备就绪');
|
||||
let tagUrl = memosPath+"/api/v1/tag?openId="+memosOpenId;
|
||||
let response = fetch(tagUrl).then(response => response.json()).then(resdata => {
|
||||
return resdata
|
||||
}).then(response => {
|
||||
let taglist = "";
|
||||
response.map((t)=>{
|
||||
taglist += '<div class="memos-tag d-flex text-xs mt-2 mr-2"><a class="d-flex px-2 justify-content-center" onclick="setMemoTag(this)">#'+t+'</a></div>'
|
||||
})
|
||||
document.querySelector(".memos-tag-list").innerHTML = taglist;
|
||||
memosRadomCont.classList.remove("d-none");
|
||||
}).catch(err => cocoMessage.error('Memos Open API 有误,请重新输入!'));
|
||||
}
|
||||
}
|
||||
|
||||
function random(a,b) {
|
||||
var choices = b - a + 1;
|
||||
return Math.floor(Math.random() * choices + a);
|
||||
}
|
||||
|
||||
function getMemosData(e) {
|
||||
let apiReg = /openId=([^&]*)/,urlReg = /(.+?)(?:\/api)/;
|
||||
fetch(e).then(res => {
|
||||
if (res.status == 200) {
|
||||
return res.json()
|
||||
}else{
|
||||
cocoMessage.error('出错了,再检查一下吧!')
|
||||
}
|
||||
}).then(resdata => {
|
||||
if(typeof(resdata) !== "undefined"){
|
||||
let apiRes = e.match(apiReg),urlRes = e.match(urlReg)[1];
|
||||
memosOpenId = apiRes[1];
|
||||
memosPath = urlRes;
|
||||
memosCount = resdata.length;
|
||||
window.localStorage && window.localStorage.setItem("memos-access-path", urlRes);
|
||||
window.localStorage && window.localStorage.setItem("memos-access-token", memosOpenId);
|
||||
window.localStorage && window.localStorage.setItem("memos-response-count", memosCount);
|
||||
cocoMessage.success(
|
||||
'保存成功',
|
||||
()=>{
|
||||
memosEditorOption.classList.add("d-none");
|
||||
memosEditorInner.classList.remove("d-none");
|
||||
memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
hasMemosOpenId();
|
||||
})
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
//发布框 TAG
|
||||
function setMemoTag(e){
|
||||
let memoTag = e.textContent + " ";
|
||||
memosTextarea.value += memoTag;
|
||||
}
|
||||
|
||||
function deleteImage(e){
|
||||
if(e){
|
||||
let memoId = e.getAttribute("data-id")
|
||||
let memosResource = window.localStorage && JSON.parse(window.localStorage.getItem("memos-resource-list"));
|
||||
let memosResourceList = memosResource.filter(function(item){ return item != memoId});
|
||||
window.localStorage && window.localStorage.setItem("memos-resource-list", JSON.stringify(memosResourceList));
|
||||
e.remove()
|
||||
}
|
||||
}
|
||||
|
||||
//增加memos编辑功能
|
||||
function editMemo(e) {
|
||||
var memoContent = e.content,memoId = e.id,memoRelationList = e.relationList,memoResourceList = e.resourceList,memoVisibility = e.visibility;
|
||||
getEditor = window.localStorage && window.localStorage.getItem("memos-editor-display"),
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
if(memosOpenId && getEditor == "show"){
|
||||
memosTextarea.value = memoContent;
|
||||
memosTextarea.style.height = memosTextarea.scrollHeight + 'px';
|
||||
submitMemoBtn.classList.add("d-none");
|
||||
editMemoDom.classList.remove("d-none");
|
||||
document.body.scrollIntoView({behavior: 'smooth'});
|
||||
}
|
||||
editMemoBtn.addEventListener("click", function () {
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token"),
|
||||
memoContent = memosTextarea.value;
|
||||
memoResourceList = window.localStorage && JSON.parse(window.localStorage.getItem("memos-resource-list")) ? window.localStorage && JSON.parse(window.localStorage.getItem("memos-resource-list")) : e.resourceList,
|
||||
memoVisibility = memosVisibilitySelect.value;
|
||||
let TAG_REG = /(?<=#)([^#\s!.,;:?"'()]+)(?= )/g;
|
||||
let memosTag = memoContent.match(TAG_REG);
|
||||
let hasContent = memoContent.length !== 0;
|
||||
if (hasContent) {
|
||||
var memoUrl = memosPath+"/api/v1/memo/"+memoId+"?openId="+memosOpenId;
|
||||
var memoBody = {content:memoContent,id:memoId,relationList:memoRelationList,resourceList:memoResourceList,visibility:memoVisibility}
|
||||
fetch(memoUrl, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(memoBody),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(res) {
|
||||
if (res.status == 200) {
|
||||
if (memosTag !== null) {
|
||||
const memoTagUrl = memosPath + "/api/v1/tag?openId=" + memosOpenId;
|
||||
(async () => {
|
||||
for await (const i of memosTag) {
|
||||
const response = await fetch(memoTagUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
name: i
|
||||
})
|
||||
});
|
||||
}
|
||||
})();
|
||||
}
|
||||
cocoMessage.success(
|
||||
'修改成功',
|
||||
()=>{
|
||||
submitMemoBtn.classList.remove("d-none");
|
||||
editMemoDom.classList.add("d-none");
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//增加memo编辑的时候取消功能
|
||||
cancelEditBtn.addEventListener("click", function () {
|
||||
if (!editMemoDom.classList.contains("d-none")) {
|
||||
memosTextarea.value = '';
|
||||
memosTextarea.style.height = 'inherit';
|
||||
editMemoDom.classList.add("d-none");
|
||||
submitMemoBtn.classList.remove("d-none");
|
||||
}
|
||||
})
|
||||
|
||||
//增加memos归档功能
|
||||
function archiveMemo(memoId) { //获取Memos的ID值
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token"); //登录信息
|
||||
if(memosOpenId && memoId){ //判断是否登录以及获取到Memos的ID值
|
||||
var memoUrl = memosPath+"/api/v1/memo/"+memoId+"?openId="+memosOpenId;
|
||||
var memoBody = {id:memoId,rowStatus:"ARCHIVED"};
|
||||
fetch(memoUrl, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(memoBody),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(res) {
|
||||
if (res.status == 200) {
|
||||
cocoMessage.success(
|
||||
'归档成功',
|
||||
()=>{
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//增加memo删除功能
|
||||
function deleteMemo(memoId) {
|
||||
memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
if(memosOpenId && memoId){
|
||||
var memoUrl = memosPath+"/api/v1/memo/"+memoId+"?openId="+memosOpenId;
|
||||
fetch(memoUrl, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(function(res) {
|
||||
if (res.status == 200) {
|
||||
cocoMessage.success(
|
||||
'删除成功',
|
||||
()=>{
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
cocoMessage.error('出错了,再检查一下吧')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Emoji表情选择
|
||||
|
||||
let emojiSelectorVisible = false;
|
||||
let emojiSelector;
|
||||
let emojis = []; // 缓存表情数据
|
||||
|
||||
// 页面加载时获取表情数据
|
||||
window.addEventListener("DOMContentLoaded", async () => {
|
||||
try {
|
||||
emojis = await getEmojisData(); // 获取表情数据
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch emojis data:', error);
|
||||
}
|
||||
});
|
||||
|
||||
// 表情选择器点击事件处理
|
||||
biaoqing.addEventListener("click", function (event) {
|
||||
event.stopPropagation();
|
||||
emojiSelectorVisible = !emojiSelectorVisible;
|
||||
const memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
const memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
|
||||
if (emojiSelectorVisible && memosPath && memosOpenId) {
|
||||
displayEmojiSelector();
|
||||
} else {
|
||||
emojiSelector?.remove();
|
||||
}
|
||||
});
|
||||
|
||||
// 显示表情选择器
|
||||
function displayEmojiSelector() {
|
||||
if (!emojiSelector) {
|
||||
emojiSelector = document.createElement('div');
|
||||
emojiSelector.classList.add('emoji-selector');
|
||||
|
||||
// 使用事件代理,将事件监听器添加到父元素上
|
||||
emojiSelector.addEventListener('click', (event) => {
|
||||
const target = event.target;
|
||||
if (target.classList.contains('emoji-item')) {
|
||||
insertEmoji(target.innerHTML); // 直接插入emoji图标
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
emojiSelector.innerHTML = ''; // 清空表情选择器内容
|
||||
|
||||
emojis.forEach(emoji => {
|
||||
const emojiItem = document.createElement('div');
|
||||
emojiItem.classList.add('emoji-item');
|
||||
emojiItem.innerHTML = emoji.icon;
|
||||
emojiItem.title = emoji.text;
|
||||
emojiSelector.appendChild(emojiItem);
|
||||
});
|
||||
|
||||
// 将表情下拉框插入到对应位置
|
||||
const memosEditorTools = document.querySelector(".memos-editor-tools");
|
||||
if (memosEditorTools) {
|
||||
memosEditorTools.insertAdjacentElement('afterend', emojiSelector);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取json文件中的数据
|
||||
async function getEmojisData() {
|
||||
const response = await fetch('/memos/owo.json');
|
||||
const data = await response.json();
|
||||
return data.Emoji.container;
|
||||
}
|
||||
|
||||
// 表情光标位置
|
||||
function insertEmoji(emojiText) {
|
||||
const selectionStart = memosTextarea.selectionStart;
|
||||
const newValue = `${memosTextarea.value.substring(0, selectionStart)}${emojiText}${memosTextarea.value.substring(memosTextarea.selectionEnd)}`;
|
||||
memosTextarea.value = newValue;
|
||||
memosTextarea.dispatchEvent(new Event('input'));
|
||||
const newCursorPosition = selectionStart + emojiText.length;
|
||||
memosTextarea.setSelectionRange(newCursorPosition, newCursorPosition);
|
||||
memosTextarea.focus();
|
||||
}
|
||||
|
||||
|
||||
// 标签自动补全
|
||||
|
||||
const tagListElement = document.querySelector('.memos-tag-list');
|
||||
const tagMenu = document.getElementById('memos-tag-menu');
|
||||
let selectedTagIndex = -1;
|
||||
|
||||
const getMatchingTags = (tagPrefix) => {
|
||||
const allTags = Array.from(tagListElement.querySelectorAll('.memos-tag a')).map(tagLink => tagLink.textContent);
|
||||
return allTags.filter(tag => tag.toLowerCase().includes(tagPrefix.toLowerCase()));
|
||||
};
|
||||
|
||||
const hideTagMenu = () => tagMenu.style.display = 'none';
|
||||
|
||||
const showTagMenu = (matchingTags) => {
|
||||
tagMenu.innerHTML = matchingTags.map(tag => `<div class="tag-option">${tag}</div>`).join('');
|
||||
const { left, bottom } = memosTextarea.getBoundingClientRect();
|
||||
tagMenu.style.cssText = `display: block;`;
|
||||
selectedTagIndex = -1;
|
||||
};
|
||||
|
||||
const insertSelectedTag = (tag) => {
|
||||
const inputValue = memosTextarea.value;
|
||||
const cursorPosition = memosTextarea.selectionStart;
|
||||
|
||||
const textBeforeCursor = inputValue.substring(0, cursorPosition);
|
||||
const wordsBeforeCursor = textBeforeCursor.split(/\s+/);
|
||||
wordsBeforeCursor.pop();
|
||||
const newValue = `${wordsBeforeCursor.join(' ')} ${tag} ${inputValue.substring(cursorPosition)}`;
|
||||
|
||||
memosTextarea.value = newValue;
|
||||
|
||||
const newCursorPosition = newValue.lastIndexOf(tag) + tag.length + 1;
|
||||
|
||||
hideTagMenu();
|
||||
selectedTagIndex = -1;
|
||||
|
||||
memosTextarea.focus();
|
||||
memosTextarea.setSelectionRange(newCursorPosition, newCursorPosition);
|
||||
};
|
||||
|
||||
memosTextarea.addEventListener('input', () => {
|
||||
const inputValue = memosTextarea.value;
|
||||
const cursorPosition = memosTextarea.selectionStart;
|
||||
|
||||
const lastWord = inputValue.substring(0, cursorPosition).split(/\s+/).pop();
|
||||
|
||||
if (lastWord && lastWord.includes('#')) {
|
||||
const matchingTags = getMatchingTags(lastWord);
|
||||
matchingTags.length > 0 ? showTagMenu(matchingTags) : hideTagMenu();
|
||||
} else {
|
||||
hideTagMenu();
|
||||
}
|
||||
});
|
||||
|
||||
memosTextarea.addEventListener('keydown', event => {
|
||||
const keyCode = event.keyCode;
|
||||
|
||||
if (tagMenu.style.display === 'block') {
|
||||
const matchingTags = Array.from(tagMenu.querySelectorAll('.tag-option')).map(tag => tag.textContent);
|
||||
|
||||
if (keyCode === 38 || keyCode === 40 || keyCode === 37 || keyCode === 39) { // 添加左右方向键的处理
|
||||
event.preventDefault();
|
||||
if (keyCode === 37 || keyCode === 39) { // 处理左右方向键
|
||||
const direction = keyCode === 37 ? -1 : 1;
|
||||
selectedTagIndex = (selectedTagIndex + direction + matchingTags.length) % matchingTags.length;
|
||||
} else { // 处理上下方向键
|
||||
selectedTagIndex = (selectedTagIndex + (keyCode === 38 ? -1 : 1) + matchingTags.length) % matchingTags.length;
|
||||
}
|
||||
Array.from(tagMenu.querySelectorAll('.tag-option')).forEach((option, index) => option.classList.toggle('selected', index === selectedTagIndex));
|
||||
} else if (keyCode === 13 && selectedTagIndex !== -1) {
|
||||
event.preventDefault();
|
||||
insertSelectedTag(matchingTags[selectedTagIndex]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tagMenu.addEventListener('click', event => {
|
||||
insertSelectedTag(event.target.textContent);
|
||||
});
|
||||
|
||||
}
|
||||
initArtalk()
|
||||
@@ -0,0 +1,417 @@
|
||||
|
||||
var hasLogin = 0 //没登录隐藏编辑归档按钮
|
||||
|
||||
var memosData = {
|
||||
dom:'#memos',
|
||||
}
|
||||
|
||||
var bbMemo = {
|
||||
memos: 'https://memos.koobai.com/',
|
||||
limit: '15',
|
||||
creatorId: '101',
|
||||
domId: '#bber',
|
||||
};
|
||||
if(typeof(bbMemos) !=="undefined"){
|
||||
for(var key in bbMemos) {
|
||||
if(bbMemos[key]){
|
||||
bbMemo[key] = bbMemos[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
function loadCssCode(code){
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.rel = 'stylesheet';
|
||||
style.appendChild(document.createTextNode(code));
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
head.appendChild(style);
|
||||
}
|
||||
|
||||
var limit = bbMemo.limit
|
||||
var memos = bbMemo.memos
|
||||
var mePage = 1,offset = 0,nextLength = 0,nextDom='';
|
||||
var bbDom = document.querySelector(bbMemo.domId);
|
||||
var load = '<div class="bb-load"><button class="load-btn button-load">加载中……</button></div>'
|
||||
// 增加memos编辑及归档
|
||||
var memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
var memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
var getEditor = window.localStorage && window.localStorage.getItem("memos-editor-display");
|
||||
|
||||
if(bbDom){
|
||||
getFirstList() //首次加载数据
|
||||
// meNums() //加载总数
|
||||
var btn = document.querySelector("button.button-load");
|
||||
btn.addEventListener("click", function () {
|
||||
btn.textContent= '加载中……';
|
||||
updateHTMl(nextDom)
|
||||
if(nextLength < limit){ //返回数据条数小于限制条数,隐藏
|
||||
document.querySelector("button.button-load").remove()
|
||||
return
|
||||
}
|
||||
getNextList()
|
||||
});
|
||||
}
|
||||
function initCircle(){
|
||||
var limit = bbMemo.limit
|
||||
var memos = bbMemo.memos
|
||||
var mePage = 1,offset = 0,nextLength = 0,nextDom='';
|
||||
var bbDom = document.querySelector(bbMemo.domId);
|
||||
var load = '<div class="bb-load"><button class="load-btn button-load">加载中……</button></div>'
|
||||
// 增加memos编辑及归档
|
||||
var memosOpenId = window.localStorage && window.localStorage.getItem("memos-access-token");
|
||||
var memosPath = window.localStorage && window.localStorage.getItem("memos-access-path");
|
||||
var getEditor = window.localStorage && window.localStorage.getItem("memos-editor-display");
|
||||
|
||||
if(bbDom){
|
||||
getFirstList() //首次加载数据
|
||||
// meNums() //加载总数
|
||||
var btn = document.querySelector("button.button-load");
|
||||
btn.addEventListener("click", function () {
|
||||
btn.textContent= '加载中……';
|
||||
updateHTMl(nextDom)
|
||||
if(nextLength < limit){ //返回数据条数小于限制条数,隐藏
|
||||
document.querySelector("button.button-load").remove()
|
||||
return
|
||||
}
|
||||
getNextList()
|
||||
});
|
||||
}
|
||||
}
|
||||
function getFirstList(){
|
||||
bbDom.insertAdjacentHTML('afterend', load);
|
||||
let tagHtml = `<div class="memos-search-all img-hide">
|
||||
<div class="memos-search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-auto opacity-30 dark:text-gray-200"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>
|
||||
<input type="text" id="memos-search-input" placeholder="输入关键词,搜索博主的动态..." onkeydown="searchMemoevent(event)">
|
||||
</div>
|
||||
<div id="tag-list-all"></div>
|
||||
</div>
|
||||
<div id="tag-list"></div>` // TAG筛选 memos搜索
|
||||
bbDom.insertAdjacentHTML('beforebegin', tagHtml); // TAG筛选
|
||||
showTaglist(); // 显示所有 TAG
|
||||
var bbUrl = memos+"api/v1/memo?creatorId="+bbMemo.creatorId+"&rowStatus=NORMAL&limit="+limit;
|
||||
fetch(bbUrl).then(res => res.json()).then( resdata =>{
|
||||
updateHTMl(resdata);
|
||||
var nowLength = resdata.length;
|
||||
if(nowLength < limit){ //返回数据条数小于 limit 则直接移除“加载更多”按钮,中断预加载
|
||||
document.querySelector("button.button-load").remove()
|
||||
return
|
||||
}
|
||||
mePage++
|
||||
offset = limit*(mePage-1)
|
||||
getNextList()
|
||||
});
|
||||
}
|
||||
//预加载下一页数据
|
||||
function getNextList(){
|
||||
var bbUrl = memos+"api/v1/memo?creatorId="+bbMemo.creatorId+"&rowStatus=NORMAL&limit="+limit+"&offset="+offset;
|
||||
fetch(bbUrl).then(res => res.json()).then( resdata =>{
|
||||
nextDom = resdata;
|
||||
nextLength = nextDom.length
|
||||
mePage++
|
||||
offset = limit*(mePage-1)
|
||||
if(nextLength < 1){ //返回数据条数为 0 ,隐藏
|
||||
document.querySelector("button.button-load").remove()
|
||||
return
|
||||
}
|
||||
//在未展开评论时,默认显示评论数
|
||||
Artalk.loadCountWidget({
|
||||
server: 'https://artalk.usj.cc/',
|
||||
site: '优世界',
|
||||
countEl: '#ArtalkCount'
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
//加载总 Memos 数
|
||||
function meNums() {
|
||||
var bbLoad = document.querySelector('.bb-load');
|
||||
var bbUrl = memos + "api/v1/memo/stats?creatorId=" + bbMemo.creatorId;
|
||||
fetch(bbUrl).then(res => res.json()).then(resdata => {
|
||||
if (Array.isArray(resdata)) {
|
||||
var allnums = ' 博主共发布了 ' + resdata.length + ' 条动态🎉 ';
|
||||
bbLoad.insertAdjacentHTML('afterend', allnums);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 插入 html
|
||||
function updateHTMl(data){
|
||||
var result="",resultAll="";
|
||||
//登录显示编辑归档按钮
|
||||
if(memosOpenId && getEditor == "show"){
|
||||
hasLogin = 1
|
||||
}
|
||||
const TAG_REG = /#([^#\s!.,;:?"'()]+)(?= )/g
|
||||
, IMG_REG = /\!\[(.*?)\]\((.*?)\)/g //content 内 md 格式图片
|
||||
, LINK_REG = /\[(.*?)\]\((.*?)\)/g //链接新窗口打开
|
||||
marked.setOptions({
|
||||
breaks: false,
|
||||
smartypants: false,
|
||||
langPrefix: 'language-',
|
||||
headerIds: false,
|
||||
mangle: false
|
||||
});
|
||||
for(var i=0;i < data.length;i++){
|
||||
var memo_id = data[i].id; //评论调用
|
||||
var bbContREG = data[i].content
|
||||
.replace(TAG_REG, "")
|
||||
.replace(IMG_REG, '')
|
||||
.replace(LINK_REG, '<a href="$2" target="_blank">$1</a>')
|
||||
bbContREG = marked.parse(bbContREG)
|
||||
|
||||
//解析 content 内 md 格式图片
|
||||
var IMG_ARR = data[i].content.match(IMG_REG) || '',IMG_ARR_Grid='';
|
||||
if(IMG_ARR){
|
||||
var IMG_ARR_Length = IMG_ARR.length,IMG_ARR_Url = '';
|
||||
if(IMG_ARR_Length !== 1){var IMG_ARR_Grid = " grid grid-"+IMG_ARR_Length}
|
||||
IMG_ARR.forEach(item => {
|
||||
let imgSrc = item.replace(/!\[.*?\]\((.*?)\)/g,'$1')
|
||||
IMG_ARR_Url += '<figure class="gallery-thumbnail"><img loading="lazy" decoding="async" class="img thumbnail-image lazyload" loading="lazy" decoding="async" data-lazy-src="'+imgSrc+'" src="'+imgSrc+'"/></figure>'
|
||||
});
|
||||
bbContREG += '<div class="resimg'+IMG_ARR_Grid+'" uk-scrollspy="target: > img; cls: uk-animation-fade; delay: 600">'+IMG_ARR_Url+'</div>';
|
||||
}
|
||||
//TAG 解析
|
||||
var tagArr = data[i].content.match(TAG_REG);
|
||||
var memosTag = '';
|
||||
|
||||
if (tagArr) {
|
||||
memosTag = tagArr.map(function(tag) {
|
||||
var tagText = String(tag).replace(/[#]/g, '');
|
||||
return '<div class="memos-tag-dg" onclick="getTagNow(this)"># ' + tagText + '</div>';
|
||||
}).join('');
|
||||
} else {
|
||||
memosTag = '<div class="memos-tag-dg">#生活日常</div>';
|
||||
}
|
||||
|
||||
//解析内置资源文件
|
||||
if(data[i].resourceList && data[i].resourceList.length > 0){
|
||||
var resourceList = data[i].resourceList;
|
||||
var imgUrl='',resUrl='',resImgLength = 0;
|
||||
for(var j=0;j < resourceList.length;j++){
|
||||
var restype = resourceList[j].type.slice(0,5)
|
||||
var resexlink = resourceList[j].externalLink
|
||||
var resLink = '',fileId=''
|
||||
if(resexlink){
|
||||
resLink = resexlink
|
||||
}else{
|
||||
fileId = resourceList[j].publicId || resourceList[j].filename
|
||||
resLink = memos+'o/r/'+resourceList[j].id+'/'+fileId
|
||||
}
|
||||
if(restype == 'image'){
|
||||
imgUrl += '<figure class="gallery-thumbnail"><img loading="lazy" decoding="async" class="img thumbnail-image" src="'+resLink+'"/></figure>'
|
||||
resImgLength = resImgLength + 1
|
||||
}
|
||||
if(restype !== 'image'){
|
||||
resUrl += '<a target="_blank" rel="noreferrer" href="'+resLink+'">'+resourceList[j].filename+'</a>'
|
||||
}
|
||||
}
|
||||
if(imgUrl){
|
||||
var resImgGrid = ""
|
||||
if(resImgLength !== 1){var resImgGrid = "grid grid-"+resImgLength}
|
||||
bbContREG += '<div class="resimg '+resImgGrid+'">'+imgUrl+'</div></div>'
|
||||
}
|
||||
if(resUrl){
|
||||
bbContREG += '<p class="datasource">'+resUrl+'</p>'
|
||||
}
|
||||
}
|
||||
result += `
|
||||
<li class="bb-list-li img-hide" id="${memo_id}">
|
||||
<div class="memos-pl">
|
||||
<div class="memos_diaoyong_time">${moment(data[i].createdTs * 1000).twitterLong()}</div>
|
||||
${hasLogin == 0 ? '' : `
|
||||
<div class="memos-edit">
|
||||
<div class="memos-menu">...</div>
|
||||
<div class="memos-menu-d">
|
||||
<div class="edit-btn" onclick="editMemo(${JSON.stringify(data[i]).replace(/"/g, '"')})">修改</div>
|
||||
<div class="archive-btn" onclick="archiveMemo('${data[i].id}')">归档</div>
|
||||
<div class="delete-btn" onclick="deleteMemo('${data[i].id}')">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
`}
|
||||
</div>
|
||||
<div class="memos-tag-wz">${memosTag}</div>
|
||||
<div class="datacont" view-image>${bbContREG}</div>
|
||||
<div class="memos_diaoyong_top">
|
||||
<div class="memos-zan"><emoji-reaction class="reactions" reactTargetId="/m/${memo_id}" theme="system" endpoint="https://e.52ql.cn" availableArrayString="👍,thumbs-up;🎉,party-popper;❤️,red-heart;"></emoji-reaction></div>
|
||||
<div class="talks_comments">
|
||||
<a onclick="loadArtalk('${memo_id}')">
|
||||
<span id="ArtalkCount" data-page-key="/m/${memo_id}" class="comment-s"></span> 条评论 <span id="btn_memo_${memo_id}">
|
||||
<svg width="6px" height="12px" viewBox="0 0 6 12" version="1.1" xmlns="http://www.w3.org/2000/svg"><g><path d="M0.211503518,0.218577027 C0.493508208,-0.072859009 0.95072815,-0.072859009 1.23273284,0.218577027 L5.41780916,4.54361875 C6.19406361,5.34583421 6.19406361,6.65416579 5.41780916,7.45638125 L1.23273284,11.781423 C0.95072815,12.072859 0.493508208,12.072859 0.211503518,11.781423 C-0.0705011726,11.4899869 -0.0705011726,11.0174758 0.211503518,10.7260397 L4.39657984,6.400998 C4.60882491,6.18165462 4.60882491,5.81834538 4.39657984,5.599002 L0.211503518,1.27396027 C-0.0705011726,0.982524238 -0.0705011726,0.510013063 0.211503518,0.218577027 Z"></path></g></svg>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="memo_${memo_id}" class="artalk hidden"></div>
|
||||
</li>`;
|
||||
} // end for
|
||||
|
||||
var bbBefore = "<section class='bb-timeline'><ul class='bb-list-ul' uk-scrollspy='target: > li; cls: uk-animation-fade; delay: 500'>";
|
||||
var bbAfter = "</ul></section>";
|
||||
resultAll = bbBefore + result + bbAfter;
|
||||
bbDom.insertAdjacentHTML('beforeend', resultAll);
|
||||
|
||||
// animateSummaries(); // 在DOM加载完毕后执行滑动加载动画
|
||||
|
||||
if(document.querySelector('button.button-load')) document.querySelector('button.button-load').textContent = '看更多 ...';
|
||||
// 延时加载评论数方法
|
||||
setTimeout(function() {
|
||||
Artalk.loadCountWidget({
|
||||
server: 'https://artalk.usj.cc/',
|
||||
site: '优世界',
|
||||
countEl: '#ArtalkCount'
|
||||
});
|
||||
}, 1000); // 延迟3000毫秒(也就是3秒)执行
|
||||
}
|
||||
|
||||
// TAG 筛选
|
||||
function getTagNow(e){
|
||||
//console.log(e.innerHTML)
|
||||
let tagName = e.innerHTML.replace('# ','')
|
||||
let domClass = document.getElementById("bber")
|
||||
window.scrollTo({
|
||||
top: domClass.offsetTop - 30,
|
||||
behavior: "smooth"
|
||||
});
|
||||
let tagHtmlNow = `<div class='memos-tag-sc-2' onclick='javascript:location.reload();'><div class='memos-tag-sc-1' >标签筛选:</div><div class='memos-tag-sc' >${e.innerHTML}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-auto ml-1 opacity-40"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></div></div>`
|
||||
document.querySelector('#tag-list').innerHTML = tagHtmlNow
|
||||
let bbUrl = memos+"api/v1/memo?creatorId="+bbMemo.creatorId+"&tag="+tagName+"&limit=20";
|
||||
fetch(bbUrl).then(res => res.json()).then( resdata =>{
|
||||
document.querySelector(bbMemo.domId).innerHTML = ""
|
||||
if(document.querySelector("button.button-load")) document.querySelector("button.button-load").remove()
|
||||
|
||||
updateHTMl(resdata)
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
// 延时加载评论数方法
|
||||
setTimeout(function() {
|
||||
Artalk.loadCountWidget({
|
||||
server: 'https://artalk.usj.cc/',
|
||||
site: '优世界',
|
||||
countEl: '#ArtalkCount'
|
||||
});
|
||||
}, 1000); // 延迟3000毫秒(也就是3秒)执行
|
||||
// 显示所有 TAG
|
||||
function showTaglist(){
|
||||
let bbUrl = 'https://tag.52ql.cn/'
|
||||
let tagListDom = ""
|
||||
fetch(bbUrl).then(res => res.json()).then( resdata =>{
|
||||
for(let i=0;i < resdata.length;i++){
|
||||
tagListDom += `<div class="memos-tag-all img-hide" onclick='getTagNow(this)'># ${resdata[i]}</div>`
|
||||
}
|
||||
document.querySelector('#tag-list-all').innerHTML = tagListDom
|
||||
|
||||
// animateSummaries(); // 加载完毕后执行滑动加载动画
|
||||
})
|
||||
}
|
||||
|
||||
// 搜索 Memos
|
||||
function searchMemoevent(event) {
|
||||
if (event.key === "Enter") {
|
||||
searchMemo();
|
||||
}
|
||||
}
|
||||
|
||||
function searchMemo() {
|
||||
let searchText = document.querySelector('#memos-search-input').value;
|
||||
let tagHtmlNow = `<div class='memos-tag-sc-2' onclick='javascript:location.reload();'><div class='memos-tag-sc-1' >关键词搜索:</div><div class='memos-tag-sc' >${searchText}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-auto ml-1 opacity-40"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></div></div>`
|
||||
document.querySelector('#tag-list').innerHTML = tagHtmlNow;
|
||||
let bbUrl = memos + "api/v1/memo?creatorId=" + bbMemo.creatorId + "&content=" + searchText + "&limit=20";
|
||||
fetchMemoDOM(bbUrl);
|
||||
}
|
||||
|
||||
function fetchMemoDOM(bbUrl) {
|
||||
fetch(bbUrl)
|
||||
.then(res => res.json())
|
||||
.then(resdata => {
|
||||
let arrData = resdata || '';
|
||||
if (resdata.data) {
|
||||
arrData = resdata.data;
|
||||
}
|
||||
if (arrData.length > 0) {
|
||||
// 清空旧的搜索结果和加载按钮
|
||||
document.querySelector(bbMemo.domId).innerHTML = "";
|
||||
if (document.querySelector("button.button-load")) {
|
||||
document.querySelector("button.button-load").remove();
|
||||
// 延时加载评论数方法
|
||||
setTimeout(function() {
|
||||
Artalk.loadCountWidget({
|
||||
server: 'https://artalk.usj.cc/',
|
||||
site: '优世界',
|
||||
countEl: '#ArtalkCount'
|
||||
});
|
||||
}, 1000); // 延迟3000毫秒(也就是3秒)执行
|
||||
}
|
||||
updateHTMl(resdata);
|
||||
} else {
|
||||
alert("搜不到,尝试换一个关键词");
|
||||
setTimeout(() => location.reload(), 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//增加memos评论
|
||||
function loadArtalk(memo_id) {
|
||||
const commentDiv = document.getElementById('memo_' + memo_id);
|
||||
const commentBtn = document.getElementById('btn_memo_' + memo_id);
|
||||
const allCommentDivs = document.querySelectorAll("[id^='memo_']");
|
||||
const allCommentBtns = document.querySelectorAll("[id^='btn_memo_']");
|
||||
|
||||
if (commentDiv.classList.contains('hidden')) {
|
||||
// 收起其他评论
|
||||
for (let i = 0; i < allCommentDivs.length; i++) {
|
||||
if (allCommentDivs[i] !== commentDiv) {
|
||||
allCommentDivs[i].classList.add('hidden');
|
||||
}
|
||||
}
|
||||
// 修改其他评论按钮文字
|
||||
for (let i = 0; i < allCommentBtns.length; i++) {
|
||||
if (allCommentBtns[i] !== commentBtn) {
|
||||
allCommentBtns[i].innerHTML = '<svg width="6px" height="12px" viewBox="0 0 6 12" version="1.1" xmlns="http://www.w3.org/2000/svg"><g><path d="M0.211503518,0.218577027 C0.493508208,-0.072859009 0.95072815,-0.072859009 1.23273284,0.218577027 L5.41780916,4.54361875 C6.19406361,5.34583421 6.19406361,6.65416579 5.41780916,7.45638125 L1.23273284,11.781423 C0.95072815,12.072859 0.493508208,12.072859 0.211503518,11.781423 C-0.0705011726,11.4899869 -0.0705011726,11.0174758 0.211503518,10.7260397 L4.39657984,6.400998 C4.60882491,6.18165462 4.60882491,5.81834538 4.39657984,5.599002 L0.211503518,1.27396027 C-0.0705011726,0.982524238 -0.0705011726,0.510013063 0.211503518,0.218577027 Z"></path></g></svg>';
|
||||
}
|
||||
}
|
||||
|
||||
commentDiv.classList.remove('hidden');
|
||||
commentBtn.innerHTML = '<svg width="14px" height="14px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><g fill-rule="evenodd"><path d="M256,0 C397.167,0 512,114.853 512,256 C512,397.147 397.167,512 256,512 C114.833,512 0,397.167 0,256 C0,114.833 114.833,0 256,0 Z M256,39.659 C136.725,39.659 39.659,136.705 39.659,256 C39.659,375.295 136.725,472.341 256,472.341 C375.275,472.341 472.341,375.295 472.341,256 C472.341,136.705 375.295,39.659 256,39.659 Z M242.119,184.217 C249.853,176.523 262.345,176.523 270.079,184.217 L369.227,283.365 C376.921,291.098 376.921,303.591 369.227,311.325 C361.493,319.019 349.001,319.019 341.267,311.325 L256,226.256 L170.931,311.324 C162.622,318.443 150.09,317.472 142.971,309.163 C136.606,301.747 136.606,290.781 142.971,283.365 Z" fill-rule="nonzero"></path></g></svg>';
|
||||
//增加评论平滑定位
|
||||
// const commentLi = document.getElementById(memo_id);
|
||||
// const commentLiPosition = commentLi.getBoundingClientRect().top + window.pageYOffset;
|
||||
// const offset = commentLiPosition - 3.5 * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||
// if ('scrollBehavior' in document.documentElement.style) {
|
||||
// // 支持平滑滚动的情况下,使用 window.scrollTo
|
||||
// window.scrollTo({
|
||||
// top: offset,
|
||||
// behavior: 'smooth'
|
||||
// });
|
||||
// } else {
|
||||
// // 不支持平滑滚动的情况下,使用滚动容器的平滑滚动方法(如需要滚动到具体的容器内)
|
||||
// // 例如:document.documentElement.scrollTop = offset;
|
||||
// // 或者使用第三方的平滑滚动库
|
||||
// }
|
||||
const artalk = new Artalk({
|
||||
el: '#memo_' + memo_id,
|
||||
pageKey: '/m/' + memo_id,
|
||||
pageTitle: '',
|
||||
server: 'https://artalk.usj.cc/',
|
||||
site: '优世界',
|
||||
darkMode: 'auto'
|
||||
});
|
||||
} else {
|
||||
commentDiv.classList.add('hidden');
|
||||
commentBtn.innerHTML = '<svg width="6px" height="12px" viewBox="0 0 6 12" version="1.1" xmlns="http://www.w3.org/2000/svg"><g><path d="M0.211503518,0.218577027 C0.493508208,-0.072859009 0.95072815,-0.072859009 1.23273284,0.218577027 L5.41780916,4.54361875 C6.19406361,5.34583421 6.19406361,6.65416579 5.41780916,7.45638125 L1.23273284,11.781423 C0.95072815,12.072859 0.493508208,12.072859 0.211503518,11.781423 C-0.0705011726,11.4899869 -0.0705011726,11.0174758 0.211503518,10.7260397 L4.39657984,6.400998 C4.60882491,6.18165462 4.60882491,5.81834538 4.39657984,5.599002 L0.211503518,1.27396027 C-0.0705011726,0.982524238 -0.0705011726,0.510013063 0.211503518,0.218577027 Z"></path></g></svg>';
|
||||
}
|
||||
}
|
||||
|
||||
//调用coco-message插件暗黑模式
|
||||
// const darkModeMatcher = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
// darkModeMatcher.addEventListener('change', handleDarkModeChange);
|
||||
// function handleDarkModeChange(e) {
|
||||
// if (e.matches) {
|
||||
// document.documentElement.classList.add('dark');
|
||||
// } else {
|
||||
// document.documentElement.classList.remove('dark');
|
||||
// }
|
||||
// }
|
||||
// handleDarkModeChange(darkModeMatcher);
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function f(){return H.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Pt(e,t,n,s,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){if(null==e._isValid){var t=m(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function I(e){var t=l(NaN);return null!=e?E(m(t),e):m(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=f.momentProperties=[],z=!1;function $(e,t){var n,s,i,r=Z.length;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=m(t)),o(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)o(i=t[s=Z[n]])||(e[s]=i);return e}function q(e){$(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,f.updateOffset(this),z=!1)}function h(e){return e instanceof q||null!=e&&null!=e._isAMomentObject}function B(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function d(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=d(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
moment.updateLocale("zh-cn",{meridiem:function(hour,minute,isLowercase){return hour<6?"凌晨":hour<9?"早上":hour<11&&minute<30?"上午":hour<13&&minute<30?"中午":hour<18?"下午":"晚上"}}),function(){var day,formats,hour,initialize,minute,second,week;second=1e3,minute=6e4,hour=36e5,day=864e5,week=6048e5,year=(new Date).getFullYear(),formats={seconds:{short:" 秒钟前",long:" 秒钟前"},minutes:{short:" 分钟前",long:" 分钟前"},hours:{short:" 小时前",long:" 小时前"},days:{short:" 天前",long:" 天前"}},initialize=function(moment){var twitterFormat;return twitterFormat=function(format){var diff,num,unit,unitStr;if(unit=null,num=null,(diff=Math.abs(this.diff(moment())))<=1e3)unit="seconds",num=1;else if(diff<6e4)unit="seconds";else if(diff<36e5)unit="minutes";else if(diff<day)unit="hours";else{if("long"!==format)return this.format("YYYY年MM月DD日 HH:mm");if(!(diff<week))return this.year()==year?this.format("MM月DD日 HH:mm"):this.format("YYYY年MM月DD日 HH:mm");unit="days"}return num&&unit||(num=moment.duration(diff)[unit]()),unitStr=unit=formats[unit][format],"long"===format&&num>1&&(unitStr+=""),num+unitStr},moment.fn.twitterLong=function(){return twitterFormat.call(this,"long")},moment.fn.twitter=moment.fn.twitterShort=function(){return twitterFormat.call(this,"short")},moment},"function"==typeof define&&define.amd?define("moment-twitter",["moment"],(function(moment){return this.moment=initialize(moment)})):"undefined"!=typeof module?module.exports=initialize(require("moment")):"undefined"!=typeof window&&window.moment&&(this.moment=initialize(this.moment))}.call(this);
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* ViewImage.min.js 2.0.2
|
||||
* MIT License - http://www.opensource.org/licenses/mit-license.php
|
||||
* https://tokinx.github.io/ViewImage/
|
||||
*/
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,a){b.raw=a;return b};$jscomp.arrayIteratorImpl=function(b){var a=0;return function(){return a<b.length?{done:!1,value:b[a++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var a="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return a?a.call(b):$jscomp.arrayIterator(b)};
|
||||
$jscomp.arrayFromIterator=function(b){for(var a,d=[];!(a=b.next()).done;)d.push(a.value);return d};$jscomp.arrayFromIterable=function(b){return b instanceof Array?b:$jscomp.arrayFromIterator($jscomp.makeIterator(b))};
|
||||
(function(){window.ViewImage=new function(){var b=this;this.target="[view-image] img";this.listener=function(a){if(!(a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)){var d=String(b.target.split(",").map(function(g){return g.trim()+":not([no-view])"})),c=a.target.closest(d);if(c){var e=c.closest("[view-image]")||document.body;d=[].concat($jscomp.arrayFromIterable(e.querySelectorAll(d))).map(function(g){return g.href||g.src});b.display(d,c.href||c.src);a.stopPropagation();a.preventDefault()}}};this.init=
|
||||
function(a){a&&(b.target=a);["removeEventListener","addEventListener"].forEach(function(d){document[d]("click",b.listener,!1)})};this.display=function(a,d){var c=a.indexOf(d),e=(new DOMParser).parseFromString('\n <div class="view-image">\n <style>.view-image{position:fixed;inset:0;z-index:500;padding:1rem;display:flex;flex-direction:column;animation:view-image-in 300ms;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}.view-image__out{animation:view-image-out 300ms}@keyframes view-image-in{0%{opacity:0}}@keyframes view-image-out{100%{opacity:0}}.view-image-btn{width:32px;height:32px;display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:3px;background-color:rgba(255,255,255,0.2)}.view-image-btn:hover{background-color:rgba(255,255,255,0.5)}.view-image-close__full{position:absolute;inset:0;background-color:rgba(48,55,66,0.3);z-index:unset;cursor:zoom-out;margin:0}.view-image-container{height:0;flex:1;display:flex;align-items:center;justify-content:center;}.view-image-lead{display:contents}.view-image-lead img{position:relative;z-index:1;max-width:100%;max-height:100%;object-fit:contain;border-radius:3px}.view-image-lead__in img{animation:view-image-lead-in 300ms}.view-image-lead__out img{animation:view-image-lead-out 300ms forwards}@keyframes view-image-lead-in{0%{opacity:0;transform:translateY(-20px)}}@keyframes view-image-lead-out{100%{opacity:0;transform:translateY(20px)}}[class*=__out] ~ .view-image-loading{display:block}.view-image-loading{position:absolute;inset:50%;width:8rem;height:2rem;color:#aab2bd;overflow:hidden;text-align:center;margin:-1rem -4rem;z-index:1;display:none}.view-image-loading::after{content:"";position:absolute;inset:50% 0;width:100%;height:3px;background:rgba(255,255,255,0.5);transform:translateX(-100%) translateY(-50%);animation:view-image-loading 800ms -100ms ease-in-out infinite}@keyframes view-image-loading{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}.view-image-tools{position:relative;display:flex;justify-content:space-between;align-content:center;color:#fff;max-width:600px;position: absolute; bottom: 5%; left: 1rem; right: 1rem; backdrop-filter: blur(10px);margin:0 auto;padding:10px;border-radius:5px;background:rgba(0,0,0,0.1);margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom);z-index:1}.view-image-tools__count{width:60px;display:flex;align-items:center;justify-content:center}.view-image-tools__flip{display:flex;gap:10px}.view-image-tools [class*=-close]{margin:0 10px}</style>\n <div class="view-image-container">\n <div class="view-image-lead"></div>\n <div class="view-image-loading"></div>\n <div class="view-image-close view-image-close__full"></div>\n </div>\n <div class="view-image-tools">\n <div class="view-image-tools__count">\n <span><b class="view-image-index">'+
|
||||
(c+1)+"</b>/"+a.length+'</span>\n </div>\n <div class="view-image-tools__flip">\n <div class="view-image-btn view-image-tools__flip-prev">\n <svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M31 36L19 24L31 12" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>\n </div>\n <div class="view-image-btn view-image-tools__flip-next">\n <svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M19 12L31 24L19 36" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>\n </div>\n </div>\n <div class="view-image-btn view-image-close">\n <svg width="16" height="16" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M8 8L40 40" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 40L40 8" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>\n </div>\n </div>\n </div>\n ',
|
||||
"text/html").body.firstChild,g=function(f){var h={Escape:"close",ArrowLeft:"tools__flip-prev",ArrowRight:"tools__flip-next"};h[f.key]&&e.querySelector(".view-image-"+h[f.key]).click()},l=function(f){var h=new Image,k=e.querySelector(".view-image-lead");k.className="view-image-lead view-image-lead__out";setTimeout(function(){k.innerHTML="";h.onload=function(){setTimeout(function(){k.innerHTML='<img src="'+h.src+'" alt="ViewImage" no-view/>';k.className="view-image-lead view-image-lead__in"},100)};
|
||||
h.src=f},300)};document.body.appendChild(e);l(d);window.addEventListener("keydown",g);e.onclick=function(f){f.target.closest(".view-image-close")?(window.removeEventListener("keydown",g),e.onclick=null,e.classList.add("view-image__out"),setTimeout(function(){return e.remove()},290)):f.target.closest(".view-image-tools__flip")&&(c=f.target.closest(".view-image-tools__flip-prev")?0===c?a.length-1:c-1:c===a.length-1?0:c+1,l(a[c]),e.querySelector(".view-image-index").innerHTML=c+1)}}}})();
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"Emoji": {
|
||||
"type": "emoji",
|
||||
"container":[
|
||||
{
|
||||
"icon": "😂",
|
||||
"text": "哭笑不得"
|
||||
},
|
||||
{
|
||||
"icon": "😎",
|
||||
"text": "酷"
|
||||
},
|
||||
{
|
||||
"icon": "😏",
|
||||
"text": "坏笑"
|
||||
},
|
||||
{
|
||||
"icon": "😄",
|
||||
"text": "笑"
|
||||
},
|
||||
{
|
||||
"icon": "😜",
|
||||
"text": "调皮"
|
||||
},
|
||||
{
|
||||
"icon": "🤣",
|
||||
"text": "笑倒"
|
||||
},
|
||||
{
|
||||
"icon": "😭",
|
||||
"text": "大哭"
|
||||
},
|
||||
{
|
||||
"icon": "🙄",
|
||||
"text": "白眼"
|
||||
},
|
||||
{
|
||||
"icon": "🤐",
|
||||
"text": "嘘"
|
||||
},
|
||||
{
|
||||
"icon": "😋",
|
||||
"text": "美食脸"
|
||||
},
|
||||
{
|
||||
"icon": "🥶",
|
||||
"text": "冰冻"
|
||||
},
|
||||
{
|
||||
"icon": "🥵",
|
||||
"text": "热"
|
||||
},
|
||||
{
|
||||
"icon": "😴",
|
||||
"text": "睡觉"
|
||||
},
|
||||
{
|
||||
"icon": "🤧",
|
||||
"text": "打喷嚏"
|
||||
},
|
||||
{
|
||||
"icon": "🍉",
|
||||
"text": "西瓜"
|
||||
},
|
||||
{
|
||||
"icon": "😱",
|
||||
"text": "惊恐"
|
||||
},
|
||||
{
|
||||
"icon": "👋",
|
||||
"text": "招手"
|
||||
},
|
||||
{
|
||||
"icon": "🔨",
|
||||
"text": "锤子"
|
||||
},
|
||||
{
|
||||
"icon": "🐶",
|
||||
"text": "小狗"
|
||||
},
|
||||
{
|
||||
"icon": "👏",
|
||||
"text": "鼓掌"
|
||||
},
|
||||
{
|
||||
"icon": "🙈",
|
||||
"text": "不看"
|
||||
},
|
||||
{
|
||||
"icon": "😓",
|
||||
"text": "汗"
|
||||
},
|
||||
{
|
||||
"icon": "😍",
|
||||
"text": "爱心眼"
|
||||
},
|
||||
{
|
||||
"icon": "🤝",
|
||||
"text": "握手"
|
||||
},
|
||||
{
|
||||
"icon": "🥺",
|
||||
"text": "求你"
|
||||
},
|
||||
{
|
||||
"icon": "😔",
|
||||
"text": "沮丧"
|
||||
},
|
||||
{
|
||||
"icon": "😪",
|
||||
"text": "困"
|
||||
},
|
||||
{
|
||||
"icon": "😕",
|
||||
"text": "困惑"
|
||||
},
|
||||
{
|
||||
"icon": "🤷♂️",
|
||||
"text": "摊手"
|
||||
},
|
||||
{
|
||||
"icon": "😛",
|
||||
"text": "舌头"
|
||||
},
|
||||
{
|
||||
"icon": "🤭",
|
||||
"text": "偷笑"
|
||||
},
|
||||
{
|
||||
"icon": "🤮",
|
||||
"text": "呕吐"
|
||||
},
|
||||
{
|
||||
"icon": "🥺",
|
||||
"text": "求你"
|
||||
},
|
||||
{
|
||||
"icon": "🙂",
|
||||
"text": "轻松的笑"
|
||||
},
|
||||
{
|
||||
"icon": "😈",
|
||||
"text": "恶魔"
|
||||
},
|
||||
{
|
||||
"icon": "😃",
|
||||
"text": "笑脸"
|
||||
},
|
||||
{
|
||||
"icon": "🤫",
|
||||
"text": "嘘"
|
||||
},
|
||||
{
|
||||
"icon": "😒",
|
||||
"text": "无语"
|
||||
},
|
||||
{
|
||||
"icon": "😵",
|
||||
"text": "晕"
|
||||
},
|
||||
{
|
||||
"icon": "💪",
|
||||
"text": "加油"
|
||||
},
|
||||
{
|
||||
"icon": "👍",
|
||||
"text": "赞"
|
||||
},
|
||||
{
|
||||
"icon": "👎",
|
||||
"text": "踩"
|
||||
},
|
||||
{
|
||||
"icon": "😡",
|
||||
"text": "愤怒"
|
||||
},
|
||||
{
|
||||
"icon": "🤬",
|
||||
"text": "怒骂"
|
||||
},
|
||||
{
|
||||
"icon": "😖",
|
||||
"text": "心烦"
|
||||
},
|
||||
{
|
||||
"icon": "🌹",
|
||||
"text": "玫瑰"
|
||||
},
|
||||
{
|
||||
"icon": "🏃",
|
||||
"text": "跑步"
|
||||
},
|
||||
{
|
||||
"icon": "😆",
|
||||
"text": "大笑"
|
||||
},
|
||||
{
|
||||
"icon": "💵",
|
||||
"text": "钞票"
|
||||
},
|
||||
{
|
||||
"icon": "😘",
|
||||
"text": "飞吻"
|
||||
},
|
||||
{
|
||||
"icon": "😷",
|
||||
"text": "生病"
|
||||
},
|
||||
{
|
||||
"icon": "🤕",
|
||||
"text": "受伤"
|
||||
},
|
||||
{
|
||||
"icon": "🎉",
|
||||
"text": "庆祝"
|
||||
},
|
||||
{
|
||||
"icon": "❤️",
|
||||
"text": "红心"
|
||||
},
|
||||
{
|
||||
"icon": "💔",
|
||||
"text": "心碎"
|
||||
},
|
||||
{
|
||||
"icon": "😣",
|
||||
"text": "无奈"
|
||||
},
|
||||
{
|
||||
"icon": "😘",
|
||||
"text": "飞吻"
|
||||
},
|
||||
{
|
||||
"icon": "💩",
|
||||
"text": "一坨便便"
|
||||
},
|
||||
{
|
||||
"icon": "🤩",
|
||||
"text": "爱慕"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||