Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
generateur-slogans
Commits
4e83175e
Verified
Commit
4e83175e
authored
Oct 02, 2017
by
Thibaut Broggi
Browse files
Add random text
It needs more than 3 words
parent
759f240d
Changes
1
Hide whitespace changes
Inline
Side-by-side
canvas.js
View file @
4e83175e
let
cachedImages
=
[];
let
sampleTexts
=
[
"
démocratie
"
,
"
raclette
"
,
"
couleurs moches
"
];
let
canvas
=
document
.
getElementById
(
'
output
'
);
let
ctx
=
canvas
.
getContext
(
'
2d
'
);
...
...
@@ -131,5 +132,6 @@ document.getElementById('randomize').onclick = function(e) {
randomElement
(
'
input[name="fg-color"]
'
).
checked
=
true
;
randomElement
(
'
input[name="font"]
'
).
checked
=
true
;
randomElement
(
'
input[name="icon"]
'
).
checked
=
true
;
document
.
getElementById
(
'
step2value
'
).
value
=
document
.
getElementById
(
'
step2value
'
).
innerText
=
sampleTexts
[
Math
.
trunc
(
Math
.
random
()
*
sampleTexts
.
length
)];
draw
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment