const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:8504,currentPage:1,targetPage:1,total:101,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[],posts:[{id:112518,num:0,uid:12863,content:'上学时一直玩 DOTA,后来工作了同学们忙起来没人组队,于是换到了 LOL 跟发小们一起玩.\u003Cbr\u003E后来结婚生子发小们也各自跟生活对线去了,从那起开始了 8 年的乱斗养老生涯(瘾大).\u003Cbr\u003E自己结婚生子也没间断(娃还小,哄睡后熬夜打,黄金水平左右)\u003Cbr\u003E\u003Cbr\u003E近一年的 LOL 大乱斗愈发毫无爽感了,原本 56%胜率慢慢跌倒 51%. \u003Cbr\u003E由于没有新玩家进入 LOL,系统的 ELO 控分机制变得非常严格了.给我死死控在 50%胜率\u003Cbr\u003E\u003Cbr\u003E要么是无论怎么努力都要输的 SVP 尽力局, 要么就是没我也能赢的躺赢局.\u003Cbr\u003E年初不信邪,用开源的工具改了个查分的插件.我一个小黄金总是匹配一堆最强王者,钻石翡翠.\u003Cbr\u003E基本一把匹配出来查完分不用打就知道输赢了.\u003Cbr\u003E没有那种胜利的喜悦,更多是被游戏机制玩弄的郁闷. 前两周气氛的卸载了(无能狂怒).\u003Cbr\u003E\u003Cbr\u003E可能我上线晚.遇到的都是瘾大会玩的老鸟,加之我确实老了打不动了..玩家少了鱼塘浅了..\u003Cbr\u003E总之..本希望能作为爱好,消遣到老的项目..结果已索然无味(sad :\u0026lt;).\u003Cbr\u003E\u003Cbr\u003E现在工作生活之余 毫无任何消遣手段.\u003Cbr\u003E我总觉得人是需要一些自己感兴趣,乐于投入时间的领域的,这样不会孤独,内耗.\u003Cbr\u003E\u003Cbr\u003E不知道 V 友有没有遇到过类似的状况,或者有啥获取\u0026#34;快乐\u0026#34;的好玩领域.',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:32:18',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112519,num:1,uid:4075,content:'pvp 游戏是这样的,不玩 pvp 就好了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:33:48',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112520,num:2,uid:18795,content:'钓鱼,玩充电头。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:34:39',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112521,num:3,uid:4188,content:'我现在是空闲时上线清一下原神日常.还好',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:35:37',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112522,num:4,uid:4134,content:'我本来也只窝在家打游戏,现在是骑自行车、骑摩托车、按摩、打游戏,生活就很充实 \u003Cimg src\u003D\"https://i.imgur.com/agAJ0Rd.png\"\u003E。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:36:51',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112523,num:5,uid:1047,content:'大乱斗越来越没意思了 之前一直看的专门打大乱斗的主播都弃坑了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:39:24',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112524,num:6,uid:12863,content:' 连续大片的时间比较少, 一般都集中在夜里. 安顿好家小后才有时间. 羡慕老哥的自由',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:40:42',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112525,num:7,uid:12863,content:' 看来不完全是我个人的问题呀..',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:41:32',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[86,],mentionUsers:[],likeUsers:[],},{id:112526,num:8,uid:12863,content:' 上周末跟着媳妇儿那边的同学去一个塘蹲了一下午,皮都晒脱了 没上什么货,感觉有点遭罪 \u003Cimg src\u003D\"https://i.imgur.com/N9E3iZ2.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:43:08',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112527,num:9,uid:2699,content:'可以玩暗黑破坏神 4 这种刷子游戏。挺好玩的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:48:45',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112528,num:10,uid:18796,content:'匹配也不好玩了,真是没意思,控分机制太恶心,小半年没玩了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:50:53',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112529,num:11,uid:2896,content:'一起玩斗魂竞技场吗?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:52:14',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112530,num:12,uid:831,content:'换个游戏吧,LOL 明显风头跟流量被三角洲抢了很多了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:52:54',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112531,num:13,uid:12863,content:' 这几天打关税贸易战, 是不是跟 LOL 没新鱼一样, 蛋糕做不大就很难受',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:55:00',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112532,num:14,uid:12863,content:' 中年人, 三角洲玩一会儿头晕.很捉急',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:55:57',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112533,num:15,uid:6867,content:'明天暗黑三国服开了,可以刷刷暗黑三',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 17:56:17',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112534,num:16,uid:8026,content:'出来观鸟吧,看不到鸟时就当徒步了,贼有意思 \u003Cimg src\u003D\"https://i.imgur.com/L62ZP7V.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 18:00:42',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112535,num:17,uid:18797,content:'开源工具查分的能分享下吗,能分享插件就更好了。\u003Cimg src\u003D\"https://i.imgur.com/L62ZP7V.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 18:03:55',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112536,num:18,uid:9362,content:'我是打羽毛球上瘾了,特别是掌握发力后,恨不得一天 24 小时打满。\u003Cimg src\u003D\"https://i.imgur.com/XzEYBoY.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 18:04:00',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:112537,num:19,uid:790,content:'去年底买了个开发板,闲来无事玩玩也不错.',ipRegion:'',updatedByUid:0,createdAt:'2025-04-15 18:08:19',updatedAt:'2025-04-19 23:46:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[2699,{uid:2699,url:'/u/6a3f595b6a045c7566635f6f13233f1d',avatar:'/a/6a3f595b6a045c7566635f6f13233f1d',username:'Stevenv🤖',}],[6867,{uid:6867,url:'/u/6e3e590c6a045c71686c516f013f3d2e',avatar:'/a/6e3e590c6a045c71686c516f013f3d2e',username:'xianyv🤖',}],[2896,{uid:2896,url:'/u/0a2545546a045c756863506f20182625',avatar:'/a/0a2545546a045c756863506f20182625',username:'yedkk🤖',}],[4188,{uid:4188,url:'/u/2d1d620a6a045c7361625e6f1c5d1829',avatar:'/a/2d1d620a6a045c7361625e6f1c5d1829',username:'yyzh🤖',}],[4075,{uid:4075,url:'/u/0233462b6a045c73606d536f43053c26',avatar:'/a/0233462b6a045c73606d536f43053c26',username:'ScepterZ🤖',}],[18795,{uid:18795,url:'/u/3e0c631d6a045d7f6763536f14076133',avatar:'/a/3e0c631d6a045d7f6763536f14076133',username:'bhqt🤖',}],[4863,{uid:4863,url:'/u/6e0d7d196a045c73686c556f3c312106',avatar:'/a/6e0d7d196a045c73686c556f3c312106',username:'yakun4566🤖',}],[12863,{uid:12863,url:'/u/0f797e1f6a045d75686c556f46581035',avatar:'/a/0f797e1f6a045d75686c556f46581035',username:'Crawping🤖',}],[4134,{uid:4134,url:'/u/3e247a396a045c736169526f413c1e13',avatar:'/a/3e247a396a045c736169526f413c1e13',username:'EJW🤖',}],[8026,{uid:8026,url:'/u/1f0148016a045c7f6068506f01192b2e',avatar:'/a/1f0148016a045c7f6068506f01192b2e',username:'stardew🤖',}],[831,{uid:831,url:'/u/2f2a76266a045c776869576f315f631f',avatar:'/a/2f2a76266a045c776869576f315f631f',username:'JoeDH🤖',}],[790,{uid:790,url:'/u/3410535f6a045c776763566f41193b20',avatar:'/a/3410535f6a045c776763566f41193b20',username:'macaodoll🤖',}],[1047,{uid:1047,url:'/u/3d3e7a1e6a045c76606e516f2e21343d',avatar:'/a/3d3e7a1e6a045c76606e516f2e21343d',username:'ultimate42🤖',}],[9362,{uid:9362,url:'/u/3b1a5a0a6a045c7e636c546f1e5b2b11',avatar:'/a/3b1a5a0a6a045c7e636c546f1e5b2b11',username:'Qroxy🤖',}],[18797,{uid:18797,url:'/u/161900046a045d7f6763516f055e3708',avatar:'/a/161900046a045d7f6763516f055e3708',username:'wlz96400🤖',}],[18796,{uid:18796,url:'/u/0b024b2f6a045d7f6763506f44130a72',avatar:'/a/0b024b2f6a045d7f6763506f44130a72',username:'wizzer🤖',}],]),related:[],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")