Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en-us">
- <head>
- <title>Welcome to Pair-A-Dice</title>
- <!-- for-mobile-apps -->
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <!-- //for-mobile-apps -->
- <!-- Proudly Authored by: Lionel Mertens on October 6, 2018 for all to enjoy -->
- <style>
- body {
- margin:0 calc(50% - 150px);
- background-color:#000;
- }
- #canvass {
- position:absolute;
- width:300px;
- height:100%;
- background:#B22222;
- background:-moz-linear-gradient(top, #B22222 0%, #800000 100%);
- background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #B22222), color-stop(100%, #800000));
- background:-webkit-linear-gradient(top, #B22222 0%, #800000 100%);
- background:-o-linear-gradient(top, #B22222 0%, #800000 100%);
- background:-ms-linear-gradient(top, #B22222 0%, #800000 100%);
- background:linear-gradient(to bottom, #B22222 0%, #800000 100%);
- /*filter:progid:DXImageTransform.Mic.social_icrosoft.gradient(startColorstr='#B22222', endColorstr='#800000', GradientType=0);*/
- margin:0;
- box-shadow:inset 0 0 10px #000;
- }
- #cushion {
- display:block;
- position:relative;
- margin:6px auto 0 auto;
- width:220px;
- height:482px;
- border:10px solid #A0522D;
- border-radius:70px;
- }
- #crapsTable {
- display:block;
- position:relative;
- margin:0 auto;
- width:200px;
- height:462px;
- padding:0;
- top:0;
- background-color:green;
- border:10px solid #4C2715;
- border-radius:60px;
- z-index:1;
- }
- #crapsTable svg#jewl {
- position:absolute;
- stroke: red;
- stroke-width:8;
- fill:blue;
- z-index:1;
- }
- #felt {
- position:relative;
- margin:0;
- z-index:2;
- }
- #tableEnd {
- width:220px;
- margin:0;
- }
- #tableEnd p {
- font-family:serif;
- font-size:14px;
- font-weight:lighter;
- text:align:left;
- color:#EDC39E;
- letter-spacing:1px;
- }
- #tableEnd p strong {color:#EB8;}
- #rake {
- display:none;
- position:absolute;
- margin:0 auto;
- width:100px;
- height:170px;
- margin:0;
- padding:0;
- left:50px;
- top:423px;
- }
- #rake svg#raake {
- width:100px;
- height:170px;
- fill:none;
- stroke:#282828;
- stroke-width:5;
- }
- .pair {
- position:relative;
- display:block;
- box-sizing:border-box;
- padding:0;
- width:30px;
- height:30px;
- border-radius:5px;
- z-index:2;
- background-color:#FFF;
- }
- .pair svg {
- position:relative;
- display:block;
- margin:0 auto;
- height:30px;
- width:30px;
- background-color:#FFF;
- border-radius:5px;
- fill:#ec7677;
- }
- svg#A1,svg#A2,svg#A3,svg#A4,svg#A5,svg#A6,
- svg#B1,svg#B2,svg#B3,svg#B4,svg#B5,svg#B6 {display:none;fill:#ec7677;}
- #die1 {float:left;margin-left:50px;top:432px;}
- #die1 svg {fill:#ec7677;}
- #die2 {float:right;margin-right:50px;top:432px;}
- #die2 svg {fill:#ec7677;}
- #btn {
- position:relative;
- display:block;
- margin:20px auto;
- width:60px;
- text-align:center;
- background-color:#008080;
- border:1px solid #008080;
- border-radius:3px;
- padding:4px 0;
- color:#FFF;
- font-family: 'Arial', Helvetica, Sans-Serif;
- font-size:14px;
- font-weight:300;
- text-decoration:none;
- top:0px;
- letter-spacing:2px;
- box-shadow:0px 0px 2px 2px cyan;
- top:10px;
- }
- #btn:hover {color:cyan;}
- #btn:active {
- box-shadow:0px 0px 3px 3px cyan, 0px 0px 2px 2px lime;
- color:#FFF;}
- </style>
- <script>
- var letters = new Array('A','B');
- stopSpin = 'stopped';
- function loadDiceHaHa(){
- var cubeData = new Array();
- for(i = 0; i < 2; i++){
- var letter = letters[i];
- var randNum = Math.floor((Math.random()*6)+1);
- cubeData[i] = letter+randNum;
- var cube = cubeData[i];
- document.getElementById(cube).style.setProperty('display','block');
- }
- cube1 = cubeData[0];
- cube2 = cubeData[1];
- }
- function tossDice(){
- if(stopSpin == 'stopped'){
- toss = 0;
- xTravel = 0;
- oldDegree = 0;
- stopSpin = setInterval(rollDice,0010);
- }
- else {return;}
- }
- function resetDice(){
- document.getElementById('rake').style.setProperty('display','block');
- rakePath = 0;
- stopRake = setInterval(rakeDice,0040);
- }
- function rakeDice(){
- if(rakePath > -430){
- var r = 'matrix(1,0,0,1,0,'+rakePath+')';
- document.getElementById('raake').style.transform=r;
- rakePath = rakePath - 6;
- }
- else{
- clearInterval(stopRake);
- stopReset = setInterval(rollBack,0040);
- }
- }
- function rollBack() {
- if(toss <= 0){
- for(i = 1; i < 3;i++){
- if(i < 2){var sideWays = xTravel;}
- else{
- var sideWays = -xTravel;
- var r = 'matrix(1,0,0,1,0,'+rakePath+')';
- document.getElementById('raake').style.transform=r;
- rakePath = rakePath + 6;
- }
- var m = 'matrix(1,0,0,1,'+sideWays+','+toss+')';
- var die = 'die'+ i;
- document.getElementById(die).style.transform=m;
- }
- toss = toss + 6;
- }
- else {
- clearInterval(stopReset);
- stopSpin='stopped';
- document.getElementById('rake').style.setProperty('display','none');
- }
- }
- function rollDice(){
- var oldCubes = new Array();
- oldCubes[0] = cube1;
- oldCubes[1] = cube2;
- var cubeData = new Array();
- var degree = parseInt(+oldDegree + 5);
- toss = toss - 6;
- xTravel = xTravel + 1;
- if(degree > 360){clearInterval(stopSpin);setTimeout(resetDice,0800);}
- else{
- for(i = 0; i < 2; i++){
- if(i > 0){var sideWays = -xTravel;}
- else{var sideWays = xTravel;}
- var rot = 'matrix(1,0,0,1,'+sideWays+','+toss+') rotate('+degree+'deg)';
- var randNum = Math.floor((Math.random()*6)+1);
- cubeData[i] = letters[i]+randNum;
- var cube = cubeData[i];
- var oldCube = oldCubes[i];
- var die = 'die' + (i+1);
- document.getElementById(oldCube).style.setProperty('display','none');
- document.getElementById(cube).style.setProperty('display','block');
- document.getElementById(die).style.transform=rot;
- }
- cube1 = cubeData[0];
- cube2 = cubeData[1];
- oldDegree = degree;
- }
- }
- </script>
- </head>
- <body onload="loadDiceHaHa()">
- <div id="canvass">
- <div id="cushion">
- <div id="crapsTable">
- <svg id="jewl" width="200px" height="462px" viewBox="0 0 200 462">
- <defs>
- <pattern id="diamond" width="200px" height="462px" patternUnits="userSpaceOnUse">
- <polyline points="100,20 180,231 100,442 20,231 100,20 180,231">
- </polyline>
- </pattern>
- <pattern id="facet1" width="200px" height="462px" patternUnits="userSpaceOnUse">
- <polyline style="fill:lime;stroke-width:0;" points="100,95 150,231 100,367 50,231 100,95 150,231">
- </polyline>
- </pattern>
- <pattern id="outline" width="200px" height="462px" patternUnits="userSpaceOnUse">
- <polyline style="fill:transparent;stroke-width:3;stroke:#EB8;" points="100,145 130,231 100,317 70,231 100,145 130,231">
- </polyline>
- </pattern>
- </defs>
- <rect id="outlay" x="0" y="0" rx="5" ry="5" width="200" height="462" stroke-width="0" fill="url(#diamond)" />
- <rect id="inlay" x="0" y="0" rx="5" ry="5" width="200" height="462" stroke-width="0" fill="url(#facet1)" />
- <rect id="outline" x="0" y="0" rx="5" ry="5" width="200" height="462" stroke-width="0" fill="url(#outline)" />
- </svg>
- <div id="felt">
- <div id="rake">
- <svg id="raake" width="100" height="170" viewBox="0 0 100 170">
- <polyline points="0,0 100,0 50,0 50,170 52,170 52,150 48,150 48,170 52,170">
- </polyline>
- </svg>
- </div>
- <div class="pair" id="die1">
- <svg id="A1">
- <defs>
- <pattern id="onedot" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".50" cy=".50" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#onedot)" />
- </svg>
- <svg id="A2">
- <defs>
- <pattern id="twodots" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".25" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".75" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#twodots)" />
- </svg>
- <svg id="A3">
- <defs>
- <pattern id="threedots" width="1" height=".33" patternContentUnits="objectBoundingBox">
- <circle cx=".50" cy=".165" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#33333" stroke-width="1" fill="url(#threedots)" />
- </svg>
- <svg id="A4">
- <defs>
- <pattern id="fourdots" width=".50" height=".50" patternContentUnits="objectBoundingBox">
- <circle cx=".250" cy=".250" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#fourdots)" />
- </svg>
- <svg id="A5">
- <defs>
- <pattern id="fivedots" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".25" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".5" cy=".5" r=".1" fill="#ec7677" />
- <circle cx=".25" cy=".75" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".75" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#fivedots)" />
- </svg>
- <svg id="A6">
- <defs>
- <pattern id="sixdots" width=".50" height=".33" patternContentUnits="objectBoundingBox">
- <circle cx=".250" cy=".165" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#sixdots)" />
- </svg>
- </div>
- <div class="pair" id="die2">
- <svg id="B1">
- <defs>
- <pattern id="onedot" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".50" cy=".50" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#onedot)" />
- </svg>
- <svg id="B2">
- <defs>
- <pattern id="twodots" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".25" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".75" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#twodots)" />
- </svg>
- <svg id="B3">
- <defs>
- <pattern id="threedots" width="1" height=".33" patternContentUnits="objectBoundingBox">
- <circle cx=".50" cy=".165" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#33333" stroke-width="1" fill="url(#threedots)" />
- </svg>
- <svg id="B4">
- <defs>
- <pattern id="fourdots" width=".50" height=".50" patternContentUnits="objectBoundingBox">
- <circle cx=".250" cy=".250" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#fourdots)" />
- </svg>
- <svg id="B5">
- <defs>
- <pattern id="fivedots" width="1" height="1" patternContentUnits="objectBoundingBox">
- <circle cx=".25" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".25" r=".1" fill="#ec7677" />
- <circle cx=".5" cy=".5" r=".1" fill="#ec7677" />
- <circle cx=".25" cy=".75" r=".1" fill="#ec7677" />
- <circle cx=".75" cy=".75" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#fivedots)" />
- </svg>
- <svg id="B6">
- <defs>
- <pattern id="sixdots" width=".50" height=".33" patternContentUnits="objectBoundingBox">
- <circle cx=".250" cy=".165" r=".1" fill="#ec7677" />
- </pattern>
- </defs>
- <rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" stroke="#333333" stroke-width="1" fill="url(#sixdots)" />
- </svg>
- </div>
- </div>
- </div>
- <div id="tableEnd">
- <button id="btn" onclick="tossDice()">TOSS</button>
- <p>To day shalt thou be with me in paradise. <strong>Lu 23:43</strong></p>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement