Skip to content

Instantly share code, notes, and snippets.

View MartijnHols's full-sized avatar
😄
Hoi!

Martijn Hols MartijnHols

😄
Hoi!
View GitHub Profile
@MartijnHols
MartijnHols / iosedgedragnavigationmonitor.md
Last active July 25, 2022 15:18
iOS edge drag navigation monitor

Using a transition to open screens helps users keep track of where they are and mimicks the native apps they're used to.

2021-11-11 09 58 48

But on iOS Safari this leads to an issue. In Safari users can drag the edges of the screen to navigate to the previous and next page. This also works on iOS in native apps to close "pushed" screens (screens that animate in from the left). Keeping this behavior in place is likely desirable, but this can conflict with custom screen transitions.

2021-11-11 10 06 22

If you pay close attention, you'll see the screen transitions from one side to the other twice. The first is Safari transitioning between the current and previous page neatly with the position of the finger of the user. The second is the transition from our app "catching up". We don't need both transiti

@jsprpalm
jsprpalm / viewer.html
Created May 23, 2019 12:25
Pinch zoom implementation for PDF.js viewer
<!-- Goes into viewer.html just before ending </body> -->
<script>
let pinchZoomEnabled = false;
function enablePinchZoom(pdfViewer) {
let startX = 0, startY = 0;
let initialPinchDistance = 0;
let pinchScale = 1;
const viewer = document.getElementById("viewer");
const container = document.getElementById("viewerContainer");
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; };
@saghul
saghul / stream.js
Last active September 27, 2023 02:40
Streaming a webcam to a Jitsi Meet room
const puppeteer = require('puppeteer');
// Streams the first webcam in the system to the specified Jitsi Meet room. Audio is currently
// not sent, but it can be easily enabled by disabling the corresponding setting in `meetArgs`.
//
// TODO
// - Detect if we are kicked from the room
// - Support authenticated deployments
//