Showing 2 changed files with 39 additions and 7 deletions
+19
css/style.css
... ...
@@ -75,13 +75,32 @@ iframe {
75 75
 }
76 76
 
77 77
 
78
+#menu-btn {
79
+  position: absolute;
80
+  background-color: #5b7e96; 
81
+  border: 2px;
82
+  color: white;
83
+  padding: 4px 4px;
84
+  margin: 2px;
85
+  text-align: center;
86
+  text-decoration: none;
87
+  display: inline-block;
88
+  font-size: 16px;
89
+}
90
+
78 91
 #article-current {
79 92
   text-align: justify;
80 93
   text-justify: inter-word;
81 94
 }
95
+
82 96
 /* For mobile phones: */
83 97
 [class*="col-"] {
84 98
     width: 100%;
99
+
100
+  }
101
+@media only screen and (min-width: 500px) {
102
+    /* For phone */
103
+
85 104
 }
86 105
 @media only screen and (min-width: 600px) {
87 106
     /* For tablets: */
+20 -7
index.php
... ...
@@ -4,11 +4,11 @@ $newslist = array();
4 4
 $imagelist = array();
5 5
 $cmdlist = array();
6 6
 $content = file_get_contents("sources/news.json");
7
-$games = json_decode($content,true);
8
-foreach( $games as $game ) {
9
-  array_push($newslist, $game['name']);
10
-  array_push($imagelist, $game['image']);
11
-  array_push($cmdlist, $game['html']);
7
+$newsdetails = json_decode($content,true);
8
+foreach( $newsdetails as $news ) {
9
+  array_push($newslist, $news['name']);
10
+  array_push($imagelist, $news['image']);
11
+  array_push($cmdlist, $news['html']);
12 12
 }
13 13
 
14 14
 //Generate HTML code section for dosbox
... ...
@@ -29,7 +29,6 @@ function NewsSection($title, $game, $sourceHTML) {
29 29
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
30 30
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
31 31
     <link rel="shortcut icon" href="favicon.png">
32
-    <!-- <script type="text/javascript" src="jquery.min.js"></script> -->
33 32
     <link href="css/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
34 33
     <link rel="stylesheet" type="text/css" href="css/style.css" />
35 34
     <script>
... ...
@@ -54,6 +53,19 @@ function NewsSection($title, $game, $sourceHTML) {
54 53
     }
55 54
     getStylesheet();
56 55
     </script>
56
+    <script>
57
+    function hideMenu() {
58
+      var x = document.getElementById("menu-news");
59
+      var btn = document.getElementById("menu-btn");
60
+      if (x.style.display === "none") {
61
+        x.style.display = "block";
62
+        btn.innerHTML = '<i class="fa fa-eye-slash fa-fw"></i>';
63
+      } else {
64
+        x.style.display = "none";
65
+        btn.innerHTML = '<i class="fa fa-eye fa-fw"></i>';
66
+      }
67
+    }
68
+    </script>
57 69
     <title>News.fr</title>
58 70
   </head>
59 71
   <body>
... ...
@@ -62,7 +74,8 @@ function NewsSection($title, $game, $sourceHTML) {
62 74
     </div>
63 75
 
64 76
     <div class="row">
65
-    <div class="col-2 col-s-2 menu">
77
+    <button id="menu-btn" onclick="hideMenu()"><i class="fa fa-eye-slash fa-fw"></i></button>
78
+    <div id="menu-news" class="col-2 col-s-2 menu">
66 79
       <ul>
67 80
 <?php
68 81
   $cpt = 0;