Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Last active October 13, 2015 02:09
Show Gist options
  • Save tomhodgins/510e79a6ac9c6999c47f to your computer and use it in GitHub Desktop.
Save tomhodgins/510e79a6ac9c6999c47f to your computer and use it in GitHub Desktop.
Shuffle — a random card and die roll generator. Tap to shuffle. http://staticresource.com/shuffle.html
<!DOCTYPE html>
<html manifest="shuffle.manifest">
<meta charset=utf-8>
<title>Shuffle</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, minimal-ui">
<script>eval(unescape(escape('♶♡♲☠♩☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♣♡♮♶♡♳☧☩☬♣☽♩☮♧♥♴♃♯♮♴♥♸♴☨☧☲♤☧☩☬♦☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☬♭☽♤♯♣♵♭♥♮♴☮♣♲♥♡♴♥♅♬♥♭♥♮♴☨☧♬♩♮♫☧☩☻♩☮♷♩♤♴♨☽☲☰☰☻♩☮♨♥♩♧♨♴☽☲☰☰☻♣☮♦♩♬♬♓♴♹♬♥☽☧♤♡♲♫♧♲♥♥♮☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻♣☮♭♯♶♥♔♯☨☱☰☬☰☩☻♣☮♬♩♮♥♔♯☨☱☹☰☬☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☰☬☲☰☰☬☱☰☩☻♣☮♬♩♮♥♔♯☨☲☰☰☬☱☹☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☲☰☰☬☲☰☰☬☱☹☰☬☲☰☰☩☻♣☮♬♩♮♥♔♯☨☱☰☬☲☰☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☲☰☰☬☰☬☱☹☰☩☻♣☮♬♩♮♥♔♯☨☰☬☱☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☰☬☰☬☱☰☬☰☩☻♣☮♣♬♯♳♥♐♡♴♨☨☩☻♣☮♦♩♬♬☨☩☻♣☮♦♩♬♬♓♴♹♬♥☽☧♷♨♩♴♥☧☻♣☮♢♥♧♩♮♐♡♴♨☨☩☻♣☮♭♯♶♥♔♯☨☳☰☬☲☰☰☩☻♣☮♬♩♮♥♔♯☨☳☰☬☳☵☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☳☰☬☳☰☬☳☵☬☳☰☩☻♣☮♬♩♮♥♔♯☨☱☶☵☬☳☰☩☻♣☮♱♵♡♤♲♡♴♩♣♃♵♲♶♥♔♯☨☱☷☰☬☳☰☬☱☷☰☬☳☵☩☻♣☮♬♩♮♥♔♯☨☱☷☰☬☲☰☰☩☻♣☮♬♩♮♥♔♯☨☳☰☬☲☰☰☩☻♣☮♣♬♯♳♥♐♡♴♨☨☩☻♣☮♦♩♬♬☨☩☻♣☮♦♩♬♬♓♴♹♬♥☽☧♢♬♡♣♫☧☻♣☮♦♯♮♴☽☧♢♯♬♤☠☱☷☵♰♸☠♳♥♲♩♦☧☻♣☮♴♥♸♴♁♬♩♧♮☽☢♣♥♮♴♥♲☢☻♣☮♦♩♬♬♔♥♸♴☨☧♜♵☲☶☶☰☧☬☱☰☰☬☱☷☵☩☻♦☮♴♹♰♥☽☧♩♭♡♧♥☯♸☭♩♣♯♮☧☻♦☮♲♥♬☽☧♳♨♯♲♴♣♵♴☠♩♣♯♮☧☻♭☮♲♥♬☽☧♡♰♰♬♥☭♴♯♵♣♨☭♩♣♯♮☧☻♦☮♨♲♥♦☽♭☮♨♲♥♦☽♩☮♴♯♄♡♴♡♕♒♌☨☧♩♭♡♧♥☯♰♮♧☧☩☻♤♯♣♵♭♥♮♴☮♧♥♴♅♬♥♭♥♮♴♳♂♹♔♡♧♎♡♭♥☨☧♨♥♡♤☧☩♛☰♝☮♡♰♰♥♮♤♃♨♩♬♤☨♦☩☻♤♯♣♵♭♥♮♴☮♧♥♴♅♬♥♭♥♮♴♳♂♹♔♡♧♎♡♭♥☨☧♨♥♡♤☧☩♛☰♝☮♡♰♰♥♮♤♃♨♩♬♤☨♭☩☻').replace(/u../g,'')))</script>
<body>
<style>
html {margin:0;width:100%;min-height:100%;background:darkGreen;text-align:center;box-shadow:inset rgba(0,0,0,.3) 0 0 300px;}
body {margin:50px auto 10px auto;width:250px;height:400px;background:white;border-radius:15px;font-size:140pt;line-height:1.1;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;box-shadow:rgba(0,0,0,.5)0 15px 50px}
body:before {content:attr(data-card);display:block}
body:after {content:attr(data-suit)}
html:after {content:attr(data-roll);display:block;width:100px;height:100px;border-radius:3px;margin:50px auto;background:white;font-size:75px;line-height:1.4;cursor:pointer;box-shadow:rgba(0,0,0,.5)0 15px 50px}
</style>
<script>
var data = [1,2,3,4,5,6,7,8,9,'J','Q','K','A','♣','♦','♠','♥'];
onload = document.onmousedown = document.ontouchstart = function(){
var pick = data[shuffle(13,16)];
document.body.setAttribute('data-card',data[shuffle(1,12)]);
document.body.setAttribute('data-suit',pick);
if ((pick === '♥') || (pick === '♦')) { document.body.style.color = 'red' } else { document.body.style.color = 'black' }
document.documentElement.setAttribute('data-roll',data[shuffle(0,5)]);
}
function shuffle(min,max){ return Math.floor(Math.random()*(max-min+1))+min; }
</script>
CACHE MANIFEST
# version 1
CACHE:
shuffle.html
NETWORK:
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment