Is it possible to use a smartphone as a pointer device for controlling a website?

Yes, it is possible to use a smartphone as a pointer device for controlling a website by utilizing the device's gyroscope and accelerometer sensors. By capturing the motion data from these sensors, we can translate the movements into cursor movements on the website. This can be achieved by implementing a JavaScript code that reads the sensor data and updates the cursor position accordingly.

// JavaScript code to capture smartphone sensor data and control cursor on website

<script>
    window.addEventListener("deviceorientation", handleOrientation, true);

    function handleOrientation(event) {
        var x = event.beta; // In degree in the range [-180,180]
        var y = event.gamma; // In degree in the range [-90,90]

        // Update cursor position on website based on sensor data
        // Example: document.getElementById("cursor").style.left = x + "px";
        // Example: document.getElementById("cursor").style.top = y + "px";
    }
</script>