从此
📄文章 #️⃣专题 🌐酷站 👨‍💻技术 📺 📱

Web网页实例、新特性示例

HTML网页实例、Web新特性示例

综述

...

绘制、显示

Canvas画布

// <canvas id="canvas"></canvas> // var c = document.getElementById("canvas"); var c = document.createElement("canvas"); //c.width = 150; c.height = 150; document.body.appendChild(c); var ctx = c.getContext('2d') ctx.strokeStyle = 'red' ctx.strokeRect(0, 0, 100, 100)

WebGPU渲染:

实例 - https://webgpu.github.io/webgpu-samples/ const commandEncoder = device.createCommandEncoder(); const x = commandEncoder.beginRenderPass(...); x.setPipeline(...); x.draw(3); x.end(); device.queue.submit([commandEncoder.finish()]);

网址协议

  <button onclick="navigator.registerProtocolHandler('Web+OurCongciArticleSearchVersionOne', 'https://example.com/main/apis/more/js-protocol-handler/#s=%s')">注册网址协议(协议名会自动转小写/域名必须同源)</button>
  <a href="Web+OurCongciArticleSearchVersionOne:AI" target="_blank">测试网址协议(桌面程序也可调用/无需同源)</a>

其他

...