{"id":27998532,"url":"https://github.com/pjaerr/vanilla-modal","last_synced_at":"2025-08-10T11:13:18.339Z","repository":{"id":96048317,"uuid":"100703928","full_name":"Pjaerr/vanilla-modal","owner":"Pjaerr","description":"A material design-esque modal that only uses HTML, CSS and JS.","archived":false,"fork":false,"pushed_at":"2017-09-19T11:59:38.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-08T22:53:57.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pjaerr.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,"zenodo":null}},"created_at":"2017-08-18T11:02:32.000Z","updated_at":"2017-09-19T11:58:44.000Z","dependencies_parsed_at":"2023-05-13T21:46:09.216Z","dependency_job_id":null,"html_url":"https://github.com/Pjaerr/vanilla-modal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pjaerr/vanilla-modal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pjaerr%2Fvanilla-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pjaerr%2Fvanilla-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pjaerr%2Fvanilla-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pjaerr%2Fvanilla-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pjaerr","download_url":"https://codeload.github.com/Pjaerr/vanilla-modal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pjaerr%2Fvanilla-modal/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269713884,"owners_count":24463244,"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-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2025-05-08T22:53:56.381Z","updated_at":"2025-08-10T11:13:18.331Z","avatar_url":"https://github.com/Pjaerr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vanilla-modal\nA material design-esque modal that uses no libraries, only HTML, CSS and JS. Other things on the modal such as buttons and text fields won't fit material design**.\n\nInclude ```modal.css``` at the top of your html file, and ```modal.js``` at the bottom of your html file.\n\n```\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"modal.css\"\u003e```\n```\u003cscript src=\"modal.js\"\u003e\u003c/script\u003e```\n\nFirst put the html code below somewhere in your body, anything outside of this div will be covered\nby a black overlay and rendered unusable (apart from the modal) when the modal is toggled on.\n\n```\u003cdiv id=\"modal-overlay\" class=\"modal-overlay\"\u003e\u003c/div\u003e```\n\nNext, put this html code somewhere in your body, it will add the modal in a hidden state to your page.\nThe modal will be centered via \"margin: 0 auto;\" but this can be changed in the css.\n\n```\n\u003cdiv id=\"modal-box\" class=\"modal-box\"\u003e\n    \u003cdiv class=\"modal-header\"\u003e\n        \u003cdiv class=\"modal-close-btn\"\u003e\n            \u003cbutton id=\"close-modal\" onclick=\"toggleModal()\"\u003eClose\u003c/button\u003e\n        \u003c/div\u003e\n        \u003cdiv class=\"modal-title\"\u003e\n            \u003ch4\u003eModal Title\u003c/h4\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"modal-content\"\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\nTo open or close the modal, call the function 'toggleModal()'.\n\nHopefully this is useful to someone, it doesn't depend on any libraries and so I thought I should share it as it is easy to add to a web page. If you wish to change the code and make it better, by all means create a pull request.\n\n![Modal Without Content](https://user-images.githubusercontent.com/11336751/29475786-2e37be42-8459-11e7-942d-7d71c806d140.PNG \"Modal Without Content\")\n\n![Modal With Content](https://user-images.githubusercontent.com/11336751/29475741-0205a96a-8459-11e7-85c2-b8a6fa0517d6.PNG \"Modal With Content\")\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjaerr%2Fvanilla-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjaerr%2Fvanilla-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjaerr%2Fvanilla-modal/lists"}