@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
/psd
|
||||
超多图片处理测试包
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
-=
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang=en>
|
||||
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<meta http-equiv=X-UA-Compatible content="IE=edge">
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<link rel=icon href='https://cdn.jsdelivr.net/gh/renzhezhilu/webp2jpg-online/cdn/batch/logo2.png'>
|
||||
<title>图片批量加水印</title>
|
||||
<!-- <script>
|
||||
window.location.href = 'https://imagestool.com/images-watermark'
|
||||
</script> -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src=https://cdn.jsdelivr.net/gh/renzhezhilu/webp2jpg-online/cdn/localforage.min.js></script>
|
||||
<noscript><strong>We're sorry but vue doesn't work properly without JavaScript enabled. Please enable it to
|
||||
continue.</strong></noscript>
|
||||
<div id=app></div>
|
||||
<script src=https://cdn.jsdelivr.net/gh/renzhezhilu/webp2jpg-online/cdn/batch/batch1225_05.js></script>
|
||||
<script>
|
||||
// 换视频介绍图标
|
||||
let icon = setInterval(() => {
|
||||
if (document.querySelector('#logoDiv > ul > div')) {
|
||||
document.querySelector('#logoDiv > ul > div').remove()
|
||||
document.querySelector('#logoDiv > ul').insertAdjacentHTML('beforeend', `
|
||||
<a href="https://cdn.jsdelivr.net/gh/renzhezhilu/webp2jpg-online/cdn/batch/video.mp4" target="_blank">
|
||||
<i class="iconfont icon-youtube-play"></i>
|
||||
</a>
|
||||
`);
|
||||
clearInterval(icon)
|
||||
}
|
||||
}, 300);
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 1000 B |
After Width: | Height: | Size: 965 B |
After Width: | Height: | Size: 1016 B |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 4.1 MiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 8.0 KiB |
@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Cropper.js v1.5.12
|
||||
* https://fengyuanchen.github.io/cropperjs
|
||||
*
|
||||
* Copyright 2015-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2021-06-12T08:00:17.411Z
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Vue.js v2.6.12
|
||||
* (c) 2014-2020 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* clipboard.js v2.0.8
|
||||
* https://clipboardjs.com/
|
||||
*
|
||||
* Licensed MIT © Zeno Rocha
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* vue-class-component v7.0.1
|
||||
* (c) 2015-present Evan You
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/**!
|
||||
* Sortable 1.10.2
|
||||
* @author RubaXa <trash@rubaxa.org>
|
||||
* @author owenm <owen23355@gmail.com>
|
||||
* @license MIT
|
||||
*/
|
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 6.1 KiB |
After Width: | Height: | Size: 361 KiB |
@ -0,0 +1,88 @@
|
||||
<input type="file" id="files" accept=".jpeg,.jpg,.png,.gif,.webp,.svg,.ico,.bmp" multiple>
|
||||
<canvas id="can" class="play-pause"></canvas>
|
||||
<img id="imgsss" src="" alt="">
|
||||
<script src="https://unpkg.com/konva@4.1.2/konva.min.js"></script>
|
||||
<script src="https://unpkg.com/gifler@0.1.0/gifler.min.js"></script>
|
||||
<script src="https://jnordberg.github.io/gif.js/gif.js?v=3"></script>
|
||||
|
||||
<script>
|
||||
let input = document.getElementById("files")
|
||||
let imgsss = document.getElementById("imgsss")
|
||||
let _canvas = document.getElementById("can")
|
||||
input.addEventListener('change', function() {
|
||||
let files = [...this.files]
|
||||
let b = window.URL.createObjectURL(files[0])
|
||||
console.log(b)
|
||||
// let img = new Image()
|
||||
// img.src = b
|
||||
// imgsss.src = b
|
||||
// console.log(img)
|
||||
|
||||
// gifler(b)
|
||||
// .animate('canvas.play-pause')
|
||||
// .then(function(animator) {
|
||||
// });
|
||||
var gif = new GIF();
|
||||
let CCC = 0
|
||||
gifler(b).frames(_canvas, function(ctx, frame) {
|
||||
CCC++
|
||||
if (CCC > 10) {
|
||||
gif.render();
|
||||
gif.on('finished', function(blob) {
|
||||
// window.open(URL.createObjectURL(blob));
|
||||
funDownload(blob, `1234455.webp`)
|
||||
|
||||
});
|
||||
return
|
||||
}
|
||||
// update canvas size
|
||||
_canvas.width = frame.width;
|
||||
_canvas.height = frame.height;
|
||||
// update canvas that we are using for Konva.Image
|
||||
_canvas.getContext("2d").drawImage(frame.buffer, 0, 0, this.width, this.height)
|
||||
// redraw the layer
|
||||
console.log(gif);
|
||||
|
||||
_canvas.toBlob(function(blob) {
|
||||
let img = new Image()
|
||||
img.src = window.URL.createObjectURL(blob)
|
||||
gif.addFrame(img);
|
||||
|
||||
// funDownload(blob, `1234455.webp`)
|
||||
console.log(blob);
|
||||
|
||||
|
||||
}, `image/webp`, 0.1)
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// img.onload = function() {
|
||||
|
||||
// _canvas.setAttribute("width", this.width)
|
||||
// _canvas.setAttribute("height", this.height)
|
||||
// _canvas.getContext("2d").drawImage(this, 0, 0, this.width, this.height)
|
||||
// //转格式
|
||||
// _canvas.toBlob(function(blob) {
|
||||
// funDownload(blob, `${files[0].name}.webp`)
|
||||
// }, `image/webp`, 0.1)
|
||||
// }
|
||||
// console.log(b)
|
||||
|
||||
}, false)
|
||||
|
||||
//下载文件
|
||||
function funDownload(blob, filename = '未命名') {
|
||||
let eleLink = document.createElement('a')
|
||||
eleLink.download = filename
|
||||
eleLink.style.display = 'none'
|
||||
eleLink.href = URL.createObjectURL(blob)
|
||||
// 触发点击
|
||||
document.body.appendChild(eleLink)
|
||||
eleLink.click()
|
||||
// 然后移除
|
||||
document.body.removeChild(eleLink)
|
||||
// location.reload()
|
||||
}
|
||||
</script>
|
@ -0,0 +1,53 @@
|
||||
# !/usr/bin/env python
|
||||
import webbrowser
|
||||
|
||||
# import wx
|
||||
import PySimpleGUI as sg
|
||||
|
||||
from wsgiref.simple_server import make_server
|
||||
|
||||
def hello_world_app(environ, start_response):
|
||||
status = '200 OK' # HTTP Status
|
||||
headers = [('Content-type', 'text/plain; charset=utf-8')] # HTTP Headers
|
||||
start_response(status, headers)
|
||||
msg = 'Hello %s\n' % environ["REMOTE_ADDR"]
|
||||
return [msg.encode('utf8')]
|
||||
|
||||
with make_server('', 5678, hello_world_app) as httpd:
|
||||
print("Serving on port 5678...")
|
||||
httpd.serve_forever()
|
||||
|
||||
webbrowser.open('https://www.jianshu.com/p/d4eea5b503ed',
|
||||
new=0, autoraise=True)
|
||||
|
||||
sg.theme('DarkAmber') # Add a touch of color
|
||||
# All the stuff inside your window.
|
||||
layout = [
|
||||
[sg.Text('Some text on Row 1')],
|
||||
[sg.Text('Enter something on Row 2'), sg.InputText()],
|
||||
[sg.Button('Ok'), sg.Button('Cancel')]]
|
||||
|
||||
# Create the Window
|
||||
window = sg.Window('Window Title', layout)
|
||||
# Event Loop to process "events" and get the "values" of the inputs
|
||||
while True:
|
||||
event, values = window.read()
|
||||
if event == sg.WIN_CLOSED or event == 'Cancel': # if user closes window or clicks cancel
|
||||
break
|
||||
print('You entered ', values[0])
|
||||
|
||||
window.close()
|
||||
|
||||
|
||||
# app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window.
|
||||
# frame = wx.Frame(None, wx.ID_ANY, "Hello222 World") # A Frame is a top-level window.
|
||||
# frame.Show(True) # Show the frame.
|
||||
# app.MainLoop()
|
||||
|
||||
# pyinstaller -F -D -w hello.py
|
||||
# wxpython
|
||||
|
||||
# https://www.csdn.net/tags/MtTakg2sNTU2MTYtYmxvZwO0O0OO0O0O.html
|
||||
# http://www.codebaoku.com/it-python/it-python-227355.html
|
||||
# https://zhuanlan.zhihu.com/p/57674343
|
||||
#
|
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<body>
|
||||
|
||||
<p>要使用的视频:</p>
|
||||
|
||||
<video id="video1" controls width="270" autoplay>
|
||||
<source src="mov_bbb.mp4" type='video/mp4'>
|
||||
</video>
|
||||
|
||||
<p>画布(每 20 毫秒,代码就会绘制视频的当前帧):</p>
|
||||
|
||||
<canvas id="myCanvas" width="270" height="135" style="border:1px solid #d3d3d3;">
|
||||
Your browser does not support the HTML5 canvas tag.
|
||||
</canvas>
|
||||
|
||||
<canvas id="ccccc" width="270" height="135" style="border:1px solid #d3d3d3;">
|
||||
Your browser does not support the HTML5 canvas tag.
|
||||
</canvas>
|
||||
|
||||
|
||||
<img id="img" src="./g.gif" alt="">
|
||||
|
||||
<script>
|
||||
// var v = document.getElementById("video1");
|
||||
// var c = document.getElementById("myCanvas");
|
||||
// ctx = c.getContext('2d');
|
||||
|
||||
// v.addEventListener('play', function() {
|
||||
// var i = window.setInterval(function() {
|
||||
// ctx.drawImage(v, 0, 0, 270, 135)
|
||||
// }, 20);
|
||||
// }, false);
|
||||
// v.addEventListener('pause', function() {
|
||||
// window.clearInterval(i);
|
||||
// }, false);
|
||||
// v.addEventListener('ended', function() {
|
||||
// clearInterval(i);
|
||||
// }, false);
|
||||
|
||||
// let xhr = new XMLHttpRequest();
|
||||
// xhr.open('get', './g.gif');
|
||||
// xhr.setRequestHeader("Content-Type", "image/gif");
|
||||
// xhr.send();
|
||||
// xhr.onreadystatechange = function() {
|
||||
// if (xhr.readyState === 4) {
|
||||
// if (xhr.status === 200) {
|
||||
// console.log('response', xhr.response);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
const img = document.getElementById("img");
|
||||
const ccc = document.getElementById("ccccc");
|
||||
const ctx22 = ccc.getContext('2d');
|
||||
render();
|
||||
|
||||
function render() {
|
||||
ctx22.drawImage(img, 0, 0);
|
||||
window.requestAnimationFrame(render);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,315 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Page Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<script>
|
||||
var Groover = (function() {
|
||||
// ensure webp is supported
|
||||
function canEncode() {
|
||||
var canvas = document.createElement("canvas");
|
||||
canvas.width = 8;
|
||||
canvas.height = 8;
|
||||
return canvas.toDataURL("image/webp", 0.1).indexOf("image/webp") > -1;
|
||||
}
|
||||
if (!canEncode()) {
|
||||
return undefined;
|
||||
}
|
||||
var webmData = null;
|
||||
var clusterTimecode = 0;
|
||||
var clusterCounter = 0;
|
||||
var CLUSTER_MAX_DURATION = 30000;
|
||||
var frameNumber = 0;
|
||||
var width;
|
||||
var height;
|
||||
var frameDelay;
|
||||
var quality;
|
||||
var name;
|
||||
const videoMimeType = "video/webm"; // the only one.
|
||||
const frameMimeType = 'image/webp'; // can be no other
|
||||
const S = String.fromCharCode;
|
||||
const dataTypes = {
|
||||
object: function(data) {
|
||||
return toBlob(data);
|
||||
},
|
||||
number: function(data) {
|
||||
return stream.num(data);
|
||||
},
|
||||
string: function(data) {
|
||||
return stream.str(data);
|
||||
},
|
||||
array: function(data) {
|
||||
return data;
|
||||
},
|
||||
double2Str: function(num) {
|
||||
var c = new Uint8Array((new Float64Array([num])).buffer);
|
||||
return S(c[7]) + S(c[6]) + S(c[5]) + S(c[4]) + S(c[3]) + S(c[2]) + S(c[1]) + S(c[0]);
|
||||
}
|
||||
};
|
||||
|
||||
const stream = {
|
||||
num: function(num) { // writes int
|
||||
var parts = [];
|
||||
while (num > 0) {
|
||||
parts.push(num & 0xff);
|
||||
num = num >> 8;
|
||||
}
|
||||
return new Uint8Array(parts.reverse());
|
||||
},
|
||||
str: function(str) { // writes string
|
||||
var i, len, arr;
|
||||
len = str.length;
|
||||
arr = new Uint8Array(len);
|
||||
for (i = 0; i < len; i++) {
|
||||
arr[i] = str.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
compInt: function(num) { // could not find full details so bit of a guess
|
||||
if (num < 128) { // number is prefixed with a bit (1000 is on byte 0100 two, 0010 three and so on)
|
||||
num += 0x80;
|
||||
return new Uint8Array([num]);
|
||||
} else
|
||||
if (num < 0x4000) {
|
||||
num += 0x4000;
|
||||
return new Uint8Array([num >> 8, num])
|
||||
} else
|
||||
if (num < 0x200000) {
|
||||
num += 0x200000;
|
||||
return new Uint8Array([num >> 16, num >> 8, num])
|
||||
} else
|
||||
if (num < 0x10000000) {
|
||||
num += 0x10000000;
|
||||
return new Uint8Array([num >> 24, num >> 16, num >> 8, num])
|
||||
}
|
||||
}
|
||||
}
|
||||
const ids = { // header names and values
|
||||
videoData: 0x1a45dfa3,
|
||||
Version: 0x4286,
|
||||
ReadVersion: 0x42f7,
|
||||
MaxIDLength: 0x42f2,
|
||||
MaxSizeLength: 0x42f3,
|
||||
DocType: 0x4282,
|
||||
DocTypeVersion: 0x4287,
|
||||
DocTypeReadVersion: 0x4285,
|
||||
Segment: 0x18538067,
|
||||
Info: 0x1549a966,
|
||||
TimecodeScale: 0x2ad7b1,
|
||||
MuxingApp: 0x4d80,
|
||||
WritingApp: 0x5741,
|
||||
Duration: 0x4489,
|
||||
Tracks: 0x1654ae6b,
|
||||
TrackEntry: 0xae,
|
||||
TrackNumber: 0xd7,
|
||||
TrackUID: 0x63c5,
|
||||
FlagLacing: 0x9c,
|
||||
Language: 0x22b59c,
|
||||
CodecID: 0x86,
|
||||
CodecName: 0x258688,
|
||||
TrackType: 0x83,
|
||||
Video: 0xe0,
|
||||
PixelWidth: 0xb0,
|
||||
PixelHeight: 0xba,
|
||||
Cluster: 0x1f43b675,
|
||||
Timecode: 0xe7,
|
||||
Frame: 0xa3,
|
||||
Keyframe: 0x9d012a,
|
||||
FrameBlock: 0x81,
|
||||
};
|
||||
const keyframeD64Header = '\x9d\x01\x2a'; //VP8 keyframe header 0x9d012a
|
||||
const videoDataPos = 1; // data pos of frame data header
|
||||
const defaultDelay = dataTypes.double2Str(1000 / 25);
|
||||
const header = [ // structure of webM header/chunks what ever they are called.
|
||||
ids.videoData, [
|
||||
ids.Version, 1,
|
||||
ids.ReadVersion, 1,
|
||||
ids.MaxIDLength, 4,
|
||||
ids.MaxSizeLength, 8,
|
||||
ids.DocType, 'webm',
|
||||
ids.DocTypeVersion, 2,
|
||||
ids.DocTypeReadVersion, 2
|
||||
],
|
||||
ids.Segment, [
|
||||
ids.Info, [
|
||||
ids.TimecodeScale, 1000000,
|
||||
ids.MuxingApp, 'Groover',
|
||||
ids.WritingApp, 'Groover',
|
||||
ids.Duration, 0
|
||||
],
|
||||
ids.Tracks, [
|
||||
ids.TrackEntry, [
|
||||
ids.TrackNumber, 1,
|
||||
ids.TrackUID, 1,
|
||||
ids.FlagLacing, 0, // always o
|
||||
ids.Language, 'und', // undefined I think this means
|
||||
ids.CodecID, 'V_VP8', // These I think must not change
|
||||
ids.CodecName, 'VP8', // These I think must not change
|
||||
ids.TrackType, 1,
|
||||
ids.Video, [
|
||||
ids.PixelWidth, 0,
|
||||
ids.PixelHeight, 0
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
function getHeader() {
|
||||
header[3][2][3] = name;
|
||||
header[3][2][5] = name;
|
||||
header[3][2][7] = dataTypes.double2Str(frameDelay);
|
||||
header[3][3][1][15][1] = width;
|
||||
header[3][3][1][15][3] = height;
|
||||
|
||||
function create(dat) {
|
||||
var i, kv, data;
|
||||
data = [];
|
||||
for (i = 0; i < dat.length; i += 2) {
|
||||
kv = {
|
||||
i: dat[i]
|
||||
};
|
||||
if (Array.isArray(dat[i + 1])) {
|
||||
kv.d = create(dat[i + 1]);
|
||||
} else {
|
||||
kv.d = dat[i + 1];
|
||||
}
|
||||
data.push(kv);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
return create(header);
|
||||
}
|
||||
|
||||
function addCluster() {
|
||||
webmData[videoDataPos].d.push({
|
||||
i: ids.Cluster,
|
||||
d: [{
|
||||
i: ids.Timecode,
|
||||
d: Math.round(clusterTimecode)
|
||||
}]
|
||||
}); // Fixed bug with Round
|
||||
clusterCounter = 0;
|
||||
}
|
||||
|
||||
function addFrame(frame) {
|
||||
var VP8, kfS, riff;
|
||||
riff = getWebPChunks(atob(frame.toDataURL(frameMimeType, quality).slice(23)));
|
||||
VP8 = riff.RIFF[0].WEBP[0];
|
||||
kfS = VP8.indexOf(keyframeD64Header) + 3;
|
||||
frame = {
|
||||
width: ((VP8.charCodeAt(kfS + 1) << 8) | VP8.charCodeAt(kfS)) & 0x3FFF,
|
||||
height: ((VP8.charCodeAt(kfS + 3) << 8) | VP8.charCodeAt(kfS + 2)) & 0x3FFF,
|
||||
data: VP8,
|
||||
riff: riff
|
||||
};
|
||||
if (clusterCounter > CLUSTER_MAX_DURATION) {
|
||||
addCluster();
|
||||
}
|
||||
webmData[videoDataPos].d[webmData[videoDataPos].d.length - 1].d.push({
|
||||
i: ids.Frame,
|
||||
d: S(ids.FrameBlock) + S(Math.round(clusterCounter) >> 8) + S(Math.round(clusterCounter) & 0xff) + S(128) + frame.data.slice(4),
|
||||
});
|
||||
clusterCounter += frameDelay;
|
||||
clusterTimecode += frameDelay;
|
||||
webmData[videoDataPos].d[0].d[3].d = dataTypes.double2Str(clusterTimecode);
|
||||
}
|
||||
|
||||
function startEncoding() {
|
||||
frameNumber = clusterCounter = clusterTimecode = 0;
|
||||
webmData = getHeader();
|
||||
addCluster();
|
||||
}
|
||||
|
||||
function toBlob(vidData) {
|
||||
var data, i, vData, len;
|
||||
vData = [];
|
||||
for (i = 0; i < vidData.length; i++) {
|
||||
data = dataTypes[typeof vidData[i].d](vidData[i].d);
|
||||
len = data.size || data.byteLength || data.length;
|
||||
vData.push(stream.num(vidData[i].i));
|
||||
vData.push(stream.compInt(len));
|
||||
vData.push(data)
|
||||
}
|
||||
return new Blob(vData, {
|
||||
type: videoMimeType
|
||||
});
|
||||
}
|
||||
|
||||
function getWebPChunks(str) {
|
||||
var offset, chunks, id, len, data;
|
||||
offset = 0;
|
||||
chunks = {};
|
||||
while (offset < str.length) {
|
||||
id = str.substr(offset, 4);
|
||||
// value will have top bit on (bit 32) so not simply a bitwise operation
|
||||
// Warning little endian (Will not work on big endian systems)
|
||||
len = new Uint32Array(
|
||||
new Uint8Array([
|
||||
str.charCodeAt(offset + 7),
|
||||
str.charCodeAt(offset + 6),
|
||||
str.charCodeAt(offset + 5),
|
||||
str.charCodeAt(offset + 4)
|
||||
]).buffer)[0];
|
||||
id = str.substr(offset, 4);
|
||||
chunks[id] = chunks[id] === undefined ? [] : chunks[id];
|
||||
if (id === 'RIFF' || id === 'LIST') {
|
||||
chunks[id].push(getWebPChunks(str.substr(offset + 8, len)));
|
||||
offset += 8 + len;
|
||||
} else if (id === 'WEBP') {
|
||||
chunks[id].push(str.substr(offset + 8));
|
||||
break;
|
||||
} else {
|
||||
chunks[id].push(str.substr(offset + 4));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
function Encoder(fps, _quality = 0.8, _name = "Groover") {
|
||||
this.fps = fps;
|
||||
this.quality = quality = _quality;
|
||||
this.frameDelay = frameDelay = 1000 / fps;
|
||||
this.frame = 0;
|
||||
this.width = width = null;
|
||||
this.timecode = 0;
|
||||
this.name = name = _name;
|
||||
}
|
||||
Encoder.prototype = {
|
||||
addFrame: function(frame) {
|
||||
if ('canvas' in frame) {
|
||||
frame = frame.canvas;
|
||||
}
|
||||
if (width === null) {
|
||||
this.width = width = frame.width,
|
||||
this.height = height = frame.height
|
||||
startEncoding();
|
||||
} else
|
||||
if (width !== frame.width || height !== frame.height) {
|
||||
throw RangeError("Frame size error. Frames must be the same size.");
|
||||
}
|
||||
addFrame(frame);
|
||||
this.frame += 1;
|
||||
this.timecode = clusterTimecode;
|
||||
},
|
||||
toBlob: function() {
|
||||
return toBlob(webmData);
|
||||
}
|
||||
}
|
||||
return {
|
||||
Video: Encoder,
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<img id="testImg" src="js_gif.gif" width="224" height="126">
|
||||
<p><input type="button" id="testBtn" value="停止"></p>
|
||||
|
||||
<script>
|
||||
if ('getContext' in document.createElement('canvas')) {
|
||||
HTMLImageElement.prototype.play = function() {
|
||||
if (this.storeCanvas) {
|
||||
// 移除存储的canvas
|
||||
this.storeCanvas.parentElement.removeChild(this.storeCanvas);
|
||||
this.storeCanvas = null;
|
||||
// 透明度还原
|
||||
image.style.opacity = '';
|
||||
}
|
||||
if (this.storeUrl) {
|
||||
this.src = this.storeUrl;
|
||||
}
|
||||
};
|
||||
HTMLImageElement.prototype.stop = function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
// 尺寸
|
||||
var width = this.width,
|
||||
height = this.height;
|
||||
if (width && height) {
|
||||
// 存储之前的地址
|
||||
if (!this.storeUrl) {
|
||||
this.storeUrl = this.src;
|
||||
}
|
||||
// canvas大小
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
// 绘制图片帧(第一帧)
|
||||
canvas.getContext('2d').drawImage(this, 0, 0, width, height);
|
||||
// 重置当前图片
|
||||
try {
|
||||
this.src = canvas.toDataURL("image/gif");
|
||||
} catch (e) {
|
||||
// 跨域
|
||||
this.removeAttribute('src');
|
||||
// 载入canvas元素
|
||||
canvas.style.position = 'absolute';
|
||||
// 前面插入图片
|
||||
this.parentElement.insertBefore(canvas, this);
|
||||
// 隐藏原图
|
||||
this.style.opacity = '0';
|
||||
// 存储canvas
|
||||
this.storeCanvas = canvas;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var image = document.getElementById("testImg"),
|
||||
button = document.getElementById("testBtn");
|
||||
|
||||
if (image && button) {
|
||||
button.onclick = function() {
|
||||
if (this.value == '停止') {
|
||||
image.stop();
|
||||
this.value = '播放';
|
||||
} else {
|
||||
image.play();
|
||||
this.value = '停止';
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Page Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<input id="files" type="file" multiple />
|
||||
<h4 id="t1"></h4>
|
||||
<img id="img01" src="" alt="">
|
||||
<canvas id="can"></canvas>
|
||||
<h4 id="t2"></h4>
|
||||
<img id="img02" src="" alt="">
|
||||
<script>
|
||||
let input = document.getElementById("files")
|
||||
|
||||
let img01 = document.getElementById("img01")
|
||||
let img02 = document.getElementById("img02")
|
||||
input.addEventListener('change', function() {
|
||||
console.log(this.files[0]);
|
||||
let files = this.files
|
||||
let img = new Image()
|
||||
let count = 0
|
||||
img.src = URL.createObjectURL(this.files[0])
|
||||
img.onload = function() {
|
||||
console.log(this);
|
||||
let _canvas = document.getElementById("can")
|
||||
//处理缩放
|
||||
let w = this.width
|
||||
let h = this.height
|
||||
_canvas.setAttribute("width", w)
|
||||
_canvas.setAttribute("height", h)
|
||||
_canvas.getContext("2d").drawImage(this, 0, 0, w, h)
|
||||
//转格式
|
||||
console.log(_canvas);
|
||||
|
||||
//输出100%质量
|
||||
_canvas.toBlob(function(blob) {
|
||||
console.log(blob, '完成0.81');
|
||||
let size = 1024 * 100 //预设值
|
||||
size = size - 4000 //默认簇
|
||||
let skip = 0.01 //变化幅度
|
||||
let maxSize = blob.size //1压缩
|
||||
|
||||
|
||||
//先预判图片压缩后的大小再微调
|
||||
let yu = size > maxSize ? 0.81 * 0.81 : 0.81
|
||||
let startQu = size / maxSize * yu
|
||||
|
||||
if (startQu >= 1) startQu = 0.99
|
||||
if (startQu <= 0) startQu = 0.01
|
||||
setSizeFun(size, startQu.toFixed(2) - 0)
|
||||
|
||||
function setSizeFun(setSize, qu) {
|
||||
_canvas.toBlob(function(blob22) {
|
||||
console.log('count:', count++);
|
||||
|
||||
// let isLess = blob22.size < setSize
|
||||
console.log(blob22, qu, '继续');
|
||||
img02.src = URL.createObjectURL(blob22)
|
||||
let bSize = blob22.size
|
||||
//符合条件区间
|
||||
if (bSize > setSize * 0.9 && bSize < setSize) {
|
||||
console.log(blob22, URL.createObjectURL(blob22), qu, '完成✅✅✅');
|
||||
return
|
||||
}
|
||||
//原图太小,
|
||||
if (qu >= 0.95 && bSize < setSize) {
|
||||
console.warn(blob22, qu, URL.createObjectURL(blob22), '最大输出✅');
|
||||
return
|
||||
}
|
||||
//压缩不到制定的大小
|
||||
if (qu < 0.0001 && bSize > setSize) {
|
||||
console.error(blob22, qu, URL.createObjectURL(blob22), '没有符合的🙅');
|
||||
return
|
||||
}
|
||||
if (qu < 0.0001 && bSize < setSize) {
|
||||
console.warn(blob22, qu, URL.createObjectURL(blob22), '最小输出✅');
|
||||
return
|
||||
}
|
||||
//微调
|
||||
if (bSize < setSize) {
|
||||
qu = qu + skip
|
||||
} else {
|
||||
qu = qu - skip
|
||||
}
|
||||
setSizeFun(setSize, qu.toFixed(2) - 0)
|
||||
|
||||
}, `image/webp`, qu)
|
||||
}
|
||||
}, `image/webp`, 0.81)
|
||||
}
|
||||
}, false)
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Page Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<input id="files" type="file" multiple />
|
||||
<h4 id="t1"></h4>
|
||||
<img id="img01" src="" alt="">
|
||||
<canvas id="can"></canvas>
|
||||
<h4 id="t2"></h4>
|
||||
<img id="img02" src="" alt="">
|
||||
<script>
|
||||
let input = document.getElementById("files")
|
||||
|
||||
let img01 = document.getElementById("img01")
|
||||
let img02 = document.getElementById("img02")
|
||||
input.addEventListener('change', function() {
|
||||
console.log(this.files[0]);
|
||||
let files = this.files
|
||||
let img = new Image()
|
||||
|
||||
img.src = URL.createObjectURL(this.files[0])
|
||||
img.onload = async function() {
|
||||
console.log(this);
|
||||
let jg = await funMaxSize({
|
||||
defWidth:this.width,
|
||||
defHeight:this.height,
|
||||
setWidth:400,
|
||||
setHeight:null,
|
||||
imageData:this,
|
||||
setSize:88
|
||||
})
|
||||
// let b= new Blob(this)
|
||||
// URL.createObjectURL(b)
|
||||
console.log('😊 结果:',jg,JSON.stringify(this),);
|
||||
|
||||
}
|
||||
}, false)
|
||||
|
||||
|
||||
|
||||
|
||||
function funMaxSize({
|
||||
defWidth,
|
||||
defHeight,
|
||||
setWidth,
|
||||
setHeight,
|
||||
imageData,
|
||||
setSize=100 //kb
|
||||
}) {
|
||||
return new Promise((res, rej) => {
|
||||
let arg = arguments[0]
|
||||
let count = 0
|
||||
let _canvas = document.getElementById("can")
|
||||
//处理缩放
|
||||
let w = arg.setWidth || arg.defWidth
|
||||
let h = arg.setHeight || (arg.setWidth/arg.defWidth) * arg.defHeight
|
||||
_canvas.setAttribute("width", w)
|
||||
_canvas.setAttribute("height", h)
|
||||
_canvas.getContext("2d").drawImage(arg.imageData, 0, 0, w, h)
|
||||
//转格式
|
||||
console.log(_canvas);
|
||||
|
||||
//输出100%质量
|
||||
_canvas.toBlob(function(blob) {
|
||||
console.log(blob, '完成0.81');
|
||||
// let size = 1024 * 100 //预设值
|
||||
let size = arg.setSize * 1000 //预设值
|
||||
|
||||
size = size - 4000 //默认簇
|
||||
let skip = 0.01 //变化幅度
|
||||
let maxSize = blob.size //1压缩
|
||||
|
||||
|
||||
//先预判图片压缩后的大小再微调
|
||||
let yu = size > maxSize ? 0.81 * 0.81 : 0.81
|
||||
let startQu = size / maxSize * yu
|
||||
|
||||
if (startQu >= 1) startQu = 0.99
|
||||
if (startQu <= 0) startQu = 0.01
|
||||
setSizeFun(size, startQu.toFixed(2) - 0)
|
||||
|
||||
function setSizeFun(setSize, qu) {
|
||||
_canvas.toBlob(function(blob22) {
|
||||
console.log('count:', count++);
|
||||
|
||||
// let isLess = blob22.size < setSize
|
||||
console.log(blob22, qu, '继续');
|
||||
img02.src = URL.createObjectURL(blob22)
|
||||
let bSize = blob22.size
|
||||
//符合条件区间
|
||||
if (bSize > setSize * 0.9 && bSize < setSize) {
|
||||
console.log(blob22, URL.createObjectURL(blob22), qu, '完成✅✅✅');
|
||||
res(URL.createObjectURL(blob22))
|
||||
return
|
||||
}
|
||||
//原图太小,
|
||||
if (qu >= 0.95 && bSize < setSize) {
|
||||
console.warn(blob22, qu, URL.createObjectURL(blob22), '最大输出✅');
|
||||
res(URL.createObjectURL(blob22))
|
||||
return
|
||||
}
|
||||
//压缩不到制定的大小
|
||||
if (qu < 0.0001 && bSize > setSize) {
|
||||
console.error(blob22, qu, URL.createObjectURL(blob22), '没有符合的🙅');
|
||||
rej(URL.createObjectURL(blob22))
|
||||
|
||||
return
|
||||
}
|
||||
if (qu < 0.0001 && bSize < setSize) {
|
||||
console.warn(blob22, qu, URL.createObjectURL(blob22), '最小输出✅');
|
||||
res(URL.createObjectURL(blob22))
|
||||
return
|
||||
}
|
||||
//微调
|
||||
if (bSize < setSize) {
|
||||
qu = qu + skip
|
||||
} else {
|
||||
qu = qu - skip
|
||||
}
|
||||
setSizeFun(setSize, qu.toFixed(2) - 0)
|
||||
|
||||
}, `image/webp`, qu)
|
||||
}
|
||||
|
||||
}, `image/webp`, 0.81)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,545 @@
|
||||
/* 格式化 */
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "微软雅黑";
|
||||
font-size: 12px;
|
||||
color: #000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
span,
|
||||
p,
|
||||
ul,
|
||||
li,
|
||||
table,
|
||||
tr,
|
||||
td,
|
||||
input,
|
||||
a,
|
||||
dl,
|
||||
dt,
|
||||
dd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
list-style: none;
|
||||
text-shadow: rgba(0, 0, 0, 0.08) 0px 1px 2px;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: top;
|
||||
border: none
|
||||
}
|
||||
|
||||
#jg {
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.drag {
|
||||
width: 90%;
|
||||
padding: 30px 0;
|
||||
background-color: rgb(255, 255, 255);
|
||||
border: 8px dashed rgb(0, 0, 0, .3);
|
||||
border-radius: 50px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.img_box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
.img_box img {
|
||||
max-width: 180px;
|
||||
max-height: 180px;
|
||||
min-width: 80px;
|
||||
|
||||
}
|
||||
|
||||
.img_one {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 2px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.img_one .type {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: 0 0 20px 0;
|
||||
display: inline;
|
||||
min-width: 20px;
|
||||
padding: 0 10px;
|
||||
text-align: center;
|
||||
backdrop-filter: saturate(180%) blur(3px);
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.img_one .type.jpeg,
|
||||
.img_one .type.jpg {
|
||||
color: rgb(77, 77, 255);
|
||||
}
|
||||
|
||||
.img_one .type.gif {
|
||||
color: rgb(77, 208, 255);
|
||||
}
|
||||
|
||||
.img_one .type.png {
|
||||
color: rgb(77, 255, 148);
|
||||
}
|
||||
|
||||
.img_one .type.webp {
|
||||
color: rgb(160, 255, 77);
|
||||
}
|
||||
|
||||
.img_one .type.svg {
|
||||
color: rgb(246, 255, 77);
|
||||
}
|
||||
|
||||
.img_one .type.ico {
|
||||
color: rgb(255, 130, 77);
|
||||
}
|
||||
|
||||
.img_one .type.bmp {
|
||||
color: rgb(255, 89, 77);
|
||||
}
|
||||
|
||||
.img_one .size {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
backdrop-filter: saturate(180%) blur(10px);
|
||||
background-color: rgba(0, 0, 0, 0.38);
|
||||
color: #fff;
|
||||
bottom: 0;
|
||||
left: 0
|
||||
}
|
||||
|
||||
|
||||
.download_but {
|
||||
width: 90%;
|
||||
padding: 14px;
|
||||
margin: 20px auto;
|
||||
background-color: rgb(55, 78, 255);
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
border-radius: 100px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.download_but:hover {
|
||||
opacity: .9;
|
||||
}
|
||||
|
||||
.drag:hover {
|
||||
opacity: .8;
|
||||
}
|
||||
|
||||
.con {}
|
||||
|
||||
.p1 {
|
||||
font-size: 100px;
|
||||
line-height: 100px;
|
||||
height: 100px;
|
||||
font-weight: 900;
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
.p2 {
|
||||
font-size: 30px;
|
||||
line-height: 38px;
|
||||
padding: 25px 0;
|
||||
text-align: center;
|
||||
font-weight: 900;
|
||||
}
|
||||
.p2 h1, .p2 h2{
|
||||
font-size: 30px;
|
||||
line-height: 38px;
|
||||
}
|
||||
|
||||
|
||||
.p2 label {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#files {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
@keyframes ggg {
|
||||
100% {
|
||||
background-position: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
body.ondragover .ready {
|
||||
display: flex
|
||||
}
|
||||
|
||||
.ready {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
backdrop-filter: saturate(180%) blur(10px);
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 10px solid transparent;
|
||||
box-sizing: border-box;
|
||||
background:
|
||||
linear-gradient(rgb(55, 78, 255),
|
||||
rgba(55, 78, 255, 1)) padding-box,
|
||||
repeating-linear-gradient(-45deg,
|
||||
black 0, rgba(55, 78, 255, .8) 25%,
|
||||
white 0, white 50%) 0/1em 1em;
|
||||
animation: ggg 12s linear infinite;
|
||||
opacity: .8;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ready p {
|
||||
font-size: 80px;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
}
|
||||
|
||||
#can {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* --------------------------------------------- */
|
||||
#loading {
|
||||
display: none;
|
||||
zoom: 6;
|
||||
}
|
||||
|
||||
select {
|
||||
height: 30px;
|
||||
font-size: 15px;
|
||||
background-color: #fff;
|
||||
border: 2px solid rgb(55, 78, 255);
|
||||
border-left: 5px solid rgb(55, 78, 255);
|
||||
padding: 0 10px;
|
||||
|
||||
}
|
||||
[type=checkbox] {
|
||||
zoom:2;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.viewInGithub {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
/* --------------------------------------------- */
|
||||
/* 烟花 - from https://codepen.io/yshlin/pen/ylDEk */
|
||||
.pyro>.before,
|
||||
.pyro>.after {
|
||||
position: absolute;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff, 0 0 #fff;
|
||||
|
||||
animation: 1s bang ease-out 3 backwards, 1s gravity ease-in 3 backwards, 5s position linear 3 backwards;
|
||||
|
||||
/* animation: 1s bang ease-out infinite backwards, 1s gravity ease-in infinite backwards, 5s position linear infinite backwards; */
|
||||
}
|
||||
|
||||
.pyro>.after {
|
||||
-moz-animation-delay: 1.25s, 1.25s, 1.25s;
|
||||
-webkit-animation-delay: 1.25s, 1.25s, 1.25s;
|
||||
-o-animation-delay: 1.25s, 1.25s, 1.25s;
|
||||
-ms-animation-delay: 1.25s, 1.25s, 1.25s;
|
||||
animation-delay: 1.25s, 1.25s, 1.25s;
|
||||
-moz-animation-duration: 1.25s, 1.25s, 6.25s;
|
||||
-webkit-animation-duration: 1.25s, 1.25s, 6.25s;
|
||||
-o-animation-duration: 1.25s, 1.25s, 6.25s;
|
||||
-ms-animation-duration: 1.25s, 1.25s, 6.25s;
|
||||
animation-duration: 1.25s, 1.25s, 6.25s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes bang {
|
||||
to {
|
||||
box-shadow: -234px -283.6666666667px #ff0900, 21px -260.6666666667px #5eff00, -203px -141.6666666667px #ff00bf, 120px -228.6666666667px #ff00b7, 103px 11.3333333333px #ff9900, -14px -414.6666666667px #ff009d, -186px -1.6666666667px #00eaff, 217px -114.6666666667px #ff0095, 111px -407.6666666667px #bf00ff, 71px 42.3333333333px #d5ff00, -189px 37.3333333333px #ff00e1, 185px -301.6666666667px #1eff00, 141px -400.6666666667px #ff8400, 129px -290.6666666667px #ffc800, 92px 45.3333333333px #ff0077, -137px -72.6666666667px #fff700, 171px -383.6666666667px #e6ff00, -238px -1.6666666667px #00ffaa, -8px -99.6666666667px #4dff00, -37px -329.6666666667px #ff6f00, 208px -221.6666666667px #00fffb, -75px -209.6666666667px #007bff, -140px -45.6666666667px #09ff00, 85px -125.6666666667px #0d00ff, 234px -238.6666666667px #09ff00, 104px -156.6666666667px #ff00d5, 213px -225.6666666667px #ff0055, -8px -360.6666666667px #00ffbf, -71px 75.3333333333px #ff0062, -129px -124.6666666667px #ff0033, 212px 47.3333333333px #d000ff, 19px -248.6666666667px #ff00ae, 72px -293.6666666667px #ff0080, -91px -28.6666666667px #00ffb3, 132px -258.6666666667px #0044ff, 7px -72.6666666667px #00ffe6, -179px -346.6666666667px #4800ff, 200px -351.6666666667px #4d00ff, -183px -228.6666666667px #aa00ff, -80px -211.6666666667px #ff9900, 70px -91.6666666667px #006aff, -243px -163.6666666667px #ff00a6, 76px -135.6666666667px #ff0084, -212px -297.6666666667px #00ffbb, 128px 46.3333333333px #95ff00, -113px 79.3333333333px #00ffbb, -157px -34.6666666667px #ff00c8, -160px -74.6666666667px #9500ff, 228px 48.3333333333px #00ff62, -235px -57.6666666667px #ff00b3, 185px -149.6666666667px #b300ff;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes bang {
|
||||
to {
|
||||
box-shadow: -234px -283.6666666667px #ff0900, 21px -260.6666666667px #5eff00, -203px -141.6666666667px #ff00bf, 120px -228.6666666667px #ff00b7, 103px 11.3333333333px #ff9900, -14px -414.6666666667px #ff009d, -186px -1.6666666667px #00eaff, 217px -114.6666666667px #ff0095, 111px -407.6666666667px #bf00ff, 71px 42.3333333333px #d5ff00, -189px 37.3333333333px #ff00e1, 185px -301.6666666667px #1eff00, 141px -400.6666666667px #ff8400, 129px -290.6666666667px #ffc800, 92px 45.3333333333px #ff0077, -137px -72.6666666667px #fff700, 171px -383.6666666667px #e6ff00, -238px -1.6666666667px #00ffaa, -8px -99.6666666667px #4dff00, -37px -329.6666666667px #ff6f00, 208px -221.6666666667px #00fffb, -75px -209.6666666667px #007bff, -140px -45.6666666667px #09ff00, 85px -125.6666666667px #0d00ff, 234px -238.6666666667px #09ff00, 104px -156.6666666667px #ff00d5, 213px -225.6666666667px #ff0055, -8px -360.6666666667px #00ffbf, -71px 75.3333333333px #ff0062, -129px -124.6666666667px #ff0033, 212px 47.3333333333px #d000ff, 19px -248.6666666667px #ff00ae, 72px -293.6666666667px #ff0080, -91px -28.6666666667px #00ffb3, 132px -258.6666666667px #0044ff, 7px -72.6666666667px #00ffe6, -179px -346.6666666667px #4800ff, 200px -351.6666666667px #4d00ff, -183px -228.6666666667px #aa00ff, -80px -211.6666666667px #ff9900, 70px -91.6666666667px #006aff, -243px -163.6666666667px #ff00a6, 76px -135.6666666667px #ff0084, -212px -297.6666666667px #00ffbb, 128px 46.3333333333px #95ff00, -113px 79.3333333333px #00ffbb, -157px -34.6666666667px #ff00c8, -160px -74.6666666667px #9500ff, 228px 48.3333333333px #00ff62, -235px -57.6666666667px #ff00b3, 185px -149.6666666667px #b300ff;
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes bang {
|
||||
to {
|
||||
box-shadow: -234px -283.6666666667px #ff0900, 21px -260.6666666667px #5eff00, -203px -141.6666666667px #ff00bf, 120px -228.6666666667px #ff00b7, 103px 11.3333333333px #ff9900, -14px -414.6666666667px #ff009d, -186px -1.6666666667px #00eaff, 217px -114.6666666667px #ff0095, 111px -407.6666666667px #bf00ff, 71px 42.3333333333px #d5ff00, -189px 37.3333333333px #ff00e1, 185px -301.6666666667px #1eff00, 141px -400.6666666667px #ff8400, 129px -290.6666666667px #ffc800, 92px 45.3333333333px #ff0077, -137px -72.6666666667px #fff700, 171px -383.6666666667px #e6ff00, -238px -1.6666666667px #00ffaa, -8px -99.6666666667px #4dff00, -37px -329.6666666667px #ff6f00, 208px -221.6666666667px #00fffb, -75px -209.6666666667px #007bff, -140px -45.6666666667px #09ff00, 85px -125.6666666667px #0d00ff, 234px -238.6666666667px #09ff00, 104px -156.6666666667px #ff00d5, 213px -225.6666666667px #ff0055, -8px -360.6666666667px #00ffbf, -71px 75.3333333333px #ff0062, -129px -124.6666666667px #ff0033, 212px 47.3333333333px #d000ff, 19px -248.6666666667px #ff00ae, 72px -293.6666666667px #ff0080, -91px -28.6666666667px #00ffb3, 132px -258.6666666667px #0044ff, 7px -72.6666666667px #00ffe6, -179px -346.6666666667px #4800ff, 200px -351.6666666667px #4d00ff, -183px -228.6666666667px #aa00ff, -80px -211.6666666667px #ff9900, 70px -91.6666666667px #006aff, -243px -163.6666666667px #ff00a6, 76px -135.6666666667px #ff0084, -212px -297.6666666667px #00ffbb, 128px 46.3333333333px #95ff00, -113px 79.3333333333px #00ffbb, -157px -34.6666666667px #ff00c8, -160px -74.6666666667px #9500ff, 228px 48.3333333333px #00ff62, -235px -57.6666666667px #ff00b3, 185px -149.6666666667px #b300ff;
|
||||
}
|
||||
}
|
||||
|
||||
@-ms-keyframes bang {
|
||||
to {
|
||||
box-shadow: -234px -283.6666666667px #ff0900, 21px -260.6666666667px #5eff00, -203px -141.6666666667px #ff00bf, 120px -228.6666666667px #ff00b7, 103px 11.3333333333px #ff9900, -14px -414.6666666667px #ff009d, -186px -1.6666666667px #00eaff, 217px -114.6666666667px #ff0095, 111px -407.6666666667px #bf00ff, 71px 42.3333333333px #d5ff00, -189px 37.3333333333px #ff00e1, 185px -301.6666666667px #1eff00, 141px -400.6666666667px #ff8400, 129px -290.6666666667px #ffc800, 92px 45.3333333333px #ff0077, -137px -72.6666666667px #fff700, 171px -383.6666666667px #e6ff00, -238px -1.6666666667px #00ffaa, -8px -99.6666666667px #4dff00, -37px -329.6666666667px #ff6f00, 208px -221.6666666667px #00fffb, -75px -209.6666666667px #007bff, -140px -45.6666666667px #09ff00, 85px -125.6666666667px #0d00ff, 234px -238.6666666667px #09ff00, 104px -156.6666666667px #ff00d5, 213px -225.6666666667px #ff0055, -8px -360.6666666667px #00ffbf, -71px 75.3333333333px #ff0062, -129px -124.6666666667px #ff0033, 212px 47.3333333333px #d000ff, 19px -248.6666666667px #ff00ae, 72px -293.6666666667px #ff0080, -91px -28.6666666667px #00ffb3, 132px -258.6666666667px #0044ff, 7px -72.6666666667px #00ffe6, -179px -346.6666666667px #4800ff, 200px -351.6666666667px #4d00ff, -183px -228.6666666667px #aa00ff, -80px -211.6666666667px #ff9900, 70px -91.6666666667px #006aff, -243px -163.6666666667px #ff00a6, 76px -135.6666666667px #ff0084, -212px -297.6666666667px #00ffbb, 128px 46.3333333333px #95ff00, -113px 79.3333333333px #00ffbb, -157px -34.6666666667px #ff00c8, -160px -74.6666666667px #9500ff, 228px 48.3333333333px #00ff62, -235px -57.6666666667px #ff00b3, 185px -149.6666666667px #b300ff;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes bang {
|
||||
to {
|
||||
box-shadow: -234px -283.6666666667px #ff0900, 21px -260.6666666667px #5eff00, -203px -141.6666666667px #ff00bf, 120px -228.6666666667px #ff00b7, 103px 11.3333333333px #ff9900, -14px -414.6666666667px #ff009d, -186px -1.6666666667px #00eaff, 217px -114.6666666667px #ff0095, 111px -407.6666666667px #bf00ff, 71px 42.3333333333px #d5ff00, -189px 37.3333333333px #ff00e1, 185px -301.6666666667px #1eff00, 141px -400.6666666667px #ff8400, 129px -290.6666666667px #ffc800, 92px 45.3333333333px #ff0077, -137px -72.6666666667px #fff700, 171px -383.6666666667px #e6ff00, -238px -1.6666666667px #00ffaa, -8px -99.6666666667px #4dff00, -37px -329.6666666667px #ff6f00, 208px -221.6666666667px #00fffb, -75px -209.6666666667px #007bff, -140px -45.6666666667px #09ff00, 85px -125.6666666667px #0d00ff, 234px -238.6666666667px #09ff00, 104px -156.6666666667px #ff00d5, 213px -225.6666666667px #ff0055, -8px -360.6666666667px #00ffbf, -71px 75.3333333333px #ff0062, -129px -124.6666666667px #ff0033, 212px 47.3333333333px #d000ff, 19px -248.6666666667px #ff00ae, 72px -293.6666666667px #ff0080, -91px -28.6666666667px #00ffb3, 132px -258.6666666667px #0044ff, 7px -72.6666666667px #00ffe6, -179px -346.6666666667px #4800ff, 200px -351.6666666667px #4d00ff, -183px -228.6666666667px #aa00ff, -80px -211.6666666667px #ff9900, 70px -91.6666666667px #006aff, -243px -163.6666666667px #ff00a6, 76px -135.6666666667px #ff0084, -212px -297.6666666667px #00ffbb, 128px 46.3333333333px #95ff00, -113px 79.3333333333px #00ffbb, -157px -34.6666666667px #ff00c8, -160px -74.6666666667px #9500ff, 228px 48.3333333333px #00ff62, -235px -57.6666666667px #ff00b3, 185px -149.6666666667px #b300ff;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes gravity {
|
||||
to {
|
||||
transform: translateY(200px);
|
||||
-moz-transform: translateY(200px);
|
||||
-webkit-transform: translateY(200px);
|
||||
-o-transform: translateY(200px);
|
||||
-ms-transform: translateY(200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes gravity {
|
||||
to {
|
||||
transform: translateY(200px);
|
||||
-moz-transform: translateY(200px);
|
||||
-webkit-transform: translateY(200px);
|
||||
-o-transform: translateY(200px);
|
||||
-ms-transform: translateY(200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes gravity {
|
||||
to {
|
||||
transform: translateY(200px);
|
||||
-moz-transform: translateY(200px);
|
||||
-webkit-transform: translateY(200px);
|
||||
-o-transform: translateY(200px);
|
||||
-ms-transform: translateY(200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-ms-keyframes gravity {
|
||||
to {
|
||||
transform: translateY(200px);
|
||||
-moz-transform: translateY(200px);
|
||||
-webkit-transform: translateY(200px);
|
||||
-o-transform: translateY(200px);
|
||||
-ms-transform: translateY(200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes gravity {
|
||||
to {
|
||||
transform: translateY(200px);
|
||||
-moz-transform: translateY(200px);
|
||||
-webkit-transform: translateY(200px);
|
||||
-o-transform: translateY(200px);
|
||||
-ms-transform: translateY(200px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes position {
|
||||
|
||||
0%,
|
||||
19.9% {
|
||||
margin-top: 10%;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
20%,
|
||||
39.9% {
|
||||
margin-top: 40%;
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
40%,
|
||||
59.9% {
|
||||
margin-top: 20%;
|
||||
margin-left: 70%;
|
||||
}
|
||||
|
||||
60%,
|
||||
79.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
80%,
|
||||
99.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes position {
|
||||
|
||||
0%,
|
||||
19.9% {
|
||||
margin-top: 10%;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
20%,
|
||||
39.9% {
|
||||
margin-top: 40%;
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
40%,
|
||||
59.9% {
|
||||
margin-top: 20%;
|
||||
margin-left: 70%;
|
||||
}
|
||||
|
||||
60%,
|
||||
79.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
80%,
|
||||
99.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes position {
|
||||
|
||||
0%,
|
||||
19.9% {
|
||||
margin-top: 10%;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
20%,
|
||||
39.9% {
|
||||
margin-top: 40%;
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
40%,
|
||||
59.9% {
|
||||
margin-top: 20%;
|
||||
margin-left: 70%;
|
||||
}
|
||||
|
||||
60%,
|
||||
79.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
80%,
|
||||
99.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@-ms-keyframes position {
|
||||
|
||||
0%,
|
||||
19.9% {
|
||||
margin-top: 10%;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
20%,
|
||||
39.9% {
|
||||
margin-top: 40%;
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
40%,
|
||||
59.9% {
|
||||
margin-top: 20%;
|
||||
margin-left: 70%;
|
||||
}
|
||||
|
||||
60%,
|
||||
79.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
80%,
|
||||
99.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 80%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes position {
|
||||
|
||||
0%,
|
||||
19.9% {
|
||||
margin-top: 10%;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
20%,
|
||||
39.9% {
|
||||
margin-top: 40%;
|
||||
margin-left: 30%;
|
||||
}
|
||||
|
||||
40%,
|
||||
59.9% {
|
||||
margin-top: 20%;
|
||||
margin-left: 70%;
|
||||
}
|
||||
|
||||
60%,
|
||||
79.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
80%,
|
||||
99.9% {
|
||||
margin-top: 30%;
|
||||
margin-left: 80%;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 1000 B |
After Width: | Height: | Size: 965 B |
After Width: | Height: | Size: 1004 B |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 6.0 KiB |