JSFiddle - React, Tailwind, and code Playground

HTML

<p>Touch the screen</p>

JavaScript

var startCoords = {}, endCoords = {};
$(document.body).bind("touchstart", function(event) {
    startCoords = endCoords = event.originalEvent.targetTouches[0];
});
$(document.body).bind("touchmove", function(event) {
    endCoords = event.originalEvent.targetTouches[0];
});
$(document.body).bind("touchend", function(event) {
    $('p').text("Your touch on the axis: " + Math.abs(startCoords.pageY-endCoords.pageY) + "x, " + Math.abs(startCoords.pageY-endCoords.pageY) + "y");
});