-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsinetext.js
More file actions
28 lines (26 loc) · 750 Bytes
/
Copy pathsinetext.js
File metadata and controls
28 lines (26 loc) · 750 Bytes
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
var text = "vugnaes sreo "
const repeattext = 15
const maxheight = 20
const speed = 15 //lower = faster
const positions = []
for(const c in text.repeat(repeattext+1)) positions[c] = 1
let i = 1
let i2 = 0
let newtext = []
setInterval(()=>{
i2 = -1
for(const k of Object.keys(positions)) {
positions[k] = Math.floor(Math.sin((i+i2++)/speed)*maxheight)+maxheight
}
i++
for(let i3 = 0; i3 < maxheight*2; i3++) {
let layer = ""
for(const height in positions) {
layer += positions[height] == i3 ? text.repeat(repeattext+1)[height] : ' '
}
newtext.push(layer)
}
console.clear()
console.log(newtext.join('\n'))
newtext = []
},(1/20)*1000)