Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luc Didry
wemawema
Commits
476cb955
Commit
476cb955
authored
Sep 28, 2017
by
Luc Didry
Browse files
Fix
#10
parent
37a10fcd
Pipeline
#24006
passed with stage
in 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
css/wema_wema.css
View file @
476cb955
.container
{
.container
,
#filename
{
text-align
:
center
;
}
#wemake
{
...
...
index.html
View file @
476cb955
...
...
@@ -76,6 +76,10 @@
<input
id=
"porn-size"
type=
"number"
min=
"1"
value=
"220"
>
</div>
</div>
<div>
<label
for=
"filename"
>
First line
</label>
<input
id=
"filename"
placeholder=
"WE_MAKE_PORN.png"
type=
"text"
value=
"WE_MAKE_PORN.png"
class=
"u-full-width"
>
</div>
</div>
<div>
<a
class=
"button"
href=
"#"
id=
"download"
>
Download
</a>
...
...
js/wema_wema.js
View file @
476cb955
...
...
@@ -29,9 +29,11 @@ var domIsReady = (function(domIsReady) {
document
.
querySelectorAll
(
'
input[type="text"]
'
).
forEach
(
function
(
e
)
{
e
.
addEventListener
(
'
keyup
'
,
function
()
{
refreshText
();
refreshFilename
();
});
e
.
addEventListener
(
'
paste
'
,
function
()
{
refreshText
();
refreshFilename
();
});
});
document
.
querySelectorAll
(
'
input[type="radio"]
'
).
forEach
(
function
(
e
)
{
...
...
@@ -45,7 +47,8 @@ var domIsReady = (function(domIsReady) {
});
});
document
.
querySelector
(
'
#download
'
).
addEventListener
(
'
click
'
,
function
()
{
this
.
download
=
'
WeMake.png
'
;
var
f
=
document
.
getElementById
(
'
filename
'
);
this
.
download
=
f
.
value
;
this
.
href
=
document
.
getElementById
(
'
canvas
'
).
toDataURL
().
replace
(
"
image/png
"
,
"
image/octet-stream
"
);
});
document
.
querySelector
(
'
#reset
'
).
addEventListener
(
'
click
'
,
function
()
{
...
...
@@ -102,7 +105,11 @@ var domIsReady = (function(domIsReady) {
if
(
url
.
searchParams
.
get
(
'
rc
'
)
!==
null
)
{
document
.
getElementById
(
'
rect-color
'
).
value
=
url
.
searchParams
.
get
(
'
rc
'
);
}
if
(
url
.
searchParams
.
get
(
'
f
'
)
!==
null
)
{
document
.
getElementById
(
'
filename
'
).
value
=
url
.
searchParams
.
get
(
'
f
'
);
}
refreshFilename
();
refreshText
();
});
})(
document
,
window
,
domIsReady
);
...
...
@@ -132,6 +139,15 @@ function reset() {
refreshText
();
}
function
refreshFilename
()
{
var
w
=
document
.
getElementById
(
'
wemake
'
);
var
p
=
document
.
getElementById
(
'
porn
'
);
var
f
=
document
.
getElementById
(
'
filename
'
);
var
name
=
w
.
value
+
'
'
+
p
.
value
+
'
.png
'
;
f
.
value
=
name
.
replace
(
/ /g
,
'
_
'
);
}
function
refreshText
()
{
var
w
=
document
.
getElementById
(
'
wemake
'
);
var
wx
=
document
.
getElementById
(
'
wemake-x
'
);
...
...
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