让你的网站输入炫酷起来,激活电源模式!

燥起来,让你的网站输入不再单调,激活电源模式,从此你就是最亮的仔!保存为书签,其他网站也能瞬间燥起来!

Demo:https://demo.buyao.vip/power/

部署:
下载源码,上传JS文件,然后在需要的网页引用以下代码:

<script src="./dist/activate-power-mode.js"></script>
<script> POWERMODE.colorful = true; document.body.addEventListener('input', POWERMODE); </script>
chrome capture - 让你的网站输入炫酷起来,激活电源模式!

源码下载: 点击下载分流下载

如果你想在其他网站也使用此效果,可以将以下代码保存为书签(收藏夹),然后在需要临时使用的网页点击一下书签(收藏夹)即可:

javascript:(function()%7B!function(t%2Ce)%7B"object"%3D%3Dtypeof exports%26%26"object"%3D%3Dtypeof module%3Fmodule.exports%3De()%3A"function"%3D%3Dtypeof define%26%26define.amd%3Fdefine(%5B%5D%2Ce)%3A"object"%3D%3Dtypeof exports%3Fexports.POWERMODE%3De()%3At.POWERMODE%3De()%7D(this%2Cfunction()%7Breturn function(t)%7Bfunction e(n)%7Bif(o%5Bn%5D)return o%5Bn%5D.exports%3Bvar r%3Do%5Bn%5D%3D%7Bexports%3A%7B%7D%2Cid%3An%2Cloaded%3A!1%7D%3Breturn t%5Bn%5D.call(r.exports%2Cr%2Cr.exports%2Ce)%2Cr.loaded%3D!0%2Cr.exports%7Dvar o%3D%7B%7D%3Breturn e.m%3Dt%2Ce.c%3Do%2Ce.p%3D""%2Ce(0)%7D(%5Bfunction(t%2Ce%2Co)%7B"use strict"%3Bfunction n(t%2Ce)%7Breturn Math.random()(e-t)%2Bt%7Dfunction r(t)%7Bif(a.colorful)%7Bvar e%3Dn(0%2C360)%3Breturn"hsla("%2Bn(e-10%2Ce%2B10)%2B"%2C 100%25%2C "%2Bn(50%2C80)%2B"%25%2C 1)"%7Dreturn window.getComputedStyle(t).color%7Dfunction i()%7Bvar t%2Ce%3Ddocument.activeElement%3Bif("TEXTAREA"%3D%3D%3De.tagName%7C%7C"INPUT"%3D%3D%3De.tagName%26%26"text"%3D%3D%3De.getAttribute("type"))%7Bvar n%3Do(1)(e%2Ce.selectionStart)%3Breturn t%3De.getBoundingClientRect()%2C%7Bx%3An.left%2Bt.left%2Cy%3An.top%2Bt.top%2Ccolor%3Ar(e)%7D%7Dvar i%3Dwindow.getSelection()%3Bif(i.rangeCount)%7Bvar d%3Di.getRangeAt(0)%2Ca%3Dd.startContainer%3Breturn a.nodeType%3D%3D%3Ddocument.TEXT_NODE%26%26(a%3Da.parentNode)%2Ct%3Dd.getBoundingClientRect()%2C%7Bx%3At.left%2Cy%3At.top%2Ccolor%3Ar(a)%7D%7Dreturn%7Bx%3A0%2Cy%3A0%2Ccolor%3A"transparent"%7D%7Dfunction d(t%2Ce%2Co)%7Breturn%7Bx%3At%2Cy%3Ae%2Calpha%3A1%2Ccolor%3Ao%2Cvelocity%3A%7Bx%3A-1%2B2Math.random()%2Cy%3A-3.5%2B2Math.random()%7D%7D%7Dfunction a()%7Bfor(var t%3Di()%2Ce%3D5%2BMath.round(10Math.random())%3Be--%3B)p%5Bf%5D%3Dd(t.x%2Ct.y%2Ct.color)%2Cf%3D(f%2B1)%25500%3Bvar o%3D1%2B2Math.random()%2Cn%3Do(Math.random()>.5%3F-1%3A1)%2Cr%3Do(Math.random()>.5%3F-1%3A1)%3Bdocument.body.style.marginLeft%3Dn%2B"px"%2Cdocument.body.style.marginTop%3Dr%2B"px"%2CsetTimeout(function()%7Bdocument.body.style.marginLeft%3D""%2Cdocument.body.style.marginTop%3D""%7D%2C75)%7Dfunction l()%7BrequestAnimationFrame(l)%2Cu.clearRect(0%2C0%2Cc.width%2Cc.height)%3Bfor(var t%3D0%3Bt%3D.96%2Cu.globalAlpha%3De.alpha%2Cu.fillStyle%3De.color%2Cu.fillRect(Math.round(e.x-1.5)%2CMath.round(e.y-1.5)%2C3%2C3))%7D%7Dvar c%3Ddocument.createElement("canvas")%3Bc.width%3Dwindow.innerWidth%2Cc.height%3Dwindow.innerHeight%2Cc.style.cssText%3D"position%3Afixed%3Btop%3A0%3Bleft%3A0%3Bpointer-events%3Anone%3Bz-index%3A999999"%2Cwindow.addEventListener("resize"%2Cfunction()%7Bc.width%3Dwindow.innerWidth%2Cc.height%3Dwindow.innerHeight%7D)%2Cdocument.body.appendChild(c)%3Bvar u%3Dc.getContext("2d")%2Cp%3D%5B%5D%2Cf%3D0%3Ba.colorful%3D!1%2CrequestAnimationFrame(l)%2Ct.exports%3Da%7D%2Cfunction(t%2Ce)%7B!function()%7Bfunction e(t%2Ce%2Cr)%7Bvar i%3Dr%26%26r.debug%7C%7C!1%3Bif(i)%7Bvar d%3Ddocument.querySelector("%23input-textarea-caret-position-mirror-div")%3Bd%26%26d.parentNode.removeChild(d)%7Dvar a%3Ddocument.createElement("div")%3Ba.id%3D"input-textarea-caret-position-mirror-div"%2Cdocument.body.appendChild(a)%3Bvar l%3Da.style%2Cc%3Dwindow.getComputedStyle%3FgetComputedStyle(t)%3At.currentStyle%3Bl.whiteSpace%3D"pre-wrap"%2C"INPUT"!%3D%3Dt.nodeName%26%26(l.wordWrap%3D"break-word")%2Cl.position%3D"absolute"%2Ci%7C%7C(l.visibility%3D"hidden")%2Co.forEach(function(t)%7Bl%5Bt%5D%3Dc%5Bt%5D%7D)%2Cn%3Ft.scrollHeight>parseInt(c.height)%26%26(l.overflowY%3D"scroll")%3Al.overflow%3D"hidden"%2Ca.textContent%3Dt.value.substring(0%2Ce)%2C"INPUT"%3D%3D%3Dt.nodeName%26%26(a.textContent%3Da.textContent.replace(%2F%5Cs%2Fg%2C" "))%3Bvar u%3Ddocument.createElement("span")%3Bu.textContent%3Dt.value.substring(e)%7C%7C"."%2Ca.appendChild(u)%3Bvar p%3D%7Btop%3Au.offsetTop%2BparseInt(c.borderTopWidth)%2Cleft%3Au.offsetLeft%2BparseInt(c.borderLeftWidth)%7D%3Breturn i%3Fu.style.backgroundColor%3D"%23aaa"%3Adocument.body.removeChild(a)%2Cp%7Dvar o%3D%5B"direction"%2C"boxSizing"%2C"width"%2C"height"%2C"overflowX"%2C"overflowY"%2C"borderTopWidth"%2C"borderRightWidth"%2C"borderBottomWidth"%2C"borderLeftWidth"%2C"borderStyle"%2C"paddingTop"%2C"paddingRight"%2C"paddingBottom"%2C"paddingLeft"%2C"fontStyle"%2C"fontVariant"%2C"fontWeight"%2C"fontStretch"%2C"fontSize"%2C"fontSizeAdjust"%2C"lineHeight"%2C"fontFamily"%2C"textAlign"%2C"textTransform"%2C"textIndent"%2C"textDecoration"%2C"letterSpacing"%2C"wordSpacing"%2C"tabSize"%2C"MozTabSize"%5D%2Cn%3Dnull!%3Dwindow.mozInnerScreenX%3B"undefined"!%3Dtypeof t%26%26"undefined"!%3Dtypeof t.exports%3Ft.exports%3De%3Awindow.getCaretCoordinates%3De%7D()%7D%5D)%7D)%2Cfunction()%7BPOWERMODE.colorful%3D!0%2Cdocument.body.addEventListener("input"%2CPOWERMODE)%7D()%7D)()