made mobile actually work :)
This commit is contained in:
moonmoon97 2024-02-08 12:59:09 +01:00 committed by GitHub
parent 8e3e083c63
commit b355b404ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 541 additions and 38 deletions

BIN
Avatar_editv3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before After
Before After

1
icon-close.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="21"><g fill="#D0D6F9" fill-rule="evenodd"><path d="M2.575.954l16.97 16.97-2.12 2.122L.455 3.076z"/><path d="M.454 17.925L17.424.955l2.122 2.12-16.97 16.97z"/></g></svg>

After

Width:  |  Height:  |  Size: 227 B

1
icon-hamburger.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="21"><g fill="#D0D6F9" fill-rule="evenodd"><path d="M0 0h24v3H0zM0 9h24v3H0zM0 18h24v3H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 160 B

View file

@ -1,38 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>Moon Moon's Hub</title>
<link rel="shortcut icon" type="image/jpg" href="Avatar_editv3.png">
<title>Moon Moon's hub</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<script src="navigation.js" defer></script>
</head>
<body>
<div class="logo-container">
<img src="https://host.moonmoon.tech/u/o73AQR.png" alt="Logo" class="logo">
<h1>Moon Moon's Hub</h1>
<header class="primary-header flex">
<div>
<img src="MyLogo.png" alt="M^2" class="logo">
</div>
<div class="background-container">
<div class="background-image"></div>
<button class="mobile-nav-toggle" aria-controls="primary-navigation"><span class="sr-only" aria-expanded="false">Menu</span></button>
<nav>
<ul id="primary-navigation" data-visible="false" class="primary-navigation flex">
<li><a class="ff-sans-cond uppercase text-white letter-spacing-1" href="https://lab.moonmoon.tech"><span aria-hidden="true">01</span>Dashboard</a>
<li><a class="ff-sans-cond uppercase text-white letter-spacing-1" href="https://pdf.moonmoon.tech"><span aria-hidden="true">02</span>PDF.tools</a>
<li><a class="ff-sans-cond uppercase text-white letter-spacing-1" href="https://tech.moonmoon.tech"><span aria-hidden="true">03</span>IT.tools</a>
</ul>
</nav>
</header>
<div class="background"></div>
<main id="main" class="grid-container grid-container--home">
<div>
<h1 class="text-accent fs-500 ff-sans-cond uppercase letter-spacing-1">Welcome to
<span class="d-block fs-900 ff-serif text-white">Moon Moon's Hub</span></h1>
<p>I am a 26-year-old Norwegian guy that occasionally streams, is a tech head, and hosts various things on my local server.
Some of these you can check out at my dashborad.</p>
</div>
</main>
</div>
<div class="content">
<p>I am a 26-year-old Norwegian guy that occasionally streams, is a tech head, and hosts various things on my local server. Some of these you can check out here:</p>
<a href="https://lab.moonmoon.tech" class="my-projects-button">My Projects' dashboard</a>
<a href="https://pdf.moonmoon.tech" class="PDF-tools-button">PDF Tools</a>
<a href="https://tech.moonmoon.tech" class="IT-tools-button">IT Tools</a>
</div>
</body>
<footer>
<div class="social-buttons">
<p>Social links:</p>
<a href="https://twitter.com/M0onmo0nGaming" target="_blank">X</a>
<a href="https://www.twitch.tv/m0onmo0ngaming" target="_blank">Twitch</a>
<a href="https://github.com/moonmoon97" target="_blank">GitHub</a>
<a href="https://www.youtube.com/@M0onMo0n" target="_blank">YouTube</a>
<a href="https://twitter.com/M0onmo0nGaming"><i class="fa-brands fa-x-twitter"></i></a>
<a href="https://www.twitch.tv/m0onmo0ngaming"><i class="fa-brands fa-twitch"></i></a>
<a href="https://github.com/moonmoon97"><i class="fa-brands fa-github"></i></a>
<a href="https://www.youtube.com/@M0onMo0n"><i class="fa-brands fa-youtube"></i></a>
<a href="mailto:admin@moonmoon.tech"><i class="fa-solid fa-envelope"></i></a>
</div>
</footer>
<script src="script.js"></script>
</body>
</html>

14
navigation.js Normal file
View file

@ -0,0 +1,14 @@
const nav = document.querySelector(".primary-navigation");
const navToggle = document.querySelector(".mobile-nav-toggle");
navToggle.addEventListener("click", () => {
const visiblity = nav.getAttribute("data-visible");
if (visiblity === "false") {
nav.setAttribute("data-visible", true);
navToggle.setAttribute("aria-expanded", true);
} else {
nav.setAttribute("data-visible", false);
navToggle.setAttribute("aria-expanded", false);
}
})

View file

@ -0,0 +1,22 @@
const wrapper = document.querySelector('.wrapper');
const loginLink = document.querySelector('.login-link');
const registerLink = document.querySelector('.register-link');
const btnPopup = document.querySelector('.btnLogin-popup');
const iconClose = document.querySelector('.icon-close');
registerLink.addEventListener('click', ()=> {
wrapper.classList.add('active');
});
loginLink.addEventListener('click', ()=> {
wrapper.classList.remove('active');
});
btnPopup.addEventListener('click', ()=> {
wrapper.classList.add('active-popup');
});
iconClose.addEventListener('click', ()=> {
wrapper.classList.remove('active-popup');
wrapper.classList.remove('active');
});

447
style.css Normal file
View file

@ -0,0 +1,447 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
/* ------------------- */
/* Custom properties */
/* ------------------- */
:root {
/* colors */
--clr-dark: 230 35% 7%;
--clr-light: 231 77% 90%;
--clr-white: 0 0% 100%;
/* font-sizes */
--fs-900: clamp(5rem, 8vw + 1rem, 9.375rem);
--fs-800: 3.5rem;
--fs-700: 1.5rem;
--fs-600: 1rem;
--fs-500: 1rem;
--fs-400: 0.9375rem;
--fs-300: 1rem;
--fs-200: 0.875rem;
/* font-families */
--ff-serif: "Bellefair", serif;
--ff-sans-cond: "Barlow Condensed", sans-serif;
--ff-sans-normal: "Barlow", sans-serif;
}
@media (min-width: 35em) {
:root {
--fs-800: 5rem;
--fs-700: 2.5rem;
--fs-600: 1.5rem;
--fs-500: 1.25rem;
--fs-400: 1rem;
}
}
@media (min-width: 45em) {
:root {
/* font-sizes */
--fs-800: 6.25rem;
--fs-700: 3.5rem;
--fs-600: 2rem;
--fs-500: 1.75rem;
--fs-400: 1.125rem;
}
}
/* ------------------- */
/* Reset */
/* ------------------- */
/* https://piccalil.li/blog/a-modern-css-reset/ */
/* Box sizing */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
font-weight: 400;
}
/* set up the body */
body {
color: hsl( var(--clr-white) );
font-family: var(--ff-sans-normal);
font-size: var(--fs-400);
background-color: hsl( var(--clr-dark) );
display: flex;
justify-content: center;
align-items: center;
line-height: 1.5;
min-height: 100vh;
overflow-x: hidden;
}
.background {
position: absolute;
top: 0;
left: 0;
width: 100%;
min-height: 100vh;
background-image: url('background.jpg');
background-repeat: no repeat;
background-position: bottom center;
background-size: cover;
z-index: -1;
filter:blur(5px) saturate(100%) brightness(75%);
}
/* primary-header */
.primary-header {
display: flex;
padding: 20px 100px;
position: fixed;
top: 0;
height: auto;
width: 100%;
align-items: center;
justify-content: space-between;
z-index: 99;
}
.logo {
width: auto;
height: 90px;
margin: 1.5rem clamp(1.5rem, 5vw, 3.5rem);
user-select: none;
}
.primary-navigation {
--gap: clamp(1.5rem, 5vw, 3.5rem);
--underline-gap: 2rem;
list-style: none;
padding: 0;
margin: 0;
}
.primary-navigation a {
text-decoration: none;
}
.primary-navigation a > span {
font-weight: 700;
margin-right: .5em;
}
.mobile-nav-toggle {
display: none;
}
@media (max-width: 35rem) {
.primary-navigation {
--underline-gap: .5rem;
position: fixed;
z-index: 1000;
inset: 0 0 0 30%;
list-style: none;
padding: min(20rem, 15vh) 2rem;
margin: 0;
flex-direction: column;
transform: translateX(100%);
transition: transform 500ms ease-in-out;
}
.primary-navigation[data-visible="true"] {
transform: translateX(0);
}
.primary-navigation.underline-indicators > .active {
border: 0;
}
.mobile-nav-toggle {
display: block;
position: absolute;
z-index: 2000;
right: 1rem;
top: 2rem;
background: transparent;
background-image: url(icon-hamburger.svg);
background-repeat: no-repeat;
background-position: center;
width: 1.5rem;
aspect-ratio: 1;
border: 0;
}
.mobile-nav-toggle[aria-expanded="true"] {
background-image: url(icon-close.svg);
}
.mobile-nav-toggle:focus-visible {
outline: 5px solid white;
outline-offset: 5px;
}
}
@media (min-width: 35em) {
.primary-navigation {
padding-inline: clamp(3rem, 7vw, 7rem);
}
}
@media (min-width: 35em) and (max-width: 44.999em) {
.primary-navigation a > span {
display: none;
}
}
@media (min-width: 45em) {
.primary-header::after {
content: '';
display: block;
position: relative;
height: 1px;
width: 100%;
margin-right: -2.5rem;
background: hsl( var(--clr-white) / .25);
order: 1;
}
nav {
order: 2;
}
.primary-navigation {
margin-block: 2rem;
}
}
.primary-navigation a {
position: relative;
align-self: flex-end;
align-items: center;
font-size: 1.1em;
color: #fff;
text-decoration: none;
font-weight: 500;
margin-left: 40px;
margin: 0.5rem;
margin-inline-end: 0.5rem;
}
.primary-navigation a::after {
content: '';
position: absolute;
left: 0;
bottom: -6px;
width: 100%;
height: 3px;
background: #fff;
border-radius: 5px;
transform-origin: right;
transform: scaleX(0);
transition: transform .5s;
}
.primary-navigation a:hover::after {
transform-origin: right;
transform: scaleX(1);
}
.content {
display: flex;
justify-content: center;
text-align: center;
width: 700px;
height: 50vh;
margin: 0 auto;
}
.content p {
font-size: 25px;
color: #000000;
height: auto;
}
footer {
position: fixed;
display: flex;
bottom: 0;
align-items: center;
justify-content: center;
z-index: 99;
min-height: 10vh;
overflow-x: hidden;
}
.social-buttons {
display: flex;
align-self: center;
position: relative;
align-items: center;
bottom: 0;
margin: 0 auto;
}
.social-buttons a {
position: relative;
display: inline-block;
width: 45px;
height: 45px;
background: transparent;
box-shadow: 0 4px 4px rgba(0, 0, 0, .3);
margin: 0 8px;
z-index: 1;
text-align: center;
line-height: 45px;
transition: .3s;
}
.social-buttons a:hover{
background: rgb(63, 9, 126);
transform: rotate(135deg);
box-shadow: 0 0 5px rgb(63, 9, 126), 0 0 10px rgb(63, 9, 126);
}
.social-buttons a::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 40px;
height: 40px;
background: #929498;
z-index: -1;
}
.social-buttons a i {
font-size: 18px;
color: #000;
transition: .3s;
}
.social-buttons a i:hover {
transform: rotate(225deg);
color: rgb(63, 9, 126);
}
/* ------------------- */
/* Utility classes */
/* ------------------- */
/* general */
.flex {
display: flex;
gap: var(--gap, .5rem)
}
.grid {
display: grid;
gap: var(--gap, 1rem);
}
.d-block {
display: block;
}
.flow > *:where(:not(:first-child)) {
margin-top: var(--flow-space, 1rem);
}
.flow--space-small {
--flow-space: .75rem;
}
.container {
padding-inline: 2em;
margin-inline: auto;
max-width: 80rem;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; /* added line */
border: 0;
}
.skip-to-content {
position: absolute;
z-index: 9999;
background: hsl( var(--clr-white) );
color: hsl( var(--clr-dark) );
padding: .5em 1em;
margin-inline: auto;
transform: translateY(-100%);
transition: transform 250ms ease-in;
}
.skip-to-content:focus {
transform: translateY(0);
}
.grid-container {
text-align: center;
display: grid;
place-items: center;
padding-inline: 1rem;
padding-bottom: 4rem;
}
.grid-container p:not([class]) {
max-width: 50ch;
}
img,
picutre {
max-width: 100%;
display: block;
}