From e9728a5d38fe531d943c12cbe734cf96bc744346 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Sat, 30 Mar 2024 13:31:07 +0000 Subject: [PATCH] feat: tg mini app --- html/assets/index-8374296f.js | 4 + html/assets/index-8e3998a6.js | 4 - ...{index-c1af15fa.css => index-f861d73e.css} | 2 +- html/index.html | 73 +++++++++++++------ 4 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 html/assets/index-8374296f.js delete mode 100644 html/assets/index-8e3998a6.js rename html/assets/{index-c1af15fa.css => index-f861d73e.css} (53%) diff --git a/html/assets/index-8374296f.js b/html/assets/index-8374296f.js new file mode 100644 index 0000000..3f63601 --- /dev/null +++ b/html/assets/index-8374296f.js @@ -0,0 +1,4 @@ +var Re=Object.defineProperty;var Ie=(t,e,n)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ie=(t,e,n)=>(Ie(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&l(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();function j(){}function Me(t){return t()}function we(){return Object.create(null)}function B(t){t.forEach(Me)}function Ue(t){return typeof t=="function"}function ae(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ne;function J(t,e){return t===e?!0:(ne||(ne=document.createElement("a")),ne.href=e,t===ne.href)}function Pe(t){return Object.keys(t).length===0}function g(t,e){t.appendChild(e)}function U(t,e,n){t.insertBefore(e,n||null)}function O(t){t.parentNode&&t.parentNode.removeChild(t)}function qe(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Be(t){return function(e){return e.preventDefault(),t.call(this,e)}}function p(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function He(t){return Array.from(t.childNodes)}function x(t,e){e=""+e,t.data!==e&&(t.data=e)}function Q(t,e){t.value=e??""}function ye(t,e,n){for(let l=0;lt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),V=e}const le=new Set;let X;function Fe(){X={r:0,c:[],p:X}}function Se(){X.r||B(X.c),X=X.p}function P(t,e){t&&t.i&&(le.delete(t),t.i(e))}function W(t,e,n,l){if(t&&t.o){if(le.has(t))return;le.add(t),X.c.push(()=>{le.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Y(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Qe(t,e){t.d(1),e.delete(t.key)}function Ye(t,e,n,l,s,r,o,i,u,_,h,f){let d=t.length,b=r.length,a=d;const m={};for(;a--;)m[t[a].key]=a;const k=[],q=new Map,L=new Map,E=[];for(a=b;a--;){const w=f(s,r,a),A=n(w);let M=o.get(A);M?l&&E.push(()=>M.p(w,e)):(M=_(A,w),M.c()),q.set(A,k[a]=M),A in m&&L.set(A,Math.abs(a-m[A]))}const R=new Set,C=new Set;function D(w){P(w,1),w.m(i,h),o.set(w.key,w),h=w.first,b--}for(;d&&b;){const w=k[b-1],A=t[d-1],M=w.key,S=A.key;w===A?(h=w.first,d--,b--):q.has(S)?!o.has(M)||R.has(M)?D(w):C.has(S)?d--:L.get(M)>L.get(S)?(C.add(M),D(w)):(R.add(S),d--):(u(A,o),d--)}for(;d--;){const w=t[d];q.has(w.key)||u(w,o)}for(;b;)D(k[b-1]);return B(E),k}function Ze(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function Te(t){t&&t.c()}function he(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),oe(()=>{const r=t.$$.on_mount.map(Me).filter(Ue);t.$$.on_destroy?t.$$.on_destroy.push(...r):B(r),t.$$.on_mount=[]}),s.forEach(oe)}function pe(t,e){const n=t.$$;n.fragment!==null&&(Je(n.after_update),B(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function $e(t,e){t.$$.dirty[0]===-1&&(G.push(t),Ge(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const a=b.length?b[0]:d;return _.ctx&&s(_.ctx[f],_.ctx[f]=a)&&(!_.skip_bound&&_.bound[f]&&_.bound[f](a),h&&$e(t,f)),d}):[],_.update(),h=!0,B(_.before_update),_.fragment=l?l(_.ctx):!1,e.target){if(e.hydrate){const f=He(e.target);_.fragment&&_.fragment.l(f),f.forEach(O)}else _.fragment&&_.fragment.c();e.intro&&P(t.$$.fragment),he(t,e.target,e.anchor),je()}$(u)}class me{constructor(){ie(this,"$$");ie(this,"$$set")}$destroy(){pe(this,1),this.$destroy=j}$on(e,n){if(!Ue(n))return j;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!Pe(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const xe="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(xe);function et(t){let e,n,l,s,r,o,i,u=(t[0].from_name||" ")+"",_,h,f,d=t[0].html+"",b,a,m=t[1][t[0].group_id][1]+"",k,q,L,E,R;return{c(){e=y("div"),n=y("img"),r=T(),o=y("div"),i=y("div"),_=H(u),h=T(),f=y("div"),b=T(),a=y("div"),k=H(m),q=T(),L=y("a"),E=y("time"),R=H(t[3]),p(n,"class","avatar svelte-15hb0c4"),J(n.src,l=ue("LUOXU_URL")+"/avatar/"+t[0].from_id+".jpg")||p(n,"src",l),p(n,"height","64"),p(n,"width","64"),p(n,"alt",s=t[0].from_name+" 的头像"),p(i,"class","name svelte-15hb0c4"),p(f,"class","text svelte-15hb0c4"),p(E,"datetime",t[4]),p(E,"title",t[2]),p(L,"href",t[5]),p(L,"class","svelte-15hb0c4"),p(a,"class","time svelte-15hb0c4"),p(o,"class","content svelte-15hb0c4"),p(e,"class","message svelte-15hb0c4")},m(C,D){U(C,e,D),g(e,n),g(e,r),g(e,o),g(o,i),g(i,_),g(o,h),g(o,f),f.innerHTML=d,g(o,b),g(o,a),g(a,k),g(a,q),g(a,L),g(L,E),g(E,R)},p(C,[D]){D&1&&!J(n.src,l=ue("LUOXU_URL")+"/avatar/"+C[0].from_id+".jpg")&&p(n,"src",l),D&1&&s!==(s=C[0].from_name+" 的头像")&&p(n,"alt",s),D&1&&u!==(u=(C[0].from_name||" ")+"")&&x(_,u),D&1&&d!==(d=C[0].html+"")&&(f.innerHTML=d),D&3&&m!==(m=C[1][C[0].group_id][1]+"")&&x(k,m)},i:j,o:j,d(C){C&&O(e)}}}function tt(t,e){const n={year:31536e6,month:2628e6,day:864e5,hour:36e5,minute:6e4,second:1e3},l=new Intl.RelativeTimeFormat,s=t.valueOf()-e.valueOf();for(const[r,o]of Object.entries(n))if(Math.abs(s)>o||r==="second")return l.format(Math.round(s/o),r)}function nt(t,e,n){let{msg:l}=e,{groupinfo:s}=e,{now:r}=e;const i=new Intl.DateTimeFormat(void 0,{timeStyle:"full",dateStyle:"full",hour12:!1}).format;let u=new Date(l.t*1e3),_=l.edited?new Date(l.edited*1e3):null,h=i(u)+(_?` +最后编辑于:${i(_)}`:""),f=tt(u,r),d=u.toISOString(),b=s[l.group_id][0]?`https://t.me/${s[l.group_id][0]}/${l.id}`:`tg://privatepost?channel=${l.group_id}&post=${l.id}`;return t.$$set=a=>{"msg"in a&&n(0,l=a.msg),"groupinfo"in a&&n(1,s=a.groupinfo),"now"in a&&n(6,r=a.now)},[l,s,h,f,d,b,r]}class lt extends me{constructor(e){super(),ge(this,e,nt,et,ae,{msg:0,groupinfo:1,now:6})}}function ke(t,e,n){const l=t.slice();return l[25]=e[n],l[27]=n,l}function Ee(t,e){let n,l,s,r=e[25][1]+"",o,i,u,_;return{key:t,first:null,c(){n=y("li"),l=y("img"),o=H(r),i=T(),J(l.src,s=e[6]+"/avatar/"+e[25][0]+".jpg")||p(l,"src",s),p(l,"alt","avatar"),p(l,"class","svelte-179qc5o"),p(n,"data-idx",u=e[27]),p(n,"title",_=e[25][1]),p(n,"class","svelte-179qc5o"),se(n,"selected",e[27]===e[1]),this.first=n},m(h,f){U(h,n,f),g(n,l),g(n,o),g(n,i)},p(h,f){e=h,f&4&&!J(l.src,s=e[6]+"/avatar/"+e[25][0]+".jpg")&&p(l,"src",s),f&4&&r!==(r=e[25][1]+"")&&x(o,r),f&4&&u!==(u=e[27])&&p(n,"data-idx",u),f&4&&_!==(_=e[25][1])&&p(n,"title",_),f&6&&se(n,"selected",e[27]===e[1])},d(h){h&&O(n)}}}function st(t){let e,n,l,s,r,o,i,u=[],_=new Map,h,f,d=Y(t[2]);const b=a=>a[25];for(let a=0;a{};function it(t,e,n){let{group:l}=e,{selected:s}=e,{selected_init:r}=e,o="",i,u,_=[],h=ue("LUOXU_URL"),f,d,b=!1,a=new AbortController;Ne(()=>{const c=f.getBoundingClientRect();n(4,d.style.top=`${c.height-1}px`,d),n(4,d.style.width=`${c.width-2}px`,d)});function m(){const c=f.getBoundingClientRect();n(4,d.style.width=`${c.width-2}px`,d)}function k(){u&&clearTimeout(u),u=setTimeout(function(){q()},300)}async function q(){if(f.value){n(1,i=null),a.abort(),a=new AbortController;try{const v=await(await fetch(`${h}/names?g=${l}&q=${f.value}`,{signal:a.signal})).json();a.signal.aborted||n(2,_=v.names)}catch(c){c instanceof DOMException&&c.name==="AbortError"||console.error(c)}}}function L(c){let v=c.target;v.tagName==="IMG"&&(v=v.parentNode),v.tagName=="LI"&&(n(1,i=parseInt(v.dataset.idx)),E(),f.focus(),n(5,b=!0))}function E(){n(0,s=_[i][0]),o=_[i][1],n(3,f.value=o,f),n(12,r=null)}function R(){!s||s===r||(f.value?n(3,f.value=o,f):(n(0,s=r),o=""))}function C(c){c.key==="ArrowDown"||c.key==="n"&&c.altKey?(D(1),c.preventDefault()):c.key==="ArrowUp"||c.key==="p"&&c.altKey?(D(-1),c.preventDefault()):c.key==="Enter"&&(E(),c.preventDefault())}function D(c){typeof i=="number"?c>0?n(1,i=(i+1)%_.length):n(1,i=(i-1)%_.length):c>0?n(1,i=0):n(1,i=_.length-1)}function w(c){te[c?"unshift":"push"](()=>{f=c,n(3,f)})}const A=()=>{n(5,b=!1),k()},M=()=>n(5,b=!1),S=()=>{n(5,b=!0),R()};function F(c){te[c?"unshift":"push"](()=>{d=c,n(4,d)})}return t.$$set=c=>{"group"in c&&n(13,l=c.group),"selected"in c&&n(0,s=c.selected),"selected_init"in c&&n(12,r=c.selected_init)},[s,i,_,f,d,b,h,m,k,L,R,C,r,l,w,A,M,S,F]}class rt extends me{constructor(e){super(),ge(this,e,it,st,ae,{group:13,selected:0,selected_init:12})}}function ut(t){return new Promise((n,l)=>{setTimeout(n,t)})}function Le(t,e,n){const l=t.slice();return l[25]=e[n],l}function Ce(t,e,n){const l=t.slice();return l[2]=e[n],l}function ct(t){let e,n,l,s,r=t[10]&&at(),o=Y(t[0]),i=[];for(let u=0;ut[17].call(e))},m(u,_){U(u,e,_),r&&r.m(e,null),g(e,n);for(let h=0;h搜索消息时,搜索字符串不区分简繁(会使用 OpenCC + 自动转换),也不进行分词(请手动将可能不连在一起的词语以空格分开)。

搜索字符串支持以下功能:

  • 以空格分开的多个搜索词是「与」的关系
  • 使用 OR(全大写)来表达「或」条件
  • 使用 - 来表达排除,如 落絮 - 测试
  • 使用小括号来分组

人名补全支持上下方向键和 Alt+N/P 进行选择。

搜索结果右下角的时间,悬停可查看绝对时间、最后编辑时间(如编辑过),点击可跳转到 + Telegram 中展示该消息。

`},m(n,l){U(n,e,l)},p:j,i:j,o:j,d(n){n&&O(e)}}}function dt(t){let e,n,l=Y(t[4].messages),s=[];for(let o=0;oW(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o正在加载...

',p(e,"class","info svelte-1cv5ivi")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function gt(t){let e;return{c(){e=y("div"),e.innerHTML='

到底了。

',p(e,"class","info svelte-1cv5ivi")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function mt(t){let e;return{c(){e=y("div"),e.innerHTML='

没有匹配的消息。

',p(e,"class","info svelte-1cv5ivi")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function vt(t){let e,n;return{c(){e=y("p"),n=H(t[3]),p(e,"class","error svelte-1cv5ivi")},m(l,s){U(l,e,s),g(e,n)},p(l,s){s&8&&x(n,l[3])},d(l){l&&O(e)}}}function Ae(t){let e,n,l,s;return{c(){e=y("div"),n=y("button"),n.textContent="加载更多",p(n,"class","svelte-1cv5ivi"),p(e,"class","info svelte-1cv5ivi")},m(r,o){U(r,e,o),g(e,n),l||(s=N(n,"click",t[14]),l=!0)},p:j,d(r){r&&O(e),l=!1,s()}}}function bt(t){let e,n,l,s,r,o,i,u,_,h,f,d,b,a,m,k;function q(c,v){return c[0].length===0?ft:ct}let L=q(t),E=L(t);function R(c){t[21](c)}let C={group:t[2],selected_init:t[8]};t[7]!==void 0&&(C.selected=t[7]),o=new rt({props:C}),te.push(()=>Ze(o,"selected",R));const D=[dt,_t],w=[];function A(c,v){return c[4]?0:!c[6]&&!c[3]?1:-1}~(f=A(t))&&(d=w[f]=D[f](t));function M(c,v){return c[6]?pt:ht}let S=M(t),F=S(t);return{c(){e=y("main"),n=y("div"),E.c(),l=T(),s=y("input"),r=T(),Te(o.$$.fragment),u=T(),_=y("button"),_.textContent="搜索",h=T(),d&&d.c(),b=T(),F.c(),p(s,"type","search"),p(s,"class","svelte-1cv5ivi"),p(_,"class","svelte-1cv5ivi"),p(n,"id","searchbox"),p(n,"class","svelte-1cv5ivi"),p(e,"class","svelte-1cv5ivi")},m(c,v){U(c,e,v),g(e,n),E.m(n,null),g(n,l),g(n,s),Q(s,t[1]),g(n,r),he(o,n,null),g(n,u),g(n,_),g(e,h),~f&&w[f].m(e,null),g(e,b),F.m(e,null),a=!0,m||(k=[N(window,"hashchange",t[16]),N(s,"input",t[18]),N(s,"input",t[19]),N(s,"keydown",t[20]),N(_,"click",t[22])],m=!0)},p(c,[v]){L===(L=q(c))&&E?E.p(c,v):(E.d(1),E=L(c),E&&(E.c(),E.m(n,l))),v&2&&s.value!==c[1]&&Q(s,c[1]);const I={};v&4&&(I.group=c[2]),v&256&&(I.selected_init=c[8]),!i&&v&128&&(i=!0,I.selected=c[7],Ve(()=>i=!1)),o.$set(I);let K=f;f=A(c),f===K?~f&&w[f].p(c,v):(d&&(Fe(),W(w[K],1,1,()=>{w[K]=null}),Se()),~f?(d=w[f],d?d.p(c,v):(d=w[f]=D[f](c),d.c()),P(d,1),d.m(e,b)):d=null),S===(S=M(c))&&F?F.p(c,v):(F.d(1),F=S(c),F&&(F.c(),F.m(e,null)))},i(c){a||(P(o.$$.fragment,c),P(d),a=!0)},o(c){W(o.$$.fragment,c),W(d),a=!1},d(c){c&&O(e),E.d(),pe(o),~f&&w[f].d(),F.d(),m=!1,B(k)}}}const Z="https://search-pub.xtaolabs.com/luoxu";function wt(){const t=location.hash;if(t)return new URLSearchParams(t.substring(1))}function yt(t,e,n){const l=Z.startsWith("http://localhost");let s=[],r,o,i,u,_=new Date,h=!1,f=!1,d,b,a=!1,m=new AbortController;Ke("LUOXU_URL",Z),Ne(async()=>{for(k();;)try{const c=await fetch(`${Z}/groups`);n(0,s=(await c.json()).groups),n(15,f=!0),r||n(2,r="");break}catch(c){console.error("failed to fetch group info, will retry",c),await ut(1e3)}});function k(){const c=wt();c&&(n(1,o=""),n(2,r=""),n(4,u=null),c.has("g")&&n(2,r=c.get("g")),c.has("q")&&n(1,o=c.get("q")),c.has("sender")&&(n(7,d=c.get("sender")),n(8,b=d)),(r||l)&&o&&(n(4,u=null),L()))}let q=0;async function L(c){q+=1;try{if(m.abort(),m=new AbortController,!r&&!l){n(3,i="请选择要搜索的群组");return}if(!o&&!l&&!d){n(3,i="请输入搜索关键字");return}n(3,i=""),n(9,a=!0),console.log(`searching ${o} for group ${r}, older than ${c}, from ${d}`);const v=new URLSearchParams;r&&v.append("g",r),o&&v.append("q",o),d&&v.append("sender",d);let I;const K=v.toString();c?I=`${Z}/search?${v}&end=${c}`:(location.hash=`#${K}`,n(15,f=!0),u&&n(4,u.messages=[],u),I=`${Z}/search?${K}`),n(5,_=new Date),n(6,h=!0);try{const be=await(await fetch(I,{signal:m.signal})).json();if(n(6,h=!1),m.signal.aborted)return[];if(c)return be;n(4,u=be)}catch(ve){q<=1&&(n(3,i=ve),n(6,h=!1))}n(9,a=!1)}finally{q-=1}}async function E(){n(3,i=""),o&&await L()}async function R(){const c=u.messages[u.messages.length-1].t,v=u.messages,I=await L(c);n(4,u.messages=[...v,...I.messages],u),n(4,u.has_more=I.has_more,u)}const C=()=>{a||k()};function D(){r=Xe(this),n(2,r),n(0,s)}function w(){o=this.value,n(1,o)}const A=()=>n(3,i=""),M=c=>{c.key==="Enter"&&L()};function S(c){d=c,n(7,d)}const F=()=>L();return t.$$.update=()=>{if(t.$$.dirty&32775&&f&&s){let c;for(const v of s)v.group_id===r&&(c=v.name);o&&c?document.title=`搜索:${o} 于 ${c} - 落絮`:o?document.title=`搜索:${o} - 落絮`:c?document.title=`搜索 ${c} - 落絮`:document.title="落絮",n(15,f=!1)}},[s,o,r,i,u,_,h,d,b,a,l,k,L,E,R,f,C,D,w,A,M,S,F]}class kt extends me{constructor(e){super(),ge(this,e,yt,bt,ae,{})}}new kt({target:document.body}); diff --git a/html/assets/index-8e3998a6.js b/html/assets/index-8e3998a6.js deleted file mode 100644 index 14af36b..0000000 --- a/html/assets/index-8e3998a6.js +++ /dev/null @@ -1,4 +0,0 @@ -var Re=Object.defineProperty;var Ie=(t,e,n)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var re=(t,e,n)=>(Ie(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&l(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function l(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function j(){}function Me(t){return t()}function ye(){return Object.create(null)}function B(t){t.forEach(Me)}function Ue(t){return typeof t=="function"}function ae(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ne;function J(t,e){return t===e?!0:(ne||(ne=document.createElement("a")),ne.href=e,t===ne.href)}function Pe(t){return Object.keys(t).length===0}function g(t,e){t.appendChild(e)}function U(t,e,n){t.insertBefore(e,n||null)}function O(t){t.parentNode&&t.parentNode.removeChild(t)}function qe(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Be(t){return function(e){return e.preventDefault(),t.call(this,e)}}function p(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function He(t){return Array.from(t.childNodes)}function x(t,e){e=""+e,t.data!==e&&(t.data=e)}function Q(t,e){t.value=e??""}function ve(t,e,n){for(let l=0;lt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),V=e}const le=new Set;let X;function Fe(){X={r:0,c:[],p:X}}function Se(){X.r||B(X.c),X=X.p}function P(t,e){t&&t.i&&(le.delete(t),t.i(e))}function W(t,e,n,l){if(t&&t.o){if(le.has(t))return;le.add(t),X.c.push(()=>{le.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function Y(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Qe(t,e){t.d(1),e.delete(t.key)}function Ye(t,e,n,l,s,i,o,r,u,_,h,f){let d=t.length,w=i.length,a=d;const m={};for(;a--;)m[t[a].key]=a;const k=[],q=new Map,L=new Map,E=[];for(a=w;a--;){const y=f(s,i,a),A=n(y);let M=o.get(A);M?l&&E.push(()=>M.p(y,e)):(M=_(A,y),M.c()),q.set(A,k[a]=M),A in m&&L.set(A,Math.abs(a-m[A]))}const R=new Set,C=new Set;function D(y){P(y,1),y.m(r,h),o.set(y.key,y),h=y.first,w--}for(;d&&w;){const y=k[w-1],A=t[d-1],M=y.key,S=A.key;y===A?(h=y.first,d--,w--):q.has(S)?!o.has(M)||R.has(M)?D(y):C.has(S)?d--:L.get(M)>L.get(S)?(C.add(M),D(y)):(R.add(S),d--):(u(A,o),d--)}for(;d--;){const y=t[d];q.has(y.key)||u(y,o)}for(;w;)D(k[w-1]);return B(E),k}function Ze(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function Te(t){t&&t.c()}function he(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),oe(()=>{const i=t.$$.on_mount.map(Me).filter(Ue);t.$$.on_destroy?t.$$.on_destroy.push(...i):B(i),t.$$.on_mount=[]}),s.forEach(oe)}function pe(t,e){const n=t.$$;n.fragment!==null&&(Je(n.after_update),B(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function $e(t,e){t.$$.dirty[0]===-1&&(G.push(t),Ge(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const a=w.length?w[0]:d;return _.ctx&&s(_.ctx[f],_.ctx[f]=a)&&(!_.skip_bound&&_.bound[f]&&_.bound[f](a),h&&$e(t,f)),d}):[],_.update(),h=!0,B(_.before_update),_.fragment=l?l(_.ctx):!1,e.target){if(e.hydrate){const f=He(e.target);_.fragment&&_.fragment.l(f),f.forEach(O)}else _.fragment&&_.fragment.c();e.intro&&P(t.$$.fragment),he(t,e.target,e.anchor),je()}$(u)}class me{constructor(){re(this,"$$");re(this,"$$set")}$destroy(){pe(this,1),this.$destroy=j}$on(e,n){if(!Ue(n))return j;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!Pe(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const xe="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(xe);function et(t){let e,n,l,s,i,o,r,u=(t[0].from_name||" ")+"",_,h,f,d=t[0].html+"",w,a,m=t[1][t[0].group_id][1]+"",k,q,L,E,R;return{c(){e=v("div"),n=v("img"),i=T(),o=v("div"),r=v("div"),_=H(u),h=T(),f=v("div"),w=T(),a=v("div"),k=H(m),q=T(),L=v("a"),E=v("time"),R=H(t[3]),p(n,"class","avatar svelte-15hb0c4"),J(n.src,l=ue("LUOXU_URL")+"/avatar/"+t[0].from_id+".jpg")||p(n,"src",l),p(n,"height","64"),p(n,"width","64"),p(n,"alt",s=t[0].from_name+" 的头像"),p(r,"class","name svelte-15hb0c4"),p(f,"class","text svelte-15hb0c4"),p(E,"datetime",t[4]),p(E,"title",t[2]),p(L,"href",t[5]),p(L,"class","svelte-15hb0c4"),p(a,"class","time svelte-15hb0c4"),p(o,"class","content svelte-15hb0c4"),p(e,"class","message svelte-15hb0c4")},m(C,D){U(C,e,D),g(e,n),g(e,i),g(e,o),g(o,r),g(r,_),g(o,h),g(o,f),f.innerHTML=d,g(o,w),g(o,a),g(a,k),g(a,q),g(a,L),g(L,E),g(E,R)},p(C,[D]){D&1&&!J(n.src,l=ue("LUOXU_URL")+"/avatar/"+C[0].from_id+".jpg")&&p(n,"src",l),D&1&&s!==(s=C[0].from_name+" 的头像")&&p(n,"alt",s),D&1&&u!==(u=(C[0].from_name||" ")+"")&&x(_,u),D&1&&d!==(d=C[0].html+"")&&(f.innerHTML=d),D&3&&m!==(m=C[1][C[0].group_id][1]+"")&&x(k,m)},i:j,o:j,d(C){C&&O(e)}}}function tt(t,e){const n={year:31536e6,month:2628e6,day:864e5,hour:36e5,minute:6e4,second:1e3},l=new Intl.RelativeTimeFormat,s=t.valueOf()-e.valueOf();for(const[i,o]of Object.entries(n))if(Math.abs(s)>o||i==="second")return l.format(Math.round(s/o),i)}function nt(t,e,n){let{msg:l}=e,{groupinfo:s}=e,{now:i}=e;const r=new Intl.DateTimeFormat(void 0,{timeStyle:"full",dateStyle:"full",hour12:!1}).format;let u=new Date(l.t*1e3),_=l.edited?new Date(l.edited*1e3):null,h=r(u)+(_?` -最后编辑于:${r(_)}`:""),f=tt(u,i),d=u.toISOString(),w=s[l.group_id][0]?`tg://resolve?domain=${s[l.group_id][0]}&post=${l.id}`:`tg://privatepost?channel=${l.group_id}&post=${l.id}`;return t.$$set=a=>{"msg"in a&&n(0,l=a.msg),"groupinfo"in a&&n(1,s=a.groupinfo),"now"in a&&n(6,i=a.now)},[l,s,h,f,d,w,i]}class lt extends me{constructor(e){super(),ge(this,e,nt,et,ae,{msg:0,groupinfo:1,now:6})}}function ke(t,e,n){const l=t.slice();return l[25]=e[n],l[27]=n,l}function Ee(t,e){let n,l,s,i=e[25][1]+"",o,r,u,_;return{key:t,first:null,c(){n=v("li"),l=v("img"),o=H(i),r=T(),J(l.src,s=e[6]+"/avatar/"+e[25][0]+".jpg")||p(l,"src",s),p(l,"alt","avatar"),p(l,"class","svelte-179qc5o"),p(n,"data-idx",u=e[27]),p(n,"title",_=e[25][1]),p(n,"class","svelte-179qc5o"),se(n,"selected",e[27]===e[1]),this.first=n},m(h,f){U(h,n,f),g(n,l),g(n,o),g(n,r)},p(h,f){e=h,f&4&&!J(l.src,s=e[6]+"/avatar/"+e[25][0]+".jpg")&&p(l,"src",s),f&4&&i!==(i=e[25][1]+"")&&x(o,i),f&4&&u!==(u=e[27])&&p(n,"data-idx",u),f&4&&_!==(_=e[25][1])&&p(n,"title",_),f&6&&se(n,"selected",e[27]===e[1])},d(h){h&&O(n)}}}function st(t){let e,n,l,s,i,o,r,u=[],_=new Map,h,f,d=Y(t[2]);const w=a=>a[25];for(let a=0;a{};function rt(t,e,n){let{group:l}=e,{selected:s}=e,{selected_init:i}=e,o="",r,u,_=[],h=ue("LUOXU_URL"),f,d,w=!1,a=new AbortController;Ne(()=>{const c=f.getBoundingClientRect();n(4,d.style.top=`${c.height-1}px`,d),n(4,d.style.width=`${c.width-2}px`,d)});function m(){const c=f.getBoundingClientRect();n(4,d.style.width=`${c.width-2}px`,d)}function k(){u&&clearTimeout(u),u=setTimeout(function(){q()},300)}async function q(){if(f.value){n(1,r=null),a.abort(),a=new AbortController;try{const b=await(await fetch(`${h}/names?g=${l}&q=${f.value}`,{signal:a.signal})).json();a.signal.aborted||n(2,_=b.names)}catch(c){c instanceof DOMException&&c.name==="AbortError"||console.error(c)}}}function L(c){let b=c.target;b.tagName==="IMG"&&(b=b.parentNode),b.tagName=="LI"&&(n(1,r=parseInt(b.dataset.idx)),E(),f.focus(),n(5,w=!0))}function E(){n(0,s=_[r][0]),o=_[r][1],n(3,f.value=o,f),n(12,i=null)}function R(){!s||s===i||(f.value?n(3,f.value=o,f):(n(0,s=i),o=""))}function C(c){c.key==="ArrowDown"||c.key==="n"&&c.altKey?(D(1),c.preventDefault()):c.key==="ArrowUp"||c.key==="p"&&c.altKey?(D(-1),c.preventDefault()):c.key==="Enter"&&(E(),c.preventDefault())}function D(c){typeof r=="number"?c>0?n(1,r=(r+1)%_.length):n(1,r=(r-1)%_.length):c>0?n(1,r=0):n(1,r=_.length-1)}function y(c){te[c?"unshift":"push"](()=>{f=c,n(3,f)})}const A=()=>{n(5,w=!1),k()},M=()=>n(5,w=!1),S=()=>{n(5,w=!0),R()};function F(c){te[c?"unshift":"push"](()=>{d=c,n(4,d)})}return t.$$set=c=>{"group"in c&&n(13,l=c.group),"selected"in c&&n(0,s=c.selected),"selected_init"in c&&n(12,i=c.selected_init)},[s,r,_,f,d,w,h,m,k,L,R,C,i,l,y,A,M,S,F]}class it extends me{constructor(e){super(),ge(this,e,rt,st,ae,{group:13,selected:0,selected_init:12})}}function ut(t){return new Promise((n,l)=>{setTimeout(n,t)})}function Le(t,e,n){const l=t.slice();return l[25]=e[n],l}function Ce(t,e,n){const l=t.slice();return l[2]=e[n],l}function ct(t){let e,n,l,s,i=t[10]&&at(),o=Y(t[0]),r=[];for(let u=0;ut[17].call(e))},m(u,_){U(u,e,_),i&&i.m(e,null),g(e,n);for(let h=0;h搜索消息时,搜索字符串不区分简繁(会使用 OpenCC - 自动转换),也不进行分词(请手动将可能不连在一起的词语以空格分开)。

搜索字符串支持以下功能:

  • 以空格分开的多个搜索词是「与」的关系
  • 使用 OR(全大写)来表达「或」条件
  • 使用 - 来表达排除,如 落絮 - 测试
  • 使用小括号来分组

人名补全支持上下方向键和 Alt+N/P 进行选择。

搜索结果右下角的时间,悬停可查看绝对时间、最后编辑时间(如编辑过),点击可跳转到 - Telegram 中展示该消息。

`},m(n,l){U(n,e,l)},p:j,i:j,o:j,d(n){n&&O(e)}}}function dt(t){let e,n,l=Y(t[4].messages),s=[];for(let o=0;oW(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o正在加载...

',p(e,"class","info svelte-cd7t1")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function gt(t){let e;return{c(){e=v("div"),e.innerHTML='

到底了。

',p(e,"class","info svelte-cd7t1")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function mt(t){let e;return{c(){e=v("div"),e.innerHTML='

没有匹配的消息。

',p(e,"class","info svelte-cd7t1")},m(n,l){U(n,e,l)},p:j,d(n){n&&O(e)}}}function bt(t){let e,n;return{c(){e=v("p"),n=H(t[3]),p(e,"class","error svelte-cd7t1")},m(l,s){U(l,e,s),g(e,n)},p(l,s){s&8&&x(n,l[3])},d(l){l&&O(e)}}}function Ae(t){let e,n,l,s;return{c(){e=v("div"),n=v("button"),n.textContent="加载更多",p(n,"class","svelte-cd7t1"),p(e,"class","info svelte-cd7t1")},m(i,o){U(i,e,o),g(e,n),l||(s=N(n,"click",t[14]),l=!0)},p:j,d(i){i&&O(e),l=!1,s()}}}function wt(t){let e,n,l,s,i,o,r,u,_,h,f,d,w,a,m,k;function q(c,b){return c[0].length===0?ft:ct}let L=q(t),E=L(t);function R(c){t[21](c)}let C={group:t[2],selected_init:t[8]};t[7]!==void 0&&(C.selected=t[7]),o=new it({props:C}),te.push(()=>Ze(o,"selected",R));const D=[dt,_t],y=[];function A(c,b){return c[4]?0:!c[6]&&!c[3]?1:-1}~(f=A(t))&&(d=y[f]=D[f](t));function M(c,b){return c[6]?pt:ht}let S=M(t),F=S(t);return{c(){e=v("main"),n=v("div"),E.c(),l=T(),s=v("input"),i=T(),Te(o.$$.fragment),u=T(),_=v("button"),_.textContent="搜索",h=T(),d&&d.c(),w=T(),F.c(),p(s,"type","search"),p(s,"class","svelte-cd7t1"),p(_,"class","svelte-cd7t1"),p(n,"id","searchbox"),p(n,"class","svelte-cd7t1"),p(e,"class","svelte-cd7t1")},m(c,b){U(c,e,b),g(e,n),E.m(n,null),g(n,l),g(n,s),Q(s,t[1]),g(n,i),he(o,n,null),g(n,u),g(n,_),g(e,h),~f&&y[f].m(e,null),g(e,w),F.m(e,null),a=!0,m||(k=[N(window,"hashchange",t[16]),N(s,"input",t[18]),N(s,"input",t[19]),N(s,"keydown",t[20]),N(_,"click",t[22])],m=!0)},p(c,[b]){L===(L=q(c))&&E?E.p(c,b):(E.d(1),E=L(c),E&&(E.c(),E.m(n,l))),b&2&&s.value!==c[1]&&Q(s,c[1]);const I={};b&4&&(I.group=c[2]),b&256&&(I.selected_init=c[8]),!r&&b&128&&(r=!0,I.selected=c[7],Ve(()=>r=!1)),o.$set(I);let K=f;f=A(c),f===K?~f&&y[f].p(c,b):(d&&(Fe(),W(y[K],1,1,()=>{y[K]=null}),Se()),~f?(d=y[f],d?d.p(c,b):(d=y[f]=D[f](c),d.c()),P(d,1),d.m(e,w)):d=null),S===(S=M(c))&&F?F.p(c,b):(F.d(1),F=S(c),F&&(F.c(),F.m(e,null)))},i(c){a||(P(o.$$.fragment,c),P(d),a=!0)},o(c){W(o.$$.fragment,c),W(d),a=!1},d(c){c&&O(e),E.d(),pe(o),~f&&y[f].d(),F.d(),m=!1,B(k)}}}const Z="https://search-pub.xtaolabs.com/luoxu";function yt(){const t=location.hash;if(t)return new URLSearchParams(t.substring(1))}function vt(t,e,n){const l=Z.startsWith("http://localhost");let s=[],i,o,r,u,_=new Date,h=!1,f=!1,d,w,a=!1,m=new AbortController;Ke("LUOXU_URL",Z),Ne(async()=>{for(k();;)try{const c=await fetch(`${Z}/groups`);n(0,s=(await c.json()).groups),n(15,f=!0),i||n(2,i="");break}catch(c){console.error("failed to fetch group info, will retry",c),await ut(1e3)}});function k(){const c=yt();c&&(n(1,o=""),n(2,i=""),n(4,u=null),c.has("g")&&n(2,i=c.get("g")),c.has("q")&&n(1,o=c.get("q")),c.has("sender")&&(n(7,d=c.get("sender")),n(8,w=d)),(i||l)&&o&&(n(4,u=null),L()))}let q=0;async function L(c){q+=1;try{if(m.abort(),m=new AbortController,!i&&!l){n(3,r="请选择要搜索的群组");return}if(!o&&!l&&!d){n(3,r="请输入搜索关键字");return}n(3,r=""),n(9,a=!0),console.log(`searching ${o} for group ${i}, older than ${c}, from ${d}`);const b=new URLSearchParams;i&&b.append("g",i),o&&b.append("q",o),d&&b.append("sender",d);let I;const K=b.toString();c?I=`${Z}/search?${b}&end=${c}`:(location.hash=`#${K}`,n(15,f=!0),u&&n(4,u.messages=[],u),I=`${Z}/search?${K}`),n(5,_=new Date),n(6,h=!0);try{const we=await(await fetch(I,{signal:m.signal})).json();if(n(6,h=!1),m.signal.aborted)return[];if(c)return we;n(4,u=we)}catch(be){q<=1&&(n(3,r=be),n(6,h=!1))}n(9,a=!1)}finally{q-=1}}async function E(){n(3,r=""),o&&await L()}async function R(){const c=u.messages[u.messages.length-1].t,b=u.messages,I=await L(c);n(4,u.messages=[...b,...I.messages],u),n(4,u.has_more=I.has_more,u)}const C=()=>{a||k()};function D(){i=Xe(this),n(2,i),n(0,s)}function y(){o=this.value,n(1,o)}const A=()=>n(3,r=""),M=c=>{c.key==="Enter"&&L()};function S(c){d=c,n(7,d)}const F=()=>L();return t.$$.update=()=>{if(t.$$.dirty&32775&&f&&s){let c;for(const b of s)b.group_id===i&&(c=b.name);o&&c?document.title=`搜索:${o} 于 ${c} - 落絮`:o?document.title=`搜索:${o} - 落絮`:c?document.title=`搜索 ${c} - 落絮`:document.title="落絮",n(15,f=!1)}},[s,o,i,r,u,_,h,d,w,a,l,k,L,E,R,f,C,D,y,A,M,S,F]}class kt extends me{constructor(e){super(),ge(this,e,vt,wt,ae,{})}}new kt({target:document.body}); diff --git a/html/assets/index-c1af15fa.css b/html/assets/index-f861d73e.css similarity index 53% rename from html/assets/index-c1af15fa.css rename to html/assets/index-f861d73e.css index 7907867..79f1a77 100644 --- a/html/assets/index-c1af15fa.css +++ b/html/assets/index-f861d73e.css @@ -1 +1 @@ -.message.svelte-15hb0c4.svelte-15hb0c4{margin:1em 0;padding:.5em;max-width:max-content;border:1px #eeeeee solid;box-shadow:0 0 3px gray;border-radius:5px;display:flex}.avatar.svelte-15hb0c4.svelte-15hb0c4{padding-right:.5em}.content.svelte-15hb0c4.svelte-15hb0c4{overflow:hidden}.name.svelte-15hb0c4.svelte-15hb0c4{white-space:nowrap;color:#1e90ff;overflow:hidden;text-overflow:ellipsis}.text.svelte-15hb0c4.svelte-15hb0c4{white-space:pre-wrap;margin:.2em 0}.text.svelte-15hb0c4>.keyword{background-color:#ffffab}.time.svelte-15hb0c4.svelte-15hb0c4{font-size:.75em;float:right;margin-right:2px}.time.svelte-15hb0c4.svelte-15hb0c4,.time.svelte-15hb0c4>a.svelte-15hb0c4{color:gray}div.svelte-179qc5o.svelte-179qc5o{position:relative}ul.svelte-179qc5o.svelte-179qc5o{list-style:none;padding:0;margin:0;position:absolute;left:0;background-color:#fff;box-shadow:0 0 4px var(--color-inactive);clip-path:polygon(-100% 0,200% 0,200% 200%,-100% 200%)}li.svelte-179qc5o.svelte-179qc5o{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;line-height:2em}li.svelte-179qc5o>img.svelte-179qc5o{height:calc(2.3em - 2px);width:calc(2.3em - 2px);vertical-align:middle;padding-right:.5em;display:inline-block;overflow:hidden}ul.svelte-179qc5o:not(:hover)>li.selected.svelte-179qc5o,li.svelte-179qc5o.svelte-179qc5o:hover{background-color:#d9f5ff}input.svelte-179qc5o.svelte-179qc5o{padding-left:2.5em;width:100%}input.svelte-179qc5o.svelte-179qc5o,ul.svelte-179qc5o.svelte-179qc5o{border-radius:0;border:1px solid var(--color-inactive)}input.svelte-179qc5o.svelte-179qc5o:focus,input.svelte-179qc5o:focus~ul.svelte-179qc5o{border-color:var(--color-active);box-shadow:0 0 4px var(--color-active);outline:1px solid var(--color-active)}input.svelte-179qc5o:focus~ul.svelte-179qc5o{border-top-color:var(--color-inactive)}.selected-avatar.svelte-179qc5o.svelte-179qc5o{position:absolute;pointer-events:none;top:1px;left:1px;height:calc(2.3em - 2px);width:calc(2.3em - 2px)}.hidden.svelte-179qc5o.svelte-179qc5o{display:none}html,body{position:relative;width:100%;height:100%}body{color:#333;margin:0;padding:8px;box-sizing:border-box;line-height:1.2;font-family:DejaVu Sans,sans-serif;margin-left:calc(100vw - 100%);overflow-x:hidden}a{color:#0064c8;text-decoration:none}a:hover{text-decoration:underline}a:visited{color:#0050a0}label{display:block}input,button,select,textarea{font-family:inherit;font-size:inherit;-webkit-padding:.4em 0;padding:.4em;margin:0 0 .5em;box-sizing:border-box;border:1px solid #ccc;border-radius:2px}input:disabled{color:#ccc}button{color:#333;background-color:#f4f4f4;outline:none}button:disabled{color:#999}button:not(:disabled):active{background-color:#ddd}button:focus{border-color:#666}main.svelte-cd7t1.svelte-cd7t1{margin:1em}button.svelte-cd7t1.svelte-cd7t1{white-space:nowrap}#searchbox.svelte-cd7t1.svelte-cd7t1{display:flex;margin-left:1px}#searchbox.svelte-cd7t1>*{margin-left:-1px}#searchbox.svelte-cd7t1 input[type=search].svelte-cd7t1{flex-grow:1}@media (max-width: 700px){#searchbox.svelte-cd7t1.svelte-cd7t1{flex-direction:column}}.error.svelte-cd7t1.svelte-cd7t1{color:red;text-align:center}.info.svelte-cd7t1.svelte-cd7t1{display:flex;justify-content:center}.info.svelte-cd7t1>.svelte-cd7t1{padding:.5em 1em;margin:1em 0}.info.svelte-cd7t1>p.svelte-cd7t1{border:1px #bfbfbf solid;border-radius:2em}input,button,select{border-radius:0;border:1px solid var(--color-inactive);height:2.3em}input:focus,button:focus,select:focus{border-color:var(--color-active);outline:1px solid var(--color-active);z-index:10}:root{--color-inactive:#bfbfbf;--color-active:#add8e6} +.message.svelte-15hb0c4.svelte-15hb0c4{margin:1em 0;padding:.5em;max-width:max-content;border:1px #eeeeee solid;box-shadow:0 0 3px gray;border-radius:5px;display:flex}.avatar.svelte-15hb0c4.svelte-15hb0c4{padding-right:.5em}.content.svelte-15hb0c4.svelte-15hb0c4{overflow:hidden}.name.svelte-15hb0c4.svelte-15hb0c4{white-space:nowrap;color:#1e90ff;overflow:hidden;text-overflow:ellipsis}.text.svelte-15hb0c4.svelte-15hb0c4{white-space:pre-wrap;margin:.2em 0}.text.svelte-15hb0c4>.keyword{background-color:#ffffab}.time.svelte-15hb0c4.svelte-15hb0c4{font-size:.75em;float:right;margin-right:2px}.time.svelte-15hb0c4.svelte-15hb0c4,.time.svelte-15hb0c4>a.svelte-15hb0c4{color:gray}div.svelte-179qc5o.svelte-179qc5o{position:relative}ul.svelte-179qc5o.svelte-179qc5o{list-style:none;padding:0;margin:0;position:absolute;left:0;background-color:#fff;box-shadow:0 0 4px var(--color-inactive);clip-path:polygon(-100% 0,200% 0,200% 200%,-100% 200%)}li.svelte-179qc5o.svelte-179qc5o{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;line-height:2em}li.svelte-179qc5o>img.svelte-179qc5o{height:calc(2.3em - 2px);width:calc(2.3em - 2px);vertical-align:middle;padding-right:.5em;display:inline-block;overflow:hidden}ul.svelte-179qc5o:not(:hover)>li.selected.svelte-179qc5o,li.svelte-179qc5o.svelte-179qc5o:hover{background-color:#d9f5ff}input.svelte-179qc5o.svelte-179qc5o{padding-left:2.5em;width:100%}input.svelte-179qc5o.svelte-179qc5o,ul.svelte-179qc5o.svelte-179qc5o{border-radius:0;border:1px solid var(--color-inactive)}input.svelte-179qc5o.svelte-179qc5o:focus,input.svelte-179qc5o:focus~ul.svelte-179qc5o{border-color:var(--color-active);box-shadow:0 0 4px var(--color-active);outline:1px solid var(--color-active)}input.svelte-179qc5o:focus~ul.svelte-179qc5o{border-top-color:var(--color-inactive)}.selected-avatar.svelte-179qc5o.svelte-179qc5o{position:absolute;pointer-events:none;top:1px;left:1px;height:calc(2.3em - 2px);width:calc(2.3em - 2px)}.hidden.svelte-179qc5o.svelte-179qc5o{display:none}html,body{position:relative;width:100%;height:100%}body{margin:0;padding:8px;box-sizing:border-box;line-height:1.2;font-family:DejaVu Sans,sans-serif;margin-left:calc(100vw - 100%);overflow-x:hidden}a{text-decoration:none}a:hover{text-decoration:underline}a:visited{color:#0050a0}label{display:block}input,button,select,textarea{font-family:inherit;font-size:inherit;-webkit-padding:.4em 0;padding:.4em;margin:0 0 .5em;box-sizing:border-box;border:1px solid #ccc;border-radius:2px}input:disabled{color:#ccc}button{outline:none}button:disabled{color:#999}button:not(:disabled):active{background-color:#ddd}button:focus{border-color:#666}main.svelte-1cv5ivi.svelte-1cv5ivi{margin:1em}button.svelte-1cv5ivi.svelte-1cv5ivi{white-space:nowrap}#searchbox.svelte-1cv5ivi.svelte-1cv5ivi{display:flex;margin-left:1px}#searchbox.svelte-1cv5ivi>*{margin-left:-1px}#searchbox.svelte-1cv5ivi input[type=search].svelte-1cv5ivi{flex-grow:1}#searchbox.svelte-1cv5ivi select.svelte-1cv5ivi,#searchbox.svelte-1cv5ivi input[type=search].svelte-1cv5ivi{background-color:var(--tg-theme-bg-color, #ffffff);color:var(--tg-theme-text-color, #222222);border:1px solid var(--tg-theme-link-color, #000);border-radius:4px}@media (max-width: 700px){#searchbox.svelte-1cv5ivi.svelte-1cv5ivi{flex-direction:column}}.error.svelte-1cv5ivi.svelte-1cv5ivi{color:red;text-align:center}.info.svelte-1cv5ivi.svelte-1cv5ivi{display:flex;justify-content:center}.info.svelte-1cv5ivi>.svelte-1cv5ivi{padding:.5em 1em;margin:1em 0}.info.svelte-1cv5ivi>p.svelte-1cv5ivi{border:1px #bfbfbf solid;border-radius:2em}input,button,select{border-radius:0;border:1px solid var(--color-inactive);height:2.3em}input:focus,button:focus,select:focus{border-color:var(--color-active);outline:1px solid var(--color-active);z-index:10}:root{--color-inactive:#bfbfbf;--color-active:#add8e6} diff --git a/html/index.html b/html/index.html index 461aef2..c828d89 100644 --- a/html/index.html +++ b/html/index.html @@ -1,33 +1,58 @@ - - + + - 消息记录搜索 - PaiGramTeam - 落絮 - - - - - - - - - - - - - - - - - + 消息记录搜索 - PaiGramTeam - 落絮 + + + + + + + + + + + + + + + + + - - - + + + + + + + + -