Début de la page de scores.
This commit is contained in:
parent
cfe1023c11
commit
68a927d6bd
31
code/html5/score.html
Normal file
31
code/html5/score.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>PtiClic pre-alpha 0.2</title>
|
||||
<meta charset="utf-8" />
|
||||
<style>
|
||||
body {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#screen {
|
||||
background-color : #FFFFE0;
|
||||
}
|
||||
</style>
|
||||
<script src="jquery-1.5.1.min.js"></script>
|
||||
<script src="jquery-ui-1.8.11.custom.min.js"></script>
|
||||
<script src="scores.js"></script>
|
||||
<script src="my-extensions.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="screen">
|
||||
<h1>Score total : <span class="scoreTotal"></span></h1>
|
||||
<div class="scores"></div>
|
||||
<div id="templates" style="display: none;">
|
||||
<div class="scoreLine">
|
||||
<span class="word"></span> (<span class="score"></span>)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
code/html5/score.json
Normal file
1
code/html5/score.json
Normal file
|
@ -0,0 +1 @@
|
|||
[{"id":84632,"name":"camion","score":3},{"id":61939,"name":"transbahutage","score":10},{"id":104263,"name":"trimbaler","score":4},{"id":44654,"name":"transporter","score":-2},{"id":38285,"name":"d\u00e9m\u00e9nageur","score":5},{"id":43404,"name":"porter","score":5},{"id":63192,"name":"transports","score":-1},{"id":130473,"name":"enthousiasmer","score":0},{"id":90461,"name":"se trimbaler","score":6},{"id":134609,"name":"baguenauder","score":9}]
|
13
code/html5/scores.js
Normal file
13
code/html5/scores.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
$(function () {
|
||||
var url = "score.json";
|
||||
$.getJSON(url, function(data) {
|
||||
console.log(data);
|
||||
$.each(data, function(i,e) {
|
||||
$("#templates .scoreLine")
|
||||
.clone()
|
||||
.find(".word").text(e.name).end()
|
||||
.find(".score").text(e.score).end()
|
||||
.appendTo(".scores")
|
||||
});
|
||||
})
|
||||
});
|
Loading…
Reference in New Issue
Block a user