Version 1.12
4
htdocs/n3p7bLn59Yco3d/.htaccess
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
AuthName "Here is Dave"
|
||||
AuthType Basic
|
||||
AuthUserFile "/var/www/virtual/hb.s-fr.com/htdocs/n3p7bLn59Yco3d/.htpasswd"
|
||||
Require valid-user
|
||||
1
htdocs/n3p7bLn59Yco3d/.htpasswd
Normal file
|
|
@ -0,0 +1 @@
|
|||
Dave:$1$XyqNbevU$7uqBE0zkcfWGH1/b5h9fe/
|
||||
BIN
htdocs/n3p7bLn59Yco3d/css/images/Thumbs.db
Normal file
BIN
htdocs/n3p7bLn59Yco3d/css/images/background.gif
Normal file
|
After Width: | Height: | Size: 473 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/barre.gif
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/bottom.gif
Normal file
|
After Width: | Height: | Size: 36 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/bottomleft.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
htdocs/n3p7bLn59Yco3d/css/images/bottomright.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
htdocs/n3p7bLn59Yco3d/css/images/cancel.gif
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/close.gif
Normal file
|
After Width: | Height: | Size: 969 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/down.gif
Normal file
|
After Width: | Height: | Size: 107 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/full.gif
Normal file
|
After Width: | Height: | Size: 630 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/hide.gif
Normal file
|
After Width: | Height: | Size: 564 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/li.gif
Normal file
|
After Width: | Height: | Size: 59 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/li2.gif
Normal file
|
After Width: | Height: | Size: 59 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/top.gif
Normal file
|
After Width: | Height: | Size: 55 B |
BIN
htdocs/n3p7bLn59Yco3d/css/images/topleft.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
htdocs/n3p7bLn59Yco3d/css/images/topright.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
htdocs/n3p7bLn59Yco3d/css/images/up.gif
Normal file
|
After Width: | Height: | Size: 105 B |
625
htdocs/n3p7bLn59Yco3d/css/style.css
Normal file
|
|
@ -0,0 +1,625 @@
|
|||
*
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
html, body
|
||||
{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
font-size: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
background: #A7A7A7 url(images/background.gif) repeat-y center;
|
||||
text-align: left;
|
||||
font-family: Arial;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:link
|
||||
{
|
||||
color: #383838;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover, a:active
|
||||
{
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited, a:visited:hover
|
||||
{
|
||||
color: #545454;
|
||||
}
|
||||
|
||||
p a:hover, p a:active
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
acronym, abbr
|
||||
{
|
||||
border-bottom: dotted 1px;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
h1,h2,h3,h4,h5,h6
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
h5
|
||||
{
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
h6
|
||||
{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
font-family: "Tahoma";
|
||||
text-align: justify;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.4em;
|
||||
word-spacing: 1px;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
background-color: #FFF;
|
||||
border: 1px #000 solid;
|
||||
border-bottom-width: 2px;
|
||||
border-right-width: 2px;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button:hover, button:active
|
||||
{
|
||||
color: #FFF;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
input
|
||||
{
|
||||
border: #000 solid 1px;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
#start
|
||||
{
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
font-size: 1.1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.window
|
||||
{
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 25%;
|
||||
width: 50%;
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
.window .top, .window .bottom
|
||||
{
|
||||
height: 6px;
|
||||
position: relative;
|
||||
font-size: 1px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.window .top
|
||||
{
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.window .bottom
|
||||
{
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.window .top .topcenter
|
||||
{
|
||||
display: block;
|
||||
margin: 0 6px;
|
||||
height: 6px;
|
||||
background: transparent url(images/top.gif) repeat-x 0 0;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.window .bottom .bottomcenter
|
||||
{
|
||||
display: block;
|
||||
margin: 0 6px;
|
||||
height: 6px;
|
||||
background: transparent url(images/bottom.gif) repeat-x 0 0;
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
|
||||
.window .top .topleft, .window .top .topright, .window .bottom .bottomleft, .window .bottom .bottomright
|
||||
{
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.window .top .topleft
|
||||
{
|
||||
left: 0;
|
||||
background: transparent url(images/topleft.png) no-repeat 0 0;
|
||||
cursor: nw-resize;
|
||||
}
|
||||
|
||||
.window .top .topright
|
||||
{
|
||||
right: 0;
|
||||
background: transparent url(images/topright.png) no-repeat 0 0;
|
||||
cursor: ne-resize;
|
||||
}
|
||||
|
||||
.window .bottom .bottomleft
|
||||
{
|
||||
left: 0;
|
||||
background: transparent url(images/bottomleft.png) no-repeat 0 0;
|
||||
cursor: sw-resize;
|
||||
}
|
||||
|
||||
.window .bottom .bottomright
|
||||
{
|
||||
right: 0;
|
||||
background: transparent url(images/bottomright.png) no-repeat 0 0;
|
||||
cursor: se-resize;
|
||||
}
|
||||
|
||||
.window .barre
|
||||
{
|
||||
height: 17px;
|
||||
background: #5D5D5D url(images/barre.gif) repeat-x 0 0;
|
||||
border-left: #707070 1px solid;
|
||||
border-right: #707070 1px solid;
|
||||
}
|
||||
|
||||
.window .barre:active, .window .barre:focus
|
||||
{
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.window .barre .button
|
||||
{
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
.window .barre .button *
|
||||
{
|
||||
float: left;
|
||||
width: 30px;
|
||||
height: 13px;
|
||||
margin: 0 2px;
|
||||
background: transparent none no-repeat 0 0;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.window .barre .button *:hover
|
||||
{
|
||||
background-position: 0 -13px;
|
||||
}
|
||||
|
||||
.window .barre .button *:active
|
||||
{
|
||||
background-position: 0 -26px;
|
||||
}
|
||||
|
||||
.window .barre .button .close
|
||||
{
|
||||
background-image: url(images/close.gif);
|
||||
}
|
||||
|
||||
.window .barre .button .full
|
||||
{
|
||||
background-image: url(images/full.gif);
|
||||
}
|
||||
|
||||
.window .barre .button .hide
|
||||
{
|
||||
background-image: url(images/hide.gif);
|
||||
}
|
||||
|
||||
.window .barre .titre
|
||||
{
|
||||
font-size: 14px;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
float: left;
|
||||
padding-left: 20px;
|
||||
position: relative;
|
||||
bottom: 3px;
|
||||
}
|
||||
|
||||
.window .content
|
||||
{
|
||||
position: relative;
|
||||
border-left: #707070 1px solid;
|
||||
border-right: #707070 1px solid;
|
||||
overflow: auto;
|
||||
height: 100%;
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
text-align: justify;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#barre
|
||||
{
|
||||
position: absolute;
|
||||
z-index: 200000;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #4D4D4D;
|
||||
height: 25px;
|
||||
border-top: #FFF 1px solid;
|
||||
}
|
||||
|
||||
#barre div
|
||||
{
|
||||
float: left;
|
||||
padding: 1px 10px;
|
||||
width: 150px;
|
||||
font-size: 13px;
|
||||
color: #BCBCBC;
|
||||
height: 15px;
|
||||
font-weight: bold;
|
||||
margin: 3px 2px 0 2px;
|
||||
border: #282828 1px solid;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#barre div:hover
|
||||
{
|
||||
background-color: #393939;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
#menu
|
||||
{
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#menu li
|
||||
{
|
||||
list-style-type: none;
|
||||
width: 180px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
background-color: #FFF;
|
||||
margin: 3px 0 3px 10px;
|
||||
padding: 3px 0 3px 20px;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
border-left: 3px solid #FFF;
|
||||
}
|
||||
|
||||
#menu li:hover
|
||||
{
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
#darkness
|
||||
{
|
||||
position: absolute;
|
||||
z-index: 100000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000;
|
||||
filter: alpha(opacity=0);
|
||||
-moz-opacity: 0;
|
||||
-khtml-opacity: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#dialog
|
||||
{
|
||||
position: absolute;
|
||||
z-index: 100000;
|
||||
padding: 2% 3%;
|
||||
width: 20%;
|
||||
left: 37%;
|
||||
top: 35%;
|
||||
background-color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
#dialog button
|
||||
{
|
||||
float: right;
|
||||
margin: 15px 0 0 20px;
|
||||
}
|
||||
|
||||
#dialog .quit
|
||||
{
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background: #FFF url(images/cancel.gif) no-repeat 0 0;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#dialog .quit:hover
|
||||
{
|
||||
background-position: 0 -12px;
|
||||
}
|
||||
|
||||
#ressources
|
||||
{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding-left: 5%;
|
||||
width: 95%;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
#ressources div
|
||||
{
|
||||
text-align: center;
|
||||
float: left;
|
||||
padding: 4px 0;
|
||||
width: 18%;
|
||||
background-color: #FFF;
|
||||
border: 1px solid #000;
|
||||
border-top-width: 0;
|
||||
margin: 0 2%;
|
||||
font-weight: bold;
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
-moz-border-radius-bottomright: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
#ressources div strong
|
||||
{
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#planetes
|
||||
{
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
right: 20px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#planetes .up, #planetes .down
|
||||
{
|
||||
display: block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
background: transparent url(images/up.gif) no-repeat 0 0;
|
||||
cursor: pointer;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#planetes .up:hover, #planetes .down:hover
|
||||
{
|
||||
background-position: 0 100%;
|
||||
}
|
||||
|
||||
#planetes .down
|
||||
{
|
||||
background-image: url(images/down.gif);
|
||||
}
|
||||
|
||||
#planetes img
|
||||
{
|
||||
display: block;
|
||||
height: 75px;
|
||||
width: 75px;
|
||||
border: 1px solid #000;
|
||||
cursor: pointer;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
#planetes img:hover
|
||||
{
|
||||
border-color: #FFF;
|
||||
}
|
||||
|
||||
#planetes img.selected
|
||||
{
|
||||
border: 3px #FFF solid;
|
||||
}
|
||||
|
||||
p#notification
|
||||
{
|
||||
position: absolute;
|
||||
z-index: 100000;
|
||||
right: 10px;
|
||||
bottom: -110px;
|
||||
width: 250px;
|
||||
height: 100px;
|
||||
padding: 10px 20px;
|
||||
background-color: #000;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
filter: alpha(opacity=80);
|
||||
-moz-opacity: 0.8;
|
||||
-khtml-opacity: 0.8;
|
||||
opacity: 0.8;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
}
|
||||
|
||||
.window dl.menu
|
||||
{
|
||||
width: 30%;
|
||||
height: 97%;
|
||||
padding-top: 2%;
|
||||
float: left;
|
||||
list-style-type: none;
|
||||
background-color: #F2F2F2;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.window dl.menu dt
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 1.2em;
|
||||
padding-left: 2%;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.window dl.menu dd
|
||||
{
|
||||
margin: 0 0 1px 4%;
|
||||
padding: 3px 0 3px 14px;
|
||||
cursor: pointer;
|
||||
background: transparent url(images/li.gif) no-repeat 0 center;
|
||||
font-size: 0.9em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.window dl.menu dd:hover, .window dl.menu dd.selected
|
||||
{
|
||||
background: #FFF url(images/li2.gif) no-repeat 0 center;
|
||||
}
|
||||
|
||||
.window .description
|
||||
{
|
||||
width: 70%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.window .description h4
|
||||
{
|
||||
font-size: 0.9em;
|
||||
padding-left: 10%;
|
||||
float: left;
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.window .description img
|
||||
{
|
||||
float: right;
|
||||
margin: 5% 5% 25px 0;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.window .description p
|
||||
{
|
||||
clear: both;
|
||||
margin: 0 25px;
|
||||
}
|
||||
|
||||
.window .description button
|
||||
{
|
||||
float: right;
|
||||
margin: 20px 10% 0 0;
|
||||
}
|
||||
|
||||
.window .info
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#background
|
||||
{
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
left: 230px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#background .content
|
||||
{
|
||||
border: 1px #8E8D8D dotted;
|
||||
width: 100%;
|
||||
height: 80%;
|
||||
}
|
||||
|
||||
#resize
|
||||
{
|
||||
border: #000 1px solid;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100000000;
|
||||
}
|
||||
|
||||
#console
|
||||
{
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
bottom: 2px;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
z-index: 100000000;
|
||||
background-color: #000;
|
||||
filter: alpha(opacity=80);
|
||||
-moz-opacity: 0.8;
|
||||
-khtml-opacity: 0.8;
|
||||
opacity: 0.8;
|
||||
}
|
||||
16
htdocs/n3p7bLn59Yco3d/demo.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Dave</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="start"><script type="text/javascript"><!--
|
||||
document.write('Chargement...')
|
||||
--></script><noscript>Vous devez activer le javascript pour continuer sur cette page.</noscript></div>
|
||||
<script src="js/prototype.js" type="text/javascript"></script>
|
||||
<script src="js/animations.js" type="text/javascript"></script>
|
||||
<script src="js/interface.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
6
htdocs/n3p7bLn59Yco3d/descriptions.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<descriptions>
|
||||
<batiment id="1" name="Usine de Métal" img="metal.png"><![CDATA[Le purificateur de métal vous fournit les matières premières pour la construction de vos infrastructures et de vos unités. Plus vous développerez vos purificateurs, plus ils produiront de ressources. Les purificateurs les plus développés ont aussi besoin de plus d'énergie.]]></batiment>
|
||||
<batiment id="2" name="Purificateur de Cristal" img="cristal.png"><![CDATA[Le purificateur de cristal vous fournit les ressources pour vos installations électroniques et pour les alliages. Le purificateur de cristal consomme deux fois plus d'énergie que celui de métal. Tous les vaisseaux et bâtiments ont besoin de cristal pour leur bouclier ou encore leurs composants électroniques. La production augmente avec le développement de l'usine.]]></batiment>
|
||||
<batiment id="3" name="Ionisateur" img="hydrogene.jpg"><![CDATA[L'ionisateur utilise des ions négatifs et positifs d'hydrogène pour créer une source conventionnelle de courant stable, servant à alimenter les bâtiments covenants qui nécessitent une arrivée massive de cette "ressource" pour actionner les divers éléments matériels des contrôles. La centrale de fusion à besoin de beaucoup d'ions pour fonctionner.]]></batiment>
|
||||
</descriptions>
|
||||
BIN
htdocs/n3p7bLn59Yco3d/images/Thumbs.db
Normal file
BIN
htdocs/n3p7bLn59Yco3d/images/batiments/Thumbs.db
Normal file
BIN
htdocs/n3p7bLn59Yco3d/images/batiments/cristal.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
htdocs/n3p7bLn59Yco3d/images/batiments/hydrogene.jpg
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
htdocs/n3p7bLn59Yco3d/images/batiments/metal.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
225
htdocs/n3p7bLn59Yco3d/js/animations.js
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
function create(type,parent,id,classe)
|
||||
{
|
||||
var element = document.createElement(type);
|
||||
if(id && !$(id)) element.setAttribute('id',id);
|
||||
if(classe) Element.addClassName(element,classe);
|
||||
if(parent) element = $(parent).appendChild(element);
|
||||
return element;
|
||||
}
|
||||
|
||||
var Effect =
|
||||
{
|
||||
queue : [],
|
||||
|
||||
hide : function(element)
|
||||
{
|
||||
element.style.display = 'none';
|
||||
|
||||
return element;
|
||||
},
|
||||
|
||||
show : function(element)
|
||||
{
|
||||
element.style.display = '';
|
||||
|
||||
return element;
|
||||
},
|
||||
|
||||
opacity : function(element,opacity)
|
||||
{
|
||||
element.style.opacity = opacity / 100;
|
||||
element.style.MozOpacity = opacity / 100;
|
||||
element.style.KhtmlOpacity = opacity / 100;
|
||||
element.style.filter = "alpha(opacity="+ opacity +")";
|
||||
|
||||
return element;
|
||||
},
|
||||
|
||||
style : function(element,style)
|
||||
{
|
||||
for(var property in style)
|
||||
{
|
||||
if(property == 'opacity') Effect.opacity(element,style[property]);
|
||||
else element.style[property] = style[property];
|
||||
}
|
||||
|
||||
return element;
|
||||
},
|
||||
|
||||
animate : function(element,style,speed) //usage : Effect.animate(element,{backgroundColor: [[0,0,0],[0,255,255]], fontSize: [12,14,'px']},500)
|
||||
{
|
||||
for(var i = 0; i < Effect.queue.length; i++) if(Effect.queue[i] == element) return false;
|
||||
Effect.queue.push(element);
|
||||
|
||||
var anim = {};
|
||||
var noanim = {};
|
||||
|
||||
var dif = 0;
|
||||
|
||||
for(var property in style)
|
||||
{
|
||||
if(typeof style[property] == 'string')
|
||||
noanim[property] = style[property];
|
||||
|
||||
else if(typeof style[property] == 'number')
|
||||
anim[property] = [!element.style.property ? 0 : element.style.property , style[property]];
|
||||
|
||||
else if(typeof style[property] == 'object')
|
||||
{
|
||||
if(style[property].length == 1)
|
||||
noanim[property] = style[property][0];
|
||||
|
||||
else if(style[property].length == 2 || style[property].length == 3)
|
||||
{
|
||||
if(typeof style[property][0] == 'number' && typeof style[property][1] == 'number')
|
||||
{
|
||||
anim[property] = style[property];
|
||||
}
|
||||
|
||||
else if(typeof style[property][0] == 'number' && typeof style[property][1] == 'string')
|
||||
{
|
||||
anim[property] = [!element.style[property] ? 0 : element.style[property].substr(0,element.style[property].length - style[property][1].length) , style[property][0], style[property][1]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Effect.style(element,noanim);
|
||||
|
||||
for(var property in anim) dif = dif < Math.abs(anim[property][0] - anim[property][1]) ? Math.abs(anim[property][0] - anim[property][1]) : dif;
|
||||
|
||||
for(var i=1; i <= dif ;i++)
|
||||
{
|
||||
|
||||
for(var property in anim)
|
||||
{
|
||||
var from = Number(anim[property][0]);
|
||||
var to = Number(anim[property][1]);
|
||||
var ext = typeof anim[property][2] != 'undefined' ? anim[property][2] : 0;
|
||||
|
||||
var count = Math.floor(from + i*(to - from) / dif);
|
||||
|
||||
var funct = function()
|
||||
{
|
||||
var style = {};
|
||||
style[this.property] = this.count+this.ext;
|
||||
Effect.style(element,style);
|
||||
};
|
||||
|
||||
setTimeout(funct.bind({property: property,count: count,ext: ext}),Math.floor(i/dif*speed));
|
||||
}
|
||||
}
|
||||
setTimeout(function(){for(var i = 0; i < Effect.queue.length; i++) if(Effect.queue[i] == element) Effect.queue[i] = null},speed+10);
|
||||
return element;
|
||||
},
|
||||
|
||||
fadeIn: function(element,speed)
|
||||
{
|
||||
Effect.animate(element,{visibility: 'visible',opacity: [0,100]},speed);
|
||||
},
|
||||
|
||||
fadeOut: function(element,speed)
|
||||
{
|
||||
Effect.animate(element,{opacity: [100,0]},speed);
|
||||
setTimeout(function(){Effect.style(element,{visibility: 'hidden'})},speed);
|
||||
},
|
||||
|
||||
move : function(element,relative,from,to,speed)
|
||||
{
|
||||
switch(relative)
|
||||
{
|
||||
case 'top':
|
||||
case 'left':
|
||||
case 'bottom':
|
||||
case 'right':
|
||||
var anim = {};
|
||||
anim[relative] = [from,to,'px'];
|
||||
Effect.animate(element,anim,speed);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*Element.prototype.effect.hide = function()
|
||||
{
|
||||
return Effect.hide(this);
|
||||
};
|
||||
|
||||
Element.prototype.effect.show = function()
|
||||
{
|
||||
return Effect.show(this);
|
||||
};*/
|
||||
|
||||
Object.extend(Element.prototype,{
|
||||
opacity : function(opacity)
|
||||
{
|
||||
return Effect.opacity(this,opacity);
|
||||
},
|
||||
|
||||
setStyle : function(style)
|
||||
{
|
||||
return Effect.style(this,style);
|
||||
},
|
||||
|
||||
animate : function(style,speed)
|
||||
{
|
||||
return Effect.animate(this,style,speed);
|
||||
},
|
||||
|
||||
fadeIn : function(speed)
|
||||
{
|
||||
return Effect.fadeIn(this,speed);
|
||||
},
|
||||
|
||||
fadeOut : function(speed)
|
||||
{
|
||||
return Effect.fadeOut(this,speed);
|
||||
},
|
||||
|
||||
move : function(relative,from,to,speed)
|
||||
{
|
||||
return Effect.move(this,relative,from,to,speed);
|
||||
}
|
||||
});
|
||||
|
||||
Element.addMethods();
|
||||
|
||||
/*Element.prototype.opacity = function(opacity)
|
||||
{
|
||||
return Effect.opacity(this,opacity);
|
||||
};
|
||||
|
||||
Element.prototype.setStyle = function(style)
|
||||
{
|
||||
return Effect.style(this,style);
|
||||
};
|
||||
|
||||
Element.prototype.animate = function(style,speed)
|
||||
{
|
||||
return Effect.animate(this,style,speed);
|
||||
};
|
||||
|
||||
Element.prototype.fadeIn = function(speed)
|
||||
{
|
||||
return Effect.fadeIn(this,speed);
|
||||
};
|
||||
|
||||
Element.prototype.fadeOut = function(speed)
|
||||
{
|
||||
return Effect.fadeOut(this,speed);
|
||||
};
|
||||
|
||||
Element.prototype.move = function(relative,from,to,speed)
|
||||
{
|
||||
return Effect.move(this,relative,from,to,speed);
|
||||
};*/
|
||||
|
||||
/*create('div',document.body,'test2');
|
||||
myfunct = function(){ $('test2').innerHTML += this.i };
|
||||
for(var i = 1; i < 20; i++)
|
||||
{
|
||||
setTimeout(myfunct.bind({i:i}),1000*i);
|
||||
}*/
|
||||
|
||||
/*var masque = [/#([0-9A-F]{6}|[0-9A-F]{3})/i,
|
||||
/rgb\((\d{1,3})%?,(\d{1,3})%?,(\d{1,3})%?\)/i,
|
||||
/\d+(px|pc|pt|ex|em|mm|cm|in|%)/i];*/
|
||||
534
htdocs/n3p7bLn59Yco3d/js/api.js
Normal file
|
|
@ -0,0 +1,534 @@
|
|||
|
||||
var Desktop =
|
||||
{
|
||||
|
||||
dom : {windows: {}},
|
||||
|
||||
ressources : {metal: 2000, cristal: 1500, ions: 1000, energie: [1000,1500]},
|
||||
|
||||
planete : 1, //Planete sélectionné
|
||||
|
||||
planetes : [[01,'Pegasi Alpha',8,31,4,1],[02,'Pegasi Beta',8,31,3,2],[03,'Pegasi Delta',8,31,2,3],[04,'Pegasi Zeta',8,31,1,4]], //id, nom , amas, syteme solaire, position, image.
|
||||
|
||||
menu : [['Fenêtre 1',fenetre1],['Fenêtre 2',fenetre2],['Batiments',batiments],['Dialog',dialog],['Notification',notification],['Double',doubler]],
|
||||
|
||||
descriptions : {
|
||||
batiments:
|
||||
{
|
||||
1:['Usine de Métal','metal.png','Le purificateur de métal vous fournit les matières premières pour la construction de vos infrastructures et de vos unités. Plus vous développerez vos purificateurs, plus ils produiront de ressources. Les purificateurs les plus développés ont aussi besoin de plus d\'énergie.'],
|
||||
2:['Purificateur de Cristal','cristal.png','Le purificateur de cristal vous fournit les ressources pour vos installations électroniques et pour les alliages. Le purificateur de cristal consomme deux fois plus d\'énergie que celui de métal. Tous les vaisseaux et bâtiments ont besoin de cristal pour leur bouclier ou encore leurs composants électroniques. La production augmente avec le développement de l\'usine.'],
|
||||
3:['Ionisateur','hydrogene.jpg','L\'ionisateur utilise des ions négatifs et positifs d\'hydrogène pour créer une source conventionnelle de courant stable, servant à alimenter les bâtiments covenants qui nécessitent une arrivée massive de cette "ressource" pour actionner les divers éléments matériels des contrôles. La centrale de fusion à besoin de beaucoup d\'ions pour fonctionner.']
|
||||
}},
|
||||
|
||||
|
||||
Start : function()
|
||||
{
|
||||
|
||||
/*new Ajax.Request('descriptions.xml',{method: 'get',onSuccess: function(xhr)
|
||||
{
|
||||
Desktop.dom.descriptions = xhr.responseXML;
|
||||
truc = xhr;
|
||||
bat = Desktop.dom.descriptions.documentElement.getElementsByTagName('*');
|
||||
//alert(bat[2].textContent);
|
||||
for(var i in bat)
|
||||
{
|
||||
//Desktop.descriptions['batiments'][bat[i].getAttribute('id')] = [bat[i].getAttribute('name'),bat[i].getAttribute('img'),bat[i].textContent];
|
||||
//Desktop.descriptions.batiments = bat[i];
|
||||
alert(i);
|
||||
}
|
||||
}});*/
|
||||
|
||||
this.dom.menu = create('ul',document.body,'menu');
|
||||
|
||||
this.dom.barre = create('div',document.body,'barre');
|
||||
|
||||
var barre = new Array();
|
||||
|
||||
for(var i=0; i < this.menu.length ; i++)
|
||||
{
|
||||
this.menu[i][2] = create('li',this.dom.menu);
|
||||
this.menu[i][2].innerHTML = this.menu[i][0];
|
||||
this.menu[i][2].onclick = this.menu[i][1];
|
||||
}
|
||||
|
||||
var ressources = create('div',document.body,'ressources');
|
||||
|
||||
var metal = create('div',ressources);
|
||||
metal.innerHTML = 'Métal : ';
|
||||
metal = create('span',metal);
|
||||
metal.innerHTML = this.ressources.metal;
|
||||
|
||||
var cristal = create('div',ressources);
|
||||
cristal.innerHTML = 'Cristal : ';
|
||||
cristal = create('span',cristal);
|
||||
cristal.innerHTML = this.ressources.cristal;
|
||||
|
||||
var ions = create('div',ressources);
|
||||
ions.innerHTML = 'Ions : ';
|
||||
ions = create('span',ions);
|
||||
ions.innerHTML = this.ressources.ions;
|
||||
|
||||
var energie = create('div',ressources);
|
||||
energie.innerHTML = 'Energie : ';
|
||||
var energie = create('span',energie);
|
||||
energie.innerHTML = this.ressources.energie[0] +'/'+ this.ressources.energie[1];
|
||||
|
||||
this.dom.ressources = {metal: metal,cristal: cristal, ions: ions,energie: energie};
|
||||
|
||||
var planetes = create('div',document.body,'planetes');
|
||||
var up = create('span',planetes,document.body,'up');
|
||||
up.onclick = function()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(var i = 0; i <= 2 && i < this.planetes[i].length; i++)
|
||||
{
|
||||
var p = create('img',planetes);
|
||||
p.src = 'planetes/'+this.planetes[i][5]+'.jpg';
|
||||
p.onclick = callback(function(i) { Desktop.ChangePlanete(i);},i);
|
||||
if(this.planetes[i][0] == this.planete) Element.addClassName(p,'selected');
|
||||
}
|
||||
|
||||
var down = create('span',planetes,0,'down');
|
||||
down.onclick = function()
|
||||
{
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
NewWin : function(id,t,c)
|
||||
{
|
||||
if(!this.dom.windows[id])
|
||||
{
|
||||
|
||||
var o = new Object();
|
||||
|
||||
o.win = create('div',document.body,'Window'+id,'window');
|
||||
|
||||
o.win.style.zIndex = 10;
|
||||
|
||||
o.top = create('div',o.win,0,'top');
|
||||
|
||||
o.topleft = create('span',o.top,0,'topleft');
|
||||
|
||||
o.topcenter = create('span',o.top,0,'topcenter');
|
||||
|
||||
o.topright = create('span',o.top,0,'topright');
|
||||
|
||||
o.barre = create('div',o.win,0,'barre');
|
||||
o.barre.onmousedown = function(event) { Desktop.WinMove(id,event,1); };
|
||||
o.barre.onmouseup = function(event) { Desktop.WinMove(id,event,3); };
|
||||
|
||||
o.titre = create('span',o.barre,0,'titre');
|
||||
o.titre.innerHTML = t;
|
||||
|
||||
o.button = create('div',o.barre,0,'button');
|
||||
o.button.onmousedown, o.button.onmouseup = function() { return false;};
|
||||
|
||||
o.hide = create('span',o.button,0,'hide');
|
||||
|
||||
o.full = create('span',o.button,0,'full');
|
||||
|
||||
o.close = create('span',o.button,0,'close');
|
||||
|
||||
o.hide.onclick = function() { Desktop.WinHide(id); };
|
||||
o.full.onclick = function() { Desktop.WinFull(id); };
|
||||
o.close.onclick = function() { Desktop.WinClose(id); };
|
||||
o.hide.onmousedown, o.full.onmousedown, o.close.onmousedown = function() { return false;};
|
||||
|
||||
o.content = create('div',o.win,0,'content');
|
||||
if(typeof(c) == 'object') o.content.appendChild(c);
|
||||
else o.content.innerHTML = c;
|
||||
|
||||
o.bottom = create('div',o.win,0,'bottom');
|
||||
|
||||
o.bottomleft = create('span',o.bottom,0,'bottomleft');
|
||||
|
||||
o.bottomcenter = create('span',o.bottom,0,'bottomcenter');
|
||||
|
||||
o.bottomright = create('span',o.bottom,0,'bottomright');
|
||||
|
||||
o.barre = create('div',this.dom.barre);
|
||||
o.barre.innerHTML = t;
|
||||
o.barre.onclick = function() { Desktop.WinFocus(id); } ;
|
||||
|
||||
o.id = id;
|
||||
|
||||
o.x = o.win.offsetLeft;
|
||||
|
||||
o.y = o.win.offsetTop;
|
||||
|
||||
o.h = o.win.offsetHeight;
|
||||
|
||||
o.w = o.win.offsetWidth;
|
||||
|
||||
o.full = false;
|
||||
|
||||
o.move = false;
|
||||
|
||||
o.moveX = 0;
|
||||
|
||||
o.moveY = 0;
|
||||
|
||||
this.dom.windows[id] = o;
|
||||
|
||||
var r = new Object();
|
||||
|
||||
r.id = id;
|
||||
|
||||
r.Close = function() { return Desktop.WinClose(id); } ;
|
||||
|
||||
r.Full = function() { return Desktop.WinFull(id); } ;
|
||||
|
||||
r.Hide = function() { return Desktop.WinHide(id); } ;
|
||||
|
||||
r.Focus = function() { return Desktop.WinFocus(id); } ;
|
||||
|
||||
r.Move = function(x,y) { return Desktop.WinMove(id,x,y); } ;
|
||||
|
||||
r.Resize = function(x,y) { return Desktop.WinResize(id,x,y); } ;
|
||||
|
||||
r.Content = function(t) { return Desktop.WinContent(id,t); } ;
|
||||
|
||||
this.WinFocus(id);
|
||||
|
||||
return r;
|
||||
}
|
||||
else this.WinFocus(id);
|
||||
|
||||
},
|
||||
|
||||
WinFull : function(id)
|
||||
{
|
||||
if(this.dom.windows[id].full)
|
||||
{
|
||||
this.dom.windows[id].win.style.left = this.dom.windows[id].full[0]+'px';
|
||||
this.dom.windows[id].win.style.top = this.dom.windows[id].full[1]+'px';
|
||||
this.dom.windows[id].win.style.width = this.dom.windows[id].full[2]+'px';
|
||||
this.dom.windows[id].win.style.height = this.dom.windows[id].full[3]+'px';
|
||||
|
||||
this.dom.windows[id].full = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dom.windows[id].full = [this.dom.windows[id].win.offsetLeft, this.dom.windows[id].win.offsetTop, this.dom.windows[id].win.offsetWidth, this.dom.windows[id].win.offsetHeight];
|
||||
|
||||
this.dom.windows[id].win.style.top = '0';
|
||||
this.dom.windows[id].win.style.left = '0';
|
||||
this.dom.windows[id].win.style.width = '100%';
|
||||
this.dom.windows[id].win.style.height = (document.documentElement.offsetHeight - this.dom.barre.offsetHeight - 49) + 'px';
|
||||
}
|
||||
Desktop.WinFocus(id);
|
||||
},
|
||||
|
||||
WinHide : function(id)
|
||||
{
|
||||
this.dom.windows[id].win.style.display = 'none';
|
||||
},
|
||||
|
||||
WinFocus : function(id)
|
||||
{
|
||||
this.dom.windows[id].win.style.display = 'block';
|
||||
this.dom.windows[id].x = this.dom.windows[id].win.offsetLeft;
|
||||
this.dom.windows[id].y = this.dom.windows[id].win.offsetTop;
|
||||
this.dom.windows[id].w = this.dom.windows[id].win.offsetHeight;
|
||||
this.dom.windows[id].h = this.dom.windows[id].win.offsetWidth;
|
||||
|
||||
var z = this.dom.windows[id].win.style.zIndex * 1;
|
||||
|
||||
for(var i in this.dom.windows)
|
||||
{
|
||||
z = z >= this.dom.windows[i].win.style.zIndex ? z : this.dom.windows[i].win.style.zIndex * 1;
|
||||
}
|
||||
|
||||
this.dom.windows[id].win.style.zIndex = z+1;
|
||||
},
|
||||
|
||||
WinMove : function(id,event,action)
|
||||
{
|
||||
if(action == 1 && !this.dom.windows[id].full) // MouseDown
|
||||
{
|
||||
Desktop.WinFocus(id);
|
||||
this.dom.windows[id].moveX = Event.pointerX(event) - this.dom.windows[id].win.offsetLeft;
|
||||
this.dom.windows[id].moveY = Event.pointerY(event) - this.dom.windows[id].win.offsetTop;
|
||||
|
||||
document.body.onmousemove = function(event) { Desktop.dom.windows[id].move = event; Desktop.WinMove(id,event,2);};
|
||||
opacity(this.dom.windows[id].win,50);
|
||||
}
|
||||
else if(action == 2) //MouseMove
|
||||
{
|
||||
x = Event.pointerX(event) - this.dom.windows[id].moveX;
|
||||
y = Event.pointerY(event) - this.dom.windows[id].moveY;
|
||||
this.dom.windows[id].win.style.left = (x > 0 ? x : 0) + 'px';
|
||||
this.dom.windows[id].win.style.top = (y > 0 ? y : 0) + 'px';
|
||||
}
|
||||
|
||||
else if(action == 3) //MouseUp
|
||||
{
|
||||
this.dom.windows[id].x = this.dom.windows[id].win.offsetLeft;
|
||||
this.dom.windows[id].y = this.dom.windows[id].win.offsetTop;
|
||||
opacity(this.dom.windows[id].win,100);
|
||||
document.body.onmousemove = function() { return false;};
|
||||
}
|
||||
},
|
||||
|
||||
WinContent: function(id,c)
|
||||
{
|
||||
if(typeof(c) == 'object')
|
||||
{
|
||||
this.dom.windows[id].content.innerHTML = '';
|
||||
this.dom.windows[id].content.appendChild(c);
|
||||
}
|
||||
else this.dom.windows[id].content.innerHTML = c;
|
||||
},
|
||||
|
||||
WinClose : function(id)
|
||||
{
|
||||
Element.remove(this.dom.windows[id].win);
|
||||
Element.remove(this.dom.windows[id].barre);
|
||||
delete this.dom.windows[id];
|
||||
},
|
||||
|
||||
Dialog : function(text,callback)
|
||||
{
|
||||
if(!this.dom.dialog)
|
||||
{
|
||||
this.dom.darkness = create('div',document.body,'darkness');
|
||||
fade('darkness',0,80,400);
|
||||
|
||||
this.dom.dialog = create('div',document.body,'dialog');
|
||||
|
||||
var p = create('p',this.dom.dialog);
|
||||
p.innerHTML = text;
|
||||
|
||||
var ok = create('span',this.dom.dialog,0,'button');
|
||||
ok.innerHTML = 'ok';
|
||||
|
||||
var cancel = create('span',this.dom.dialog,0,'button');
|
||||
cancel.innerHTML = 'Annuler';
|
||||
|
||||
var quit = create('span',this.dom.dialog,0,'quit');
|
||||
var close = function()
|
||||
{
|
||||
Element.remove(Desktop.dom.dialog);
|
||||
Element.remove(Desktop.dom.darkness);
|
||||
|
||||
Desktop.dom.dialog = false;
|
||||
Desktop.dom.darkness = false;
|
||||
};
|
||||
|
||||
quit.onclick = close;
|
||||
cancel.onclick = close;
|
||||
ok.onclick = function()
|
||||
{
|
||||
close();
|
||||
callback();
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Notification: function(message)
|
||||
{
|
||||
if(!this.dom.notification)
|
||||
{
|
||||
this.dom.notification = create('p',document.body,'notification');
|
||||
this.dom.notification.innerHTML = message;
|
||||
|
||||
move('notification','bottom',-110,35,2000);
|
||||
setTimeout(function() {move('notification','bottom',35,-110,2000);},7000);
|
||||
setTimeout(function() {Element.remove(Desktop.dom.notification); Desktop.dom.notification = false;},10000);
|
||||
}
|
||||
},
|
||||
|
||||
Ressource: function(ressource,set)
|
||||
{
|
||||
switch(ressource)
|
||||
{
|
||||
case 'metal':
|
||||
case 'cristal':
|
||||
case 'ions':
|
||||
if(set)
|
||||
{
|
||||
this.dom.ressources[ressource].innerHTML = set;
|
||||
this.ressources[ressource] = set;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'energie':
|
||||
if(set)
|
||||
{
|
||||
this.dom.ressources[ressource].innerHTML = set+'/'+this.ressources[ressource][1];
|
||||
this.ressources[ressource][0] = set;
|
||||
}
|
||||
break;
|
||||
case 'energieAll':
|
||||
if(set)
|
||||
{
|
||||
this.dom.ressources[ressource].innerHTML = this.ressources[ressource][0]+'/'+set;
|
||||
this.ressources[ressource][1] = set;
|
||||
}
|
||||
break;
|
||||
|
||||
default: return false;
|
||||
}
|
||||
|
||||
return this.ressources[ressource];
|
||||
},
|
||||
|
||||
ChangePlanete: function(i)
|
||||
{
|
||||
if(this.planetes[i][0] != this.planete) alert('Changement de planete : '+this.planetes[i][1]);
|
||||
}
|
||||
}
|
||||
|
||||
function create(type,parent,id,classe)
|
||||
{
|
||||
var element = document.createElement(type);
|
||||
if(id && !$(id)) element.setAttribute('id',id);
|
||||
if(classe) Element.addClassName(element,classe);
|
||||
if(parent) element = $(parent).appendChild(element);
|
||||
return element;
|
||||
}
|
||||
|
||||
function callback(funct,parameter)
|
||||
{
|
||||
return function() { funct(parameter); };
|
||||
}
|
||||
|
||||
function move(objet,relative,from,to,speed)
|
||||
{
|
||||
switch(relative)
|
||||
{
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
case 'left':
|
||||
case 'right':
|
||||
|
||||
for(var i=1; i <= (Math.floor(Math.abs(from - to))) ;i++)
|
||||
{
|
||||
setTimeout(callback(function(i) {$(objet).style[relative] = (from < to ? from + i : from -i)+'px';},i),Math.floor(speed / (Math.floor(Math.abs(from - to))) * i));
|
||||
}
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fade(objet,from,to,speed)
|
||||
{
|
||||
for(var i = 1; (Math.floor(Math.abs(from - to)) / 10) >= i; i++)
|
||||
{
|
||||
setTimeout(callback(function(i) {opacity(objet,(from < to ? from + i * 10 : from - i * 10));},i),Math.floor(speed / (Math.floor(Math.abs(from - to)) / 10)) * i);
|
||||
}
|
||||
}
|
||||
|
||||
function opacity(objet,opacity)
|
||||
{
|
||||
$(objet).style.opacity = opacity / 100;
|
||||
$(objet).style.MozOpacity = opacity /100;
|
||||
$(objet).style.KhtmlOpacity = opacity / 100;
|
||||
$(objet).style.filter = "alpha(opacity="+opacity+")";
|
||||
}
|
||||
|
||||
function bulle(objet,text)
|
||||
{
|
||||
if(!$('bulle'))
|
||||
{
|
||||
objet.onmouvehover = function()
|
||||
{
|
||||
bulle = $('body').appendChild(document.createElement('div'));
|
||||
bulle.setAttribute('id','bulle');
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function fenetre1()
|
||||
{
|
||||
var test1 = Desktop.NewWin('test1','Test','<i>Hello World</i>');
|
||||
}
|
||||
|
||||
function fenetre2()
|
||||
{
|
||||
var test2 = Desktop.NewWin('test2','Test 2','<p>Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br />Bla bla bla bla bla bla bla bla bla bla bla<br /></p>');
|
||||
}
|
||||
|
||||
function dialog()
|
||||
{
|
||||
Desktop.Dialog('Test',function() {alert('test');});
|
||||
}
|
||||
|
||||
function notification()
|
||||
{
|
||||
Desktop.Notification('test');
|
||||
}
|
||||
|
||||
function doubler()
|
||||
{
|
||||
Desktop.Ressource('metal',Desktop.ressources.metal*2);
|
||||
Desktop.Ressource('cristal',Desktop.ressources.cristal*2);
|
||||
Desktop.Ressource('ions',Desktop.ressources.ions*2);
|
||||
Desktop.Ressource('energie',Desktop.ressources.energie[0]*2);
|
||||
}
|
||||
|
||||
/*description = {
|
||||
bat01: 'Le purificateur de métal vous fournit les matières premières pour la construction de vos infrastructures et de vos unités. Plus vous développerez vos purificateurs, plus ils produiront de ressources. Les purificateurs les plus développés ont aussi besoin de plus d\'énergie.',
|
||||
bat02: 'Le purificateur de cristal vous fournit les ressources pour vos installations électroniques et pour les alliages. Le purificateur de cristal consomme deux fois plus d\'énergie que celui de métal. Tous les vaisseaux et bâtiments ont besoin de cristal pour leur bouclier ou encore leurs composants électroniques. La production augmente avec le développement de l\'usine.',
|
||||
bat03:'L\'ionisateur utilise des ions négatifs et positifs d\'hydrogène pour créer une source conventionnelle de courant stable, servant à alimenter les bâtiments covenants qui nécessitent une arrivée massive de cette "ressource" pour actionner les divers éléments matériels des contrôles. La centrale de fusion à besoin de beaucoup d\'ions pour fonctionner.'
|
||||
};
|
||||
|
||||
ajax = {bat01: ['Usine de Métal','metal.png',3,100,200,300,0],bat02: ['Usine de Cristal','cristal.png',3,100,200,300,0],bat03: ['Ionisateur','hydrogene.jpg',3,100,200,300,0]};*/
|
||||
|
||||
function batiments()
|
||||
{
|
||||
var batiments = Desktop.descriptions.batiments;
|
||||
|
||||
var all = create('div');
|
||||
all.style.height = '100%';
|
||||
var left = create('dl',all,0,'menu');
|
||||
var dt = create('dt',left);
|
||||
dt.innerHTML = 'Batiments';
|
||||
|
||||
var right = create('div',all,0,'description');
|
||||
var titre = create('h4',right);
|
||||
titre.innerHTML = batiments[1][0];
|
||||
var img = create('img',right);
|
||||
img.src = 'images/'+batiments[1][1];
|
||||
img.alt = batiments[1][0];
|
||||
var p = create('p',right);
|
||||
p.innerHTML = batiments[1][2];
|
||||
var button = create('button',right);
|
||||
button.innerHTML = 'Construire';
|
||||
button.onclick = function() { alert('Construction!') };
|
||||
|
||||
for(var i in batiments)
|
||||
{
|
||||
var dd = create('dd',left);
|
||||
dd.innerHTML = batiments[i][0];
|
||||
if(i == 1) Element.addClassName(dd,'selected');
|
||||
dd.onclick = callback(function(par)
|
||||
{
|
||||
var i = par[0];
|
||||
var dd = par[1];
|
||||
var dds = dd.parentNode.childNodes;
|
||||
|
||||
for(var j = 1; j < dds.length; j++)
|
||||
{
|
||||
Element.removeClassName(dds[j],'selected');
|
||||
}
|
||||
|
||||
Element.addClassName(dd,'selected');
|
||||
|
||||
titre.innerHTML = batiments[i][0];
|
||||
img.src = 'images/'+batiments[i][1];
|
||||
img.alt = batiments[i][0];
|
||||
p.innerHTML = batiments[i][2];
|
||||
},[i,dd]);
|
||||
}
|
||||
|
||||
Desktop.NewWin('batiments','Batiments',all);
|
||||
}
|
||||
|
||||
Desktop.Start();
|
||||
Element.remove($('start'));
|
||||
Desktop.Notification('Bienvenue sur Halo-Battle');
|
||||
52
htdocs/n3p7bLn59Yco3d/js/functions.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
function create(type,parent,id,classe)
|
||||
{
|
||||
var element = document.createElement(type);
|
||||
if(id && !$(id)) element.setAttribute('id',id);
|
||||
if(classe) Element.addClassName(element,classe);
|
||||
if(parent) element = $(parent).appendChild(element);
|
||||
return element;
|
||||
}
|
||||
|
||||
function callback()
|
||||
{
|
||||
if(parameters.length == 0) return false;
|
||||
funct = prameters.shift();
|
||||
if(typeof funct != 'function') return false;
|
||||
|
||||
return function() { funct.apply(this,parameters); };
|
||||
}
|
||||
|
||||
function move(objet,relative,from,to,speed)
|
||||
{
|
||||
switch(relative)
|
||||
{
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
case 'left':
|
||||
case 'right':
|
||||
|
||||
for(var i=1; i <= (Math.floor(Math.abs(from - to))) ;i++)
|
||||
{
|
||||
setTimeout(callback(function(i) {$(objet).style[relative] = (from < to ? from + i : from -i)+'px';},i),Math.floor(speed / (Math.floor(Math.abs(from - to))) * i));
|
||||
}
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fade(objet,from,to,speed)
|
||||
{
|
||||
for(var i = 1; (Math.floor(Math.abs(from - to)) / 10) >= i; i++)
|
||||
{
|
||||
setTimeout(callback(function(i) {opacity(objet,(from < to ? from + i * 10 : from - i * 10));},i),Math.floor(speed / (Math.floor(Math.abs(from - to)) / 10)) * i);
|
||||
}
|
||||
}
|
||||
|
||||
function opacity(objet,opacity)
|
||||
{
|
||||
$(objet).style.opacity = opacity / 100;
|
||||
$(objet).style.MozOpacity = opacity /100;
|
||||
$(objet).style.KhtmlOpacity = opacity / 100;
|
||||
$(objet).style.filter = "alpha(opacity="+opacity+")";
|
||||
}
|
||||
646
htdocs/n3p7bLn59Yco3d/js/interface.js
Normal file
|
|
@ -0,0 +1,646 @@
|
|||
var script = 'interface.xml';
|
||||
|
||||
var Interface=
|
||||
{
|
||||
mouseFocus : false,
|
||||
|
||||
dom: {windows:{}},
|
||||
|
||||
descriptions : {batiments : [], vaisseaux : [],defenses : [],technologies : []},
|
||||
|
||||
planetes : [{name: 'Pegasi Alpha',position: '01:30:05',img: '1'},{name: 'Pegasi Beta',position: '01:30:06',img: '2'},{name: 'Pegasi Gamma',position: '01:30:08',img: '3'}],
|
||||
|
||||
menuList: [],
|
||||
|
||||
menu :
|
||||
{
|
||||
objects : {},
|
||||
|
||||
add : function(text,funct)
|
||||
{
|
||||
Interface.menu.objects[text] = {};
|
||||
Interface.menu.objects[text]['object'] = create('li',Interface.dom.menu);
|
||||
Interface.menu.objects[text]['object'].innerHTML = text;
|
||||
Interface.menu.objects[text]['function'] = funct;
|
||||
Interface.menu.objects[text]['event'] = Event.observe(Interface.menu.objects[text]['object'], 'click', funct);
|
||||
|
||||
},
|
||||
|
||||
remove : function(text)
|
||||
{
|
||||
if(typeof Interface.menu.objects[text] != 'object') return false;
|
||||
Interface.menu.objects[text]['object'].remove();
|
||||
delete Interface.menu.objects[text];
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/*barre :
|
||||
{
|
||||
objects : {},
|
||||
|
||||
add : function(text,funct)
|
||||
{
|
||||
Interface.menu.objects[text] = {};
|
||||
Interface.menu.objects[text].object = create('li',Interface.dom.menu);
|
||||
Interface.menu.objects[text].object.innerHTML = text;
|
||||
Interface.menu.objects[text].funct = funct;
|
||||
Interface.menu.objects[text].evt = Event.observe(Interface.menu.objects[text].object, 'click', funct);
|
||||
},
|
||||
|
||||
remove : function()
|
||||
{
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
planete :
|
||||
{
|
||||
objects : {},
|
||||
|
||||
add : function(name,position,img)
|
||||
{
|
||||
Interface.planete.objects[position] = {};
|
||||
Interface.planete.objects[position].name = name;
|
||||
Interface.planete.objects[position].position = position;
|
||||
Interface.planete.objects[position].object = create('img',Interface.dom.planetes);
|
||||
Interface.planete.objects[position].object.src = 'planetes/' + img + '.jpg';
|
||||
Interface.planete.objects[position].object.alt = name+ ' [' + position + ']';
|
||||
Interface.planete.objects[position].event = Event.observe(Interface.planete.objects[position].object, 'click', Interface.planete.change);
|
||||
},
|
||||
|
||||
focus : function(position)
|
||||
{
|
||||
for(var i in Interface.planete.objects)
|
||||
if(i == position)
|
||||
{
|
||||
$(Interface.planete.objects[i].object).addClassName('selected');
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
change : function()
|
||||
{
|
||||
|
||||
},
|
||||
|
||||
remove : function()
|
||||
{
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
ressources :
|
||||
{
|
||||
metal : 10000,
|
||||
cristal : 5000,
|
||||
ions : 7500,
|
||||
energie : 300,
|
||||
allEnergie: 450,
|
||||
|
||||
set : function(type,number)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
default: return false;
|
||||
|
||||
case 'metal':
|
||||
case 'cristal':
|
||||
case 'ions':
|
||||
Interface.ressources[type] = number;
|
||||
Interface.dom.ressources[type].innerHTML = number;
|
||||
break;
|
||||
|
||||
case 'energie':
|
||||
Interface.ressources[type] = number;
|
||||
Interface.dom.ressources.energie.innerHTML = number + '/' + Interface.ressources.allEnergie;
|
||||
break;
|
||||
|
||||
case 'allEnergie':
|
||||
Interface.ressources[type] = number;
|
||||
Interface.dom.ressources.energie.innerHTML = Interface.ressources.energie + '/' + number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updater : function()
|
||||
{
|
||||
|
||||
},
|
||||
|
||||
init : function()
|
||||
{
|
||||
var oldNodes = $(document.body).childElements();
|
||||
for(var i =0; i < oldNodes.length; i++) if(oldNodes[i].tagName != 'script') oldNodes[i].remove();
|
||||
|
||||
Interface.dom.deskbar = create('div',document.body,'barre');
|
||||
|
||||
Interface.dom.menu = create('ul',document.body,'menu');
|
||||
|
||||
for(var i = 0; i < Interface.menuList.length; i++) Interface.menu.add(Interface.menuList[i][0],Interface.menuList[i][1]);
|
||||
|
||||
Interface.dom.planetes = create('div',document.body,'planetes');
|
||||
|
||||
create('span',Interface.dom.planetes,0,'up');
|
||||
for(var i = 0; i < Interface.planetes.length; i++) Interface.planete.add(Interface.planetes[i].name,Interface.planetes[i].position,Interface.planetes[i].img);
|
||||
create('span',Interface.dom.planetes,0,'down');
|
||||
Interface.planete.focus(Interface.planetes[0].position);
|
||||
|
||||
Interface.dom.ressources = {};
|
||||
Interface.dom.ressources.all = create('div',document.body,'ressources');
|
||||
|
||||
var metal = create('div',Interface.dom.ressources.all);
|
||||
metal.innerHTML = 'Métal : ';
|
||||
Interface.dom.ressources.metal = create('strong',metal,'metal');
|
||||
Interface.dom.ressources.metal.innerHTML = Interface.ressources.metal;
|
||||
|
||||
var cristal = create('div',Interface.dom.ressources.all);
|
||||
cristal.innerHTML = 'Cristal : ';
|
||||
Interface.dom.ressources.cristal = create('strong',cristal,'metal');
|
||||
Interface.dom.ressources.cristal.innerHTML = Interface.ressources.cristal;
|
||||
|
||||
var ions = create('div',Interface.dom.ressources.all);
|
||||
ions.innerHTML = 'Métal : ';
|
||||
Interface.dom.ressources.ions = create('strong',ions,'metal');
|
||||
Interface.dom.ressources.ions.innerHTML = Interface.ressources.ions;
|
||||
|
||||
var energie = create('div',Interface.dom.ressources.all);
|
||||
energie.innerHTML = 'Métal : ';
|
||||
Interface.dom.ressources.energie = create('strong',energie,'metal');
|
||||
Interface.dom.ressources.energie.innerHTML = Interface.ressources.energie + '/' + Interface.ressources.allEnergie;
|
||||
|
||||
|
||||
desc = new Ajax.Request('descriptions.xml',{onSuccess: function(xhr)
|
||||
{
|
||||
batiments = xhr.responseXML.getElementsByTagName('batiment');
|
||||
for(var i = 0; i < batiments.length; i++)
|
||||
{
|
||||
Interface.descriptions.batiments[batiments[i].getAttribute('id')] = {name: batiments[i].getAttribute('name'),value:batiments[i].text || batiments[i].textContent};
|
||||
var img = create('img');
|
||||
img.src = 'images/batiments/' + batiments[i].getAttribute('img');
|
||||
img.alt = batiments[i].getAttribute('name');
|
||||
Interface.descriptions.batiments[batiments[i].getAttribute('id')].img = img;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*console :
|
||||
{
|
||||
active : true,
|
||||
|
||||
print : function(message)
|
||||
{
|
||||
//if(!Interface.console.active) return false;
|
||||
Interface.dom.console.innerHTHML += message + '<br />';
|
||||
},
|
||||
|
||||
flush : function()
|
||||
{
|
||||
if(!Interface.console.active) return false;
|
||||
Interface.dom.console.innerHTHML = '';
|
||||
return true;
|
||||
}
|
||||
},*/
|
||||
|
||||
batiments :
|
||||
{
|
||||
initialized : false,
|
||||
|
||||
window : null,
|
||||
|
||||
init : function()
|
||||
{
|
||||
if(Interface.batiments.initialized) return false;
|
||||
|
||||
Interface.batiments.initialized = true;
|
||||
|
||||
var batiments = Interface.descriptions.batiments;
|
||||
|
||||
if(typeof Interface.dom.batiment == 'undefined') Interface.dom.batiment = {};
|
||||
var dom = Interface.dom.batiment;
|
||||
|
||||
dom.all = create('div');
|
||||
dom.all.style.height = '100%';
|
||||
dom.left = create('dl',dom.all,0,'menu');
|
||||
dom.dt = create('dt',dom.left);
|
||||
dom.dt.innerHTML = 'Batiments';
|
||||
|
||||
dom.right = create('div',dom.all,0,'description');
|
||||
dom.titre = create('h4',dom.right);
|
||||
dom.titre.innerHTML = batiments[1].name;
|
||||
dom.img = dom.right.appendChild(batiments[1].img.cloneNode(true));
|
||||
dom.p = create('p',dom.right);
|
||||
dom.p.innerHTML = batiments[1].value;
|
||||
dom.button = create('button',dom.right);
|
||||
dom.button.innerHTML = 'Construire';
|
||||
dom.button.onclick = function() { alert('Construction!') };
|
||||
|
||||
Event.observe(dom.img,'click',function(){Interface.info('batiments',1)});
|
||||
|
||||
var change = function()
|
||||
{
|
||||
var dom = Interface.dom.batiment;
|
||||
var dd = dom.dd[this.i];
|
||||
var dds = dd.parentNode.childNodes;
|
||||
|
||||
for(var j = 1; j < dds.length; j++)
|
||||
{
|
||||
Element.removeClassName(dds[j],'selected');
|
||||
}
|
||||
|
||||
Element.addClassName(dd,'selected');
|
||||
|
||||
dom.titre.innerHTML = batiments[this.i].name;
|
||||
|
||||
var newimg = batiments[this.i].img.cloneNode(true);
|
||||
dom.right.replaceChild(newimg,dom.img);
|
||||
dom.img = newimg;
|
||||
|
||||
var i = this.i;
|
||||
Event.observe(dom.img,'click',function(){Interface.info('batiments',i)});
|
||||
|
||||
dom.p.innerHTML = batiments[this.i].value;
|
||||
};
|
||||
|
||||
dom.dd = [];
|
||||
|
||||
for(var i = 1; i < batiments.length; i++)
|
||||
{
|
||||
dom.dd[i] = create('dd',dom.left);
|
||||
dom.dd[i].innerHTML = batiments[i].name;
|
||||
if(i == 1) Element.addClassName(dom.dd[i],'selected');
|
||||
|
||||
Event.observe(dom.dd[i],'click',change.bindAsEventListener({i:i}));
|
||||
}
|
||||
|
||||
Interface.batiments.window = new Interface.window('batiments','Batiments',dom.all);
|
||||
}
|
||||
},
|
||||
|
||||
info : function(groupe,id)
|
||||
{
|
||||
if(typeof Interface.descriptions[groupe][id] == 'undefined') return false;
|
||||
|
||||
var description = Interface.descriptions[groupe][id];
|
||||
|
||||
var container = create('div',0,0,'info');
|
||||
var title = create('h5',container);
|
||||
title.innerHTML = description.name;
|
||||
container.appendChild(description.img.cloneNode(true));
|
||||
var preview = create('p',container);
|
||||
preview.innerHTML = description.value;
|
||||
|
||||
if(typeof Interface.dom.info == 'object')
|
||||
{
|
||||
Interface.dom.info.title(description.name);
|
||||
Interface.dom.info.content(container);
|
||||
Interface.dom.info.focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
Interface.dom.info = new Interface.window('description',description.name,container);
|
||||
Interface.dom.info.closeCallback = function() {Interface.dom.info = false;};
|
||||
}
|
||||
},
|
||||
|
||||
notification : function(text)
|
||||
{
|
||||
if(typeof Interface.dom.notification == 'object') return false;
|
||||
|
||||
Interface.dom.notification = create('p',document.body,'notification');
|
||||
Interface.dom.notification.innerHTML = text;
|
||||
|
||||
Effect.move(Interface.dom.notification,'bottom',-110,35,2000);
|
||||
setTimeout(function() {Effect.move(Interface.dom.notification,'bottom',35,-110,2000);},7000);
|
||||
setTimeout(function() {Element.remove(Interface.dom.notification); Interface.dom.notification = false;},10010);
|
||||
},
|
||||
|
||||
dialog : function(text,callback)
|
||||
{
|
||||
if(typeof Interface.dom.dialog == 'object') return false;
|
||||
|
||||
Interface.dom.darkness = create('div',document.body,'darkness');
|
||||
Effect.animate(Interface.dom.darkness,{opacity: [0,80]},500);
|
||||
|
||||
Interface.dom.dialog = create('div',document.body,'dialog');
|
||||
|
||||
var p = create('p',Interface.dom.dialog);
|
||||
p.innerHTML = text;
|
||||
|
||||
var ok = create('button',Interface.dom.dialog);
|
||||
ok.innerHTML = 'ok';
|
||||
|
||||
var cancel = create('button',Interface.dom.dialog);
|
||||
cancel.innerHTML = 'Annuler';
|
||||
|
||||
var quit = create('span',Interface.dom.dialog,0,'quit');
|
||||
var close = function()
|
||||
{
|
||||
Element.remove(Interface.dom.dialog);
|
||||
Element.remove(Interface.dom.darkness);
|
||||
|
||||
Interface.dom.dialog = false;
|
||||
Interface.dom.darkness = false;
|
||||
};
|
||||
|
||||
Event.observe(quit,'click',close);
|
||||
Event.observe(cancel,'click',close);
|
||||
Event.observe(ok,'click',close);
|
||||
Event.observe(ok,'click',callback);
|
||||
}
|
||||
}
|
||||
|
||||
Interface.window = Class.create({
|
||||
initialize : function(id,title,content)
|
||||
{
|
||||
if(!(id && title && content)) return false;
|
||||
this.id = id;
|
||||
this.titre = title;
|
||||
this.dom = {};
|
||||
|
||||
this.load(title,content);
|
||||
this.focus();
|
||||
},
|
||||
|
||||
load : function(title,content)
|
||||
{
|
||||
if(this.dom.win || Interface.dom.windows[this.id]) return false;
|
||||
|
||||
var title = title || this.titre;
|
||||
var content = content || this.dom.content;
|
||||
|
||||
this.dom.deskbar = create('div',Interface.dom.deskbar);
|
||||
this.dom.deskbar.innerHTML = title;
|
||||
Event.observe(this.dom.deskbar,'click',this.focus.bindAsEventListener(this));
|
||||
|
||||
this.dom.win = create('div',document.body,'window_'+this.id,'window');
|
||||
|
||||
this.dom.win.style.top = (this.dom.win.offsetTop + Math.round(Math.random()*30 -10)) + 'px';
|
||||
this.dom.win.style.left = (this.dom.win.offsetLeft + Math.round(Math.random()*30 -10)) + 'px';
|
||||
|
||||
this.dom.win.style.zIndex = 10;
|
||||
|
||||
this.dom.top = create('div',this.dom.win,0,'top');
|
||||
|
||||
this.dom.topleft = create('span',this.dom.top,0,'topleft');
|
||||
|
||||
this.dom.topcenter = create('span',this.dom.top,0,'topcenter');
|
||||
|
||||
this.dom.topright = create('span',this.dom.top,0,'topright');
|
||||
|
||||
this.dom.barre = create('div',this.dom.win,0,'barre');
|
||||
Event.observe(this.dom.win, 'mousedown', this.focus.bindAsEventListener(this));
|
||||
Event.observe(this.dom.barre, 'mousedown', this.move.mouseDown.bindAsEventListener(this));
|
||||
|
||||
this.dom.titre = create('span',this.dom.barre,0,'titre');
|
||||
|
||||
this.dom.button = create('div',this.dom.barre,0,'button');
|
||||
|
||||
this.dom.hide = create('span',this.dom.button,0,'hide');
|
||||
Event.observe(this.dom.hide, 'click', this.hide.bindAsEventListener(this));
|
||||
|
||||
this.dom.full = create('span',this.dom.button,0,'full');
|
||||
Event.observe(this.dom.full, 'click', this.full.bindAsEventListener(this));
|
||||
|
||||
this.dom.close = create('span',this.dom.button,0,'close');
|
||||
Event.observe(this.dom.close, 'click', this.close.bindAsEventListener(this));
|
||||
|
||||
this.dom.content = create('div',this.dom.win,0,'content');
|
||||
|
||||
this.dom.bottom = create('div',this.dom.win,0,'bottom');
|
||||
|
||||
this.dom.bottomleft = create('span',this.dom.bottom,0,'bottomleft');
|
||||
|
||||
this.dom.bottomcenter = create('span',this.dom.bottom,0,'bottomcenter');
|
||||
|
||||
this.dom.bottomright = create('span',this.dom.bottom,0,'bottomright');
|
||||
|
||||
Event.observe(this.dom.bottomright, 'mousedown', this.resize.mouseDown.bindAsEventListener(this));
|
||||
|
||||
this.x = this.dom.win.offsetLeft;
|
||||
|
||||
this.y = this.dom.win.offsetTop;
|
||||
|
||||
this.h = this.dom.win.offsetHeight;
|
||||
|
||||
this.w = this.dom.win.offsetWidth;
|
||||
|
||||
this.position = false;
|
||||
|
||||
this.movePosition = false;
|
||||
|
||||
Interface.dom.windows[this.id] = this.dom;
|
||||
|
||||
//for(var i in this.dom) this.dom[i].windowId = this.id;
|
||||
|
||||
if(typeof(content) == 'object') this.dom.content.appendChild(content);
|
||||
else if(typeof(content) == 'string') this.dom.content.innerHTML = content;
|
||||
|
||||
this.dom.titre.innerHTML = title;
|
||||
},
|
||||
|
||||
focus : function()
|
||||
{
|
||||
this.dom.win.style.display = '';
|
||||
|
||||
var z = Number(this.dom.win.style.zIndex);
|
||||
|
||||
for(var i in Interface.dom.windows)
|
||||
{
|
||||
if(Interface.dom.windows[i]) z = z > Number(Interface.dom.windows[i].win.style.zIndex) ? z : Number(Interface.dom.windows[i].win.style.zIndex);
|
||||
}
|
||||
|
||||
this.dom.win.style.zIndex = z+1;
|
||||
},
|
||||
|
||||
hide : function()
|
||||
{
|
||||
this.dom.win.style.display = 'none';
|
||||
},
|
||||
|
||||
full : function()
|
||||
{
|
||||
if(this.position)
|
||||
{
|
||||
this.dom.win.style.left = this.position.left+'px';
|
||||
this.dom.win.style.top = this.position.top+'px';
|
||||
this.dom.win.style.width = this.position.width+'px';
|
||||
this.dom.win.style.height = this.position.height+'px';
|
||||
|
||||
this.position = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.position = {left : this.dom.win.offsetLeft, top: this.dom.win.offsetTop, width: this.dom.win.offsetWidth, height: this.dom.win.offsetHeight};
|
||||
|
||||
this.dom.win.style.top = '0';
|
||||
this.dom.win.style.left = '0';
|
||||
this.dom.win.style.width = '100%';
|
||||
this.dom.win.style.height = (document.documentElement.offsetHeight - this.dom.barre.offsetHeight - 49) + 'px';
|
||||
}
|
||||
this.focus();
|
||||
},
|
||||
|
||||
close : function()
|
||||
{
|
||||
if(typeof this.closeCallback == 'function') this.closeCallback();
|
||||
this.dom.deskbar.remove();
|
||||
this.dom.win.remove();
|
||||
delete this.dom;
|
||||
this.dom = false;
|
||||
Interface.dom.windows[this.id] = false;
|
||||
return true;
|
||||
},
|
||||
|
||||
resize :
|
||||
{
|
||||
mouseDown : function(event)
|
||||
{
|
||||
Interface.mouseFocus = this.dom;
|
||||
|
||||
Interface.mouseFocus.resizePosition = [Interface.mouseFocus.win.offsetLeft,
|
||||
Interface.mouseFocus.win.offsetTop];
|
||||
|
||||
Interface.dom.resize = create('div',document.body,'resize');
|
||||
|
||||
Interface.dom.resize.style.left = Interface.mouseFocus.win.offsetLeft + 'px';
|
||||
Interface.dom.resize.style.top = Interface.mouseFocus.win.offsetTop + 'px';
|
||||
Interface.dom.resize.style.width = (Event.pointerX(event) - Interface.mouseFocus.win.offsetLeft) + 'px';
|
||||
Interface.dom.resize.style.height = (Event.pointerY(event) - Interface.mouseFocus.win.offsetTop) + 'px';
|
||||
|
||||
Event.observe(document.body, 'mousemove',Interface.window.prototype.resize.mouseMove);
|
||||
Event.observe(document.body, 'mouseup', Interface.window.prototype.resize.mouseUp);
|
||||
},
|
||||
|
||||
mouseMove : function(event)
|
||||
{
|
||||
|
||||
var w = Event.pointerX(event) - Interface.mouseFocus.resizePosition[0];
|
||||
var h = Event.pointerY(event) - Interface.mouseFocus.resizePosition[1];
|
||||
Interface.dom.resize.style.width = (w > 0 ? w : 0) + 'px';
|
||||
Interface.dom.resize.style.height = (h > 0 ? h : 0) + 'px';
|
||||
},
|
||||
|
||||
mouseUp : function(event)
|
||||
{
|
||||
Interface.mouseFocus.win.style.width = (Event.pointerX(event) - Interface.mouseFocus.resizePosition[0] + 2) + 'px';
|
||||
Interface.mouseFocus.win.style.height = (Event.pointerY(event) - Interface.mouseFocus.resizePosition[1] - 51) + 'px';
|
||||
|
||||
Element.remove(Interface.dom.resize);
|
||||
|
||||
Interface.mouseFocus.resizePosition = false;
|
||||
Interface.mouseFocus = false;
|
||||
|
||||
Event.stopObserving(document.body,'mousemove',Interface.window.prototype.resize.mouseMove);
|
||||
Event.stopObserving(document.body,'mouseup',Interface.window.prototype.resize.mouseUp);
|
||||
}
|
||||
},
|
||||
|
||||
move :
|
||||
{
|
||||
mouseDown : function(event)
|
||||
{
|
||||
if(Event.element(event).parentNode == this.dom.button) return false;
|
||||
|
||||
Interface.mouseFocus = this.dom;
|
||||
|
||||
Effect.opacity(Interface.mouseFocus.win,60);
|
||||
|
||||
Interface.mouseFocus.movePosition = [Event.pointerX(event) - Interface.mouseFocus.win.offsetLeft,Event.pointerY(event) - Interface.mouseFocus.win.offsetTop];
|
||||
|
||||
Event.observe(document.body, 'mousemove',Interface.window.prototype.move.mouseMove);
|
||||
Event.observe(document.body, 'mouseup', Interface.window.prototype.move.mouseUp);
|
||||
},
|
||||
|
||||
mouseMove : function(event)
|
||||
{
|
||||
|
||||
var x = Event.pointerX(event) - Interface.mouseFocus.movePosition[0];
|
||||
var y = Event.pointerY(event) - Interface.mouseFocus.movePosition[1];
|
||||
Interface.mouseFocus.win.style.left = (x > 0 ? x : 0) + 'px';
|
||||
Interface.mouseFocus.win.style.top = (y > 0 ? y : 0) + 'px';
|
||||
},
|
||||
|
||||
mouseUp : function(event)
|
||||
{
|
||||
Effect.opacity(Interface.mouseFocus.win,100);
|
||||
Interface.mouseFocus.movePosition = false;
|
||||
Interface.mouseFocus = false;
|
||||
Event.stopObserving(document.body,'mousemove',Interface.window.prototype.move.mouseMove);
|
||||
Event.stopObserving(document.body,'mouseup',Interface.window.prototype.move.mouseUp);
|
||||
},
|
||||
|
||||
to : function(object,x,y)
|
||||
{
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
title : function(title)
|
||||
{
|
||||
if(typeof title != 'string') return this.titre;
|
||||
|
||||
var old = this.title;
|
||||
|
||||
this.titre = title;
|
||||
this.dom.titre.innerHTML = title;
|
||||
|
||||
return old;
|
||||
},
|
||||
|
||||
content : function(content)
|
||||
{
|
||||
var old = this.dom.content.cloneNode(true);
|
||||
|
||||
if(typeof(content) == 'object') { Element.remove(this.dom.content.firstChild); this.dom.content.appendChild(content); }
|
||||
else if(typeof(content) == 'string') this.dom.content.innerHTML = content ;
|
||||
else return this.dom.content;
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Interface.menuList = [['Hello World',helloWorld],
|
||||
['Batiments',Interface.batiments.init],
|
||||
['Doubler',doubler],
|
||||
//['Background',background],
|
||||
['Notification',notif],
|
||||
['Dialog',dialog]];
|
||||
|
||||
|
||||
|
||||
function dialog()
|
||||
{
|
||||
Interface.dialog('WTF??',function(){alert(':P')});
|
||||
}
|
||||
|
||||
function background()
|
||||
{
|
||||
if($('background')) return false;
|
||||
bg = create('div',document.body,'background');
|
||||
bg2 = create('div',bg,0,'content');
|
||||
}
|
||||
|
||||
function doubler()
|
||||
{
|
||||
Interface.ressources.set('metal',Interface.ressources.metal*2);
|
||||
Interface.ressources.set('cristal',Interface.ressources.cristal*2);
|
||||
Interface.ressources.set('ions',Interface.ressources.ions*2);
|
||||
Interface.ressources.set('energie',Interface.ressources.energie*2);
|
||||
Interface.ressources.set('allEnergie',Interface.ressources.allEnergie*2);
|
||||
}
|
||||
|
||||
function notif()
|
||||
{
|
||||
Interface.notification('test! :P');
|
||||
}
|
||||
|
||||
function helloWorld()
|
||||
{
|
||||
hw = new Interface.window('helloWorld','Hello World','Hello World!');
|
||||
}
|
||||
|
||||
Interface.init();
|
||||
10
htdocs/n3p7bLn59Yco3d/js/load.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function include(fichier)
|
||||
{
|
||||
var script = document.createElement('script');
|
||||
script.setAttribute('src',fichier);
|
||||
script.setAttribute('type','application/javascript');
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
include('js/prototype.js');
|
||||
include('js/api.js');
|
||||
4320
htdocs/n3p7bLn59Yco3d/js/prototype.js
vendored
Normal file
BIN
htdocs/n3p7bLn59Yco3d/planetes/1.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/10.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/11.jpg
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/12.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/13.jpg
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/14.jpg
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/15.jpg
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/2.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/3.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/4.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/5.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/6.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/7.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/8.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
htdocs/n3p7bLn59Yco3d/planetes/9.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |