Front IDILL:
authorbastiena
Wed, 01 Aug 2012 16:16:30 +0200
changeset 62 e960d66dff2b
parent 61 5292b7e88eed
child 63 0947deb9ab6d
Front IDILL: Introduction menu added.
front_idill/src/index.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/front_idill/src/index.html	Wed Aug 01 16:16:30 2012 +0200
@@ -0,0 +1,100 @@
+<!--
+/*
+* This file is part of the TraKERS\Front IDILL package.
+*
+* (c) IRI <http://www.iri.centrepompidou.fr/>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+
+/*
+ * Projet : TraKERS
+ * Module : Front IDILL
+ * Fichier : index.html
+ * 
+ * Auteur : alexandre.bastien@iri.centrepompidou.fr
+ * 
+ * Fonctionnalités : Centralise les différents éléments du Front IDILL, tels que les classes javascript, les fonctions jQuery, les css.
+ */
+-->
+
+<!doctype html>
+<html>
+    <head>
+        <!-- On inclut les styles et les scripts utilisés. -->
+        <title>IDILL</title>
+        <meta charset="UTF-8" />
+        <link rel="stylesheet" type="text/css" href="./mosaic/css/reset.css" />
+        <script type="text/javascript" src="../lib/less-1.3.0.min.js"></script>
+        <script type="text/javascript" src="../lib/underscore-min.js"></script>
+        <script type="text/javascript" src="../lib/jquery.min.js"></script>
+    </head>
+    
+    <body>
+        <!-- Scripts principaux. -->
+        <script type="text/javascript">
+            function loadMenu(textElements)
+			{
+				var form = "<div id='choice'><p id='caution'>" + textElements.caution + "</p><input id='MI' type='button' /><br ><input id='KI' type='button' /></div>";
+				
+				$('body').css({
+				'background-image': 'url("./img/background.png")',
+				'background-repeat': 'repeat'
+				});
+				$('body').append(form);
+				
+				$('#caution').css(
+				{
+					color: '#FFF',
+					'font-size': '20px'
+				});
+				$('#MI').attr('value', textElements.mouse);
+				$('#MI').css('padding', '10px').click(function()
+				{
+					window.location.replace('./index_souris.html');
+				});
+				$('#KI').attr('value', textElements.kinect);
+				$('#KI').css('padding', '10px').click(function()
+				{
+					window.location.replace('./index_kinect.html');
+				});
+				
+				$('#choice').css(
+				{
+					position: 'absolute',
+					width: '60%'
+				});
+				$('#choice').css(
+				{
+					left: ($(window).width() - $('#choice').width()) / 2,
+					'text-align': 'center',
+					top: ($(window).height() - $('#choice').height()) / 2
+				});
+			}
+			
+            //Si la page a chargé, on charge le menu de sélection de mode.
+            $(document).ready(function ()
+            {
+				//Langues gérées.
+				var langs = ["fr", "en"];
+				var lang = navigator.language;
+				
+				//Si la langue n'est pas gérée, on met l'anglais pas défaut.
+				if(langs.indexOf(lang) == -1)
+				{
+					lang = "en";
+				}
+				
+				var path = 'lang/' + lang + '.json';
+				var textElements;
+				$.getJSON(path, function(data)
+				{
+					textElements = data.choice;
+					console.log(textElements);
+					loadMenu(textElements);
+				});
+            });
+        </script>
+    </body>
+</html>
\ No newline at end of file