{"id":19623793,"url":"https://github.com/appleple/hiraku2","last_synced_at":"2025-08-10T16:04:29.483Z","repository":{"id":30181624,"uuid":"123932587","full_name":"appleple/hiraku2","owner":"appleple","description":"Vanilla JavaScript library to make drawer menus","archived":false,"fork":false,"pushed_at":"2022-11-01T23:21:30.000Z","size":1201,"stargazers_count":69,"open_issues_count":14,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-07T01:20:38.756Z","etag":null,"topics":["css","es6","javascript","npm","offcanvas-menu"],"latest_commit_sha":null,"homepage":"https://appleple.github.io/hiraku2/","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/appleple.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-03-05T14:36:58.000Z","updated_at":"2025-07-15T17:33:42.000Z","dependencies_parsed_at":"2022-08-07T15:01:14.850Z","dependency_job_id":null,"html_url":"https://github.com/appleple/hiraku2","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/appleple/hiraku2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fhiraku2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fhiraku2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fhiraku2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fhiraku2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleple","download_url":"https://codeload.github.com/appleple/hiraku2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleple%2Fhiraku2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269720428,"owners_count":24464275,"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":["css","es6","javascript","npm","offcanvas-menu"],"created_at":"2024-11-11T11:35:28.616Z","updated_at":"2025-08-10T16:04:29.372Z","avatar_url":"https://github.com/appleple.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hiraku2\n\nWe made hiraku.js so that more people can use Offcanvas-menu functionality which is used in a CMS we make.\n\nYou can easily find source code or plugins for Offcanvas-menu via Google by searching with \"offcanvas JavaScript\", but we can't find any plugins which meet all features that hiraku.js has. That's Why we made it from the scratch.\n\n## Feature\n\n- Not affected by the DOM structure.\n- Enable to open both right and left side menu.\n- Main canvas is not scrolled, while scrolling Offcanvas-menu.\n- Easy to control the movement\n- Accessible for keyboard navigation and screen readers.\n\n## Installation\n\nnpm\n\n```\n$ npm install hiraku\n```\n\n## Setup\n\n```html\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"./path/to/hiraku.css\"\u003e\n\u003cscript src=\"./path/to/hiraku.js\"\u003e\u003c/script\u003e\n```\n\n## Option\nhiraku.js has following options. Via options, you can control the behavior when you open the Offcanvas-menu.\nAnd if you want to change the width of the Offcanvas-menu, You may want to change CSS properties instead of changing the JavaScript.\n\n| Variable | Description |\n|-----------|----------------------------------------------------------------|\n| btn       | Selector of the button to open the Offcanvas-menu |\n| fixedHeader | Selector of the fixed elements |\n| direction | Offcanvas-menu from \"left\" or \"right\" |\n\n## Demo\n\n### From right side\n```html\n\u003cbutton class=\"hiraku-open-btn\" id=\"offcanvas-btn-right\" data-toggle-offcanvas=\"#js-hiraku-offcanvas-1\"\u003e\n  \u003cspan class=\"hiraku-open-btn-line\"\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cdiv class=\"offcanvas-right\"\u003e\n  \u003cul\u003e\u003cli\u003ehogehoge\u003c/li\u003e\u003c/ul\u003e\n\u003c/div\u003e\n```\n\n```js\nnew Hiraku(\".offcanvas-right\", {\n  btn: \"#offcanvas-btn-right\",\n  fixedHeader: \"#header\",\n  direction: \"right\"\n});\n```\n### From left side\n\n```html\n\u003cbutton class=\"hiraku-open-btn\" id=\"offcanvas-btn-left\" data-toggle-offcanvas=\"#js-hiraku-offcanvas-1\"\u003e\n  \u003cspan class=\"hiraku-open-btn-line\"\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cdiv class=\"offcanvas-left\"\u003e\n  \u003cul\u003e\u003cli\u003ehogehoge\u003c/li\u003e\u003c/ul\u003e\n\u003c/div\u003e\n```\n\n```js\nnew Hiraku(\".offcanvas-left\", {\n  btn: \"#offcanvas-btn-left\",\n  fixedHeader: \"#header\",\n  direction: \"left\"\n});\n```\n### From both side\n\n```html\n\u003cbutton class=\"hiraku-open-btn\" id=\"offcanvas-btn-left\" data-toggle-offcanvas=\"#js-hiraku-offcanvas-1\"\u003e\n  \u003cspan class=\"hiraku-open-btn-line\"\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cdiv class=\"offcanvas-left\"\u003e\n  \u003cul\u003e\u003cli\u003ehogehoge\u003c/li\u003e\u003c/ul\u003e\n\u003c/div\u003e\n\n\u003cbutton class=\"hiraku-open-btn\" id=\"offcanvas-btn-right\" data-toggle-offcanvas=\"#js-hiraku-offcanvas-1\"\u003e\n  \u003cspan class=\"hiraku-open-btn-line\"\u003e\u003c/span\u003e\n\u003c/button\u003e\n\u003cdiv class=\"offcanvas-right\"\u003e\n  \u003cul\u003e\u003cli\u003ehogehoge\u003c/li\u003e\u003c/ul\u003e\n\u003c/div\u003e\n```\n\n```js\nnew Hiraku(\".offcanvas-left\", {\n  btn: \"#offcanvas-btn-left\",\n  fixedHeader: \"#header\",\n  direction: \"left\"\n});\n\n\nnew Hiraku(\".offcanvas-right\", {\n  btn: \"#offcanvas-btn-right\",\n  fixedHeader: \"#header\",\n  direction: \"right\"\n});\n```\n\n### Specify the width of the Offcanvas-menu in pixels\n\n```js\nnew Hiraku(\".offcanvas-right\", {\n  btn: \"#offcanvas-btn-right\",\n  fixedHeader: \"#header\",\n  direction: \"right\",\n  width: '100px' // default 70%\n});\n```\n\n### open/close methods\n\n```js\nvar hiraku = new Hiraku(\".offcanvas-right\", {\n  breakpoint: -1,\n  btn: \"#offcanvas-btn-right\",\n  closeBtn: '.#offcanvas-btn-close',\n  fixedHeader: \"#header\",\n  direction: \"right\",\n  width: '100px' // default 70%\n});\nhiraku.open(); // open offcanvas;\nhiraku.close(); // close offcanvas;\n```\n\n### open/close events\n\n```js\nvar hiraku = new Hiraku(\".offcanvas-right\", {\n  breakpoint: -1,\n  btn: \"#offcanvas-btn-right\",\n  closeBtn: '.#offcanvas-btn-close',\n  fixedHeader: \"#header\",\n  direction: \"right\",\n  width: '100px' // default 70%\n});\nhiraku.on('open', function(){\n  // this will be executed when the offcanvas opened\n});\nhiraku.on('close', function(){\n  // this will be executed when the offcanvas closed\n});\n```\n\n## Download\n\nYou can download from here.\n\n[Download hiraku.js](http://github.com/appleple/hiraku2/archive/master.zip)\n\n## Github\n\n[hiraku.js on Github](http://github.com/appleple/hiraku2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Fhiraku2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleple%2Fhiraku2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleple%2Fhiraku2/lists"}