Get started with pressure CDN
MIT licensed
Lightweight library for creating gauges, dials: Pressure.
Tags:- forcetouch
- force-touch
- 3dtouch
- 3d-touch
- pressure
- pressurejs
- iphone6s
- iphone6splus
- iphone7
- iphone7plus
- magic-trackpad
- apple-pencil
Stable version
Copied!
How to start using pressure CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with pressure CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/pressure.min.js"></script>
<style>
#pressure-output { width: 100px; height: 100px; border: 1px solid black; }
</style>
</head>
<body>
<button id="measure-button">Measure Pressure</button>
<div id="pressure-output"></div>
<script>
const measureButton = document.getElementById('measure-button');
const pressureOutput = document.getElementById('pressure-output');
measureButton.addEventListener('click', () => {
navigator.mediaDevices.getUserMedia({ audio: true })
.then((stream) => {
const pressure = new Pressure({
audioStream: stream,
outputElement: pressureOutput,
onreading: (pressureData) => {
pressureOutput.textContent = `Pressure: ${pressureData.pressure} Pa`;
},
});
pressure.start();
})
.catch((error) => {
console.error('Error accessing microphone:', error);
});
});
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!