Skip to content

Commit

Permalink
提升在firefox下的兼容性
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed May 18, 2019
1 parent 86a6e01 commit cb7b822
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion build/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
p { font-size: 15px; line-height: 30px }

input#text { width: 100%; box-sizing: border-box; font-size: 16px; margin-bottom: 10px }
input[type=range] { width: 200px }
input[type=range] { width: 200px; height: 18px; vertical-align: text-bottom }

canvas { box-sizing: border-box; width: 100%; border: 1px dashed #AAA; cursor: pointer }
</style>
Expand All @@ -29,23 +29,23 @@ <h1>图片水印打码工具</h1>
<article>安全地为你的图片加水印,无任何网络请求,特别适合各种敏感证件(身份证,驾照,护照等)。<a href="https://github.com/joyqi/sfz">Github地址</a></article>

<label for="image">第一步:先选择一张本地图片</label>
<p><input type="file" id="image"></p>
<p><input type="file" id="image" autocomplete="off"></p>


<label for="text">第二步:输入需要打水印的文字</label>
<p><input type="text" id="text" placeholder="请输入文字" maxlength="30">
<p><input type="text" id="text" placeholder="请输入文字" autocomplete="off" maxlength="30">

<label for="color">颜色</label>
<input type="color" id="color" pattern="#[0-9A-Fa-f]{6}" value="#0000FF"><br>
<input type="color" id="color" pattern="#[0-9A-Fa-f]{6}" autocomplete="off" value="#0000FF"><br>

<label for="alpha">透明度</label>
<input type="range" id="alpha" min="0" max="1" step="0.05" value="0.15"><br>
<input type="range" id="alpha" min="0" max="1" step="0.05" autocomplete="off" value="0.15"><br>

<label for="space">间隔</label>
<input type="range" id="space" min="1" max="8" step="0.2" value="4"><br>
<input type="range" id="space" min="1" max="8" step="0.2" autocomplete="off" value="4"><br>

<label for="size">字号</label>
<input type="range" id="size" min="0.5" max="3" step="0.05" value="1">
<input type="range" id="size" min="0.5" max="3" step="0.05" autocomplete="off" value="1">
</p>

<label for="text">第三步:点击图片下载</label>
Expand Down
2 changes: 2 additions & 0 deletions src/script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ readFile = ->
imageData = canvas.toDataURL 'image/png'
blob = dataURItoBlob imageData
link.href = URL.createObjectURL blob
graph.appendChild link

setTimeout ->
link.click()
graph.removeChild link
, 100


Expand Down

0 comments on commit cb7b822

Please sign in to comment.