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