url-animations
Version:
Animations in your Browser URL Field
1 lines • 15 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("url_animations",[],t):"object"==typeof exports?exports.url_animations=t():e.url_animations=t()}(this,(()=>(()=>{"use strict";var e={89:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Bounce",creator:"LunarFang_416",baseState:{position:0,right:!0},nextState:(e,t)=>{const n=["¸",".","·","´","'","·","."];let r="";for(let e=0;e<29;++e)28===e?r+="#":e===t.position?r+=n[e%n.length]:r+="...";return t.position>=28?t.right=!1:t.position<=0&&(t.right=!0),t.position+=t.right?1:-1,{nextFrame:r,state:t}}}},556:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e=["(>'-')>","^('-')^","<('-'<)","^('-')^"],t=500){this.name="Custom",this.creator="LunarFang_416",this.baseState={frameRate:0,index:0,frames:[],pastTimeStamp:0},this.baseState.frames=e,this.baseState.frameRate=t>1e3?500:t}nextState(e,t){return e-t.pastTimeStamp>1e3-t.frameRate&&(t.index=(t.index+1)%t.frames.length,t.pastTimeStamp=e),{nextFrame:t.frames[t.index],state:t}}}},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Default",creator:"LunarFang_416",baseState:{pastTimeStamp:0,index:0},nextState:(e,t)=>{const n=["CLICK#","ON#","AN#","ANIMATION#"],r=n[t.index];return e-t.pastTimeStamp>1e3&&(t.index=(t.index+1)%n.length,t.pastTimeStamp=e),{nextFrame:r,state:t}}}},789:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Flip",creator:"LunarFang_416",baseState:{currentFrameIndex:0,right:!0},nextState:(e,t)=>{const n=["(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°-°)\\.┬─┬","(\\°□°)\\..┬─┬","(\\°□°)\\..┬─┬","(-°□°)-..┬─┬","(-°□°)-..┬─┬","(╯°□°)╯....]","(╯°□°)╯....]","(╯°□°)╯....]","(╯°□°)╯....]","(╯°□°)╯..︵..┻━┻","(╯°□°)╯..︵..┻━┻","(╯°□°)╯..︵..┻━┻","(╯°□°)╯..︵..┻━┻","(╯°□°)╯.......[","(╯°□°)╯.......[","(╯°□°)╯.......[","(╯°□°)╯.......[","(╯°□°)╯.......︵..┬─┬","(╯°□°)╯.......︵..┬─┬","(╯°□°)╯.......︵..┬─┬","(╯°□°)╯.......︵..┬─┬","(╯°□°)╯.................]","(╯°□°)╯.................]","(╯°□°)╯.................]","(╯°□°)╯.................]","(╯°□°)╯...............︵..┻━┻","(╯°□°)╯...............︵..┻━┻","(╯°□°)╯...............︵..┻━┻","(╯°□°)╯...............︵..┻━┻","(╯°□°)╯.........................[","(╯°□°)╯.........................[","(╯°□°)╯.........................[","(╯°□°)╯.........................[","(\\°-°)\\............................︵..┬─┬","(\\°-°)\\............................︵..┬─┬","(\\°-°)\\............................︵..┬─┬","(\\°-°)\\............................︵..┬─┬","(\\°-°)\\.....................................]","(\\°-°)\\.....................................]","(\\°-°)\\.....................................]","(\\°-°)\\.....................................]","(\\°-°)\\.....................................︵.┻━┻","(\\°-°)\\.....................................︵.┻━┻","(\\°-°)\\.....................................︵.┻━┻","(\\°-°)\\.....................................︵.┻━┻","(\\°-°).....................................\\[","(\\°-°).....................................\\[","(\\°-°).....................................\\[","(\\°-°).....................................\\[","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬","(\\°-°)\\..............................................┬─┬"],r="."+n[t.currentFrameIndex];return t.currentFrameIndex>=n.length-1?t.right=!1:t.currentFrameIndex<=0&&(t.right=!0),t.currentFrameIndex+=t.right?1:-1,{nextFrame:r,state:t}}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"O",creator:"LunarFang_416",baseState:{pastTimeStamp:0,index:0},nextState:(e,t)=>{const n=[":O................#","..Ö................#","...O:.............#",".....O̤............#","......:O..........#","........Ö..........#","..........O:......#","............O̤.....#",".............:O...#","...............Ö...#","................O:#","...............Ö...#",".............:O...#","............O̤.....#","..........O:......#","........Ö..........#","......:O..........#",".....O̤............#","...O:.............#","..Ö................#"];return e-t.pastTimeStamp>90&&(t.index=(t.index+1)%n.length,t.pastTimeStamp=e),{nextFrame:n[t.index],state:t}}}},434:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"OG_Loader",creator:"LunarFang_416",baseState:{pastTimeStamp:0,index:0,maxLoading:6},nextState:(e,t)=>(e-t.pastTimeStamp>500&&(t.index=(t.index+1)%t.maxLoading,t.pastTimeStamp=e),{nextFrame:"Loading"+".".repeat(t.index),state:t})}},303:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Plane",creator:"LunarFang_416",baseState:{position:0,skyLength:150,right:!0,propeller:"|"},nextState:(e,t)=>{let n="";const r=t.propeller,a=t.right?"'--//->":"<-\\\\--'",s=t.right?a+r:r+a;for(let e=0;e<t.skyLength;++e)e===t.position?(n+=s,e+=s.length):n+=".";return t.position+=t.right?1:-1,t.position>=t.skyLength-1?t.right=!1:t.position<=0&&(t.right=!0),t.propeller={"|":"/","/":"-","-":"\\","\\":"|"}[t.propeller],{nextFrame:n,state:t}}}},852:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Shark",creator:"LunarFang_416",baseState:{position:0,waterLength:30,right:!0,past:0},nextState:(e,t)=>{let n="";const r=t.right?"|\\":"/|";for(let e=0;e<t.waterLength;++e)e===t.position?n+=r:e===t.waterLength-1?n+="#":n+="_";return t.position+=t.right?1:-1,t.position>t.waterLength-3?t.right=!1:t.position<=0&&(t.right=!0),{nextFrame:n,state:t}}}},812:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Source_05=t.Source_04=t.Source_03=t.Source_02=t.Source_01=void 0;class n{nextState(e,t){let n="";const r=(t.maxLength-t.message.length)/2;for(let e=0;e<=r;e++)n+=t.chars[(t.index+e)%t.chars.length];n+=t.message;for(let e=0;e<=r;e++){const r=t.index-e,a=t.chars.length,s=(r%a+a)%a;n+=t.chars[s]}return t.index+=1,{nextFrame:n,state:t}}}t.Source_01=class extends n{constructor(){super(...arguments),this.name="Source_01",this.creator="lunarfang_416",this.baseState={index:0,chars:"_,.-'¯....",maxLength:160,message:"another_another_one"}}},t.Source_02=class extends n{constructor(){super(...arguments),this.name="Source_02",this.creator="lunarfang_416",this.baseState={index:0,chars:"|/-\\|/-\\",maxLength:160,message:"another_one_dj"}}},t.Source_03=class extends n{constructor(){super(...arguments),this.name="Source_03",this.creator="lunarfang_416",this.baseState={index:0,chars:'_.~"|',maxLength:160,message:"another_one_dj_khaled"}}},t.Source_04=class extends n{constructor(){super(...arguments),this.name="Source_04",this.creator="lunarfang_416",this.baseState={index:0,chars:"\"'-._,-'",maxLength:160,message:"dj_khaled"}}},t.Source_05=class extends n{constructor(){super(...arguments),this.name="Source_05",this.creator="lunarfang_416",this.baseState={index:0,chars:"|/-.-\\|/-'-\\",maxLength:160,message:"__dj_khaled__"}}}},70:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner_11=t.Spinner_10=t.Spinner_09=t.Spinner_08=t.Spinner_07=t.Spinner_06=t.Spinner_05=t.Spinner_04=t.Spinner_03=t.Spinner_02=t.Spinner_01=void 0;class n{nextState(e,t){let n="";return e-t.pastTimeStamp>=t.speed&&(t.index+=1,t.pastTimeStamp=e),n=t.spinner[t.index%t.spinner.length].repeat(t.maxLength),{nextFrame:n,state:t}}}t.Spinner_01=class extends n{constructor(){super(...arguments),this.name="Spinner_01",this.creator="lunarfang_416",this.baseState={index:0,spinner:["←","↖","↑","↗","→","↘","↓","↙"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_02=class extends n{constructor(){super(...arguments),this.name="Spinner_02",this.creator="lunarfang_416",this.baseState={index:0,spinner:["▁","▂","▃","▄","▅","▆","▇","█","▇","▆","▅","▄","▃","▁"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_03=class extends n{constructor(){super(...arguments),this.name="Spinner_03",this.creator="lunarfang_416",this.baseState={index:0,spinner:["▉","▊","▋","▌","▍","▎","▏","▎","▍","▌","▋","▊","▉"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_04=class extends n{constructor(){super(...arguments),this.name="Spinner_04",this.creator="lunarfang_416",this.baseState={index:0,spinner:["▖","▘","▝","▗"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_05=class extends n{constructor(){super(...arguments),this.name="Spinner_05",this.creator="lunarfang_416",this.baseState={index:0,spinner:["┤","┘","┴","└","├","┌","┬","┐"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_06=class extends n{constructor(){super(...arguments),this.name="Spinner_06",this.creator="lunarfang_416",this.baseState={index:0,spinner:["◢","◣","◤","◥"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_07=class extends n{constructor(){super(...arguments),this.name="Spinner_07",this.creator="lunarfang_416",this.baseState={index:0,spinner:["◰","◳","◲","◱"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_08=class extends n{constructor(){super(...arguments),this.name="Spinner_08",this.creator="lunarfang_416",this.baseState={index:0,spinner:["◐","◓","◑","◒"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_09=class extends n{constructor(){super(...arguments),this.name="Spinner_09",this.creator="lunarfang_416",this.baseState={index:0,spinner:["|","/","-","\\","\\"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_10=class extends n{constructor(){super(...arguments),this.name="Spinner_10",this.creator="lunarfang_416",this.baseState={index:0,spinner:[".","o","O","@","*"],maxLength:160,speed:150,pastTimeStamp:0}}},t.Spinner_11=class extends n{constructor(){super(...arguments),this.name="Spinner_11",this.creator="lunarfang_416",this.baseState={index:0,spinner:["_◡◡_","_⊙⊙_","_◠◠_"],maxLength:160,speed:150,pastTimeStamp:0}}}},625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default={name:"Squiggle",creator:"LunarFang_416",baseState:{currentFrameIndex:0,pastTimeStamp:0,prevFrame:"",curLoop:0},nextState:(e,t)=>{const n=[".̲","ﺭ","ﬤ","ᕊ","5","5.͞","5.͞.̅ᐣ","5.͞ᕈ","5.͞Ƨ","5.͞Ƨ_"],r=n[t.currentFrameIndex],a=t.prevFrame+r;return e-t.pastTimeStamp>100&&(t.currentFrameIndex>=n.length-1?(t.curLoop+=1,t.curLoop>10?(t.prevFrame="",t.curLoop=0):t.prevFrame+=r,t.currentFrameIndex=0):t.currentFrameIndex+=1,t.pastTimeStamp=e),{nextFrame:a,state:t}}}},218:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Swim",creator:"LunarFang_416",baseState:{position:0,waterLength:30,right:!0,past:0},nextState:(e,t)=>{let n="";const r=t.right?"|\\":"/|",a=["/","-","\\"][t.position%3],s=t.right?">-"+a+"o":"o"+a+"-<",i=t.right?r+"~~~~"+s:s+"~~~~"+r;for(let e=0;e<t.waterLength;++e)e===t.position?n+=i:n+="~";return t.position+=t.right?1:-1,t.position>t.waterLength-2?t.right=!1:t.position<=0&&(t.right=!0),n+="#",{nextFrame:n,state:t}}}},253:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={name:"Wave",creator:"LunarFang_416",baseState:{index:0,right:!0,prevMouseX:0},nextState:(e,t)=>{const n=["¸",".","·","´","¯","'","·",".","¸"];let r="";for(let e=0;e<800;++e)r+=n[(e+t.index)%n.length];const a=window.pageXOffset;return a>t.prevMouseX?t.right=!0:a<t.prevMouseX?t.right=!1:t.right=t.right,t.right?(r=r.split("").reverse().join(""),t.right=!0):t.right=!1,t.index=t.index===n.length-1?0:t.index+1,t.prevMouseX=a,{nextFrame:r,state:t}}};t.default=n},962:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const n={name:"Wave2_0",creator:"LunarFang_416",baseState:{index:0,right:!0,prevMouseX:0},nextState:(e,t)=>{const n=["䷫","䷌","䷉","䷈","䷍","䷈","䷉","䷌"];let r="";for(let e=0;e<800;++e)r+=n[(e+t.index)%n.length];const a=window.pageXOffset;return a>t.prevMouseX?t.right=!0:a<t.prevMouseX?t.right=!1:t.right=t.right,t.right?(r=r.split("").reverse().join(""),t.right=!0):t.right=!1,t.index=t.index===n.length-1?0:t.index+1,t.prevMouseX=a,{nextFrame:r,state:t}}};t.default=n}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.URLAnimation=e.Animations=e.Custom=void 0;const t=n(89),a=n(556),s=n(545),i=n(789),o=n(485),p=n(434),u=n(303),c=n(852),d=n(812),_=n(70),m=n(625),l=n(218),h=n(253),S=n(962);var g=n(556);Object.defineProperty(e,"Custom",{enumerable:!0,get:function(){return g.default}}),e.Animations={default:s.default,og_loader:p.default,custom:new a.default,shark:c.default,swim:l.default,plane:u.default,flip:i.default,wave:h.default,wave2_0:S.default,bounce:t.default,o:o.default,squiggle:m.default,source_01:new d.Source_01,source_02:new d.Source_02,source_03:new d.Source_03,source_04:new d.Source_04,source_05:new d.Source_05,spinner_01:new _.Spinner_01,spinner_02:new _.Spinner_02,spinner_03:new _.Spinner_03,spinner_04:new _.Spinner_04,spinner_05:new _.Spinner_05,spinner_06:new _.Spinner_06,spinner_07:new _.Spinner_07,spinner_08:new _.Spinner_08,spinner_09:new _.Spinner_09,spinner_10:new _.Spinner_10,spinner_11:new _.Spinner_11},e.URLAnimation=()=>{let e,t="";return{start:n=>{let r=n.baseState;clearInterval(e),e=setInterval((()=>{const e=n.nextState(Date.now(),r);t=e.nextFrame,r=e.state,window.location.replace(`${window.location.pathname+window.location.search}#${t}`)}),66)},stop:()=>{clearInterval(e),window.location.replace(`${window.location.pathname+window.location.search}`)}}}})(),r})()));