{"id":26781692,"url":"https://github.com/pixelunion/bc-modal","last_synced_at":"2025-03-29T08:17:32.679Z","repository":{"id":44075308,"uuid":"132650125","full_name":"pixelunion/bc-modal","owner":"pixelunion","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T01:16:43.000Z","size":561,"stargazers_count":0,"open_issues_count":10,"forks_count":3,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-03-26T12:58:29.985Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"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/pixelunion.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-08T18:39:52.000Z","updated_at":"2020-08-11T18:19:24.000Z","dependencies_parsed_at":"2023-01-25T20:16:41.314Z","dependency_job_id":null,"html_url":"https://github.com/pixelunion/bc-modal","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelunion","download_url":"https://codeload.github.com/pixelunion/bc-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156411,"owners_count":20732397,"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":["library"],"created_at":"2025-03-29T08:17:31.882Z","updated_at":"2025-03-29T08:17:32.667Z","avatar_url":"https://github.com/pixelunion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bigcommerce Modal Module\n\n## Installation\n\nNPM:\n\n```\nnpm i github:pixelunion/bc-modal\n```\n\n## Usage\n\n```\n\u003cdiv id=\"review-modal\"\u003e\n\t\u003ch1\u003eHere's my modal!\u003c/h1\u003e\n\u003c/div\u003e\n```\n\n```\n#review-modal {\n\tdisplay: none;\n}\n```\n\n```\nimport $ from 'jquery';\nimport Modal from 'bc-modal';\n\nconst reviewModal = new Modal({\n  el: $('#review-modal')\n});\n\n$('button').on('click', (event) =\u003e {\n\treviewModal.open();\n});\n```\n\n## Options\n\n#### `el`\n\nThe jQuery object of the modal markup. The modal will be filled with the _contents_ of this element, not the element itself. Required.\n\n#### `modalId`\n\nId of the modal wrapper element. Defaults to `#modal`.\n\n#### `modalClass`\n\nOptional additional class to add to the `.modal` element.\n\n#### `bodyOverflowClass`\n\nThe class added to the body when the modal is open. Defaults to `scroll-locked`.\n\n#### `bodyOverflowClass`\n\nThe class added to the body when the modal is open. Defaults to `scroll-locked`.\n\n#### `centerVertically`\n\nWhether or not to automatically center the modal vertically, defaults to `true`.\n\n#### `closeSelector`\n\nA selector string for a close button within the modal.\n\n#### `afterShow`\n\nA popular television program produced out of Toronto that ran after MTV's _The Hills_ in the early 2000's.\n\n#### `afterHide`\n\nNot a television program, but a callback. Does what you think it would.\n\n## Methods\n\n`open()` and `close()` should get you where you need to be.\n\n`position()` will force a recalculation of the modal position, if `centerVertically` is enabled.\n\n## Styling\n\n`./dist/scss/modal.scss` has enough styles for things to work by default.\n\n#### `.modal-wrapper`\n\nThe container, shouldn't need any styling.\n\n#### `.modal`\n\nThe constrained 'box' for the modal - apply width dimensions etc here\n\n#### `.modal-content`\n\nPut the meat of your modal styles here: backgrounds, borders, shadows, anything you want!!!\n\n### Animation classes\n\nTransitions are handled via jQuery.revealer and can therefore be overridden in your css: have a look at [the docs](https://github.com/PixelUnion/jquery.revealer) (or modal.scss) specifics.\n\n## Further Development\n\nFor debugging or improvements you can run a standalone demo version of the modal using a very basic node server:\n\n```\n$ npm install\n$ npm run serve\n```\n\nThis will allow you to make changes to the JS and HTML. To re-compile the scss you'll need to run `npm run build` from a separate terminal window after each change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelunion%2Fbc-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-modal/lists"}