A javascript-only Window Manager
A javascript-only Window Manager
style.left
and style.top
to transform: translate(x, y)
(should have done this sooner)I used Ventus to build internal tools and editors, but I wanted a more configurable solution with a better event model that didn't rely on CSS.
https://davidfig.github.io/window-manager/
npm i simple-window-manager
https://davidfig.github.io/window-manager/jsdoc/
import { WindowManager } from 'simple-window-manager'
// or const WindowManager = require('simple-window-manager').WindowManager
// this is the window manager with one of the default options changed
const wm = new WindowManager({ backgroundWindow: 'green' });
// enable window snapping to screen edges and other windows when moving
wm.snap()
// create a window
const window = wm.createWindow({ width: 500, height: 500, title: 'Test Window' })
// set content of window
window.content.style.margin = '10px'
window.content.innerHTML = 'This is a nifty window.'
MIT License
(c) 2020 YOPEY YOPEY LLC by David Figatner