Browse Source

complete update and integration of fruits

Kajetan Johannes Hammerle 3 years ago
parent
commit
1955f50e09

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+web/db_data.php
+.well-known

+ 98 - 9
web/brainfuck.php

@@ -1,9 +1,98 @@
-<div id="memorytable"></div>
-<textarea id="input">++++--+++>++>>++</textarea>
-<div id="outputcode"></div>
-<div id="output"></div>
-<script src="js/brainfuck.js"></script>
-<button id="start" onClick="start()" class="btn">Start</button>
-<button id="reset" onClick="reset()" class="btn">Reset</button>
-<div style="clear: both;"></div>
-<div id="delaydiv"><input type="range" min="1" max="1000" value="50" id="delay"></div>
+<div class="container">
+    <div class="textContainer">
+        Brainfuck is an esoteric programming language, consisting of only 8 
+        instructions each represented by one character. Every other character 
+        is silently ignored and can be used as comment. 
+    </div>
+
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">&gt;</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">move the active memory cell to the right</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">&lt;</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">move the active memory cell to the left</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">+</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">increase the value in the active memory cell</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">-</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">decrease the value in the active memory cell</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">.</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">print the value in the active memory cell as character</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">,</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">read one charater as input storing its value in the active memory cell (not implemented)</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">[</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">if the value of the active memory cell is 0, jump to the next ]</div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-md-auto">
+            <div class="textContainer spacer center">]</div>
+        </div>
+        <div class="col">
+            <div class="textContainer">if the value of the active memory cell is not 0, jump to the previous [</div>
+        </div>
+    </div>
+
+    <div class="brainfuckTitle">Memory Table</div>
+    <div id="memorytable"></div>
+
+    <div class="row">
+        <div class="col-lg">
+            <div class="brainfuckTitle">Input</div>
+            <textarea id="input">++++--+++>++>>++</textarea>
+        </div>
+        <div class="col-lg">
+            <div class="brainfuckTitle">Executing Code</div>
+            <div id="outputcode"></div>
+        </div>
+        <div class="col-lg">
+            <div class="brainfuckTitle">Output</div>
+            <div id="output"></div>
+        </div>
+    </div>
+
+    <script src="js/brainfuck.js"></script>
+
+    <button id="start" onClick="start()" class="btn">Start</button>
+    <button id="reset" onClick="reset()" class="btn">Reset</button>
+
+    <div style="clear: both;"></div>
+    <div id="delaydiv"><input type="range" min="1" max="1000" value="50" id="delay"></div>
+</div>

+ 74 - 15
web/css/brainfuck.css

@@ -18,27 +18,25 @@
 
 .active_cell
 {
-    background-color: #A0A0A0;
+    background-color: #909090;
 }
 
 .active_code
 {
     color: #C02020;
-    background-color: #A0A0A0;
 }
 
 #input
 {
-    margin-top: 6px;
-    
     width: 100%;
-    height: 200px;
+    height: 300px;
     resize: none;
     
+    background-color: #D0D0D0;
+    
     border-radius: 5px;
     border-style: none;
     
-    box-sizing: border-box;
     padding: 10px;
 }
 
@@ -47,16 +45,17 @@
     margin-bottom: 6px;
     
     width: 100%;
-    min-height: 100px;
-    resize: none;
+    height: 300px;
     
     color: #000000;
-    background-color: #A0A0A0;
+    background-color: #707070;
     
     border-radius: 5px;
     
     padding: 10px;
     word-wrap: break-word;
+    
+    overflow: hidden;
 }
 
 #output
@@ -64,16 +63,53 @@
     margin-bottom: 6px;
     
     width: 100%;
-    min-height: 100px;
-    resize: none;
+    height: 300px;
     
     color: #000000;
-    background-color: #A0A0A0;
+    background-color: #707070;
     
     border-radius: 5px;
     
     padding: 10px;
     word-wrap: break-word;
+    
+    overflow: hidden;
+}
+
+@media (max-width: 992px) 
+{
+    #input
+    {
+        height: 200px;
+    }
+    
+    #outputcode
+    {
+        height: 200px;
+    }
+    
+    #output
+    {
+        height: 200px;
+    }
+}
+
+@media (max-width: 768px) 
+{
+    #input
+    {
+        height: 100px;
+    }
+    
+    #outputcode
+    {
+        height: 100px;
+    }
+    
+    #output
+    {
+        height: 100px;
+    }
 }
 
 #delay
@@ -120,10 +156,11 @@
     background-color: #707070;
     width: 100%;
     padding-top: 6px;
-    padding-left: 5px;
-    padding-right: 5px;
-    padding-bottom: 5px;
+    padding-left: 10px;
+    padding-right: 10px;
+    padding-bottom: 6px;
     margin-top: 6px;
+    margin-bottom: 16px;
     border-radius: 5px;
 }
 
@@ -138,4 +175,26 @@
     margin-right: 4px;
     width: calc(50% - 2px);
     float: left;
+}
+
+.brainfuckTitle
+{
+    background-color: #602020;
+    
+    margin-top: 10px;
+    margin-bottom: 10px;
+    
+    padding-top: 8px;
+    padding-bottom: 8px;
+    
+    text-align: center;
+    
+    color: #FFFFFF;
+    
+    border-radius: 5px;
+    border-width: 2px;
+    border-color: #202020;
+    border-style: solid;
+    
+    font-weight: bold;
 }

+ 21 - 18
web/css/snuviscript.css

@@ -1,4 +1,4 @@
-table
+#snuviscript table
 {
     margin-top: 10px;
     margin-bottom: 10px;
@@ -9,13 +9,13 @@ table
 
 .bold
 {
-    font-weight: bold;
+    font-weight: bold !important;
     text-align: right;
 }
 
 .command
 {
-    font-weight: bold;
+    font-weight: bold !important;
     width: 30%;
     text-align: left;
     color: #D0D0D0;
@@ -23,12 +23,12 @@ table
 
 .desc
 {
-    font-weight: bold;
+    font-weight: bold !important;
     text-align: left;
     color: #D0D0D0;
 }
 
-table, th, td
+#snuviscript table, #snuviscript th, #snuviscript td
 {
     border-width: 2px;
     border-color: #202020;
@@ -37,13 +37,13 @@ table, th, td
     font-weight: normal;
 }
 
-td
+#snuviscript td
 {
     background-color: #707070;
     padding: 5px;
 }
 
-th
+#snuviscript th
 {
     background-color: #505050;
     padding: 5px;
@@ -62,13 +62,13 @@ th
     border-style: solid;	
 }
 
-table a
+#snuviscript table a
 {
     text-decoration: none;
     color: #801010;
 }
 
-table a:hover
+#snuviscript table a:hover
 {
     color: #700000;
 }
@@ -78,12 +78,15 @@ table a:hover
     color: #FFFFFF;
     text-decoration: none;
     display: inline-block;
-    
-    padding-right: 6px;
-    margin-right: 6px;
-    
-    border-right-width: 2px;
-    border-right-color: #000000;
+}
+
+.whitePipe
+{
+    padding-right: 8px;
+    margin-right: 8px;
+
+    border-right-width: 1px;
+    border-right-color: #FFFFFF;
     border-right-style: solid;
 }
 
@@ -92,7 +95,7 @@ table a:hover
     color: #CCCCCC;
 }
 
-.title
+.snuviTitle
 {
     background-color: #602020;
 
@@ -110,7 +113,7 @@ table a:hover
     font-weight: bold;
 }
 
-section
+#snuviscript section
 {
     margin-bottom: 50px;   
     margin-left: auto;
@@ -126,7 +129,7 @@ section
         font-size: 14px;
     }
     
-    td, th, .menu a
+    #snuviscript td, #snuviscript th, .menu a
     {
         font-size: 12px;
     }

+ 262 - 6
web/css/style.css

@@ -9,6 +9,14 @@
 body
 {
     background-color: #303030;
+    min-height: 100%; 
+    position: relative; 
+    padding-bottom: 45px;
+}
+
+html 
+{ 
+    height: 100%; 
 }
 
 /* 
@@ -22,6 +30,10 @@ nav
     background-color: #602020;
     color: #FFFFFF;
     margin-bottom: 10px;
+
+    border-width: 2px !important;
+    border-color: #000000 !important;
+    border-style: solid !important;	
 }
 
 nav a
@@ -75,6 +87,19 @@ nav .navbar-toggler-icon
     }
 }
 
+.nav_drop
+{
+    background-color: #7C2929 !important;
+    border-width: 2px !important;
+    border-color: #000000 !important;
+    border-style: solid !important;	
+}
+
+.nav_drop_item
+{
+    background-color: #7C2929 !important;
+}
+
 /* 
 --------------------------------------------------------------------------------
 Main
@@ -89,14 +114,18 @@ main
 main button
 {
     color: #FFFFFF;
-    
+
+    margin-top: 5px;
+    margin-bottom: 5px;
     padding: 10px;
-    
+
     background-color: #602020;
-    border-color: #000000;
-    border-width: 1px;
-    border-style: solid;
-    
+
+    border-radius: 5px !important;
+    border-color: #000000 !important;
+    border-width: 2px !important;
+    border-style: solid !important;
+
     box-sizing: border-box;
 }
 
@@ -110,3 +139,230 @@ main button:focus
     background-color: #801010;
 }
 
+/* 
+--------------------------------------------------------------------------------
+fruits
+--------------------------------------------------------------------------------
+*/
+
+#fruits img
+{
+    border: 1px solid #707070;
+    width: 100%;
+    min-width: 120px;
+    max-width: 200px;
+    margin: 1px;
+    border-radius: 8px;
+}
+
+#fruits table 
+{ 
+    width: 100%; 
+    border-collapse: collapse; 
+    background-color: #707070;
+    margin-bottom: 15px;
+}
+
+#fruits tr:nth-of-type(odd) 
+{ 
+    background: #858585; 
+}
+
+#fruits th 
+{ 
+    background: #601010; 
+    color: white; 
+    font-weight: bold; 
+}
+
+#fruits td, #fruits th 
+{ 
+    padding: 12px; 
+    border: 2px solid #000000; 
+    text-align: left; 
+}
+
+@media 
+(max-width: 992px)
+{
+    #fruits table, #fruits thead, #fruits tbody, #fruits th, #fruits td, #fruits tr 
+    { 
+        display: block; 
+    }
+
+    #fruits thead tr 
+    { 
+        position: absolute;
+        top: -9999px;
+        left: -9999px;
+    }
+
+    #fruits td 
+    { 
+        border: none;
+        border-bottom: 2px solid #000000; 
+        position: relative;
+        padding-left: 40%; 
+        min-height: 50px;
+    }
+
+    #fruits td:before 
+    { 
+        position: absolute;
+        top: 6px;
+        left: 6px;
+        padding-right: 10px; 
+        white-space: nowrap;
+    }
+
+    #fruits td:nth-of-type(1):before { content: "Name(n)"; }
+    #fruits td:nth-of-type(2):before { content: "Bild"; }
+    #fruits td:nth-of-type(3):before { content: "Fundort"; }
+    #fruits td:nth-of-type(4):before { content: "Anleitung"; }
+    #fruits td:nth-of-type(5):before { content: "Geschmack"; }
+}
+
+/* 
+--------------------------------------------------------------------------------
+general stuff
+--------------------------------------------------------------------------------
+*/
+
+.textContainer
+{
+    margin-bottom: 10px;
+
+    color: #000000;
+    background-color: #707070;
+
+    border-radius: 5px;
+
+    padding-top: 8px;
+    padding-bottom: 8px;
+    padding-left: 16px;
+    padding-right: 16px;
+    word-wrap: break-word;
+}
+
+.center
+{
+    text-align: center;
+}
+
+.left
+{
+    text-align: left;
+}
+
+.spacer
+{
+    background-color: #606060;
+    padding-left: 25px;
+    padding-right: 25px;
+}
+
+.title
+{
+    background-color: #602020;
+
+    margin-top: 10px;
+    margin-bottom: 10px;
+
+    padding-top: 8px;
+    padding-bottom: 8px;
+
+    text-align: center;
+
+    color: #FFFFFF;
+
+    border-radius: 5px;
+    border-width: 2px;
+    border-color: #202020;
+    border-style: solid;
+
+    font-weight: bold;
+}
+
+/* 
+--------------------------------------------------------------------------------
+footer
+--------------------------------------------------------------------------------
+*/
+
+footer
+{
+    background-color: #602020;
+    color: #FFFFFF;
+
+    border-width: 2px !important;
+    border-color: #000000 !important;
+    border-style: solid !important;	
+
+    margin-top: 20px;
+    padding: 10px;
+    font-size: 14px;
+
+    text-align: center;
+
+    position: absolute; 
+    left: 0; 
+    right: 0; 
+    bottom: 0; 
+    height: 45px;
+}
+
+footer span
+{
+    font-size: inherit;
+}
+
+.footerPipe
+{
+    border-right-style: solid; 
+    border-right-width: 1px; 
+    border-right-color: #FFFFFF; 
+    padding-right: 10px;
+    margin-right: 2px;
+}
+
+.login
+{
+    color: #FFFFFF;
+    font-size: 14px;
+    text-decoration: none;
+}
+
+.login:hover
+{
+    color: #CCCCCC;
+    text-decoration: none;
+}
+
+.inputForm
+{
+    border-radius: 5px;
+    border-style: solid; 
+    border-width: 2px; 
+    border-color: #000000; 
+    background-color: #CCCCCC; 
+    padding: 5px;
+    width: 100%;
+}
+
+.submitForm
+{
+    border-radius: 5px;
+    border-style: solid; 
+    border-width: 2px; 
+    border-color: #000000; 
+    background-color: #601010; 
+    color: #FFFFFF;
+    padding: 5px;
+    width: 100%;
+}
+
+.inputName
+{
+    font-size: 24px;
+    font-weight: bold;
+}

+ 107 - 0
web/database.php

@@ -0,0 +1,107 @@
+<?php
+    /* 
+    CREATE TABLE users
+    (
+        username varchar(50) PRIMARY KEY,
+        password varchar(255),
+        is_admin boolean default FALSE
+    );
+    */
+    class user
+    {
+        public $username;
+        public $admin;
+        
+        public function user($username, $admin)
+        {
+            $this->username = $username;
+            $this->admin = $admin;
+        }
+    }
+
+    class databank
+    {
+        private $connected = false;
+        private $con;
+
+        public function connect()
+        {
+            if(!$this->connected)
+            {
+                require_once('db_data.php');
+                $this->con = new mysqli("localhost", "snuvi", $db_pass, "snuvi");
+                if($this->con->connect_error) 
+                {
+                    echo "no databank connection";
+                } 
+                else 
+                {
+                    $this->connected = true;
+                }                
+            }
+        }
+
+        public function disconnect()
+        {
+            if($this->connected)
+            {
+                $this->con->close();
+                $this->connected = false;
+            }
+        }
+        
+        public function isConnected()
+        {
+            return $this->connected;
+        }
+        
+        public function getUser($username, $password)
+        {
+            $sql = $this->con->prepare("SELECT * FROM users WHERE username=?");
+            if($sql == false)
+            {
+                echo $this->con->error;
+                return null;
+            }
+            $sql->bind_param('s', $username);
+            $sql->execute();
+            $result = $sql->get_result();
+            $sql->close();
+            if($result->num_rows >= 1)
+            {
+                $r = $result->fetch_object();
+                if(password_verify($password, $r->password))
+                {
+                    $user = new user($r->username, $r->is_admin);
+                    return $user;
+                }
+                return null;
+            }
+            return null;
+        }
+        
+        public function addUser($username, $password)
+        {
+            $hash = password_hash($password, PASSWORD_DEFAULT);
+            $sql = $this->con->prepare("INSERT INTO users VALUES (?, ?, false);");
+            $sql->bind_param('ss', $username, $hash);
+            $sql->execute();
+            if($sql->errno === 0) 
+            {
+                $sql->close();
+                return true;
+            } 
+            if(substr($this->con->error, 0, 15) === "Duplicate entry")
+            {
+                echo "username already exists";
+            }
+            else
+            {
+                echo $this->con->error;
+                echo "database error";
+            }
+            $sql->close();
+            return false;
+        }
+    }
+?>

+ 177 - 0
web/fruits.php

@@ -0,0 +1,177 @@
+<div id="fruits" class="container">
+    <div class="title">
+        Kajetans Früchteverzeichnis
+    </div>
+    <div class="textContainer">
+        Früchte, die wohlbekannt sind, wie z.B. Bananen, Ananas, Melonen oder Avocados finden sich hier nicht.
+        Sollte es beim Fundort nicht anders angegeben sein, ist immer das Land Österreich gemeint.
+    </div>
+
+    <table>
+        <thead>
+            <tr>
+                <th>Name(n)</th>
+                <th>Bild</th>
+                <th>Fundort</th>
+                <th>Anleitung</th>
+                <th>Geschmack</th>
+            </tr>
+        </thead>
+        <tbody>
+            <tr>
+                <td>Ananasguave, Brasilianische Guave</td>
+                <td><img src="fruits/ananasguave.jpg"></td>
+                <td>Viktualienmarkt München, Deutschland</td>
+                <td>Halbieren und auslöffeln</td>
+                <td>Kaugummi</td>
+            </tr>
+            <tr>
+                <td>Drachenfrucht, Pitahaya, Pitaya</td>
+                <td><img src="fruits/drachenfrucht.jpg"><br><img src="fruits/gelbe_drachenfrucht.jpg"></td>
+                <td>Merkur Leoben und Liezen (rot), Viktualienmarkt München, Deutschland (gelb)</td>
+                <td>halbieren und auslöffeln</td>
+                <td>wässrigere weniger intensive Kiwi</td>
+            </tr>
+            <tr>
+                <td>Goji-Beeren</td>
+                <td><img src="fruits/goji.jpg"></td>
+                <td>Merkur, Billa, Fruchtmarkt Landeck</td>
+                <td>direkt essen</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Kaki, Sharon</td>
+                <td><img src="fruits/kaki.jpg"></td>
+                <td>Interspar</td>
+                <td>direkt essen</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Kaktusfeige</td>
+                <td><img src="fruits/kaktusfeige.jpg"></td>
+                <td>Billa</td>
+                <td>nicht direkt berühren, halbieren und auslöffeln</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Mango</td>
+                <td><img src="fruits/mango.jpg"><br><img src="fruits/gelbe_mango.jpg"></td>
+                <td>Spar, Billa</td>
+                <td>schälen und beliebig Fruchtfleisch vom Kern trennen</td>
+                <td>"Spezielle Pfirsich", die gelbe Sorte scheint sehr saftig zu sein</td>
+            </tr>
+            <tr>
+                <td>Passionsfrucht, Maracuja</td>
+                <td><img src="fruits/maracuja.jpg"></td>
+                <td>Interspar Leoben</td>
+                <td>halbieren und auslöffeln</td>
+                <td>süß</td>
+            </tr>
+            <tr>
+                <td>Süße Grenadilla, Granadilla</td>
+                <td><img src="fruits/suesse_grenadilla.jpg"></td>
+                <td>Interspar Leoben</td>
+                <td>halbieren und auslöffeln</td>
+                <td>sehr süß, nicht durch Aussehen abschrecken lassen</td>
+            </tr>
+            <tr>
+                <td>Gelbe Grenadilla, Granadilla</td>
+                <td><img src="fruits/gelbe_grenadilla.jpg"></td>
+                <td>M-Preis Innsbruck</td>
+                <td>halbieren und auslöffeln</td>
+                <td>süß, nicht durch Aussehen abschrecken lassen</td>
+            </tr>
+            <tr>
+                <td>Granatapfel</td>
+                <td><img src="fruits/granatapfel.jpg"></td>
+                <td>Hofer, Interspar</td>
+                <td>halbieren und mit den Händen die Frucht zerlegen, rote Früchte von allem anderen trennen, Früchte spritzen gerne</td>
+                <td>sehr saftig, leicht säuerlich</td>
+            </tr>
+            <tr>
+                <td>Tamarillo, Baumtomate</td>
+                <td><img src="fruits/tamarillo.jpeg"></td>
+                <td>M-Preis Innsbruck</td>
+                <td>halbieren und auslöffeln, die Schale ist zäh</td>
+                <td>feste Tomate</td>
+            </tr>
+            <tr>
+                <td>Grüne Guave</td>
+                <td><img src="fruits/guave.jpg"></td>
+                <td>Viktualienmarkt München, Deutschland</td>
+                <td>halbieren und auslöffeln</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Papaya</td>
+                <td><img src="fruits/papaya.jpg"></td>
+                <td>Spar</td>
+                <td>halbieren und auslöffeln, Kerne nicht essen</td>
+                <td>intensive Walnuss</td>
+            </tr>
+            <tr>
+                <td>Pepino, Melonenbirne</td>
+                <td><img src="fruits/pepino.jpg"></td>
+                <td>M-Preis Innsbruck</td>
+                <td>halbieren und auslöffeln, die Schale ist zäh</td>
+                <td>wässrig, schwache Birne, Gurke / Melone</td>
+            </tr>
+            <tr>
+                <td>Pomelo</td>
+                <td><img src="fruits/pomelo.jpg"></td>
+                <td>Merkur Leoben</td>
+                <td>schälen und Fruchtfleisch essen</td>
+                <td>leicht bitter, eher nicht süß, ähnlich zur Grapefruit</td>
+            </tr>
+            <tr>
+                <td>Kiwano,  Horngurke, Hornmelone</td>
+                <td><img src="fruits/kiwano.jpg"></td>
+                <td>Interspar Leoben</td>
+                <td>halbieren und auslöffeln</td>
+                <td>wässrig </td>
+            </tr>
+            <tr>
+                <td>Mangosteen, Mangostane</td>
+                <td><img src="fruits/mangosteen.jpg"></td>
+                <td>Interspar Leoben</td>
+                <td>Schale aufbrechen, Kern aus der Frucht entnehmen</td>
+                <td>sehr süß, sehr ähnlich zur Litschi</td>
+            </tr>
+            <tr>
+                <td>Sternfrucht, Karambole, Karambola</td>
+                <td><img src="fruits/sternfrucht.png"></td>
+                <td>Interspar Leoben</td>
+                <td>direkt essen, wird gern in Scheiben zur Deko verwendet</td>
+                <td>wässrig, schwache Gurke</td>
+            </tr>
+            <tr>
+                <td>Kumquat, Zwergorangen, Zwergpomeranzen</td>
+                <td><img src="fruits/kumquat.jpg"></td>
+                <td>Früchtemarkt Landeck, Interspar Leoben</td>
+                <td>direkt essen</td>
+                <td>bittere Orange</td>
+            </tr>
+            <tr>
+                <td>Physalis</td>
+                <td><img src="fruits/physalis.jpg"></td>
+                <td>Spar, Billa</td>
+                <td>direkt essen</td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Litschi</td>
+                <td><img src="fruits/litschi.jpg"></td>
+                <td>Hofer, in diversen Geschäften als Kompott</td>
+                <td>Schale knacken, Kern aus der Frucht entnehmen</td>
+                <td>süß</td>
+            </tr>
+            <tr>
+                <td>Rambutan</td>
+                <td><img src="fruits/rambutan.jpg"></td>
+                <td>Viktualienmarkt München, Deutschland</td>
+                <td>Schale knacken, Kern aus der Frucht entnehmen</td>
+                <td>süß, sehr ähnlich zur Litschi</td>
+            </tr>
+        </tbody>
+    </table>
+</div>

BIN
web/fruits/ananasguave.jpg


BIN
web/fruits/drachenfrucht.jpg


BIN
web/fruits/gelbe_drachenfrucht.jpg


BIN
web/fruits/gelbe_grenadilla.jpg


BIN
web/fruits/gelbe_mango.jpg


BIN
web/fruits/goji.jpg


BIN
web/fruits/granatapfel.jpg


BIN
web/fruits/guave.jpg


BIN
web/fruits/kaki.jpg


BIN
web/fruits/kaktusfeige.jpg


BIN
web/fruits/kiwano.jpg


BIN
web/fruits/kumquat.jpg


BIN
web/fruits/litschi.jpg


BIN
web/fruits/mango.jpg


BIN
web/fruits/mangosteen.jpg


BIN
web/fruits/maracuja.jpg


BIN
web/fruits/papaya.jpg


BIN
web/fruits/pepino.jpg


BIN
web/fruits/physalis.jpg


BIN
web/fruits/pomelo.jpg


BIN
web/fruits/rambutan.jpg


BIN
web/fruits/sternfrucht.png


BIN
web/fruits/suesse_grenadilla.jpg


BIN
web/fruits/tamarillo.jpeg


+ 46 - 0
web/home.php

@@ -0,0 +1,46 @@
+<div class="container">
+    <div class="textContainer">
+        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
+        eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
+        voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet 
+        clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit 
+        amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
+        nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 
+        sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
+        Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor 
+        sit amet.
+    </div>
+    <div class="textContainer">
+        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
+        eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
+        voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet 
+        clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit 
+        amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
+        nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 
+        sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
+        Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor 
+        sit amet.
+    </div>
+    <div class="textContainer">
+        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
+        eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
+        voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet 
+        clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit 
+        amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
+        nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 
+        sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
+        Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor 
+        sit amet.
+    </div>
+    <div class="textContainer">
+        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
+        eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
+        voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet 
+        clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit 
+        amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
+        nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, 
+        sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
+        Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor 
+        sit amet.
+    </div>
+</div>

+ 91 - 21
web/index.php

@@ -1,54 +1,124 @@
+<?php
+    if(session_status() == PHP_SESSION_NONE) 
+    {
+        session_start();
+    }
+?>
+
 <!DOCTYPE html>
 <html lang="en">
     <head>
         <meta charset="utf-8">
-        <title>Kajetans Interpreter</title>
+        <title>Kajetans Stuff</title>
 
         <link rel="icon" href="favicon.png">
         <meta name="viewport" content="width=device-width, maximum-scale=1.0"/>
-        
+
         <link href="css/bootstrap.min.css" rel="stylesheet">
         <link href="css/style.css" rel="stylesheet">
         <link href="css/snuviscript.css" rel="stylesheet">
         <link href="css/brainfuck.css" rel="stylesheet">
-        
+
         <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
         <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
         <script src="js/bootstrap.min.js"></script>
     </head>
     <body id="body">
         <nav id="navbar" class="navbar navbar-expand-md">
-            <a class="navbar-brand" href="#">Kajetans Interpreter</a>
+            <div class="navbar-brand">Kajetans Stuff</div>
             <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bar" aria-controls="bar" aria-expanded="false" aria-label="Toggle navigation">
                 <span class="navbar-toggler-icon"></span>
             </button>
             <div class="collapse navbar-collapse" id="bar">
                 <ul class="navbar-nav ml-auto">
                     <li class="nav-item"><a class="nav-link" href="index.php?section=home">Home</a></li>
-                    <li class="nav-item"><a class="nav-link" href="index.php?section=snuviscript">SnuviScript</a></li>
+                    <li class='nav-item dropdown'>
+                        <a class='nav-link dropdown-toggle' href='#' id='snuvi_dropdown' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
+                            SnuviScript
+                        </a>
+                        <div class='dropdown-menu nav_drop' aria-labelledby='snuvi_dropdown'>
+                            <a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_core'>Core</a>
+                            <a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_supersnuvi'>Super Snuvi</a>
+                            <?php
+                                //if(isset($_SESSION["user"]))
+                                //{
+                                    echo "<a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_minecraft'>Minecraft</a>";
+                                //}
+                            ?>
+                        </div>
+                    </li>
+                    <?php
+                        /*if(isset($_SESSION["user"]))
+                        {
+                            echo "<li class='nav-item dropdown'>";
+                            echo "<a class='nav-link dropdown-toggle' href='#' id='coding_dropdown' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>";
+                            echo "Coding";
+                            echo "</a>";
+                            echo "<div class='dropdown-menu nav_drop' aria-labelledby='coding_dropdown'>";
+                            echo "<a class='dropdown-item nav_drop_item' href='index.php?section=snuvi_git'>Snuvi Git</a>";
+                            echo "</div>";
+                            echo "</li>";
+                        }*/
+                    ?>
                     <li class="nav-item"><a class="nav-link" href="index.php?section=brainfuck">Brainfuck</a></li>
+                    <li class="nav-item"><a class="nav-link" href="index.php?section=fruits">Fruits</a></li>
                 </ul>
             </div>
         </nav>    
         <main class="container">
-            <?php  
-                if(isset($_GET["section"]))
+            <?php
+            if(isset($_GET["section"])) 
+            {
+                switch ($_GET["section"]) 
                 {
-                    switch($_GET["section"])
-                    {
-                        case "snuviscript":
-                            include "snuviscript.php";
-                            break;
-                        case "brainfuck":
-                            include "brainfuck.php";
-                            break;
-                        case "home":
-                        default:
-                            include "home.php";
-                            break;
-                    }
+                    case "snuvi_core":
+                        include "snuvi_core.php";
+                        break;
+                    case "snuvi_minecraft":
+                        include "snuvi_minecraft.php";
+                        break;
+                    case "snuvi_supersnuvi":
+                        include "snuvi_supersnuvi.php";
+                        break;
+                    //case "snuvi_git":
+                    //    include "snuvi_git.php";
+                    //    break;
+                    case "brainfuck":
+                        include "brainfuck.php";
+                        break;
+                    case "login":
+                        include "login.php";
+                        break;
+                    case "logout":
+                        include "logout.php";
+                        break;
+                    case "fruits":
+                        include "fruits.php";
+                        break;
+                    case "home":
+                    default:
+                        include "home.php";
+                        break;
                 }
+            }
+            else
+            {
+                include "home.php";
+            }
             ?>
         </main>
+        <footer>
+            <span class="footerPipe">Made by Kajetan</span>
+            <?php
+                if(isset($_SESSION["user"])) 
+                {
+                    echo "<a class='login' href='index.php?section=logout'>Logout</a>";
+                }
+                else
+                {
+                    echo "<a class='login' href='index.php?section=login'>Login</a>";
+                }
+            ?>
+        </footer>
     </body>
-</html>
+</html>

+ 6 - 1
web/js/brainfuck.js

@@ -50,7 +50,12 @@ function start()
         stopRunning = true;
         return;
     }
-    document.getElementById("start").innerHTML = "Pause";
+    var length = document.getElementById("input").value.length;
+    if(currentCodePos >= length && length !== 0)
+    {
+        reset();
+    }
+    document.getElementById("start").innerHTML = "Halt";
     running = true;
     setTimeout(execute, 200);
 }

+ 7 - 3
web/js/snuviscript.js

@@ -1,12 +1,16 @@
 var sections = document.getElementsByTagName("section");
 var menuHTML = "<div class='menu'>";
-for(var i = 0; i < sections.length; i++)
+for(var i = 0; i < sections.length - 1; i++)
+{
+    menuHTML += "<a href='#" + sections[i].id + "'><span class='whitePipe'>" + sections[i].id + "</span></a>";
+}
+for(var i = sections.length - 1; i < sections.length; i++)
 {
-    menuHTML += "<a href='#" + sections[i].id + "'>" + sections[i].id + "</a>";
+    menuHTML += "<a href='#" + sections[i].id + "'><span>" + sections[i].id + "</span></a>";
 }
 menuHTML += "</div>";
 
 for(var i = 0; i < sections.length; i++)
 {
-    sections[i].innerHTML = "<div class='title'>" + sections[i].id + "</div>" + menuHTML + sections[i].innerHTML;
+    sections[i].innerHTML = "<div class='snuviTitle'>" + sections[i].id + "</div>" + menuHTML + sections[i].innerHTML;
 }

+ 68 - 0
web/login.php

@@ -0,0 +1,68 @@
+<div class="container">
+    <div class="textContainer">
+        <p>
+            You probably do not want to log in here. You cannot create any 
+            account here, an admin must do this for you. There is not really 
+            much to see either.
+        </p>
+        <p>
+            Anyway here is the login form.
+        </p>
+        
+        <form action="index.php?section=login" method="POST">
+            <p>
+                <div class="inputName">username</div>
+                <input class="inputForm" name="user">
+            </p>
+            <p>
+                <div class="inputName">password</div>
+                <input class="inputForm" name="password" type="password">
+            </p>
+            <p>
+                <input class="submitForm" type="submit" value="login">
+            </p>
+        </form>
+        
+        <?php
+            if(session_status() == PHP_SESSION_NONE) 
+            {
+                session_start();
+            }
+
+            if(isset($_POST["user"]))
+            {   
+                $username = filter_input(INPUT_POST, "user");
+                $password = filter_input(INPUT_POST, "password");
+
+                require_once('database.php');
+                $db_connection = new databank();
+                $db_connection->connect();
+                if($db_connection->isConnected()) 
+                {
+                    $user = $db_connection->getUser($username, $password);
+                    if($user != null)
+                    {
+                        $_SESSION["user"] = $user->username;
+                        if($user->admin)
+                        {
+                            $_SESSION["admin"] = true;
+                        }
+                        header("Location: index.php");
+                    }
+                    else
+                    {
+                        echo "There is no account with this credentials.";
+                    }
+                }
+                $db_connection->disconnect();
+                
+                // hash with password_hash($password, PASSWORD_DEFAULT))
+                /*if($user == "kajetan" && password_verify($password, '$2y$10$LT4rMKf81UNRlfpKdLHVVOC9IKGrZehg9qqhkJoEMjvmtyubRYtoK'))
+                {
+                    $_SESSION["user"] = user;
+                    header("Location: index.php");
+                }*/
+            }
+        ?>
+    </div>
+</div>

+ 8 - 0
web/logout.php

@@ -0,0 +1,8 @@
+<?php
+    if(session_status() == PHP_SESSION_NONE) 
+    {
+        session_start();
+    }
+    unset($_SESSION["user"]);
+    header("Location: index.php");
+?>

+ 6 - 0
web/snuvi_core.php

@@ -0,0 +1,6 @@
+<div id="snuviscript">
+<?php 
+    include "/home/minecraft/server/scripts/docu_core.php";
+?>
+</div>
+<script src="js/snuviscript.js"></script>

+ 21 - 0
web/snuvi_minecraft.php

@@ -0,0 +1,21 @@
+<?php
+
+/*if(session_status() == PHP_SESSION_NONE) 
+{
+    session_start();
+}
+
+if(!isset($_SESSION["user"]))
+{
+    include "home.php";
+    return;
+}*/
+
+?>
+
+<div id="snuviscript">
+<?php 
+    include "/home/minecraft/server/scripts/docu_minecraft.php";
+?>
+</div>
+<script src="js/snuviscript.js"></script>

+ 607 - 0
web/snuvi_supersnuvi.php

@@ -0,0 +1,607 @@
+<div id="snuviscript">
+    <section id="Event-List">
+        <table>
+            <tr>
+                <th class="command">
+                    level_reset
+                </th>
+                <th class="desc">the level is reseted either because it is loaded the first time or the hero died</th>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>the hero is already spawned and can be modified</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    tile_interact
+                </th>
+                <th class="desc">an entity interacts with an interactable tile</th>
+            </tr>
+            <tr>
+                <td class="bold">Input</td>
+                <td>
+                    entity<br>
+                    tile_x<br>
+                    tile_y
+                </td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>
+                    currently only the hero actively interacts with tiles
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    auto_tile_interact
+                </th>
+                <th class="desc">an entity automatically interacts with an interactable tile</th>
+            </tr>
+            <tr>
+                <td class="bold">Input</td>
+                <td>
+                    entity<br>
+                    tile_x<br>
+                    tile_y
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    tile_hit
+                </th>
+                <th class="desc">a head hit tile is hit by an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Input</td>
+                <td>
+                    entity<br>
+                    tile_x<br>
+                    tile_y
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity_spawn
+                </th>
+                <th class="desc">an entity is spawned</th>
+            </tr>
+            <tr>
+                <td class="bold">Input</td>
+                <td>
+                    entity
+                </td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>
+                    entity.spawn throws this event delayed
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity_despawn
+                </th>
+                <th class="desc">an entity is despawned</th>
+            </tr>
+            <tr>
+                <td class="bold">Input</td>
+                <td>
+                    entity
+                </td>
+            </tr>
+        </table>
+    </section>
+    <section id="Level">
+        <table>
+            <tr>
+                <th class="command">
+                    level.getName
+                </th>
+                <th class="desc">returns the name of the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getName()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.getWidth
+                </th>
+                <th class="desc">returns the width of the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getWidth()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.getHeight
+                </th>
+                <th class="desc">returns the height of the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getHeight()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.getLayers
+                </th>
+                <th class="desc">returns the amount of layers of the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getLayers()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.getBackgroundIndex
+                </th>
+                <th class="desc">returns the background index of the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getBackgroundIndex()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.getTile
+                </th>
+                <th class="desc">returns a tile id of a specified position in the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.getTile(layer, x, y)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.setTile
+                </th>
+                <th class="desc">sets a tile id at a specified position in the level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.setTile(layer, x, y, tile_id)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.addMessage
+                </th>
+                <th class="desc">adds a message to the level message queue</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.settile(message)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    level.finish
+                </th>
+                <th class="desc">marks the level as done and jumps back to the level navigation</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>level.finish()</td>
+            </tr>
+        </table>
+    </section>
+    <section id="Tile">
+        <table>
+            <tr>
+                <th class="command">
+                    tile.toTileCoord
+                </th>
+                <th class="desc">returns a level coordinate tranformed to a tile coordinate</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>tile.toTileCoord(level_coord)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    tile.toLevelCoord
+                </th>
+                <th class="desc">returns a tile coordinate tranformed to a level coordinate</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>tile.toLevelCoord(tile_coord)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    tile.scale
+                </th>
+                <th class="desc">returns a value scaled by the tile size factor</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>tile.scale(value)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>this allows motion to be modified independent from tile size</td>
+            </tr>
+            <tr>
+                <td class="bold">Example</td>
+                <td>entity.setMotionY(entity.getHero(), tile.scale(-40));</td>
+            </tr>
+        </table>
+    </section>
+
+    <section id="Entity">
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getHero
+                </th>
+                <th class="desc">returns the hero of a level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getHero()</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getX
+                </th>
+                <th class="desc">returns the x coordinate of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getX(entity)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getY
+                </th>
+                <th class="desc">returns the y coordinate of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getY(entity)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.teleport
+                </th>
+                <th class="desc">moves an entity to a specified position</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.teleport(entity, x, y)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getMotionX
+                </th>
+                <th class="desc">returns the motion of an entity along the x axis</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getMotionX(entity)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getMotionY
+                </th>
+                <th class="desc">returns the motion of an entity along the y axis</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getMotionY(entity)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.setMotionX
+                </th>
+                <th class="desc">sets the motion of an entity along the x axis</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.setMotionX(entity, motion_x)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.setMotionY
+                </th>
+                <th class="desc">sets the motion of an entity along the y axis</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.setMotionY(entity, motion_y)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.isHero
+                </th>
+                <th class="desc">returns true if an entity is the hero</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.isHero(entity)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getHealth
+                </th>
+                <th class="desc">returns the health of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getHealth(entity)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>health is a value between 0 and 1 including both</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.addHealth
+                </th>
+                <th class="desc">adds a value to the health of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.addHealth(entity, value)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>health will always stay within the range 0 to 1 including both</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getEnergy
+                </th>
+                <th class="desc">returns the energy of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getHealth(entity)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>energy is a value between 0 and 1 including both</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.addEnergy
+                </th>
+                <th class="desc">adds a value to the energy of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.addEnergy(entity, value)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>energy will always stay within the range 0 to 1 including both</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.spawn
+                </th>
+                <th class="desc">spawns and returns an entity or null if the entity id is invalid</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.spawn(entity_id, x, y)</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    entity.getType
+                </th>
+                <th class="desc">returns the type of an entity</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>entity.getType(entity)</td>
+            </tr>
+        </table>
+    </section>
+    <section id="Platform">
+        <table>
+            <tr>
+                <th class="command">
+                    platform.spawn
+                </th>
+                <th class="desc">spawns and returns a platform</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>platform.spawn(x, y, tile_width)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>tile_width should be greater than or equal to 2</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    platform.addMove
+                </th>
+                <th class="desc">adds move data to a platform</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>platform.addMove(platform, x, y, speedX, speedY, wait_ticks)</td>
+            </tr>
+            <tr>
+                <td class="bold">Information</td>
+                <td>
+                    a platform will loop through its move data by moving from one specified 
+                    position to the next position with the specified speed
+                </td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>
+                    speedX and speedY are taken absolute and can therefore be either negative or positive
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    platform.clear
+                </th>
+                <th class="desc">removes all move data from a platform</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>platform.clear(platform)</td>
+            </tr>
+        </table>
+    </section>
+    <section id="Lighting">
+        <table>
+            <tr>
+                <th class="command">
+                    light.setAmbient
+                </th>
+                <th class="desc">sets the ambient lighting of a level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>light.setAmbient(red, green, blue)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>red, green and blue are within the range 0 to 1 including both</td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    light.setColor
+                </th>
+                <th class="desc">sets the color of a light in a level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>light.setColor(index, red, green, blue)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>
+                    index is a value from 0 to 31<br>
+                    red, green and blue are within the range 0 to 1 including both
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    light.setPosition
+                </th>
+                <th class="desc">sets the position of a light in a level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>light.setPosition(index, x, y)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>
+                    index is a value from 0 to 31
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    light.setPositionSmooth
+                </th>
+                <th class="desc">sets the position of a light in a level and remembers the old position for interpolation</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>light.setPositionSmooth(index, x, y)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>
+                    index is a value from 0 to 31
+                </td>
+            </tr>
+        </table>
+        <table>
+            <tr>
+                <th class="command">
+                    light.setStrength
+                </th>
+                <th class="desc">sets the strength of a light in a level</th>
+            </tr>
+            <tr>
+                <td class="bold">Format</td>
+                <td>light.setStrength(index, strength)</td>
+            </tr>
+            <tr>
+                <td class="bold">Arguments</td>
+                <td>
+                    index is a value from 0 to 31<br>
+                    strength is the loose of lighting per pixel, therefore a higher value means a smaller light
+                </td>
+            </tr>
+        </table>
+    </section>
+</div>
+<script src="js/snuviscript.js"></script>

+ 0 - 4
web/snuviscript.php

@@ -1,4 +0,0 @@
-<?php 
-        include "/home/minecraft/server/scripts/docu.php";
-?>
-<script src="js/snuviscript.js"></script>