Merge pull request 'AFTER hours of trying the dropdown menu is now up to stanard from Patrick_Pluto' (#5) from sageTheDm/foss_alternatives:main into pages
Reviewed-on: https://codeberg.org/Patrick_Pluto/foss_alternatives/pulls/5
This commit is contained in:
commit
8b162fc4bb
4 changed files with 33 additions and 15 deletions
24
burger.js
24
burger.js
|
@ -1,6 +1,24 @@
|
|||
// @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt CC0-1.0
|
||||
// burger.js
|
||||
|
||||
function toggleMenu() {
|
||||
const menu = document.querySelector(".menu");
|
||||
menu.classList.toggle("active");
|
||||
const menu = document.querySelector(".menu");
|
||||
menu.classList.toggle("active");
|
||||
|
||||
// Add event listener to close menu when clicking anywhere on the document
|
||||
if (menu.classList.contains("active")) {
|
||||
document.addEventListener("click", closeMenu);
|
||||
} else {
|
||||
document.removeEventListener("click", closeMenu);
|
||||
}
|
||||
}
|
||||
// @license-end
|
||||
|
||||
function closeMenu(event) {
|
||||
const menu = document.querySelector(".menu");
|
||||
if (!menu.contains(event.target) && !event.target.classList.contains("burger-menu")) {
|
||||
menu.classList.remove("active");
|
||||
document.removeEventListener("click", closeMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// @license-end
|
||||
|
|
|
@ -12,7 +12,7 @@ class Header extends HTMLElement {
|
|||
<header>
|
||||
<div class="header-content">
|
||||
<div class="project-name"><a href="../index.html">FOSS alternatives</a></div>
|
||||
<button class="burger-menu" onclick="toggleMenu()">☰</button>
|
||||
<button class="burger-menu" style="display: block;" onclick="toggleMenu()">☰</button>
|
||||
<ul class="menu">
|
||||
<li><a href="../games/index.html">Games</a></li>
|
||||
<li><a href="../general_purpose/index.html">General Purpose</a></li>
|
||||
|
@ -28,5 +28,5 @@ class Header extends HTMLElement {
|
|||
}
|
||||
|
||||
customElements.define('header-component', Header);
|
||||
customElements.define('header-component', Header);
|
||||
|
||||
// @license-end
|
2
list.css
2
list.css
|
@ -4,7 +4,7 @@
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Roboto", Arial, sans-serif;
|
||||
transition: all 0.3s ease; /* Smooth transitions */
|
||||
transition: all 2s ease; /* Smooth transitions */
|
||||
}
|
||||
|
||||
/* Body styles */
|
||||
|
|
18
styles.css
18
styles.css
|
@ -4,7 +4,7 @@
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Roboto", Arial, sans-serif;
|
||||
transition: all 0.3s ease; /* Smooth transitions */
|
||||
transition: all 2s ease; /* Smooth transitions */
|
||||
}
|
||||
|
||||
/* Body styles */
|
||||
|
@ -21,7 +21,7 @@ body {
|
|||
/* Header styles */
|
||||
header {
|
||||
background-color: #2c3e50;
|
||||
padding: 15px 0;
|
||||
padding: 15px 0; /* Adjusted padding */
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
@ -36,12 +36,12 @@ header {
|
|||
align-items: center;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
padding: 0 20px; /* Original padding */
|
||||
}
|
||||
|
||||
.project-name {
|
||||
color: #ffffff;
|
||||
font-size: 1.8em;
|
||||
font-size: 1.5em; /* Updated font size */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ header {
|
|||
background: none;
|
||||
border: none;
|
||||
color: #ffffff;
|
||||
font-size: 1.8em;
|
||||
font-size: 1.5em; /* Updated font size */
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
}
|
||||
|
@ -64,13 +64,13 @@ header {
|
|||
}
|
||||
|
||||
header li {
|
||||
margin: 15px;
|
||||
margin: 10px; /* Smaller margin */
|
||||
}
|
||||
|
||||
header a {
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
padding: 10px;
|
||||
padding: 8px; /* Smaller padding */
|
||||
border-radius: 5px;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
@ -198,11 +198,11 @@ nav {
|
|||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px 0 20px;
|
||||
padding: 0 20px; /* Original padding */
|
||||
}
|
||||
|
||||
.project-name {
|
||||
font-size: 1.5em;
|
||||
font-size: 1.5em; /* Updated font size */
|
||||
}
|
||||
|
||||
header li {
|
||||
|
|
Loading…
Reference in a new issue