{"id":15099283,"url":"https://github.com/psygo/hookban","last_synced_at":"2026-02-05T03:36:22.597Z","repository":{"id":241373615,"uuid":"805777167","full_name":"psygo/hookban","owner":"psygo","description":"A hookable goban","archived":false,"fork":false,"pushed_at":"2024-05-28T11:54:50.000Z","size":228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T23:56:27.450Z","etag":null,"topics":["baduk","go","goban","web-components","weiqi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psygo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-25T12:32:02.000Z","updated_at":"2024-05-28T11:54:53.000Z","dependencies_parsed_at":"2024-09-15T17:22:25.873Z","dependency_job_id":null,"html_url":"https://github.com/psygo/hookban","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"21ef3cfafda8d6893153e076aadb53a4cbc4de9e"},"previous_names":["psygo/hookban"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/psygo/hookban","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fhookban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fhookban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fhookban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fhookban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psygo","download_url":"https://codeload.github.com/psygo/hookban/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psygo%2Fhookban/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29109304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T03:27:05.906Z","status":"ssl_error","status_checked_at":"2026-02-05T03:26:43.416Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["baduk","go","goban","web-components","weiqi"],"created_at":"2024-09-25T17:09:25.574Z","updated_at":"2026-02-05T03:36:22.582Z","avatar_url":"https://github.com/psygo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hookban\n\nA hookable goban.\n\nA composable goban with no dependencies, made entirely with Vanilla JS and Web Components, which makes integration into any web platform easier.\n\nThe 2 key features of this implementation would be:\n\n- Communication through events\n- Hooks for when things change.\n\n## How It Works\n\n\u003e Check out the [`example_1.html`](./src/examples/example_1.html) for more info.\n\n### A Goban in Layers\n\nWe can achieve more fine grained control, and simpler components by deconstructing goban features into layers:\n\n```html\n\u003chookban-container\u003e\n  \u003chookban-stones\u003e\u003c/hookban-stones\u003e\n  \u003chookban-grid\u003e\u003c/hookban-grid\u003e\n  \u003chookban-background\n    oncolorchange=\"() =\u003e console.log('color changed')\"\n  \u003e\u003c/hookban-background\u003e\n\u003c/hookban-container\u003e\n```\n\nBy decomposing things in this way, anyone can easily create other custom layers as well. Ideally, each layer should be simple enough, that a developer could simply copy paste the original code and alter it in a couple of hours, I believe.\n\nThen, it's just a matter of setting properties on each HTML component:\n\n```html\n\u003cdiv class=\"form-field\"\u003e\n  \u003clabel for=\"background-color\"\u003eColor\u003c/label\u003e\n  \u003cinput id=\"background-color\" type=\"color\" /\u003e\n\u003c/div\u003e\n```\n\n```js\nconst backgroundColorInput = document.querySelector(\n  \"#background-color\"\n)\n\nbackgroundColorInput.addEventListener(\"input\", (e) =\u003e {\n  const hookbanBackground = document.querySelector(\n    \"hookban-background\"\n  )\n  hookbanBackground.setAttribute(\"color\", e.target.value)\n})\n```\n\nOr, alternatively, we could also use them as JS objects, and later append them to the DOM.\n\n### But what about SGF and Go rules?\n\nI think that, for the sake of simplicity and separation of concerns, this shouldn't be coupled with the UI. I recommend keeping controls outside the Goban UI, and then use them to communicate things in and out of the UI. I do have plans of packaging all of it in a macro component at some point.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsygo%2Fhookban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsygo%2Fhookban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsygo%2Fhookban/lists"}