Konubinix' opinionated web of thoughts

Know the Current Pinch-to-Zoom Width

Fleeting

know the current pinch-to-zoom width

open

<html>
  <head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script defer src="https://konubinix.eu/ipfs/bafkreic33rowgvvugzgzajagkuwidfnit2dyqyn465iygfs67agsukk24i?orig=https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
  </head>
  <body>
    Current zoom: <span x-data="{
    zoom: null,
    init() {
        setInterval(() => {this.zoom = document.body.clientWidth / visualViewport.width}, 100)
    },
}" x-text="zoom"></span>
  </body>
</html>