Navigation for mobile

This commit is contained in:
Hoernschen 2020-12-14 00:35:01 +01:00
parent 4ae49b6b0b
commit cbcb89f9fa
2 changed files with 92 additions and 190 deletions

View file

@ -1,21 +1,24 @@
.header { .header {
margin: auto; margin: auto;
padding: 1.5rem; padding: 1.5rem;
padding-bottom: 0rem; padding-bottom: 0.5rem;
text-align: center; text-align: center;
display: flex; display: flex;
font-size: large; font-size: large;
overflow: hidden;
height: auto;
} }
.logo { .logo {
display: flex; display: flex;
width: 48pt; height: 3.5rem;
} }
.header-items { .header-items {
padding-right: 1rem;
margin: auto; margin: auto;
margin-right: 0px; /* padding-right: 1rem;
margin-right: 0px; */
margin-left: 0px;
display: flex; display: flex;
float: right; float: right;
right: 0px; right: 0px;
@ -23,10 +26,26 @@
text-align: right; text-align: right;
} }
.header-items .menu-icon {
display: none;
font-size: larger;
}
.header-item { .header-item {
margin-left: 2.5rem margin-left: 2.5rem
} }
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
border: none;
outline: none;
margin: 0;
}
.dropdown-content { .dropdown-content {
display: none; display: none;
position: absolute; position: absolute;
@ -36,6 +55,58 @@
z-index: 1; z-index: 1;
} }
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content { .dropdown:hover .dropdown-content {
display: block; display: block;
}
@media screen and (max-width: 600px) {
.header-items .dropdown .dropbtn {
display: none;
}
.header-items .header-item {
display: none;
}
.header-items a.menu-icon {
float: right;
display: block;
}
}
@media screen and (max-width: 600px) {
.header-items.responsive {position: relative;}
.header-items.responsive .menu-icon {
position: absolute;
right: 0;
top: 0;
}
.header-items.responsive a {
float: none;
display: block;
text-align: left;
}
.header-items.responsive .dropdown {float: none;}
.header-items.responsive .dropdown-content {position: relative;}
.header-items.responsive .dropdown .dropbtn {
display: block;
width: 100vw;
text-align: left;
}
.header-items.responsive .header-item {
display: block;
width: 100vw;
text-align: left;
}
} }

View file

@ -13,7 +13,7 @@
<header class="header"> <header class="header">
<a href="#"><img class="logo" src="images/NEO Logo.png"></a> <a href="#"><img class="logo" src="images/NEO Logo.png"></a>
<div class="header-items"> <div class="header-items" id="header-items">
<a class="header-item" href="#">Über uns</a> <a class="header-item" href="#">Über uns</a>
<a class="header-item" href="#">Blog</a> <a class="header-item" href="#">Blog</a>
<div class="header-item dropdown"> <div class="header-item dropdown">
@ -21,195 +21,17 @@
<i class="fas fa-caret-down"></i> <i class="fas fa-caret-down"></i>
</button> </button>
<div class="dropdown-content"> <div class="dropdown-content">
<a href="#">Link 1</a> <a href="#">Tauschmärkte</a>
<a href="#">Link 2</a> <a href="#">Konsumkritischer Stadtrundgang</a>
<a href="#">Link 3</a> <a href="#">Workshops</a>
</div> </div>
</div> </div>
</div> </div>
<a href="javascript:void(0);" class="menu-icon" onclick="myFunction()">&#9776;</a>
</header> </header>
<!-- This example requires Tailwind CSS v2.0+ -->
<div class="relative bg-white overflow-hidden">
<div class="max-w-7xl mx-auto">
<div class="relative z-10 pb-8 bg-white sm:pb-16 md:pb-20 lg:max-w-2xl lg:w-full lg:pb-28 xl:pb-32">
<div class="absolute top-0 inset-x-0 p-2 transition transform origin-top-right md:hidden">
<div class="rounded-lg shadow-md bg-white ring-1 ring-black ring-opacity-5 overflow-hidden">
<div class="px-5 pt-4 flex items-center justify-between">
<div>
<img class="h-8 w-auto" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" alt="">
</div>
<div class="-mr-2">
<button type="button" class="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
<span class="sr-only">Close main menu</span>
<!-- Heroicon name: x -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
<div role="menu" aria-orientation="vertical" aria-labelledby="main-menu">
<div class="px-2 pt-2 pb-3 space-y-1" role="none">
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50" role="menuitem">Product</a>
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50" role="menuitem">Features</a>
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50" role="menuitem">Marketplace</a>
<a href="#" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50" role="menuitem">Company</a>
</div>
<div role="none">
<a href="#" class="block w-full px-5 py-3 text-center font-medium text-indigo-600 bg-gray-50 hover:bg-gray-100" role="menuitem">
Log in
</a>
</div>
</div>
</div>
</div>
<main class="mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28">
<div class="sm:text-center lg:text-left">
<h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
<span class="block xl:inline">Data to enrich your</span>
<span class="block text-indigo-600 xl:inline">online business</span>
</h1>
<p class="mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-5 md:text-xl lg:mx-0">
Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.
</p>
<div class="mt-5 sm:mt-8 sm:flex sm:justify-center lg:justify-start">
<div class="rounded-md shadow">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 md:py-4 md:text-lg md:px-10">
Get started
</a>
</div>
<div class="mt-3 sm:mt-0 sm:ml-3">
<a href="#" class="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-indigo-700 bg-indigo-100 hover:bg-indigo-200 md:py-4 md:text-lg md:px-10">
Live demo
</a>
</div>
</div>
</div>
</main>
</div>
</div>
<div class="lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2">
<img class="h-56 w-full object-cover sm:h-72 md:h-96 lg:w-full lg:h-full" src="https://images.unsplash.com/photo-1551434678-e076c223a692?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2850&q=80" alt="">
</div>
</div>
<!-- This example requires Tailwind CSS v2.0+ -->
<div class="py-12 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="lg:text-center">
<h2 class="text-base text-indigo-600 font-semibold tracking-wide uppercase">Transactions</h2>
<p class="mt-2 text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
A better way to send money
</p>
<p class="mt-4 max-w-2xl text-xl text-gray-500 lg:mx-auto">
Lorem ipsum dolor sit amet consect adipisicing elit. Possimus magnam voluptatum cupiditate veritatis in accusamus quisquam.
</p>
</div>
<div class="mt-10">
<dl class="space-y-10 md:space-y-0 md:grid md:grid-cols-2 md:gap-x-8 md:gap-y-10">
<div class="flex">
<div class="flex-shrink-0">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
<!-- Heroicon name: globe-alt -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
</svg>
</div>
</div>
<div class="ml-4">
<dt class="text-lg leading-6 font-medium text-gray-900">
Competitive exchange rates
</dt>
<dd class="mt-2 text-base text-gray-500">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
</dd>
</div>
</div>
<div class="flex">
<div class="flex-shrink-0">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
<!-- Heroicon name: scale -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3" />
</svg>
</div>
</div>https://www.youtube.com/watch?v=jqTSAtU-HRA
<dt class="text-lg leading-6 font-medium text-gray-900">
No hidden fees
</dt>
<dd class="mt-2 text-base text-gray-500">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
</dd>
</div>
</div>
<div class="flex">
<div class="flex-shrink-0">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
<!-- Heroicon name: lightning-bolt -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
</div>
</div>
<div class="ml-4">
<dt class="text-lg leading-6 font-medium text-gray-900">
Transfers are instant
</dt>
<dd class="mt-2 text-base text-gray-500">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
</dd>
</div>
</div>
<div class="flex">
<div class="flex-shrink-0">
<div class="flex items-center justify-center h-12 w-12 rounded-md bg-indigo-500 text-white">
<!-- Heroicon name: annotation -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z" />
</svg>
</div>
</div>
<div class="ml-4">
<dt class="text-lg leading-6 font-medium text-gray-900">
Mobile notifications
</dt>
<dd class="mt-2 text-base text-gray-500">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Maiores impedit perferendis suscipit eaque, iste dolor cupiditate blanditiis ratione.
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<!-- This example requires Tailwind CSS v2.0+ -->
<div class="bg-gray-50">
<div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8 lg:flex lg:items-center lg:justify-between">
<h2 class="text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">
<span class="block">Ready to dive in?</span>
<span class="block text-indigo-600">Start your free trial today.</span>
</h2>
<div class="mt-8 lex lg:mt-0 lg:flex-shrink-0">
<div class="inline-flex rounded-md shadow">
<a href="#" class="inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700">
Get started
</a>
</div>
<div class="ml-3 inline-flex rounded-md shadow">
<a href="#" class="inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-indigo-50">
Learn more
</a>
</div>
</div>
</div>
</div>
<footer class="footer"> <footer class="footer">
<div class="social-media"> <div class="social-media">
@ -267,5 +89,14 @@
e.preventDefault(); e.preventDefault();
scrollToTop(); scrollToTop();
} }
function myFunction() {
var x = document.getElementById("header-items");
if (x.className === "header-items") {
x.className += " responsive";
} else {
x.className = "header-items";
}
}
</script> </script>
</body> </body>