脚本站评分引导
window.scsite={},window.scsite.guide=function(n){const e={auto:function(){if(self!=top)return;if(GM_getValue("guide",!1))return;const n=GM_getValue("runDate",0);n?(new Date).getTime()/1e3-n>600&&e.open():GM_setValue("runDate",(new Date).getTime()/1e3)},open:function(){const e=GM_info&&GM_info.script;e||(e={name:"NULL"});const t=document.createElement("div");t.style.position="fixed",t.style.left="50%",t.style.top="50%",t.style.transform="translate(-50%, -50%)",t.style.background="#fff",document.body.appendChild(t);const o=t.attachShadow({mode:"open"});let i="";i=e.icon?`<div class="icon"><img src="${e.icon}" width="42" height="42" /></div>`:`<div class="icon"><span>${e.name.substr(0,1)}</span></div>`,o.innerHTML=`\n <style>\n .box{\n padding: 14px 0px 0px;\n background: #FFF;\n border: 1px solid #c6c6c6;\n border-radius: 8px;\n text-align: center;\n box-shadow: 0 1px 4px 0 rgba(222, 219, 219, 0.2), 0 1px 4px 0 rgba(132, 132, 132, 0.19);\n }\n .text-wrap{\n padding:0px 14px;\n line-height: 1.9;\n }\n\n .icon{\n margin-bottom: 5px;\n \n }\n .icon img{\n border-radius: 14px;\n border: 1px solid;\n }\n .btn{\n border-top: 1px solid #c6c6c6;\n display: flex;\n flex-wrap: nowrap;\n margin-top: 12px;\n }\n .btn a{\n text-decoration: none;\n color:#7b7b7b;\n flex:1 1 0;\n padding: 7px 0;\n cursor: pointer;\n }\n .btn a:hover{\n color: #fff;\n background: #d6d6d6;\n }\n .btn a:first-child {\n border-right: 1px solid #c6c6c6;\n }\n .content{\n padding: 0px 14px 0px;\n }\n </style>\n \n <div class="box">\n ${i}\n <div class="content">\n <div class="description">喜欢"${e.name}"吗?</div>\n <div class="guide">点击下方按钮在脚本猫中评分吧</div>\n </div>\n <div class="btn"><a class="cancel">取消</a><a class="goto" href="https://scriptcat.org/script-show-page/${n}/comment" target="_blank">前往</a></div>\n </div>`,o.querySelector(".cancel").onclick=function(){t.remove(),GM_setValue("guide",!0)},o.querySelector(".goto").onclick=function(){t.remove(),GM_setValue("guide",!0)}}};return e};