commit 68a927d6bd99091d064e4f981010de0ea9f0e240
parent cfe1023c11f8918e0fdcb46717d98c1719ba61e0
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Sun, 10 Apr 2011 11:00:12 +0200
Début de la page de scores.
Diffstat:
3 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/code/html5/score.html b/code/html5/score.html
@@ -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>
diff --git a/code/html5/score.json b/code/html5/score.json
@@ -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}]
+\ No newline at end of file
diff --git a/code/html5/scores.js b/code/html5/scores.js
@@ -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")
+ });
+ })
+});
+\ No newline at end of file