-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsketch.js
176 lines (139 loc) · 3.21 KB
/
sketch.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
let font;
let slide = welcome;
let links;
function preload() {
font = loadFont('assets/Inconsolata.otf');
}
function setup() {
createCanvas(windowWidth, windowHeight);
links = createDiv();
links.hide();
textAlign(CENTER, CENTER);
textFont(font);
}
function draw() {
slide();
}
function keyPressed() {
if (key === '0') {
welcome();
} else if (key === '1') {
slideOne();
} else if (key === '2') {
slideTwo();
} else if (key === '3') {
slideThree();
} else if (key === '4') {
slideFour();
} else if (key === '5') {
slideFive();
} else if (key === '6') {
questions();
} else if (key === '7') {
final();
}
}
function welcome() {
background(50);
fill(255);
noStroke();
textSize(64);
text('Hello, Docs!', width * 0.5 , height * 0.5);
textSize(48);
text('Getting started with documentation', width * 0.5 , height * 0.6);
slide = welcome;
}
function slideOne() {
background(50);
fill(255);
noStroke();
textSize(64);
text("Hi, we're Greg and Nick!", width * 0.5 , height * 0.5);
slide = slideOne;
}
function slideTwo() {
background(50);
fill(255);
noStroke();
textSize(64);
text('Two big questions:', width * 0.5 , height * 0.4);
push();
textSize(48);
textAlign(LEFT, CENTER);
text('1. Why are you writing documentation?', width * 0.22 , height * 0.55);
text('2. How will you write your docs?', width * 0.22 , height * 0.65);
pop();
slide = slideTwo;
}
function slideThree() {
background(50);
fill(255);
noStroke();
push();
textSize(48);
textAlign(LEFT, CENTER);
text('Why?', 48, 48);
pop();
push();
textSize(64);
text('Who will read your docs?\nWhat do they need?', width * 0.5 , height * 0.5);
pop();
slide = slideThree;
}
function slideFour() {
background(50);
fill(255);
noStroke();
push();
textSize(48);
textAlign(LEFT, CENTER);
text('How?', 48, 48);
pop();
push();
textSize(64);
text('What form will your docs take?\nWhat do you need to write well?', width * 0.5 , height * 0.5);
pop();
slide = slideFour;
}
function slideFive() {
background(50);
fill(255);
noStroke();
push();
textSize(48);
textAlign(LEFT, CENTER);
text('Write!', 48, 48);
pop();
push();
textSize(32);
textAlign(LEFT, CENTER);
text("1. Plan an audit of your project's existing documentation.", width * 0.05 , height * 0.3);
text("2. Create/remix style guides for writing and example code.", width * 0.05 , height * 0.4);
text('3. Make one "easy" and one "difficult" API reference more accessible.', width * 0.05 , height * 0.5);
text('4. Create 2 or 3 new examples that could introduce the rest of the conference \n attendees to your project.', width * 0.05 , height * 0.62)
pop();
slide = slideFive;
}
function questions() {
background(50);
fill(255);
noStroke();
textSize(64);
text('Questions?', width * 0.5 , height * 0.5);
slide = questions;
}
function final() {
background(50);
fill(255);
noStroke();
textSize(64);
text('Thanks!', width * 0.5 , height * 0.5);
slide = final;
}
function doubleClicked() {
let fs = fullscreen();
fullscreen(!fs);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}