{"id":20596035,"url":"https://github.com/davidfig/window-manager","last_synced_at":"2025-04-14T23:44:15.191Z","repository":{"id":47827235,"uuid":"116359725","full_name":"davidfig/window-manager","owner":"davidfig","description":"A javascript-only Window Manager","archived":false,"fork":false,"pushed_at":"2022-07-21T04:13:22.000Z","size":1688,"stargazers_count":65,"open_issues_count":12,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T11:51:06.282Z","etag":null,"topics":["electron","javascript","maximize","minimize","save","ui","win","window","windowmanager"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidfig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-05T08:10:34.000Z","updated_at":"2024-10-26T12:53:58.000Z","dependencies_parsed_at":"2022-08-23T15:02:38.481Z","dependency_job_id":null,"html_url":"https://github.com/davidfig/window-manager","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fwindow-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fwindow-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fwindow-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fwindow-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfig","download_url":"https://codeload.github.com/davidfig/window-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890822,"owners_count":21178513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","javascript","maximize","minimize","save","ui","win","window","windowmanager"],"created_at":"2024-11-16T08:14:51.955Z","updated_at":"2025-04-14T23:44:15.169Z","avatar_url":"https://github.com/davidfig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-window-manager\nA javascript-only Window Manager\n\n## version 2\n* the API has changed from v1 to v2\n* rollup is used to compile the libraries, so there is no longer a default export: see sample code below\n* animations are deprecated for now since they felt slow--I'm open to putting them back in\n* finally moved away from `style.left` and `style.top` to `transform: translate(x, y)` (should have done this sooner)\n* snapping working much better; screen snapping now optionally responds to window resize\n* minimize has been removed since it does the same thing as close (unless we add a taskbar)\n\n## features\n* basic windowing experience (works great with electron to run multiple windows under one process)\n* create normal and modal windows\n* optionally snap windows to screen edges and/or other windows\n* takes advantage of all the features of the DOM, including undefined width and/or height to automatically adjust size of window based on content\n* windows may be resized, maximized, and minimized\n* minimize works by minimizing to a small square that can be moved independently. Clicking it restores to its original size and location. Minimizing again moves the small square back to the last minimized location.\n* can save and load windowing state (e.g., using localStorage or json files using Electron)\n* emits events (using eventemitter3)\n* uses javascript animations instead of CSS\n\n## rationale\n\nI used [Ventus](https://github.com/rlamana/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.\n\n## live example\n[https://davidfig.github.io/window-manager/](https://davidfig.github.io/window-manager/)\n\n## installation\n\n    npm i simple-window-manager\n\n## API documentation\n[https://davidfig.github.io/window-manager/jsdoc/](https://davidfig.github.io/window-manager/jsdoc/)\n\n## sample code\n```js\n    import { WindowManager } from 'simple-window-manager'\n    // or const WindowManager = require('simple-window-manager').WindowManager\n\n    // this is the window manager with one of the default options changed\n    const wm = new WindowManager({ backgroundWindow: 'green' });\n\n    // enable window snapping to screen edges and other windows when moving\n    wm.snap()\n\n    // create a window    \n    const window = wm.createWindow({ width: 500, height: 500, title: 'Test Window' })\n\n    // set content of window\n    window.content.style.margin = '10px'\n    window.content.innerHTML = 'This is a nifty window.'\n```\n\n## License  \nMIT License  \n(c) 2020 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](david@yopeyopey.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fwindow-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfig%2Fwindow-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fwindow-manager/lists"}