{"id":21765603,"url":"https://github.com/kimkee/keypad","last_synced_at":"2026-05-18T11:37:02.395Z","repository":{"id":52954646,"uuid":"521161269","full_name":"kimkee/keypad","owner":"kimkee","description":"keypad shuffle","archived":false,"fork":false,"pushed_at":"2023-10-17T09:30:33.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T01:48:52.483Z","etag":null,"topics":["keypad","password","pin","purescript","shuffle","ui"],"latest_commit_sha":null,"homepage":"https://kimkee.github.io/keypad","language":"JavaScript","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/kimkee.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}},"created_at":"2022-08-04T07:08:51.000Z","updated_at":"2022-08-17T22:22:27.000Z","dependencies_parsed_at":"2022-09-01T12:41:45.198Z","dependency_job_id":"dd2fa74e-1599-4187-9c4d-eee5230e8610","html_url":"https://github.com/kimkee/keypad","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/kimkee%2Fkeypad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimkee%2Fkeypad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimkee%2Fkeypad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimkee%2Fkeypad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimkee","download_url":"https://codeload.github.com/kimkee/keypad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244740943,"owners_count":20502166,"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":["keypad","password","pin","purescript","shuffle","ui"],"created_at":"2024-11-26T13:13:07.415Z","updated_at":"2026-05-18T11:36:57.373Z","avatar_url":"https://github.com/kimkee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 간편비밀번호 6자리 입력 랜덤 포지션 UI\n\nDemo : https://kimkee.github.io/keypad/\n\n![](screenshot.png)\n``` js\nconst keypad = {\n    init: function(){\n        this.kset();\n    },\n    cnum: 0,\n    pnum: 6, /* 비번갯수 */\n    pwds: document.querySelector(\"input.pwds\"), /* 비번필드 */\n    dset: function(n,v){ /* 점들 그리기 */\n        const dbox = document.querySelector(\".dots .dbx\");\n        let dot = '';\n        let ac  = '';\n        if(v != null){\n            this.pwds.value = this.pwds.value + v;\n        }\n        for(let d = 0; d \u003c this.pnum; d++){\n            n \u003e d ? ac = ' on' : ac = '';\n            dot += '\u003cem class=\"dt'+ac+'\"\u003e'+ this.pwds.value.charAt(d)+'\u003c/em\u003e';\n        }\n        dbox.innerHTML = dot;\n        if( n \u003e 0 ){\n            const ldt = dbox.querySelectorAll(\".dt.on\").length;\n            dbox.querySelector(\".dt:nth-child(\"+ldt+\")\").classList.add(\"act\");\n        }\n        \n        if( this.cnum \u003e= this.pnum ){\n            this.cnum = this.pnum;\n            this.pcom();\n        };\n        console.log(n, v, this.pwds.value);\n    },\n    kset: function(c){ /* 번호 그리기 */\n        const kbox = document.querySelector(\".keys .kbx\");\n        const norg = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n        const nums = [...norg];\n        /* 랜덤 뽑기  arrs.sort( e =\u003e Math.random() - 0.5 )  */\n        const choc = e =\u003e nums.splice( Math.floor( Math.random()*nums.length ) , 1)[0]; \n        let bts= '';\n        let bn = '';\n        let bx = '\u003cbutton type=\"button\" class=\"bt del\"\u003e\u003ci\u003eDel\u003c/i\u003e\u003c/button\u003e';\n        let bc = '\u003cbutton type=\"button\" class=\"bt rst\"\u003e\u003ci\u003eReset\u003c/i\u003e\u003c/button\u003e';\n        for(let i in norg){\n            let pp = choc();\n            let bt = '\u003cbutton type=\"button\" value=\"' + pp + '\" class=\"bt num\"\u003e\u003ci\u003e' + pp + '\u003c/i\u003e\u003c/button\u003e';\n            console.log(i, pp, nums);\n            i == 8 ? bn = bc : null;\n            i == 9 ? bn = bx : null;\n            bts += bt + bn;\n        }\n        kbox.innerHTML = bts;\n        this.dset(0,null);\n        this.cnum = 0;\n        kbox.querySelectorAll(\".bt\").forEach( bt =\u003e bt.addEventListener(\"click\", e =\u003e {\n            bt.classList.contains(\"num\") \u0026\u0026 this.pset(bt);\n            bt.classList.contains(\"rst\") \u0026\u0026 this.rset(bt);\n            bt.classList.contains(\"del\") \u0026\u0026 this.pdel(bt);\n        }));\n    },\n    rset: function(){ /* Reset */\n        this.pwds.value = '';\n        setTimeout( e =\u003e this.kset(), 100);\n    },\n    pdel: function(){ /* Del */\n        this.cnum--;\n        this.cnum \u003c 0 ? this.cnum = 0 : null;\n        this.pwds.value = this.pwds.value.slice(0, -1);\n        this.dset(this.cnum ,null);\n    },\n    pset: function(bt){ /* Number */\n        this.cnum++ ;\n        this.dset(this.cnum, bt.value);\n    },\n    pcom: e =\u003e setTimeout( e =\u003e location.reload(), 200 )  /* 모두 입력 후 */\n};\n\ndocument.addEventListener('DOMContentLoaded', e =\u003e keypad.init() );\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimkee%2Fkeypad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimkee%2Fkeypad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimkee%2Fkeypad/lists"}