javascript转换静态图片,增加粒子动画效果
(编辑:jimmy 日期: 2025/12/27 浏览:3 次 )
使用getImageData接口获取图片的像素点,然后基于像素点实现动画效果,封装成一个简单的lib
<!DOCTYPE html>
<html>
<head>
<title>particle image</title>
<meta charset="utf-8" />
<style>
#logo {
margin-left:20px;
margin-top:20px;
width:160px;
height:48px;
background:url('./images/logo.png');
/*border: 1px solid red;*/
}
</style>
<script type="text/javascript" src="/UploadFiles/2021-04-02/ParticleImage.js">
ParticleImage.js
/*
The MIT License (MIT)
Copyright (c) 2015 arest
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* Add particle animation for image
* usage:
<script type="text/javascript" src="/UploadFiles/2021-04-02/ParticleImage.js">
以上所述就是本文的全部内容了,希望大家能够喜欢。
下一篇:jQuery实现限制textarea文本框输入字符数量的方法
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。