issue-fix (#32)

Closes issues #22 & #26.

Improves #23 but does not close it yet.

Co-authored-by: fred.boniface <fred@fjla.uk>
Reviewed-on: #32
This commit is contained in:
Fred Boniface 2022-09-23 10:03:54 +00:00
parent e05ba27ac8
commit 6fd580e3f9
7 changed files with 83 additions and 58 deletions

View File

@ -14,6 +14,12 @@
<h1>Oh no! That page can't be found</h1>
<p>
If you got here from a homescreen icon on your device, you will
need to remove and re-add the button due to major upgrades to
the Athena application
</p>
<p><a class="actionbutton" href="/">Go back to the homepage</a></p>
<h3>404 - Not Found</h3>

View File

@ -1,23 +1,19 @@
function openMenu() {
document.getElementById("menu").style.display = "block";
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
function closeMenu() {
document.getElementById("menu").style.display = "none";
}
function closeAboutPopup() {
document.getElementById("popup-about").style.display = "none";
}
function openAboutPopup() {
document.getElementById("popup-about").style.display = "block";
}
function closeTiplocPopup() {
document.getElementById("popup-tiploc").style.display = "none";
}
function openTiplocPopup() {
document.getElementById("popup-tiploc").style.display = "block";
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}

View File

@ -1,7 +1,7 @@
{
"name": "Athena",
"short_name": "Athena",
"start_url": "/index.html",
"start_url": "/",
"scope": "/",
"display": "standalone",
"background_color": "#7fa7e6",

View File

@ -8,3 +8,5 @@ echo '<meta name="author" content="Frederick Boniface">';
echo '<link rel="stylesheet" type="text/css" href="/styles/style.css"/>';
echo '<link rel="icon" type="image/png" href="/assets/icons/favicon.ico"/>';
echo '<link rel="manifest" type="application/json" href="/manifest.json"/>';
echo '<script src="/js/nav.js"></script>';

View File

@ -1,12 +1,10 @@
<?php
echo '<script src="/js/nav.js" async></script>';
echo '<div id="menu-button" class="menu-button">';
echo '<img onclick="openMenu()" src="/assets/icons/menu.png"></img>';
echo '</div>';
echo '<div id="menu" class="menu">';
echo '<a href="/" class="menuitem" onclick="closeMenu()"">Home</a>';
echo '<a href="/issue.php" class="menuitem" onclick="closeMenu()"">Report Issue</a>"';
echo '<a href="/help.php" class="menuitem" onclick="closeMenu()"">Help</a>';
echo '<img class="menu-button" onclick="closeMenu()" class="popup-close" src="/assets/icons/close-circle.png"></img>';
echo '<div class="dropdown">';
echo ' <button onclick="myFunction()" class="dropbtn">Menu</button>';
echo ' <div id="myDropdown" class="dropdown-content">';
echo ' <a href="/">Home</a>';
echo ' <a href="/issue.php">Report Issue</a>';
echo ' <a class="dropdown-last" href="/help.php">Help</a>';
echo ' </div>';
echo '</div>';

View File

@ -1,2 +1,2 @@
<?php
$athenaVersion = '0.4.0-alpha';
$athenaVersion = '0.4.1-alpha';

View File

@ -92,6 +92,7 @@ body {
padding: 5px;
padding-left: 15px;
padding-right: 15px;
margin-bottom: 10px;
cursor: pointer;
}
@ -114,45 +115,67 @@ body {
cursor: pointer;
}
.menu {
display: none;
background-color: #3c78d8;
width: 100%;
/* START MENU STYLE */
/* Dropdown Button */
.dropbtn {
position: fixed;
top: 0;
left: 0;
padding-top: 10px;
padding-bottom: 10px;
right: 0;
background-color: #7fa7e6;
color: white;
padding: 12px;
font-size: 12px;
border: none;
border-bottom-left-radius: 10px;
cursor: pointer;
}
.menu-button {
/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
background-color: #0280e5;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #aac4ee;
border: none;
right: 30px;
cursor: pointer;
background-color: #7fa7e6;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.menuitem {
background-color: #2256aa;
/* Links inside the dropdown */
.dropdown-content a {
color: white;
padding: 12px 16px;
text-decoration: none;
color: #f6f5f4;
border: none;
border-radius: 18px;
font-size: 16px;
font-weight: bold;
padding: 3px;
padding-left: 8px;
padding-right: 8px;
margin-left: 10px;
margin-right: 10px;
cursor: pointer;
display: block;
border-top: 1px solid black;
}
.menuitem:hover {
background-color: #112b55;
/*Final item of the dropdown has bottom border*/
.dropdown-last {
border-bottom: 1px solid black;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #ddd;}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}
/* END MENU STYLE */
/* Footer Styles */
footer {
background-color: #7fa7e6;
color: white;