Move nav-menu to external php file

This commit is contained in:
Fred Boniface 2022-09-20 19:41:47 +01:00
parent ec6551e985
commit 2e56d59664
2 changed files with 12 additions and 9 deletions

View File

@ -4,21 +4,14 @@
<?php include './page-blocks/headers.php';?> <?php include './page-blocks/headers.php';?>
<title>Athena</title> <title>Athena</title>
<script src="/js/tiploc-finder.js"></script> <script src="/js/tiploc-finder.js" async></script>
<script src="/js/nav.js"></script>
</head> </head>
<body> <body>
<!-- Popup Menu --> <!-- Popup Menu -->
<div id="menu-button" class="menu-button"> <?php require "./page-blocks/nav-menu.php";?>
<img onclick="openMenu()" src="/assets/icons/menu.png"></img>
</div>
<div id="menu" class="menu">
<button class="menuitem" onclick="openAboutPopup(),closeMenu()">Help</button>
<img onclick="closeMenu()" class="popup-close" src="/assets/icons/close-circle.png"></img>
</div>
<!-- Main Content Begins --> <!-- Main Content Begins -->
<img class="titleimg" src="/assets/title/title.webp"></img> <img class="titleimg" src="/assets/title/title.webp"></img>

10
page-blocks/nav-menu.php Normal file
View File

@ -0,0 +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 '<button class="menuitem" onclick="openAboutPopup(),closeMenu()">Help</button>'
echo '<img onclick="closeMenu()" class="popup-close" src="/assets/icons/close-circle.png"></img>'
echo '</div>'