Send ...

In this example below you will see how to do a Send ... with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by FlipFloop, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright FlipFloop ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Send ...</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

   <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

<div id = "game">
</div>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/FlipFloop/send-zNoRaO */
#game {
  position: absolute;
  left: calc((100% - 1800px)/2);
  height: 500px;
  width: 1800px;
  border: 2px solid black;
}

.block {
  height: 50px;
  width: 50px;
  position: absolute;
}

.stone {
  background-color: black;
}

.ypos-0 {
  bottom: 0px;
  position: absolute;
}

.ypos-1 {
  bottom: 50px;
  position: absolute;
}

.ypos-2 {
  bottom: 100px;
  position: absolute;
}

.ypos-3 {
  bottom: 150px;
  position: absolute;
}

.ypos-4 {
  bottom: 200px;
  position: absolute;
}

.ypos-5 {
  bottom: 250px;
  position: absolute;
}

.ypos-6 {
  bottom: 300px;
  position: absolute;
}

.ypos-7 {
  bottom: 350px;
  position: absolute;
}

.ypos-8 {
  bottom: 400px;
  position: absolute;
}

.xpos-0 {
  left: 0px;
  /*position: absolute;*/
}

.xpos-1 {
  left: 50px;
  /*position: absolute;*/
}

.xpos-2 {
  left: 100px;
  /*position: absolute;*/
}

.xpos-3 {
  left: 150px;
  /*position: absolute;*/
}

.xpos-4 {
  left: 200px;
  /*position: absolute;*/
}

.xpos-5 {
  left: 250px;
  /*position: absolute;*/
}

.xpos-6 {
  left: 300px;
  /*position: absolute;*/
}

.xpos-7 {
  left: 350px;
  /*position: absolute;*/
}

.xpos-8 {
  left: 400px;
  /*position: absolute;*/
}

.xpos-9 {
  left: 450px;
  /*position: absolute;*/
}

.xpos-10 {
  left: 500px;
  /*position: absolute;*/
}

.xpos-11 {
  left: 550px;
  /*position: absolute;*/
}

.xpos-12 {
  left: 600px;
  /*position: absolute;*/
}

.xpos-13 {
  left: 650px;
  /*position: absolute;*/
}

.xpos-14 {
  left: 700px;
  /*position: absolute;*/
}

.xpos-15 {
  left: 750px;
  /*position: absolute;*/
}

.xpos-16 {
  left: 800px;
  /*position: absolute;*/
}

.xpos-17 {
  left: 850px;
  /*position: absolute;*/
}

.xpos-18 {
  left: 900px;
  /*position: absolute;*/
}

.xpos-19 {
  left: 950px;
  /*position: absolute;*/
}

.xpos-20 {
  left: 1000px;
  /*position: absolute;*/
}

.xpos-21 {
  left: 1050px;
  /*position: absolute;*/
}

.xpos-22 {
  left: 1100px;
  /*position: absolute;*/
}

.xpos-23 {
  left: 1150px;
  /*position: absolute;*/
}

.xpos-24 {
  left: 1200px;
  /*position: absolute;*/
}

.xpos-25 {
  left: 1250px;
  /*position: absolute;*/
}

.xpos-26 {
  left: 1300px;
  /*position: absolute;*/
}

.xpos-27 {
  left: 1350px;
  /*position: absolute;*/
}

.xpos-28 {
  left: 1400px;
  /*position: absolute;*/
}

.xpos-29 {
  left: 1450px;
  /*position: absolute;*/
}

.xpos-30 {
  left: 1500px;
  /*position: absolute;*/
}

.xpos-31 {
  left: 1550px;
  /*position: absolute;*/
}

.xpos-32 {
  left: 1600px;
  /*position: absolute;*/
}

.xpos-33 {
  left: 1650px;
  /*position: absolute;*/
}

.xpos-34 {
  left: 1700px;
  /*position: absolute;*/
}

.xpos-35 {
  left: 1750px;
  /*position: absolute;*/
}

.xpos-36 {
  left: 1800px;
  /*position: absolute;*/
}


/*Downloaded from https://www.codeseek.co/FlipFloop/send-zNoRaO */
var jQueryVersion = function() {
		var anim = function() {

			var level = [
				[1,1,0,0,1,1,1,0,0,1,0,0,0,1,1,0,0,1,1],
				[0,0,2,0,2,0,0,0,0,2,0,0,0,2,2,0,0,2,0,2],
				[0,0,3,0,3,0,0,0,0,3,0,0,3,0,3,0,0,3,0,0,3],
				[0,4,0,0,4,4,0,0,0,4,0,0,4,0,4,0,0,4,0,0,4],
				[5,0,0,0,5,0,0,0,0,5,0,5,0,0,5,0,0,5,0,0,5],
				[6,0,0,0,6,0,0,0,0,6,0,6,0,0,6,0,0,6,0,6],
				[0,7,7,0,7,7,7,0,0,7,7,0,0,0,7,0,0,7,7],
			];

			var $player = $("#player");
			var $game = $("#game");

			for (var i = 0; i < level.length; i++) {
				for (var j = 0; j < level[i].length; j++) {

					var n = level[i][j];

					if (n === 1) {
						$("<div>", {
							"class": "block stone ypos-0 xpos-" + [j]
						}).appendTo("#game");

					}

					if (n === 2) {
						$("<div>", {
							"class": "block stone ypos-1 xpos-" + [j]
						}).appendTo("#game");
					}
					if (n === 3) {
						$("<div>", {
							"class": "block stone ypos-2 xpos-" + [j]
						}).appendTo("#game");

					}

					if (n === 4) {
						$("<div>", {
							"class": "block stone ypos-3 xpos-" + [j]
						}).appendTo("#game");
					}
					
					if (n === 5) {
						$("<div>", {
							"class": "block stone ypos-4 xpos-" + [j]
						}).appendTo("#game");

					}

					if (n === 6) {
						$("<div>", {
							"class": "block stone ypos-5 xpos-" + [j]
						}).appendTo("#game");
					}
					if (n === 7) {
						$("<div>", {
							"class": "block stone ypos-6 xpos-" + [j]
						}).appendTo("#game");

					}

				}
			}

			

		}

		$(document).ready(function() {

			anim();

		});
	}
	jQueryVersion();

Comments