-
Notifications
You must be signed in to change notification settings - Fork 288
/
demo.js
executable file
·151 lines (146 loc) · 4.72 KB
/
demo.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/env node
var art = require('./ascii-art');
/*art.font('Demo!', 'Doom', function(rendered){
console.log(art.style(rendered, 'blue_bg+red+blink+inverse'));
}); //*/
/*
art.image({
filepath :'/Volumes/Sparrows/Abbey/Professional/Project\ Resources/Stock\ photos/earth_in_space.jpg',
alphabet : 'ultra-wide'
}).overlay(
'******'+"\n"+
'******'+"\n"+
'******'
,{
x: 0,
y: 0,
style: 'red'
}, function(rendered){
console.log(rendered);
}); //*/
function colorInBonesShirt(rendered){
return rendered
.replace('| || | |', '|&&&||&&&&&&&&&&&&&&&&&|&&&|')
.replace('| || | |', '|&&&||&&&&&&&&&&&&&&&&&|&&&|')
.replace('| (', '|&&&&&&(').replace('/ |', '/&&&|').replace('/ |', '/&&&|')
.replace('| |', '|&&|').replace('| |', '|&|').replace('| |', '|&|')
.replace('- \\', '-&&&&&&&&&\\').replace('_ .. _', '_&&&..&&&_')
.replace('/ \\', '/&&&&&&\\').replace('/ ^ ^ \\', '/&^&&^&\\').replace('/ \\', '/&&&&&&&&&&&&&&&&\\')
.replace('| \\ @ @ / |', '|&\\&&@&&@&&/&|').replace('| He\'s dead, Jim! |', '|&&He\'s&dead,&Jim!&|')
.replace(') \\', ')&&&\\').replace('| ////// |', '|&//////&|').replace('_ _', '_&&_');
}
//*
art.font('Ghost Wire BBS', 'Doom', function(logo){
art.font('No place like home', 'rusted', function(subtext){
art.table({
verticalBar : ' ',
horizontalBar : ' ',
intersection : ' ',
data:[
{name: art.style('current users', 'red'), value: '203'},
{name: 'operator', value: 'vince.vega'},
{name: 'dial-in', value: '(917)555-4202'},
]
}).lines(2, function(table){
art.image({
filepath :'/Users/khrome/Desktop/vintage_starburst_texture_13_darkred_red_preview.jpg',
alphabet : 'ultra-wide'
}).lines(2, 30).overlay(logo, {
x: 0,
y: 0,
style: 'blue',
}).overlay(subtext, {
x: 19,
y: 8,
style: 'yellow',
}).overlay(table, {
x: -1,
y: -1,
style: 'green',
}, function(final){
console.log(final);
});
});
});
}); //*/
/*art.table({
data:[
{text: ' .\'ANDRE. '},
{text: ' ..THE.GIANT\'. '},
{text: '.With.Bobby."The.Brain"'},
{text: '.Heenan.'}
],
verticalBar : ' ',
horizontalBar : ' ',
intersection : ' '
}).lines(2, function(table){
art.strings([
'ANDRE',
'the',
'GIANT',
'POSSE',
'7\'4"',
'520 LB'
], 'rusted', function(andre, the, giant, posse, height, weight){
art.strings([ 'has', 'a'], 'twopoint', function(has, a){
art.image({
filepath :'/Users/khrome/Desktop/Unknown.jpeg',
alphabet : 'ultra-wide'
}).overlay(andre, {
x: 8, y: 4,
style: 'white'
}).overlay(the, {
x: 10, y: 7,
style: 'white',
transparent : true
}).overlay(giant, {
x: 8, y: 10,
style: 'white',
transparent : true
}).overlay(has, {
x: 10, y: 14,
style: 'white'
}).overlay(a, {
x: 13, y: 17,
style: 'white'
}).overlay(posse, {
x: 5, y: 20,
style: 'bright_black',
transparent: true
}).overlay(height, {
x: 59, y: 3,
style: 'bright_black',
transparent: true
}).overlay(weight, {
x: 59, y: 8,
style: 'bright_black',
transparent: true
}).overlay(table, {
x: 6, y: -6,
style: 'bright_black',
transparent: true
}, function(final){
console.log(final);
});
});
});
});*/
/*
art.artwork({
artwork:'textfiles.com/art/st-char.asc'
}).lines(31, 45, function(rendered){
//cleanup non-unix terminators
rendered = rendered.replace(/\r/g, '');
rendered = colorInBonesShirt(rendered);
art.image({
filepath :'/Volumes/Sparrows/Abbey/Professional/Project\ Resources/Stock\ photos/earth_in_space.jpg',
alphabet : 'ultra-wide'
}).overlay(rendered, {
x: 0,
y: -1,
style: 'red+blink',
transparent: '&'
}, function(final){
console.log(final);
});
}); //*/