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

feat: cute logo v2 and optimized images #61

Open
wants to merge 6 commits into
base: main
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
Binary file modified public/assets/cute-logo.avif
Binary file not shown.
Binary file added public/assets/cute-logo.webp
Binary file not shown.
Binary file added public/assets/favicon-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/assets/logo-nav-oneko-padding.png
Binary file not shown.
Binary file added public/assets/logo-nav.avif
Binary file not shown.
Binary file removed public/assets/logo-nav.png
Binary file not shown.
Binary file added public/assets/logo-nav.webp
Binary file not shown.
Binary file added public/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions src/components/NavBar.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import OptimizedImage from "./OptimizedImage.astro";

const navLinks = {
download: ["Download", "accentPurple"],
plugins: ["Plugins", "accentBlue"],
Expand All @@ -13,10 +15,7 @@ const page = Astro.url.pathname.split("/")[1];
<div class="nav-content">
<div id="logo">
<a href="/" id="title">
<img
src="/assets/logo-nav-oneko-padding.png"
alt="Vencord Home"
/>
<OptimizedImage src="/assets/logo-nav" id="logo-img" alt="Vencord Home" />
<div id="oneko" aria-hidden="true"></div>
</a>
</div>
Expand Down Expand Up @@ -109,11 +108,15 @@ const page = Astro.url.pathname.split("/")[1];
position: relative;
}

#logo-img {
height: 27px;
}

#oneko {
position: absolute;

top: -3px;
right: 7px;
right: -20px;

display: inline-block;
width: 32px;
Expand Down
12 changes: 12 additions & 0 deletions src/components/OptimizedImage.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import type { HTMLAttributes } from "astro/types";

export interface Props extends HTMLAttributes<"img"> {}

const { src } = Astro.props;
---

<picture>
<source srcset={`${src}.avif`} type="image/avif" />
<img src={`${src}.webp`} {...Astro.props} />
</picture>
3 changes: 2 additions & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ if (Astro.url.pathname === "/") {
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="/assets/favicon.png" />
<link rel="icon" href="/assets/favicon-dark.png" media="(prefers-color-scheme: dark)" />

<link
rel="preload"
Expand All @@ -105,7 +106,7 @@ if (Astro.url.pathname === "/") {
<meta name="og:url" content={Astro.url} />
<meta
name="og:image"
content={new URL("/assets/favicon.png", Astro.site)}
content={new URL("/assets/logo.png", Astro.site)}
/>
</>
)
Expand Down
5 changes: 3 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Layout from "layouts/Layout.astro";

import LinkButton from "components/LinkButton.astro";
import AutoSizeGrid from "components/AutoSizeGrid.astro";
import OptimizedImage from "components/OptimizedImage.astro";
import Card, { CardKind } from "components/Card.svelte";

const features = [
Expand Down Expand Up @@ -64,9 +65,9 @@ if (features.length % 3 !== 0)
</Card>

<section class="tagline">
<img
<OptimizedImage
id="cute-logo"
src="/assets/cute-logo.avif"
src="/assets/cute-logo"
alt="Vencord cute wordmark"
/>
<h2>The cutest Discord client mod</h2>
Expand Down