Touch Feedback Generator - Online Haptic & Visual Cue
Preview different touch feedback patterns (scale, color, ripple) for mobile buttons. Copy the CSS and HTML. Improve mobile UX.
UD5 Toolkit
实时手势控制演示 · 触摸轨迹可视化 · 移动端体验最佳
touch-action: auto;
在移动设备上,切换不同的 touch-action 值后尝试在主画布上滑动,可以真实感受浏览器手势行为的变化。
none 会阻止页面滚动,pan-y 仅允许垂直滚动。桌面端请使用浏览器设备模拟模式获得完整体验。
touch-action 是一个CSS属性,用于控制浏览器在触摸设备上如何处理触摸手势(如平移、缩放)。它允许开发者指定在特定元素上哪些手势应由浏览器默认处理,哪些应完全交给JavaScript自定义处理。这对于构建流畅的移动端交互体验至关重要,特别是在需要自定义拖拽、绘图或滑动手势的应用中。
auto — 浏览器默认行为,允许所有手势(滚动、缩放等)。none — 完全阻止浏览器默认手势,所有触摸事件由JS处理。适用于自定义绘图画布、游戏等。pan-x — 仅允许水平单指平移,阻止垂直滚动和缩放。pan-y — 仅允许垂直单指平移,阻止水平滚动和缩放。pinch-zoom — 仅允许多指缩放(pinch zoom),阻止平移。manipulation — 允许平移和缩放,但阻止双击缩放(double-tap zoom),相当于 pan-x pan-y pinch-zoom 的组合。pan-left / pan-right / pan-up / pan-down — 仅允许指定方向的平移(浏览器支持有限)。touch-action 解决了这一痛点:
touch-action: none 防止画布上的触摸操作触发页面滚动。touch-action: none 确保拖拽流畅不被滚动打断。touch-action: pan-y 允许垂直滚动页面但水平滑动用于切换图片。touch-action: manipulation 允许平移和缩放但阻止双击放大。touch-action: none 获取完全的手势控制权。touchstart 和 touchmove 事件设置为passive模式(即 {passive: true}),意味着事件处理器无法调用 preventDefault() 来阻止滚动。设置 touch-action: none 告诉浏览器该元素不需要默认手势处理,从而使非passive的事件监听器能够正常工作。这是性能和交互之间的关键平衡机制。
touch-action 在所有现代浏览器中都有良好支持,包括Chrome 36+、Firefox 52+、Safari 13+、Edge 79+。iOS Safari从13版本开始支持,Android Chrome完全支持。pinch-zoom 值在Safari中支持较晚(Safari 13+)。pan-left/right/up/down 等方向性值的浏览器支持较为有限,建议使用 pan-x 和 pan-y 作为替代。对于不支持的旧浏览器,可配合polyfill或降级方案。
touch-action计算值。touch-action设置(该属性可继承)。{passive: false}选项以配合touch-action: none。touch-action: none 实际上可以提升性能。因为它明确告诉浏览器该元素不需要默认手势处理,浏览器可以跳过手势识别步骤,减少触摸事件的延迟(从约300ms降至接近即时)。这正是 manipulation 值的设计初衷之一——消除双击缩放带来的300ms延迟,同时保留平移和缩放能力。合理设置 touch-action 是移动端性能优化的最佳实践之一。
Preview different touch feedback patterns (scale, color, ripple) for mobile buttons. Copy the CSS and HTML. Improve mobile UX.
Chain multiple CSS filter functions and see the result on an image. Copy the filter string. No upload.
Click on a box to set the transform‑origin point and see how rotations and scales change. Copy the CSS.
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
Create a looping animated gradient background with multiple color stops. Copy the complete CSS keyframes. Eye‑catching.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Try all object‑fit values (fill, contain, cover, scale‑down) on an image. Adjust object‑position. Copy the CSS.
Render 1000 styled elements using inline styles vs. CSS classes and compare time. Understand CSS‑in‑JS trade‑offs.
See how `animation‑composition: replace, add, accumulate` works by layering animations on the same property. Understand the spec.
Load a sprite sheet, define frames, and play an animation on a canvas. Control frame rate and loop. Game dev tool.
Answer questions about project type and strength needed to get a joint recommendation. Animations.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Apply a blur effect to image background while keeping the subject sharp. Simple brush selection for area to keep sharp. CSS+Canvas implementation, local only.
Generate a subtle or heavy noise/grain texture as a CSS background. Adjust intensity and color. Copy the small code.
Generate dynamic placeholder images by specifying width, height, colors, and text. View instantly as a URL you can embed in mockups. Canvas-based.
Generate a link to an SVG placeholder image with a custom width, height, and text. Use as dummy image src. No server.
Paste any iframe embed code (YouTube, maps) and get a responsive wrapper div with correct aspect ratio CSS.
Generate an SVG placeholder image with custom text, width, height, and colors. Use as a placeholder service. Pure SVG.
Generate the doGet() and doPost() boilerplate for a Google Apps Script web app. Ready to paste into the editor.
Automatically remove the background from any photo using a small on‑device AI model (WASM). No upload. Works offline.
Keep one selected color and turn the rest of the image to grayscale. Eye‑catching selective color effect. Pure canvas.
Rotate the hue of any image globally. Turn a red car blue instantly. Download the result. Works entirely in the browser.
Interactive cheatsheet for JavaScript regular expressions with live examples. Click any token to see its explanation and test it on sample text immediately.
Select text and see the Selection object properties. Create ranges programmatically. Understand how rich‑text editors work.
Apply real-time CSS filters or canvas effects to a video and download the processed output. Experiment with video post-processing locally.
List each item with weight, see total load. Color-coded recommendations for reducing pack weight. Local storage.
Fill in a component name and generate a complete Stencil.js component with TSX, CSS, and test files. Quick start.
Adjust a brightness threshold slider and see the live vector trace of an image. Export as SVG. Potrace‑style.
Add a dramatic fire or flame overlay to any image. Realistic blending. Adjust intensity. Download the hot result.
Search for common ingredient substitutions (e.g., buttermilk, egg, cornstarch). Quick reference for when you're missing something. Local data.