Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Navbar #16

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
-moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
display: none;
}

* {
margin: 0;
padding: 0;
Expand Down
39 changes: 27 additions & 12 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
Burger,
Drawer,
ScrollArea,
rem,

Check failure on line 9 in src/components/Navbar/Navbar.jsx

View workflow job for this annotation

GitHub Actions / Lint

'rem' is defined but never used
} from "@mantine/core";
import logo from "/src/assets/logo1.jpg";
import { IconTerminal2 } from "@tabler/icons-react";
import { useDisclosure } from "@mantine/hooks";

import classes from "./Navbar.module.css";
import { Link } from "react-router-dom";

const Navbar = () => {
const [drawerOpened, { toggle: toggleDrawer, close: closeDrawer }] =
useDisclosure(false);

return (
<Box >
<Box pb={60}>
<header className={classes.header}>
<Group className={classes.appNameContainer} justify="space-around" h="100%">
<Group className={classes.container} justify="space-around" h="100%">
<Group>
<img className={classes.logo} src={logo} alt="Logo" />
<h3>
Expand All @@ -38,18 +39,26 @@
Events
</a>
<a href="#" className={classes.link}>
Team
Teams
</a>
<a href="#" className={classes.link}>
FAQS
FAQs
</a>
<a href="#" className={classes.link}>
Contact
</a>
</Group>

<Group visibleFrom="sm">
<Button variant="default">CLI</Button>
<Link to="/cli">
<Button
leftSection={<IconTerminal2 />}
variant="default"
className={classes.cliButton}
>
CLI
</Button>
</Link>
</Group>

<Burger
Expand All @@ -66,14 +75,12 @@
opened={drawerOpened}
onClose={closeDrawer}
size="100%"
padding="md"
title="Zeroday Alliance"
title="ZeroDay Alliance"
hiddenFrom="sm"
zIndex={1000000}
>
<ScrollArea h={`calc(100vh - ${rem(80)})`} mx="-md">
<ScrollArea>
<Divider my="sm" />

<a href="#" className={classes.link}>
Home
</a>
Expand All @@ -92,8 +99,16 @@

<Divider my="sm" />

<Group justify="center" grow pb="xl" px="md">
<Button variant="default">CLI</Button>
<Group grow justify="center" pb="xl">
<Link to="/cli">
<Button
leftSection={<IconTerminal2 />}
variant="default"
className={classes.cliButton}
>
CLI
</Button>
</Link>
</Group>
</ScrollArea>
</Drawer>
Expand Down
64 changes: 30 additions & 34 deletions src/components/Navbar/Navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
top: 0;
left: 0;
right: 0;
z-index: 1000;
}

.container {
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
Expand All @@ -19,66 +26,55 @@
}

.appName {
font-size: var(--mantine-font-size-xl);
font-weight: 500;
text-decoration: none;
color: white;
}

.link {
color: white;
display: flex;
align-items: center;
height: 100%;
padding-left: var(--mantine-spacing-md);
padding-right: var(--mantine-spacing-md);
font-size: var(--mantine-font-size-sm);
padding-left: var(--mantine-spacing-sm);
padding-right: var(--mantine-spacing-sm);
text-decoration: none;
font-weight: 500;
font-size: var(--mantine-font-size-sm);
height: 100%;
color: white;

@media (max-width: $mantine-breakpoint-sm) {
color: black;
height: rem(42px);
border-radius: 0px;
width: 100%;
}

.change {
background-color: white;
}

@mixin hover {
background-color: light-dark(
var(--mantine-color-gray-4),
var(--mantine-color-dark-3)
);
color: black;
background-color: rgba(170, 170, 170, 0.2);
border-radius: var(--mantine-radius-md);
}
}

.draw {
background: linear-gradient(90deg, #071726 22%, #0a3642 68%, #0b4752 84%);
}

.subLink {
width: 100%;
padding: var(--mantine-spacing-xs) var(--mantine-spacing-md);
.cliButton {
font-weight: 500;
font-size: var(--mantine-font-size-sm);
padding-left: var(--mantine-spacing-sm);
padding-right: var(--mantine-spacing-sm);
border-radius: var(--mantine-radius-md);
text-decoration: none;
width: 100%;
color: white;
background-color: var(--mantine-color-indigo-6);

@mixin hover {
background-color: light-dark(
var(--mantine-color-gray-0),
var(--mantine-color-dark-6)
);
color: black;
background-color: var(--mantine-color-indigo-7);
}
}

.dropdownFooter {
background-color: light-dark(
var(--mantine-color-gray-0),
var(--mantine-color-dark-7)
);
margin: calc(var(--mantine-spacing-md) * -1);
margin-top: var(--mantine-spacing-sm);
padding: var(--mantine-spacing-md) calc(var(--mantine-spacing-md) * 2);
padding-bottom: var(--mantine-spacing-xl);
border-top: rem(1px) solid
light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
.draw {
background: linear-gradient(90deg, #071726 22%, #0a3642 68%, #0b4752 84%);
}
Loading