{"id":17300451,"url":"https://github.com/atomantic/javascript-playing-cards","last_synced_at":"2025-05-07T21:40:40.768Z","repository":{"id":929510,"uuid":"699035","full_name":"atomantic/JavaScript-Playing-Cards","owner":"atomantic","description":"🃏A playing card JavaScript and CSS library for creating standard deck games. Looking for developers to create game pack extensions to add onto this. The library is wrapped to allow it to act as a plugin for jquery (or another framework)","archived":false,"fork":false,"pushed_at":"2020-10-01T06:15:54.000Z","size":218,"stargazers_count":164,"open_issues_count":1,"forks_count":58,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-31T14:21:20.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://atomantic.github.com/JavaScript-Playing-Cards","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomantic.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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":"2010-06-02T11:37:45.000Z","updated_at":"2025-03-14T20:14:57.000Z","dependencies_parsed_at":"2022-08-16T11:30:47.420Z","dependency_job_id":null,"html_url":"https://github.com/atomantic/JavaScript-Playing-Cards","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/atomantic%2FJavaScript-Playing-Cards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomantic%2FJavaScript-Playing-Cards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomantic%2FJavaScript-Playing-Cards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomantic%2FJavaScript-Playing-Cards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomantic","download_url":"https://codeload.github.com/atomantic/JavaScript-Playing-Cards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961116,"owners_count":21832179,"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-10-15T11:28:35.490Z","updated_at":"2025-05-07T21:40:40.723Z","avatar_url":"https://github.com/atomantic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# License\nJavaScript \u0026 CSS:  \n@author Adam Eivy (antic | atomantic)  \n@link [http://adameivy.com/JavaScript-Playing-Cards/](http://adameivy.com/JavaScript-Playing-Cards/)  \n\n@license Copyright (c) 2010 Adam Eivy (antic | atomantic) Dual licensed under the MIT and GPL licenses:  \n * [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)  \n * [http://www.gnu.org/licenses/gpl.html](http://www.gnu.org/licenses/gpl.html)\n\nCard Face images:\n@author David Bellot  \n@link [http://david.bellot.free.fr/svg-cards/](http://david.bellot.free.fr/svg-cards/)  \n@license [http://creativecommons.org/licenses/by-sa/2.5/](http://creativecommons.org/licenses/by-sa/2.5/)  \n\n# What it does\n\nThe library comes in multiple parts. You can either just use the playingCard.js library, which has no UI rendering (just creates deck objects with the standard methods) or you can add on the playingCards.ui.js library, which adds the ability to render the cards to the page.\n\nNote: This library was really just something that I wanted to build for the sake of proving out that a deck of cards could be implemented in JavaScript and CSS. I had no real-world use-case for it. Since throwing this out on Github, several people have started using this as a foundation for making games. That's awesome--but I haven't been working on this. I welcome pull-requests, but I also am not actively updating this codebase. The code is pretty simple and could probably stand some updating with newer standards (as it is several years old). You might be better off using this as a reference point / proof-of-concept :)\n\nIf I were to re-write this for a particular game/use-case, I'd probably change the API a bit. Additionally, I'd add methods for managing hands/players, which is not part of the existing library.\n\nOn the flip-side, since you obviously like playing cards, you might be interested in my hand-painted, beetle-themed playing card deck, which I'll be releasing to Kickstarter ~Aug 1, 2015: http://bit.ly/beetledeck\n\n# Usage\n\nIf you are only using playingCards.js:  \n\n\tvar cardDeck = new playingCards(); // will create a new deck object\n\nIf you are including jQuery, the playingCards.ui.js and playingCards.ui.css:\n\n\t$('#cardTable').playingCards(); // will lay out a random deck on the cardTable element\n\noverride defaults for playingCards() and for card() by adding new properties to the following objects:\n\n\tplayingCards.defaults\n\n\tplayingCards.card.defaults\n\n## Example Implementation\nFor a rough example of implementation, look at the code for the demo page:\nhttps://github.com/atomantic/JavaScript-Playing-Cards/blob/master/index.html\n\n# API Docs (simple version)\n\n* init() - builds the deck (and shuffles it), automatically called when initializing an instance\n* shuffle() - shuffle the deck\n* orderByRank() - orders the existin cards by rank\n* orderBySuit() - calls init() again (TODO: this should probably order the existing cards in the deck by suit, but I was lazy)\n* spread($destinationElement, slowly) - (ui only) lay out the cards in the DOM, optionally with a slow placement\n* count() - return the number of cards remaining in the deck\n* addCard() - return a card from the drawn pile back to the top of the deck\n* draw() - draw a card from the top of the deck (stored in the draw pile)\n\n# Demo\n\nThe repository holds a demo in index.html, which is published on the github project page:\n[Demo](http://atomantic.github.com/JavaScript-Playing-Cards)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomantic%2Fjavascript-playing-cards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomantic%2Fjavascript-playing-cards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomantic%2Fjavascript-playing-cards/lists"}