{"id":19883791,"url":"https://github.com/hyperhype/hyperlightbox","last_synced_at":"2025-07-26T04:06:47.859Z","repository":{"id":66001515,"uuid":"61759320","full_name":"hyperhype/hyperlightbox","owner":"hyperhype","description":"A lightbox built with hyperscript","archived":false,"fork":false,"pushed_at":"2016-12-28T16:11:19.000Z","size":6,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T09:55:09.569Z","etag":null,"topics":["hyperscript"],"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/hyperhype.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-22T23:55:18.000Z","updated_at":"2025-03-30T00:42:54.000Z","dependencies_parsed_at":"2023-02-23T03:15:23.213Z","dependency_job_id":null,"html_url":"https://github.com/hyperhype/hyperlightbox","commit_stats":null,"previous_names":["dominictarr/hyperlightbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hyperhype/hyperlightbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperhype%2Fhyperlightbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperhype%2Fhyperlightbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperhype%2Fhyperlightbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperhype%2Fhyperlightbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperhype","download_url":"https://codeload.github.com/hyperhype/hyperlightbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperhype%2Fhyperlightbox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267116325,"owners_count":24038623,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hyperscript"],"created_at":"2024-11-12T17:23:04.805Z","updated_at":"2025-07-26T04:06:47.851Z","avatar_url":"https://github.com/hyperhype.png","language":"JavaScript","readme":"# hyperlightbox\n\na lightbox with hyperscript.\n\njust a box that can appear over the other content.\n\n``` js\nvar lightbox = require('hyperlightbox')\nvar lb = lightbox()\n\n\n//make sure it's in the DOM.\ndocument.body.appendChild(lb)\n\n\n//pass it an element to show.\n\nlb.show(h('h1', 'hello world'))\n\n//later, close it. this will remove the element shown, also.\nlb.close()\n```\n\n## css\n\nyou'll need to apply css to make in appear over the other content.\nthere are two ways I've found that work well.\n\n### full screen lightbox\n\nwith the full screen approach, we can attach the lightbox to the DOM\nanywhere.\n\n``` css\n.lightbox {\n  position: fixed;\n  left: 0px;\n  right: 0px;\n  top: 0px;\n  bottom: 0px;\n}\n```\n\n### inline\n\nto make the lightbox not take up the full screen, but only to go over some local context,\nwe can put it inside a position: relative div.\n\n``` js\nh('div.content',\n  h('div.relative', lb), //add light box in with content.\n  h('h1', 'blah blah blah...')\n)\n```\n\nand then apply position relative to the container.\n\n``` css\n.relative {\n  position: relative;\n  height: 0px;\n}\n```\n\nby also setting height to zero, the lightbox will show over the other content.\n(the height sets the size of the container div, which the lightbox itself overflows)\n\n## License\n\nMIT\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperhype%2Fhyperlightbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperhype%2Fhyperlightbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperhype%2Fhyperlightbox/lists"}