mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-29 05:41:03 +00:00
mobile nav & hero page adjustments
This commit is contained in:
@@ -1,14 +1,28 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import Navigation from '../atoms/Navigation.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
let menuBtn: HTMLElement;
|
||||
let menuOpen = false;
|
||||
onMount(() => {
|
||||
menuBtn.addEventListener('click', () => {
|
||||
if (!menuOpen) {
|
||||
menuBtn.classList.add('open');
|
||||
menuOpen = true;
|
||||
} else {
|
||||
menuBtn.classList.remove('open');
|
||||
menuOpen = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<div class="wrapper">
|
||||
<nav>
|
||||
<a href="/">
|
||||
<div class="logo">
|
||||
<img src="/logo.svg" class="logo-image" alt="ReVanced Logo" />
|
||||
|
||||
|
||||
{#if $page.url.pathname !== '/'}
|
||||
<h1><span>Re</span>Vanced</h1>
|
||||
{/if}
|
||||
@@ -20,23 +34,22 @@
|
||||
<Navigation href="/docs">Docs</Navigation>
|
||||
<Navigation href="/credits">Credits</Navigation>
|
||||
</ul>
|
||||
<div class="menu-btn" class:open={menuOpen} bind:this={menuBtn}>
|
||||
<div class="menu-btn__burger" />
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
nav {
|
||||
width: 100%;
|
||||
top: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
padding-top: 0.75rem;
|
||||
padding-right: 3rem;
|
||||
padding-left: 6rem;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 90px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.logo {
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -46,7 +59,7 @@
|
||||
cursor: pointer;
|
||||
transform: translateY(5%);
|
||||
}
|
||||
|
||||
|
||||
h1 {
|
||||
display: inline-block;
|
||||
margin-left: 1rem;
|
||||
@@ -58,22 +71,75 @@
|
||||
color: var(--red);
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 1052px) {
|
||||
|
||||
h1 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
nav {
|
||||
padding-left: 7%;
|
||||
padding-right: 1%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
nav {
|
||||
background-color: purple;
|
||||
/* background-color: purple; */
|
||||
}
|
||||
ul {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hamburger mmm yum */
|
||||
@media screen and (min-width: 768px) {
|
||||
.menu-btn {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
.menu-btn {
|
||||
user-select: none;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 80px;
|
||||
height: 60px;
|
||||
cursor: pointer;
|
||||
transition: all 0.5s ease-in-out;
|
||||
background: var(--grey-one);
|
||||
border-radius: 3rem;
|
||||
}
|
||||
.menu-btn__burger {
|
||||
width: 30px;
|
||||
height: 3px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2);
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
.menu-btn__burger::before,
|
||||
.menu-btn__burger::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 3px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2);
|
||||
transition: all 0.5s ease-in-out;
|
||||
}
|
||||
.menu-btn__burger::before {
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
.menu-btn__burger::after {
|
||||
transform: translateY(8px);
|
||||
}
|
||||
/* ANIMATION */
|
||||
.menu-btn.open .menu-btn__burger {
|
||||
transform: translateX(-50px);
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
.menu-btn.open .menu-btn__burger::before {
|
||||
transform: rotate(45deg) translate(35px, -35px);
|
||||
}
|
||||
.menu-btn.open .menu-btn__burger::after {
|
||||
transform: rotate(-45deg) translate(35px, 35px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
<script>
|
||||
import SocialButton from "../atoms/SocialButton.svelte";
|
||||
import SocialButton from '../atoms/SocialButton.svelte';
|
||||
</script>
|
||||
|
||||
<div class="social-host">
|
||||
<SocialButton src="socials/github.svg" alt="GitHub" href="https://revanced.app/github"></SocialButton>
|
||||
<SocialButton src="socials/discord.svg" alt="Discord" href="http://revanced.app/discord"></SocialButton>
|
||||
<SocialButton src="socials/reddit.svg" alt="Reddit" href="https://revanced.app/reddit"></SocialButton>
|
||||
<SocialButton src="socials/telegram.svg" alt="Telegram" href="https://revanced.app/telegram"></SocialButton>
|
||||
<SocialButton src="socials/github.svg" alt="GitHub" href="https://revanced.app/github" />
|
||||
<SocialButton src="socials/discord.svg" alt="Discord" href="http://revanced.app/discord" />
|
||||
<SocialButton src="socials/reddit.svg" alt="Reddit" href="https://revanced.app/reddit" />
|
||||
<SocialButton src="socials/telegram.svg" alt="Telegram" href="https://revanced.app/telegram" />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.social-host {
|
||||
justify-content: space-between;
|
||||
.social-host {
|
||||
width: min(87%, 100rem);
|
||||
/* same as margin-inline: auto on .wrapper */
|
||||
padding: 0 max(6.5%, calc(50vw - 50rem));
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 3rem;
|
||||
left: 5.5rem;
|
||||
}
|
||||
user-select: none;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
bottom: 3rem;
|
||||
gap: 1.5rem;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1052px) {
|
||||
.social-host {
|
||||
left: 6%;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
@media screen and (max-width: 768px) {
|
||||
.social-host {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user