|
1 <!-- |
|
2 /* |
|
3 * This file is part of the TraKERS\Front IDILL package. |
|
4 * |
|
5 * (c) IRI <http://www.iri.centrepompidou.fr/> |
|
6 * |
|
7 * For the full copyright and license information, please view the LICENSE |
|
8 * file that was distributed with this source code. |
|
9 */ |
|
10 |
|
11 /* |
|
12 * Projet : TraKERS |
|
13 * Module : Front IDILL |
|
14 * Fichier : index.html |
|
15 * |
|
16 * Auteur : alexandre.bastien@iri.centrepompidou.fr |
|
17 * |
|
18 * Fonctionnalités : Centralise les différents éléments du Front IDILL, tels que les classes javascript, les fonctions jQuery, les css. |
|
19 */ |
|
20 --> |
|
21 |
|
22 <!doctype html> |
|
23 <html> |
|
24 <head> |
|
25 <!-- On inclut les styles et les scripts utilisés. --> |
|
26 <title>IDILL</title> |
|
27 <meta charset="UTF-8" /> |
|
28 <link rel="stylesheet" type="text/css" href="./mosaic/css/reset.css" /> |
|
29 <script type="text/javascript" src="../lib/less-1.3.0.min.js"></script> |
|
30 <script type="text/javascript" src="../lib/underscore-min.js"></script> |
|
31 <script type="text/javascript" src="../lib/jquery.min.js"></script> |
|
32 </head> |
|
33 |
|
34 <body> |
|
35 <!-- Scripts principaux. --> |
|
36 <script type="text/javascript"> |
|
37 function loadMenu(textElements) |
|
38 { |
|
39 var form = "<div id='choice'><p id='caution'>" + textElements.caution + "</p><input id='MI' type='button' /><br ><input id='KI' type='button' /></div>"; |
|
40 |
|
41 $('body').css({ |
|
42 'background-image': 'url("./img/background.png")', |
|
43 'background-repeat': 'repeat' |
|
44 }); |
|
45 $('body').append(form); |
|
46 |
|
47 $('#caution').css( |
|
48 { |
|
49 color: '#FFF', |
|
50 'font-size': '20px' |
|
51 }); |
|
52 $('#MI').attr('value', textElements.mouse); |
|
53 $('#MI').css('padding', '10px').click(function() |
|
54 { |
|
55 window.location.replace('./index_souris.html'); |
|
56 }); |
|
57 $('#KI').attr('value', textElements.kinect); |
|
58 $('#KI').css('padding', '10px').click(function() |
|
59 { |
|
60 window.location.replace('./index_kinect.html'); |
|
61 }); |
|
62 |
|
63 $('#choice').css( |
|
64 { |
|
65 position: 'absolute', |
|
66 width: '60%' |
|
67 }); |
|
68 $('#choice').css( |
|
69 { |
|
70 left: ($(window).width() - $('#choice').width()) / 2, |
|
71 'text-align': 'center', |
|
72 top: ($(window).height() - $('#choice').height()) / 2 |
|
73 }); |
|
74 } |
|
75 |
|
76 //Si la page a chargé, on charge le menu de sélection de mode. |
|
77 $(document).ready(function () |
|
78 { |
|
79 //Langues gérées. |
|
80 var langs = ["fr", "en"]; |
|
81 var lang = navigator.language; |
|
82 |
|
83 //Si la langue n'est pas gérée, on met l'anglais pas défaut. |
|
84 if(langs.indexOf(lang) == -1) |
|
85 { |
|
86 lang = "en"; |
|
87 } |
|
88 |
|
89 var path = 'lang/' + lang + '.json'; |
|
90 var textElements; |
|
91 $.getJSON(path, function(data) |
|
92 { |
|
93 textElements = data.choice; |
|
94 console.log(textElements); |
|
95 loadMenu(textElements); |
|
96 }); |
|
97 }); |
|
98 </script> |
|
99 </body> |
|
100 </html> |