更多>
最新下载
Vue记事本添加删除特效
使用vue制作简单的文本框输入关键词创建或删除计划事项记事本功能效果。可用于生活记事本备忘录特效。使用方法:参数介绍:新增(1、生成列表结构 v-for 和数组 2、获取用户输入 v-model 3、回车,新增数据 v-on .enter)--删除(数据改变和数据绑定的元素是同步变化的;时间的自定义参数;splice方法的应用)---计数(统计信息个数length)--清除(点击清除所有信息 v-
0
2026-01-28
24小时阅读排行榜
- 1 Redis 查询结果异常:排查数据库索引错配导致的 LLEN 返回 0
- 2 Python 函数注解在实际项目中的价值
- 3 如何在 Python 数据类继承中为父类必填字段设置子类默认值
- 4 sftp 连接慢的 TCP window scaling 与 MTU 路径发现
- 5 auditd 磁盘满的 audit_backlog_limit 与 rate_limit 配置
- 6 Python 为什么支持多重继承?
- 7 Linux 资源瓶颈的系统化判断方法
- 8 如何在不改变 Tkinter 框尺寸的前提下为容器添加标签
- 9 如何用窗口函数 FIRST_VALUE / LAST_VALUE 取分组首尾值
- 10 如何解决Laravel Eloquent的N+1查询问题? (with和load方法详解)
- 11 Python 异步 IO 在高并发中的优势
- 12 Python collections 模块的高阶用法
- 13 irqbalance 失效导致中断不均衡的 /proc/irq/*/smp_affinity 手动绑定示例
- 14 conntrack 表满后即使清空也立即复满的 tcp_established_timeout 缩短方案
- 15 Linux 高 CPU 使用率的排查顺序
更多>
最新教程
-
- Node.js 教程
- 16286 2025-08-28
-
- CSS3 教程
- 1546941 2025-08-27
-
- Rust 教程
- 23415 2025-08-27
-
- Vue 教程
- 25857 2025-08-22
-
- PostgreSQL 教程
- 22353 2025-08-21
-
- Git 教程
- 9312 2025-08-21
HTML5的模拟手电筒照明效果
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5模拟手电筒照明效果</title>
<style>
html, body {
height: 100%;
margin: 0;
}
svg {
display: block;
}
</style>
</head>
<body>
<svg width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<filter id="light">
<!-- blur the source image to make bump map less sharp -->
<feGaussianBlur stdDeviation="3" result="blurred"></feGaussianBlur>
<!-- create bump map based on alpha channel -->
<feColorMatrix in="blurred" type="luminanceToAlpha" result="bumpMap"></feColorMatrix>
<!-- use bump map for lighting filter -->
<feDiffuseLighting in="bumpMap" surfaceScale="3" result="light">
<fePointLight x="225" y="150" z="30"></fePointLight>
</feDiffuseLighting>
<!-- compose the lighting result with source image using multiplication -->
<feComposite in="light" in2="SourceGraphic"
operator="arithmetic"
k1="1" k2="0" k3="0" k4="0">
</feComposite>
</filter>
<pattern id="pattern1"
width="450" height="300"
patternUnits="userSpaceOnUse"
>
<image xlink:href="img/codepen.jpg"
width="450" height="300"
></image>
</pattern>
<rect width="100%" height="100%"
fill="url(#pattern1)" filter="url(#light)"
></rect>
</svg>
<script>
const svgNode = document.querySelector('svg');
const fePointLightNode = svgNode.querySelector('fePointLight');
svgNode.addEventListener('mousemove', handleMove);
svgNode.addEventListener('touchmove', handleMove);
function handleMove(event) {
fePointLightNode.setAttribute('x', event.clientX);
fePointLightNode.setAttribute('y', event.clientY);
}
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5模拟手电筒照明效果</title>
<style>
html, body {
height: 100%;
margin: 0;
}
svg {
display: block;
}
</style>
</head>
<body>
<svg width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<filter id="light">
<!-- blur the source image to make bump map less sharp -->
<feGaussianBlur stdDeviation="3" result="blurred"></feGaussianBlur>
<!-- create bump map based on alpha channel -->
<feColorMatrix in="blurred" type="luminanceToAlpha" result="bumpMap"></feColorMatrix>
<!-- use bump map for lighting filter -->
<feDiffuseLighting in="bumpMap" surfaceScale="3" result="light">
<fePointLight x="225" y="150" z="30"></fePointLight>
</feDiffuseLighting>
<!-- compose the lighting result with source image using multiplication -->
<feComposite in="light" in2="SourceGraphic"
operator="arithmetic"
k1="1" k2="0" k3="0" k4="0">
</feComposite>
</filter>
<pattern id="pattern1"
width="450" height="300"
patternUnits="userSpaceOnUse"
>
<image xlink:href="img/codepen.jpg"
width="450" height="300"
></image>
</pattern>
<rect width="100%" height="100%"
fill="url(#pattern1)" filter="url(#light)"
></rect>
</svg>
<script>
const svgNode = document.querySelector('svg');
const fePointLightNode = svgNode.querySelector('fePointLight');
svgNode.addEventListener('mousemove', handleMove);
svgNode.addEventListener('touchmove', handleMove);
function handleMove(event) {
fePointLightNode.setAttribute('x', event.clientX);
fePointLightNode.setAttribute('y', event.clientY);
}
</script>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
</div>
</body>
</html>
本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn
