-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d79fa37
Showing
5 changed files
with
632 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
body { | ||
font-family: Arial; | ||
} | ||
|
||
header { | ||
display: block; | ||
margin: 0 auto; | ||
width: 100%; | ||
text-align: center; | ||
} | ||
|
||
header h1 { | ||
font-size: 40px; | ||
font-weight: bold; | ||
} | ||
|
||
header #newGameButton { | ||
display: block; | ||
margin: 20px auto; | ||
width: 100px; | ||
padding: 10px; | ||
background-color: #8f7a66; | ||
color: #fff; | ||
border-radius: 10px; | ||
text-decoration: none; | ||
} | ||
|
||
header #newGameButton:hover { | ||
background-color: #9f8b77; | ||
} | ||
|
||
header p { | ||
font-size: 25px; | ||
margin: 20px auto; | ||
} | ||
|
||
#grid-container { | ||
width: 460px; | ||
height: 460px; | ||
padding: 20px; | ||
margin: 50px auto; | ||
background-color: #bbada0; | ||
border-radius: 10px; | ||
position: relative; | ||
left: 0; | ||
top: 0; | ||
} | ||
|
||
|
||
/* 利用子绝父相来定位 相对定位 绝对定位 */ | ||
|
||
.grid-cell { | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 6px; | ||
background-color: #ccc0b3; | ||
position: absolute; | ||
} | ||
|
||
.number-cell { | ||
border-radius: 6px; | ||
font-weight: bold; | ||
font-size: 60px; | ||
line-height: 100px; | ||
text-align: center; | ||
position: absolute; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, height=device-height,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> | ||
<title>2048</title> | ||
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> | ||
<script type="text/javascript" src="main2048.js"></script> | ||
<script type="text/javascript" src="showanimation2048.js"></script> | ||
<script type="text/javascript" src="support2048.js"></script> | ||
<link rel="stylesheet" type="text/css" href="2048.css"> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<h1>2048</h1> | ||
<a href="javascript:newgame();" id="newGameButton">New Game</a> | ||
<p>score:<span id="score">0</span></p> | ||
</header> | ||
<div id="grid-container"> | ||
<div class="grid-cell" id="grid-cell-0-0"></div> | ||
<div class="grid-cell" id="grid-cell-0-1"></div> | ||
<div class="grid-cell" id="grid-cell-0-2"></div> | ||
<div class="grid-cell" id="grid-cell-0-3"></div> | ||
<div class="grid-cell" id="grid-cell-1-0"></div> | ||
<div class="grid-cell" id="grid-cell-1-1"></div> | ||
<div class="grid-cell" id="grid-cell-1-2"></div> | ||
<div class="grid-cell" id="grid-cell-1-3"></div> | ||
<div class="grid-cell" id="grid-cell-2-0"></div> | ||
<div class="grid-cell" id="grid-cell-2-1"></div> | ||
<div class="grid-cell" id="grid-cell-2-2"></div> | ||
<div class="grid-cell" id="grid-cell-2-3"></div> | ||
<div class="grid-cell" id="grid-cell-3-0"></div> | ||
<div class="grid-cell" id="grid-cell-3-1"></div> | ||
<div class="grid-cell" id="grid-cell-3-2"></div> | ||
<div class="grid-cell" id="grid-cell-3-3"></div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.