{"id":20724066,"url":"https://github.com/jerray/jk-keyboard","last_synced_at":"2025-04-23T17:44:14.178Z","repository":{"id":57281019,"uuid":"48792485","full_name":"jerray/jk-keyboard","owner":"jerray","description":"HTML Numeric Keyboard for Mobile (4x4)","archived":false,"fork":false,"pushed_at":"2019-09-18T05:17:32.000Z","size":64,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T02:03:37.090Z","etag":null,"topics":[],"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/jerray.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":"2015-12-30T09:09:22.000Z","updated_at":"2023-12-05T14:46:01.000Z","dependencies_parsed_at":"2022-09-06T01:02:33.227Z","dependency_job_id":null,"html_url":"https://github.com/jerray/jk-keyboard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerray%2Fjk-keyboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerray%2Fjk-keyboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerray%2Fjk-keyboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerray%2Fjk-keyboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerray","download_url":"https://codeload.github.com/jerray/jk-keyboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250483573,"owners_count":21438081,"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":[],"created_at":"2024-11-17T04:12:05.510Z","updated_at":"2025-04-23T17:44:14.154Z","avatar_url":"https://github.com/jerray.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jk-keyboard\n\n一个为移动端页面设计的HTML数字键盘程序。\n\n![Screenshot](https://raw.githubusercontent.com/jerray/jk-keyboard/master/screenshot/jk-1.gif)\n\n## 用法\n\n### 键盘布局\n\n```html\n\u003clink rel=\"stylesheet\" href=\"./jk-keyboard.css\"\u003e\n...\n\n\u003cdiv id=\"jk-keyboard\" class=\"jk-keyboard\"\u003e\n  \u003ca class=\"jk-key jk-left-0 jk-top-0\" data-code=\"1\"\u003e\u003cspan\u003e1\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-1 jk-top-0\" data-code=\"2\"\u003e\u003cspan\u003e2\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-2 jk-top-0\" data-code=\"3\"\u003e\u003cspan\u003e3\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-0 jk-top-1\" data-code=\"4\"\u003e\u003cspan\u003e4\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-1 jk-top-1\" data-code=\"5\"\u003e\u003cspan\u003e5\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-2 jk-top-1\" data-code=\"6\"\u003e\u003cspan\u003e6\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-0 jk-top-2\" data-code=\"7\"\u003e\u003cspan\u003e7\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-1 jk-top-2\" data-code=\"8\"\u003e\u003cspan\u003e8\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-2 jk-top-2\" data-code=\"9\"\u003e\u003cspan\u003e9\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-0 jk-top-3\" id=\"keyboard-down\"\u003e隐藏\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-1 jk-top-3\" data-code=\"0\"\u003e\u003cspan\u003e0\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-2 jk-top-3\" data-code=\".\"\u003e\u003cspan\u003e.\u003c/span\u003e\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-3 jk-top-0 jk-height-1\" data-code=\"backspace\"\u003e删除\u003c/a\u003e\n  \u003ca class=\"jk-key jk-left-3 jk-top-2 jk-height-1 submit disabled jk-text\" id=\"submit\"\u003e\u003cspan\u003e确认\u003c/span\u003e\u003c/a\u003e\n\u003c/div\u003e\n\u003cscript type=\"text/javascript\" src=\"./jk-keyboard.js\"\u003e\u003c/script\u003e\n```\n\n使用`jk-left-n`和`jk-top-n`设置按键位置。可以使用`jk-height-n`来改变按键高度。\n\n### 初始化\n\n```javascript\n(function() {\n  var number = document.querySelector('#number');\n  JK.start({\n    container: '#jk-keyboard',\n    decimal: 3,\n    open: true,\n    onKeyDown: function(value) {\n      console.debug('onKeyDown', value);\n      // prevent changing\n      // if (parseFloat(value) \u003e 1000) {\n      //   return false;\n      // }\n    },\n    onKeyUp: function(value) {\n      console.debug('onKeyUp', value);\n      number.textContent = value;\n    },\n    onStart: function(keyboard) {\n      keyboard.el.querySelector('#keyboard-down').on('click', function() {\n        keyboard.close();\n      });\n      number.addEventListener('click', function() {\n        keyboard.open();\n      });\n    }\n  });\n})();\n```\n\n示例代码参见 `index.html`。需要使用Chrome打开该页面，然后打开开发者工具，激活手机模式。\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerray%2Fjk-keyboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerray%2Fjk-keyboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerray%2Fjk-keyboard/lists"}