{"id":20513827,"url":"https://github.com/webreflection/screenfit","last_synced_at":"2026-03-06T22:31:04.578Z","repository":{"id":50850746,"uuid":"313073451","full_name":"WebReflection/screenfit","owner":"WebReflection","description":"A cross platform, cross WebView, solution to fit 100% any Web page.","archived":false,"fork":false,"pushed_at":"2021-05-28T13:06:42.000Z","size":257,"stargazers_count":55,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-17T12:18:05.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.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":"2020-11-15T16:28:03.000Z","updated_at":"2024-09-02T12:58:01.000Z","dependencies_parsed_at":"2022-09-24T21:41:25.331Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/screenfit","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fscreenfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fscreenfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fscreenfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fscreenfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/screenfit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242117718,"owners_count":20074438,"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":[],"created_at":"2024-11-15T21:13:21.246Z","updated_at":"2026-03-06T22:31:04.526Z","avatar_url":"https://github.com/WebReflection.png","language":"HTML","readme":"# screenfit\n\nA cross platform, cross WebView, solution to fit 100% any Web page.\n\n**[Live Demo](https://webreflection.github.io/screenfit/)**\n\n\n\n## Usage\n\nInclude *screenfit* helper on top of your *HTML* page/application:\n\n```html\n\u003cscript defer src=\"https://unpkg.com/screenfit\"\u003e\u003c/script\u003e\n```\n\nand optionally opt-in to listen to changes:\n\n```js\naddEventListener('screenfit', ({detail}) =\u003e {\n  const {width, height} = detail;\n  console.log(`Now @${width}x${height}`);\n});\n```\n\nIt's important to include this module *ASAP* as *src*, `defer`, or `module`, as it adjusts both `\u003chtml\u003e` and `\u003cbody\u003e` styles once, so the sooner it runs, the better it is for your web/application.\n\n\n\n## About\n\nWhen it comes to fullfill the current visible area of a Web page/application, nothing really works cross platform via *CSS* only, especially when the OS keyboard shows up.\n\nThis module goal is to fix the ability to fullfill a screen in both `width` and, most importantly, `height`, whenever the keyboard is on the screen, or not.\n\n\n\n## Use Cases\n\n  * hero images/pages that perfectly fit on the screen even with an active keyboard\n  * non necesasrily resizable fullscreen applications such as [Maps](https://webreflection.github.io/map/) and similar\n  * splash screens and login splash screens\n  * every other use case that needs 100% *HTML* area to work\n\n\n\n## Compatibility\n\n**Works/Tested on**\n\n - KaiOS\n - Opera Mini\n - UCE Browser / Mini\n - Windows Phone\n - Samsung Internet\n - Android 6+ / Androind One\n - Any Chrome/ium based browser\n - Safari / Moble 13+\n - Vivaldi\n - Firefox / Nightly\n - Desktop browsers, including *IE11* (see *gotchas*)\n\n**Known Gotchas**\n\n - IE11 and Kindle experimental browser need features detection (see [index.html](./index.html))\n - iOS 12 (iPad does *not* trigger any resize), possible work around for iOS \u003c 13 but not sure how to detect the available size without the keyboard: `document.addEventListener('focus', resize, true)`. If you know how to get the right height with an *iPad* on *iOS* 12 with a keyboard up, please file an issue/contact me, thank you!\n - Some weird edge case might use non-system related overlays that can't be detected from JS or CSS ... in that case, be sure your web/application shows most relevant informations in the center of the screen or above some known threshold\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fscreenfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fscreenfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fscreenfit/lists"}