-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsolefun-effect-custom1.js
57 lines (54 loc) · 1.32 KB
/
consolefun-effect-custom1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
( function(){
var custom1 = function(){
var step = 0
, storage
;
return {
'go': function( state ){
switch( step ) {
case 0:
storage = state.lexeme = state.lexeme[0].toUpperCase().split( '' );
break;
case 1:
if ( !storage.length ) storage = [];
storage[storage.length - 1] += state.lexeme[0].toUpperCase();
state.lexeme = storage;
break;
case 2:
var spaces = ''
, j
;
for ( var i = storage[storage.length - 1].length - 2; i--; ) {
spaces += ' ';
}
for ( i = storage.length - 1, j = state.lexeme[0].length - 1; i--; j-- ) {
storage[i] += ( spaces + state.lexeme[0][j].toUpperCase() );
}
state.lexeme = storage;
break;
case 3:
storage.unshift( state.lexeme[0].toUpperCase() );
state.lexeme = storage;
break;
case 4:
storage[0] += ' V V EEEEE RRRR';
storage[1] += ' V V E R R';
storage[2] += ' V V EEE RRRR';
storage[3] += ' V EEEEE R R';
state.lexeme = storage;
break;
}
step++;
},
'off': function(){
step = 0;
storage = [];
}
}
};
if ( window.ConsoleFunEffects ) {
window.ConsoleFunEffects['custom1'] = custom1;
} else {
window.ConsoleFunEffects = { 'custom1': custom1 };
}
} )();