更多>
最新下载
jQuery 3D堆叠式图片切换代码
jQuery 3D堆叠式图片切换代码是一款将各个slide堆叠在一起,利用jquery跟CSS3 transforms和transitions来制作上下切换的堆叠幻灯片效果。
0
2026-01-29
边框动画css,简单的登录界面html
这是一款好看的边框动画css,简单的登录界面html,4色边框线条动画,充分响应式设计,简约大方,可用于网页会员登录、后台登录等,供大家查看。
0
2026-01-29
24小时阅读排行榜
- 1 如何在 Go 中向字符串追加字节(byte)?
- 2 html5可视化编辑怎么改边框样式_html5可视化边框设置技巧【技巧】
- 3 html个人页面怎么加自定义光标_html光标样式修改法【细节】
- 4 html个人页面结构怎么搭_常用html页面框架搭建法【结构】
- 5 html5日期格式输出成字符串怎么做_html5日期转字符串技巧【方案】
- 6 html5播放rtsp能录屏吗_html5rtsp录制回放实现【功能】
- 7 html5可视化编辑怎么加选项卡_html5可视化选项卡制作教程【步骤】
- 8 ios怎样调用html5拖拽功能_ios拖拽html5实现法【步骤】
- 9 html5怎么嵌入颜色选择器_html5嵌入拾色器交互法【步骤】
- 10 html5布局代码弹性盒主轴对齐_html5布局代码flex主轴对齐【技巧】
- 11 html5滤镜怎样调局部亮度_html5局部亮度滤镜法【步骤】
- 12 html5滤镜怎么实现水墨效果_html5水墨滤镜css写法【步骤】
- 13 html5如何实现图片镜头光晕_html5光晕特效制作法【技巧】
- 14 html5可视化编辑怎么改组件颜色_html5可视化组件着色法【技巧】
- 15 html5播放rtsp怎么防盗链_html5rtsp防盗链设置法【安全】
更多>
最新教程
-
- Node.js 教程
- 16372 2025-08-28
-
- CSS3 教程
- 1547102 2025-08-27
-
- Rust 教程
- 23476 2025-08-27
-
- Vue 教程
- 25901 2025-08-22
-
- PostgreSQL 教程
- 22399 2025-08-21
-
- Git 教程
- 9342 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
