{"id":19349247,"url":"https://github.com/efrane/jquery-dice","last_synced_at":"2025-04-23T06:30:51.153Z","repository":{"id":137546473,"uuid":"2533207","full_name":"eFrane/jquery-dice","owner":"eFrane","description":"Decisions made easy.","archived":false,"fork":false,"pushed_at":"2016-10-12T14:29:53.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T09:22:36.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://efrane.github.com/jquery-dice/","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/eFrane.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":"2011-10-07T15:02:53.000Z","updated_at":"2016-10-12T14:29:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"8df5f091-3c16-48b5-9d17-b34eb3859d8d","html_url":"https://github.com/eFrane/jquery-dice","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/eFrane%2Fjquery-dice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2Fjquery-dice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2Fjquery-dice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2Fjquery-dice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eFrane","download_url":"https://codeload.github.com/eFrane/jquery-dice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250384737,"owners_count":21421785,"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-10T04:25:27.269Z","updated_at":"2025-04-23T06:30:51.142Z","avatar_url":"https://github.com/eFrane.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery dice plugin\n==================\n\nVery simple plugin which allows to display a dice, click on it and retrieve\na random number (between 1 and 6, of course.)\n\nThe dice glyphs can be replaced.\n\n## Usage\n\nAs with all jQuery Plugins, you need to insert the plugin's javscript source\nafter jQuery itself. Additonally, the dice.gif must be copied to a web-reachable\npath.\n\nTo create a dice and get it's value you need an empty div container and a\ncallback function that expects one argument. Than anywhere in your Javascript\nCode you can just call:\n\n    $('#diceContainer').dice({\n      'glyphSrc': '/path/to/dice.gif',\n      'callback': callbackFunction\n    });\n\nThe available configuration options are:\n\n- `background`: CSS-readable color value, defaults to `#ffffff`.\n- `callback`: Callback function, called on value change. Defaults to `null`.\n- `glyphSize`: Size of a single glyph (Glyphs have to be squares). Defaults to `40`.\n- `glyphSrc`: Source of glyph image, contains glyphs for all 6 sides of the dice. Defaults to `glyph.gif`.\n- `juggleTimeout`: Duration of the juggling animation in milliseconds. Defaults to `300`.\n- `number`: Initial number, defaults to `1`.\n- `selectGlyph`: Function which is called to change the current glyph. See __Custom Glyphs__.\n\n## Custom Glyphs\n\nThis plugin has been designed to allow custom dice glyphs. To replace the default\nset with your own, you simply need to create an image containing six squares in\nthe following layout:\n\n    1 | 2 | 3\n    ---------\n    6 | 5 | 4\n\nIf your glyphs are larger than 40 * 40 pixels, you need to adjust the `glyphSize`\noption to your chosen size, otherwise you only need to set `glyphSrc` to your new\nglyph image.\n\nIn the unlikely event that you cannot or don't want to chose the above order, you\nalso need to provide a `selectGlyph`-function of the following signature:\n\n    void selectGlyph(unsinged int number);\n\nThis function will be called whenever a new glyph is to be selected and is\nresponsible for changing the CSS background-position to the new number's\nposition in the glyph set. To access the dice container, the variable `m_this`\ncan be used as jQuery context.\n\n## License: BSD\n\nCopyright (c) 2011-2012, Stefan Graupner. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer. Redistributions in binary\nform must reproduce the above copyright notice, this list of conditions and\nthe following disclaimer in the documentation and/or other materials provided\nwith the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\nCONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefrane%2Fjquery-dice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefrane%2Fjquery-dice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefrane%2Fjquery-dice/lists"}