Menü leiste endgültig fürs Handy
This commit is contained in:
parent
fe58239332
commit
9df9bba9f5
@ -55,7 +55,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
font-size: 50px;
|
font-size: 6vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-link {
|
.menu-link {
|
||||||
@ -71,7 +71,7 @@
|
|||||||
.headline {
|
.headline {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: rgb(0, 0, 0);
|
color: rgb(0, 0, 0);
|
||||||
font-size: 40px;
|
font-size: 5vw;
|
||||||
text-shadow: 5px 5px 3px rgba(5, 0, 0, 0.26);
|
text-shadow: 5px 5px 3px rgba(5, 0, 0, 0.26);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,10 +90,11 @@
|
|||||||
.menu-links {
|
.menu-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: flex-end; /* Rechts ausrichten */
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-links.show {
|
.menu-links.show {
|
||||||
display: flex; /* Bei Klick auf das Symbol anzeigen */
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu {
|
.menu {
|
||||||
@ -114,6 +115,7 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 250%;
|
font-size: 250%;
|
||||||
|
margin: 10px; /* Abstand zwischen den Links hinzufügen */
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-menu {
|
.mobile-menu {
|
||||||
@ -141,40 +143,20 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 80px;
|
top: 80px;
|
||||||
left: 0;
|
right: 0; /* Rechts ausrichten */
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
justify-content: flex-start; /* Links oben ausrichten */
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-links.show {
|
.menu-links.show {
|
||||||
display: flex; /* Bei Klick auf das Symbol anzeigen */
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-menu.show {
|
.mobile-menu.show {
|
||||||
display: block; /* Bei Klick auf das Symbol anzeigen */
|
display: block;
|
||||||
background-color: rgb(104, 0, 0);
|
background-color: rgb(104, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-menu {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
right: 10px;
|
|
||||||
color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.close-menu {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
right: 10px;
|
|
||||||
color: white;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@ -190,15 +172,11 @@
|
|||||||
<div class="hamburger-icon"></div>
|
<div class="hamburger-icon"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-links">
|
<div class="menu-links">
|
||||||
|
<!-- Gemeinsame Links für Desktop und mobile Ansichten -->
|
||||||
<a class="menu-link" href="">Kontakt</a>
|
<a class="menu-link" href="">Kontakt</a>
|
||||||
<a class="menu-link" href="">Spiele</a>
|
<a class="menu-link" href="">Spiele</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu">
|
|
||||||
<div class="close-menu" onclick="toggleMenu()">✖</div>
|
|
||||||
<a class="menu-link-mobile" href="">Kontakt</a>
|
|
||||||
<a class="menu-link-mobile" href="">Spiele</a>
|
|
||||||
</div>
|
|
||||||
<div class="mobile-menu" onclick="toggleMenu()">
|
<div class="mobile-menu" onclick="toggleMenu()">
|
||||||
<a class="menu-link-mobile" href="">Kontakt</a>
|
<a class="menu-link-mobile" href="">Kontakt</a>
|
||||||
<a class="menu-link-mobile" href="">Spiele</a>
|
<a class="menu-link-mobile" href="">Spiele</a>
|
||||||
@ -207,15 +185,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function toggleMenu() {
|
function toggleMenu() {
|
||||||
var menuLinks = document.querySelector('.menu-links');
|
var menuLinks = document.querySelector(".menu-links");
|
||||||
var mobileMenu = document.querySelector('.mobile-menu');
|
var mobileMenu = document.querySelector(".mobile-menu");
|
||||||
var body = document.body;
|
var body = document.body;
|
||||||
|
|
||||||
menuLinks.classList.toggle('show');
|
menuLinks.classList.toggle("show");
|
||||||
mobileMenu.classList.toggle('show');
|
mobileMenu.classList.toggle("show");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
24
index.html
24
index.html
@ -5,8 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Br0tcraft</title>
|
<title>Br0tcraft</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css" />
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
@ -15,23 +14,30 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="menu-link-home" href="">BR0TCRAFT</a>
|
<a class="menu-link-home" href="">BR0TCRAFT</a>
|
||||||
<div class="mobile-menu-icon" onclick="toggleMenu()">
|
<div class="mobile-menu-icon" onclick="toggleMenu()">
|
||||||
<div class="bar"></div>
|
<div class="hamburger-icon"></div>
|
||||||
<div class="bar"></div>
|
<div class="hamburger-icon"></div>
|
||||||
<div class="bar"></div>
|
<div class="hamburger-icon"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-links">
|
<div class="menu-links">
|
||||||
|
<!-- Gemeinsame Links für Desktop und mobile Ansichten -->
|
||||||
<a class="menu-link" href="">Kontakt</a>
|
<a class="menu-link" href="">Kontakt</a>
|
||||||
<a class="menu-link" href="">Spiele</a>
|
<a class="menu-link" href="">Spiele</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mobile-menu" onclick="toggleMenu()">
|
||||||
|
<a class="menu-link-mobile" href="">Kontakt</a>
|
||||||
|
<a class="menu-link-mobile" href="">Spiele</a>
|
||||||
|
</div>
|
||||||
<h1 class="headline">Meine Werke</h1>
|
<h1 class="headline">Meine Werke</h1>
|
||||||
|
|
||||||
<!-- Weitere HTML-Elemente und Skripte hier einfügen -->
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function toggleMenu() {
|
function toggleMenu() {
|
||||||
var menuLinks = document.querySelector('.menu-links');
|
var menuLinks = document.querySelector(".menu-links");
|
||||||
menuLinks.classList.toggle('show');
|
var mobileMenu = document.querySelector(".mobile-menu");
|
||||||
|
var body = document.body;
|
||||||
|
|
||||||
|
menuLinks.classList.toggle("show");
|
||||||
|
mobileMenu.classList.toggle("show");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
86
style.css
86
style.css
@ -11,19 +11,19 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Orbitron";
|
font-family: "Orbitron";
|
||||||
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-container {
|
.header-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-image {
|
.header-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 70%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: 50% 5%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
@ -46,7 +46,7 @@ body {
|
|||||||
color: white;
|
color: white;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
font-size: 50px;
|
font-size: 6vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-link {
|
.menu-link {
|
||||||
@ -62,7 +62,7 @@ body {
|
|||||||
.headline {
|
.headline {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: rgb(0, 0, 0);
|
color: rgb(0, 0, 0);
|
||||||
font-size: 40px;
|
font-size: 5vw;
|
||||||
text-shadow: 5px 5px 3px rgba(5, 0, 0, 0.26);
|
text-shadow: 5px 5px 3px rgba(5, 0, 0, 0.26);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,9 +71,53 @@ body {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hamburger-icon {
|
||||||
|
width: 30px;
|
||||||
|
height: 3px;
|
||||||
|
background-color: white;
|
||||||
|
margin: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
.menu-links {
|
.menu-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: flex-end; /* Rechts ausrichten */
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-links.show {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #333; /* Hintergrundfarbe des Menüs */
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-link-mobile {
|
||||||
|
color: white;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
font-size: 250%;
|
||||||
|
margin: 10px; /* Abstand zwischen den Links hinzufügen */
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: transparent;
|
||||||
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 768px) {
|
||||||
@ -81,25 +125,27 @@ body {
|
|||||||
display: block; /* Bei kleinen Bildschirmen anzeigen */
|
display: block; /* Bei kleinen Bildschirmen anzeigen */
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-links {
|
.hamburger-icon {
|
||||||
display: none; /* Bei kleinen Bildschirmen ausblenden */
|
display: block;
|
||||||
flex-direction: column;
|
|
||||||
position: absolute;
|
|
||||||
top: 80px; /* Passen Sie dies an, um die Position anzupassen */
|
|
||||||
left: 0;
|
|
||||||
background-color: #333; /* Hintergrundfarbe des Menüs */
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-link {
|
.menu-links {
|
||||||
padding: 10px;
|
display: none;
|
||||||
text-align: center;
|
flex-direction: column;
|
||||||
color: white;
|
position: absolute;
|
||||||
text-decoration: none;
|
top: 80px;
|
||||||
|
right: 0; /* Rechts ausrichten */
|
||||||
|
background-color: #333;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: flex-start; /* Links oben ausrichten */
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-links.show {
|
.menu-links.show {
|
||||||
display: flex; /* Bei Klick auf das Symbol anzeigen */
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-menu.show {
|
||||||
|
display: block;
|
||||||
|
background-color: rgb(104, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user