Skip to content

Instantly share code, notes, and snippets.

@Matsukii
Last active December 11, 2019 19:50
Show Gist options
  • Select an option

  • Save Matsukii/9f2057f332f8cb8a65a912ebfd7cf553 to your computer and use it in GitHub Desktop.

Select an option

Save Matsukii/9f2057f332f8cb8a65a912ebfd7cf553 to your computer and use it in GitHub Desktop.
a simple class to get random messages from array, used in http://presnt.in
/**
* @author Matsukii
* @Description get a random text pharse from array
*/
class loadingMessages {
msgs = [
'Loading',
'Opening inventory...',
'Looking for your history',
'Link start!',
'Do you know the way?',
'loading the loading',
"Oh snap! i'm in a infinite loop /*/(this may take some time...)",
'Launching rockets...',
'Searching for... /*/wait, what i need to load?',
'Watching the dogs...',
'How did you get there?',
'Is this working?',
'Yes!',
'No',
'Looking in your browse history... /*/Hmmm, what is this??',
'Dont forget to drink water..',
'Running with scissors',
"I'm behind you... 👻 Boo!",
'Definitely not a virus...',
'Recharging the batteries',
'Close the tab to load *faster*',
'This will be loaded before One Piece ends /*/(i guess)',
'Stay Hydrated',
'Searching for bugs... /*/found 256...',
'Checking TODOs...',
"Please don't beat me if not loads",
'Humanity can be saved from Thanos snap /*/if /*/Naruto duble the population with clones',
`Is currently ${(new Date()).getHours()} hours and ${(new Date()).getMinutes()} mins`,
'Just load',
'( ͡° ͜ʖ ͡°) loading the things for you',
'SPAAAAAAAAAAAAAAAAAAAAACE',
'hehehe',
'OwO',
'(ノ◕ヮ◕)ノ*.✧',
'Se o Pica-Pau tivesse comunicado a polícia, /*/isto nunca teria acontecido',
'If Woody had gone right to the police, /*/this would never have happened',
`ヽヽ`ヽ`、ヽヽ`ヽ`、ヽヽ`ヽ ` /*/
、ヽヽ`ヽ`、ヽヽ`ヽ`、`、ヽヽ` /*/
`ヽ Do you like rainy days? `ヽ /*/
`ヽ`、ヽヽ`ヽ`、ヽヽ`ヽ`、ヽヽ /*/
`ヽ`、ヽヽ`ヽ`、ヽヽ`ヽ`、ヽ   /*/ `,
"hmm",
"GOOD NIGHT /*/GOOD LUCK",
"em caso de incendio, /*/fique embaixo do chuveiro para nao se queimar",
"In case of fire, stay under shower /*/so that you do not burn yourself",
"You can't write America without Erica",
'De-De-Death! Dekomori Desu!',
'Reality be rent. /*/Synapse break. /*/Banishment, this world!',
'This will be loaded before Half Life 3 announcement',
'CREEPER',
'CREEPER /*/Aww man',
'When did you notice there is a bunch of references in this messages? /*/(mainly related to weeabo things)',
'OOF',
'Pathetic.',
'UwU',
'NO U',
':)',
'Did you know this song: /*/Turururu rururu rururu...?',
'Tutturu o/',
'(•ᴗ•)',
'ORA ORA ORA ORA ORA ORA ORA ORA ORA ORA ORA ORA',
'MUDA MUDA MUDA MUDA MUDA MUDA MUDA MUDA',
'◕‿◕ ✿',
'>‿◕ loading',
'(◍•ᴗ•◍)',
'(^ω^)',
'(╹◡╹)',
'*make loading message later*',
'Say Aaahhhh',
'Searching for nemo',
'DIO /*/JOTARO',
'ZA WARUDO',
'UωU',
'!',
'?',
'(ง •̀ω•́)ง✧',
'✕',
'Exxprooosion',
'These messages is totally related /*/to this presentation...',
'You can disable this messages on settings, /*/you know right? /*/right?',
'KONO DIO DA',
];
constructor() {
this.message = this.newMessage();
if(this.message == undefined){
this.message = this.newMessage();
};
};
newMessage() { return this.msgs[this.randomize()] }
randomize(){
let min = Math.ceil(0);
let max = Math.floor(this.msgs.length-1);
return Math.floor(Math.random() * (max-min+1)) + 1;
}
static newm(){
let msg = (new loadingMessages).message;
msg = msg.replace('/*/', '');
return `${msg}`;
}
static newmHTML(){
let msg = (new loadingMessages).message;
while(msg.lastIndexOf('/*/') > -1){
msg = msg.replace('/*/', '<br>');
}
return `${msg}`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment