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

Created toggle for changing between dark/light mode #114

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tabWidth": 2}
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@
.block p {
flex: 1;
}

:global(html.dark) {
.block {
background: var(--dark75) !important;
border: var(--border);

svg {
fill: var(--base900);
}
}
}
27 changes: 14 additions & 13 deletions components/Community.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
import { Button, Row, Column } from 'react-basics';
import GitHub from 'assets/github.svg';
import Discord from 'assets/discord.svg';
import Twitter from 'assets/twitter.svg';
import styles from './Community.module.css';
import { REPO_URL, DISCORD_URL, TWITTER_URL } from '../lib/constants';
import Link from 'next/link';
import { Button, Row, Column } from "react-basics";
import GitHub from "assets/github.svg";
import Discord from "assets/discord.svg";
import Twitter from "assets/twitter.svg";
import styles from "./Community.module.scss";
import { REPO_URL, DISCORD_URL, TWITTER_URL } from "../lib/constants";
import Link from "next/link";

const items = [
{
name: 'GitHub',
name: "GitHub",
description:
'Check out the Umami source code, report issues, request features and join discussions.',
"Check out the Umami source code, report issues, request features and join discussions.",
url: REPO_URL,
icon: <GitHub />,
},
{
name: 'Discord',
description: "Chat directly with developers and other users in Umami's Discord channel.",
name: "Discord",
description:
"Chat directly with developers and other users in Umami's Discord channel.",
url: DISCORD_URL,
icon: <Discord />,
},
{
name: 'Twitter',
description: 'Follow us on Twitter for the latest news and updates.',
name: "Twitter",
description: "Follow us on Twitter for the latest news and updates.",
url: TWITTER_URL,
icon: <Twitter />,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
.confirm svg {
fill: var(--green400);
}

:global(html.dark) {
.container {
border-color: var(--border);
box-shadow: 4px 4px 4px rgb(0, 0, 0, 0.2);
}
}
2 changes: 1 addition & 1 deletion components/EmailSignup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { Button, Row, Column, TextField } from 'react-basics';
import CheckCircle from 'assets/check-circle.svg';
import styles from './EmailSignup.module.css';
import styles from './EmailSignup.module.scss';

interface Props {
type: string;
Expand Down
18 changes: 16 additions & 2 deletions components/Features.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
}

.feature:not(:first-child):after {
content: '';
content: "";
position: absolute;
height: 200px;
top: -200px;
left: 0;
right: 0;
background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 50%);
background: linear-gradient(
0deg,
rgba(255, 255, 255, 1) 0%,
rgba(255, 255, 255, 0) 50%
);
}

.text {
Expand All @@ -48,3 +52,13 @@
font-size: 2rem;
}
}

:global(html.dark) .feature:not(:first-child):after {
content: "";
position: absolute;
height: 200px;
top: -200px;
left: 0;
right: 0;
background: linear-gradient(0deg, #181a1b 0%, rgba(255, 255, 255, 0) 50%);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@
display: flex;
gap: 10px;
}

:global(html.dark) {
.footer {
border-color: var(--border);
background: #1b1d1e;
}
}
59 changes: 33 additions & 26 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
import React from 'react';
import { Row, Column, Container } from 'react-basics';
import Link from 'next/link';
import classNames from 'classnames';
import CompanyLogo from './CompanyLogo';
import SocialMedia from './SocialMedia';
import styles from './Footer.module.css';
import React from "react";
import { Row, Column, Container } from "react-basics";
import Link from "next/link";
import classNames from "classnames";
import CompanyLogo from "./CompanyLogo";
import SocialMedia from "./SocialMedia";
import styles from "./Footer.module.scss";

const data = [
{
title: 'Product',
title: "Product",
items: [
{ text: 'Features', href: '/features' },
{ text: 'Pricing', href: '/pricing' },
{ text: "Features", href: "/features" },
{ text: "Pricing", href: "/pricing" },
],
},
{
title: 'Resources',
title: "Resources",
items: [
{ text: 'Docs', href: '/docs' },
{ text: 'Guides', href: '/docs/guides' },
{ text: 'API Reference', href: '/docs/api' },
{ text: 'Release Notes', href: 'https://github.com/umami-software/umami/releases' },
{ text: "Docs", href: "/docs" },
{ text: "Guides", href: "/docs/guides" },
{ text: "API Reference", href: "/docs/api" },
{
text: "Release Notes",
href: "https://github.com/umami-software/umami/releases",
},
],
},
{
title: 'Community',
title: "Community",
items: [
{ text: 'Get Involved', href: '/community' },
{ text: 'GitHub', href: 'https://github.com/umami-software/umami' },
{ text: 'Discord', href: 'https://discord.gg/4dz4zcXYrQ' },
{ text: 'Twitter', href: 'https://twitter.com/umami_software' },
{ text: "Get Involved", href: "/community" },
{ text: "GitHub", href: "https://github.com/umami-software/umami" },
{ text: "Discord", href: "https://discord.gg/4dz4zcXYrQ" },
{ text: "Twitter", href: "https://twitter.com/umami_software" },
],
},
{
title: 'Company',
title: "Company",
items: [
{ text: 'About', href: '/about' },
{ text: 'Contact', href: '/contact' },
{ text: 'Privacy', href: '/privacy' },
{ text: 'Terms', href: '/terms' },
{ text: "About", href: "/about" },
{ text: "Contact", href: "/contact" },
{ text: "Privacy", href: "/privacy" },
{ text: "Terms", href: "/terms" },
],
},
];
Expand All @@ -61,7 +64,11 @@ export default function Footer() {
>
<h1>{title}</h1>
{items.map(({ text, href }) => (
<Link key={text} href={href} target={href.startsWith('http') ? '_blank' : null}>
<Link
key={text}
href={href}
target={href.startsWith("http") ? "_blank" : null}
>
{text}
</Link>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@
gap: 20px;
padding: 24px 0;
}

:global(html.dark) {
.buttons .button {
background: var(--dark150);
}

.buttons .button:hover {
background: var(--dark200);
}
}
14 changes: 10 additions & 4 deletions components/GetStarted.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Button } from 'react-basics';
import styles from './GetStarted.module.css';
import { Button } from "react-basics";
import styles from "./GetStarted.module.scss";

export default function GetStarted() {
return (
<div className={styles.banner}>
<h1>Are you ready for better analytics?</h1>
<div className={styles.buttons}>
<a href="/docs" className="button" data-umami-event="get-started-button">
<a
href="/docs"
className="button"
data-umami-event="get-started-button"
>
<Button size="lg" variant="primary">
Get Started
</Button>
Expand All @@ -18,7 +22,9 @@ export default function GetStarted() {
target="_blank"
rel="noreferrer"
>
<Button size="lg">Live Demo</Button>
<Button size="lg" className={styles.button}>
Live Demo
</Button>
</a>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions components/HamburgerButton.module.css

This file was deleted.

13 changes: 13 additions & 0 deletions components/HamburgerButton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.button {
align-self: center !important;
}

:global(html.dark) {
.button {
fill: var(--base900);
}

.button:hover {
background: var(--dark100) !important;
}
}
34 changes: 17 additions & 17 deletions components/HamburgerButton.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import { useState } from 'react';
import { Button } from 'react-basics';
import MobileMenu from './MobileMenu';
import XMark from 'assets/xmark.svg';
import Bars from 'assets/bars.svg';
import styles from './HamburgerButton.module.css';
import { useState } from "react";
import { Button } from "react-basics";
import MobileMenu from "./MobileMenu";
import XMark from "assets/xmark.svg";
import Bars from "assets/bars.svg";
import styles from "./HamburgerButton.module.scss";

const menuItems = [
{
label: 'Home',
value: '/',
label: "Home",
value: "/",
},
{
label: 'Features',
value: '/features',
label: "Features",
value: "/features",
},
{
label: 'Docs',
value: '/docs',
label: "Docs",
value: "/docs",
},
{
label: 'Community',
value: '/community',
label: "Community",
value: "/community",
},
{
label: 'Pricing',
value: '/pricing',
label: "Pricing",
value: "/pricing",
},
];

export default function HamburgerButton() {
const [active, setActive] = useState(false);

function handleClick() {
setActive(state => !state);
setActive((state) => !state);
}

function handleClose() {
Expand Down
27 changes: 25 additions & 2 deletions components/Header.module.css → components/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
width: 100%;
border: 1px solid transparent;
transition: all ease-in-out 0.3s;

.buttons a {
height: 24px;
overflow: hidden;
}
}

.header svg {
Expand Down Expand Up @@ -58,7 +63,25 @@
justify-content: flex-end;
}

html:not([data-scroll='0']) .header {
transition: all linear 0.6s;
html:not([data-scroll="0"]) .header {
transition: border linear 0.6s;
border-bottom: 1px solid var(--base300);
}

:global(html.dark) {
.header {
background: rgb(var(--base50-rgb), 0.9);
}

.header .links {
text-shadow: none;
}

.row .buttons a {
fill: var(--base900);
}
}

:global(html:not([data-scroll="0"]).dark) .header {
border-color: var(--border);
}
Loading