Apple Playing Cards

Developer
Size
4,618 Kb
Views
52,624

How do I make an apple playing cards?

A shuffled deck of cards using CSS 3D transforms to animate flipping a card, dynamic sizing of cards, CSS3 and character entities for suites.. What is a apple playing cards? How do you make a apple playing cards? This script and codes were developed by Mnicpt on 30 July 2022, Saturday.

Apple Playing Cards Previews

Apple Playing Cards - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Apple Playing Cards</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- Card structure -->
<!--<div class="card small">	<div class="face front">\uf8ff</div>	<div class="face back"	data-rank="seven" data-suite="hearts">	&hearts; </div> </div>-->
<div class="table">	<!-- shuffled deck -->
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Apple Playing Cards - Script Codes CSS Codes

.table { position: relative; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-flow: row wrap; flex-flow: row wrap; -webkit-justify-content: space-around; justify-content: space-around; -webkit-perspective: 800px; perspective: 800px;
}
.card { position: relative; box-sizing: border-box; border: 1px solid black; border-radius: 5px; margin: 10px; font-family: 'Symbol'; font-size: 30px; text-align: center; line-height: 100px; height: 100px; width: 70px; -webkit-transform-style: preserve-3d; -webkit-transition-property: transform; -webkit-transition-duration: .5s;
}
.card.flipped { -webkit-transform: rotateY(180deg);
}
.card .face { position: absolute; width: inherit; height: inherit; border-radius: 5px;
}
.card .face.front { background: black; color: white; -webkit-backface-visibility: hidden;
}
.card .face.back { -webkit-transform: rotateY(180deg); -webkit-backface-visibility: hidden;
}
.card.medium { font-size: 35px; line-height: 150px; height: 150px; width: 105px;
}
.card.large { font-size: 40px; line-height: 200px; height: 200px; width: 140px;
}
.face.back[data-suite="hearts"], .face.back[data-suite="diamonds"] { color: red;
}
.face.back[data-suite="clubs"], .face.back[data-suite="spades"] { color: black;
}
.face.back[data-rank="ace"]::before { content: "A";
}
.face.back[data-rank="ace"]::after { content: "A";
}
.face.back[data-rank="king"]::before { content: "K";
}
.face.back[data-rank="king"]::after { content: "K";
}
.face.back[data-rank="queen"]::before { content: "Q";
}
.face.back[data-rank="queen"]::after { content: "Q";
}
.face.back[data-rank="jack"]::before { content: "J";
}
.face.back[data-rank="jack"]::after { content: "J";
}
.face.back[data-rank="ten"]::before { content: "10";
}
.face.back[data-rank="ten"]::after { content: "10";
}
.face.back[data-rank="nine"]::before { content: "9";
}
.face.back[data-rank="nine"]::after { content: "9";
}
.face.back[data-rank="eight"]::before { content: "8";
}
.face.back[data-rank="eight"]::after { content: "8";
}
.face.back[data-rank="seven"]::before { content: "7";
}
.face.back[data-rank="seven"]::after { content: "7";
}
.face.back[data-rank="six"]::before { content: "6";
}
.face.back[data-rank="six"]::after { content: "6";
}
.face.back[data-rank="five"]::before { content: "5";
}
.face.back[data-rank="five"]::after { content: "5";
}
.face.back[data-rank="four"]::before { content: "4";
}
.face.back[data-rank="four"]::after { content: "4";
}
.face.back[data-rank="three"]::before { content: "3";
}
.face.back[data-rank="three"]::after { content: "3";
}
.face.back[data-rank="two"]::before { content: "2";
}
.face.back[data-rank="two"]::after { content: "2";
}
.rank, .rank_before, .face.back[data-rank="ace"]::before, .face.back[data-rank="king"]::before, .face.back[data-rank="queen"]::before, .face.back[data-rank="jack"]::before, .face.back[data-rank="ten"]::before, .face.back[data-rank="nine"]::before, .face.back[data-rank="eight"]::before, .face.back[data-rank="seven"]::before, .face.back[data-rank="six"]::before, .face.back[data-rank="five"]::before, .face.back[data-rank="four"]::before, .face.back[data-rank="three"]::before, .face.back[data-rank="two"]::before, .rank_after, .face.back[data-rank="ace"]::after, .face.back[data-rank="king"]::after, .face.back[data-rank="queen"]::after, .face.back[data-rank="jack"]::after, .face.back[data-rank="ten"]::after, .face.back[data-rank="nine"]::after, .face.back[data-rank="eight"]::after, .face.back[data-rank="seven"]::after, .face.back[data-rank="six"]::after, .face.back[data-rank="five"]::after, .face.back[data-rank="four"]::after, .face.back[data-rank="three"]::after, .face.back[data-rank="two"]::after { position: absolute; font-size: 16px; line-height: 16px; font-family: sans-serif;
}
.rank.medium, .medium.rank_before, .medium.face.back[data-rank="ace"]::before, .medium.face.back[data-rank="king"]::before, .medium.face.back[data-rank="queen"]::before, .medium.face.back[data-rank="jack"]::before, .medium.face.back[data-rank="ten"]::before, .medium.face.back[data-rank="nine"]::before, .medium.face.back[data-rank="eight"]::before, .medium.face.back[data-rank="seven"]::before, .medium.face.back[data-rank="six"]::before, .medium.face.back[data-rank="five"]::before, .medium.face.back[data-rank="four"]::before, .medium.face.back[data-rank="three"]::before, .medium.face.back[data-rank="two"]::before, .medium.rank_after, .medium.face.back[data-rank="ace"]::after, .medium.face.back[data-rank="king"]::after, .medium.face.back[data-rank="queen"]::after, .medium.face.back[data-rank="jack"]::after, .medium.face.back[data-rank="ten"]::after, .medium.face.back[data-rank="nine"]::after, .medium.face.back[data-rank="eight"]::after, .medium.face.back[data-rank="seven"]::after, .medium.face.back[data-rank="six"]::after, .medium.face.back[data-rank="five"]::after, .medium.face.back[data-rank="four"]::after, .medium.face.back[data-rank="three"]::after, .medium.face.back[data-rank="two"]::after { font-size: 18px; line-height: 18px;
}
.rank.large, .large.rank_before, .large.face.back[data-rank="ace"]::before, .large.face.back[data-rank="king"]::before, .large.face.back[data-rank="queen"]::before, .large.face.back[data-rank="jack"]::before, .large.face.back[data-rank="ten"]::before, .large.face.back[data-rank="nine"]::before, .large.face.back[data-rank="eight"]::before, .large.face.back[data-rank="seven"]::before, .large.face.back[data-rank="six"]::before, .large.face.back[data-rank="five"]::before, .large.face.back[data-rank="four"]::before, .large.face.back[data-rank="three"]::before, .large.face.back[data-rank="two"]::before, .large.rank_after, .large.face.back[data-rank="ace"]::after, .large.face.back[data-rank="king"]::after, .large.face.back[data-rank="queen"]::after, .large.face.back[data-rank="jack"]::after, .large.face.back[data-rank="ten"]::after, .large.face.back[data-rank="nine"]::after, .large.face.back[data-rank="eight"]::after, .large.face.back[data-rank="seven"]::after, .large.face.back[data-rank="six"]::after, .large.face.back[data-rank="five"]::after, .large.face.back[data-rank="four"]::after, .large.face.back[data-rank="three"]::after, .large.face.back[data-rank="two"]::after { font-size: 20px; line-height: 20px;
}
.rank_before, .face.back[data-rank="ace"]::before, .face.back[data-rank="king"]::before, .face.back[data-rank="queen"]::before, .face.back[data-rank="jack"]::before, .face.back[data-rank="ten"]::before, .face.back[data-rank="nine"]::before, .face.back[data-rank="eight"]::before, .face.back[data-rank="seven"]::before, .face.back[data-rank="six"]::before, .face.back[data-rank="five"]::before, .face.back[data-rank="four"]::before, .face.back[data-rank="three"]::before, .face.back[data-rank="two"]::before { top: 5px; left: 5px;
}
.rank_after, .face.back[data-rank="ace"]::after, .face.back[data-rank="king"]::after, .face.back[data-rank="queen"]::after, .face.back[data-rank="jack"]::after, .face.back[data-rank="ten"]::after, .face.back[data-rank="nine"]::after, .face.back[data-rank="eight"]::after, .face.back[data-rank="seven"]::after, .face.back[data-rank="six"]::after, .face.back[data-rank="five"]::after, .face.back[data-rank="four"]::after, .face.back[data-rank="three"]::after, .face.back[data-rank="two"]::after { bottom: 5px; right: 5px; transform: rotate(180deg);
}

Apple Playing Cards - Script Codes JS Codes

// Change the size of the cards with the card_size property
function CardDeck() { // private var suites = {"hearts":"&hearts;", "diamonds":"&diams;", "clubs":"&clubs;", "spades":"&spades;"}; var ranks = {"ace":1, "two":2, "three":3, "four":4, "five":5, "six":6, "seven":7, "eight":8, "nine":9, "ten":10, "jack":11, "queen":12, "king":13}; function Card(suite, rank) { this.suite = suite; this.rank = rank; }; var build = function(cards) { for(suite in suites) { for(rank in ranks) { cards.push(new Card(suite, rank)); } } shuffle(cards); }; var shuffle = function(cards) { var toSwap, tempCard; for (var i = 0; i < cards.length; i++) { toSwap = Math.floor(Math.random() * i); tempCard = cards[i]; cards[i] = cards[toSwap]; cards[toSwap] = tempCard; } }; // public this.cards = []; this.card_size = "medium"; // small, medium, large this.type = "Standard"; this.suites = function() { return suites; }; this.ranks = function() {	return ranks; }; this.unicodeForSuite = function(suite) { return suites[suite]; }; // init build(this.cards);
}
window.onload = function() { var deck = new CardDeck(), html = ""; for(card in deck.cards) { var card = deck.cards[card];
console.log(card.rank); html += "<div class = \"card " +deck.card_size+ "\">" + "<div class=\"face front\">\uf8ff</div>" + "<div class=\"face back\" data-rank=\"" +	card.rank+ "\"" + " data-suite=\"" +card.suite+ "\">" +	deck.unicodeForSuite(card.suite) +	"</div>" + "</div>"; } var table = document.querySelector('.table'); table.innerHTML = html; // Access a cards on the table var cards = document.querySelectorAll('.card'); for(card in cards) { var card = cards[card]; card.onclick = function() { this.classList.toggle("flipped"); }; }
};
Apple Playing Cards - Script Codes
Apple Playing Cards - Script Codes
Home Page Home
Developer Mnicpt
Username mnicpt
Uploaded July 30, 2022
Rating 3
Size 4,618 Kb
Views 52,624
Do you need developer help for Apple Playing Cards?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Mnicpt (mnicpt) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!