From 8f5cfeeb14745e162f85e361eda68f801ca7ce1b Mon Sep 17 00:00:00 2001 From: Last Date: Sun, 19 Jan 2020 04:23:43 +0800 Subject: [PATCH] kaomoji v3.0 --- z_kaomoji/conf.json | 10 ++++ z_kaomoji/hook/thread_end.htm | 1 + z_kaomoji/icon.png | Bin 0 -> 8564 bytes z_kaomoji/js/kaomoji.js | 90 ++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 z_kaomoji/conf.json create mode 100644 z_kaomoji/hook/thread_end.htm create mode 100644 z_kaomoji/icon.png create mode 100644 z_kaomoji/js/kaomoji.js diff --git a/z_kaomoji/conf.json b/z_kaomoji/conf.json new file mode 100644 index 0000000..d571dc4 --- /dev/null +++ b/z_kaomoji/conf.json @@ -0,0 +1,10 @@ +{ + "name": "颜文字 ~ ( ゜- ゜)つロ 乾杯~", + "brief": "颜文字插件,用于替代传统图片表情, 重构脱离了对 bootstrap 的依赖/降低了反复加载对资源的浪费/增加了动画效果", + "version": "3.0", + "bbs_version": "4.0", + "installed": 1, + "enable": 1, + "hooks_rank": [], + "dependencies": [] +} \ No newline at end of file diff --git a/z_kaomoji/hook/thread_end.htm b/z_kaomoji/hook/thread_end.htm new file mode 100644 index 0000000..d3fc447 --- /dev/null +++ b/z_kaomoji/hook/thread_end.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/z_kaomoji/icon.png b/z_kaomoji/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9a6ba3af5b106a542e2c7b0cf9a3178a3bcf4744 GIT binary patch literal 8564 zcmV-)A&cILP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>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Q zn%(B`W_Aw`MjIL=3;l-~{9L=w;^rWY1^j0^Xd@%kU u8VyOZ#-}(&hb{xY6(VJjOkPhh|91c$wF3i+ZZ%#20000 { this.show() } + + this.div = document.createElement("div") + this.div.style = "color:#555; position: relative; left: 0; bottom:-90%; display:flex; flex-direction:column; padding:32px 15px 20px; text-align:center; background:#ffffff; height:90%; width:100%; max-width:480px; margin:0 auto; border-radius:20px 20px 0 0; transition: all .75s cubic-bezier(.645, .045, 0, 1);" + this.div.innerHTML = "

(。・`ω´・) 颜文字

welcome to text world :)

" + this.div.onclick = (e) => { e.stopPropagation() } + this.element.appendChild(this.div) + + let ul = document.createElement("ul") + ul.id = "kaomojilist" + ul.style = "display:flex; flex-wrap:wrap; justify-content:center; list-style:none; margin:0; padding:0; overflow-y:scroll;" + this.div.appendChild(ul) + + this.list.forEach(item => { + let li = document.createElement("li") + li.style = "background:#e9fdff; border-radius:5px; padding: 5px 8px; font-size: 11px; margin: 4px;" + li.innerText = item + li.onclick = () => { + let tc = document.getElementById("message") + let tclen = tc.value.length; tc.focus() + if (typeof document.selection != "undefined") { + document.selection.createRange().text = item + } else { + tc.value = tc.value.substr(0, tc.selectionStart) + item + tc.value.substring(tc.selectionStart, tclen); + } + this.show() + } + ul.appendChild(li) + }) + document.body.appendChild(this.element) + } + if (this.element.style.display == "none") { + this.element.style.display = "flex" + this.div.offsetWidth + this.element.style.background = "rgba(0,0,0,.6)" + this.div.style.bottom = "0px" + } else { + setTimeout(() => { this.element.style.display = "none" }, 450) + this.element.style.background = "rgba(0,0,0,0)" + this.div.style.bottom = "-90%" + } + } +} + +function button() { + this.element = document.createElement("button") + this.element.type = "button" + this.element.style = "border:none; border-radius:5px; color:#868e96; margin-left:12px; line-height: 1.5; padding: 3px 7px" + this.element.innerText = "⊙ω⊙颜文字" + this.element.onclick = () => { kaomoji.show() } + return this.element +} + + +if (document.getElementById("submit")) { + var style = document.createElement("style") + style.type = "text/css" + style.appendChild(document.createTextNode(` + #kaomojilist::-webkit-scrollbar { width : 10px; height: 1px; } + #kaomojilist::-webkit-scrollbar-thumb { border-radius:10px; background-color: skyblue; background-image: -webkit-linear-gradient( 45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent ); } + #kaomojilist::-webkit-scrollbar-track { box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#ededed; border-radius:10px; }` + )) + document.head.appendChild(style) + + var submit = document.getElementById("submit") + submit.parentNode.insertBefore(new button(), submit.nextSibling) +} \ No newline at end of file