Skip to content

Commit

Permalink
Manually optimized images.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-bryant committed Apr 11, 2024
1 parent 53a4b55 commit 24edd07
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 81 deletions.
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
// basePath: "/Elderbrew",
assetPrefix: '/',
images: {
domains: ['www.elderbrew.com'],
unoptimized: true,
},
compiler: {
styledComponents: true,
Expand Down
Binary file modified public/elderbrew-00572.jpg
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/elderbrew-00608.jpg
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/elderbrew-00638.jpg
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/elderbrew-bw.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/elderbrew-color.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/game.jpg
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/gray-worry.jpg
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/merch.jpg
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/outside.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 1 addition & 7 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'
import Typography from '@mui/material/Typography';
import Stack from '@mui/material/Stack';
import Image, { ImageLoaderProps } from 'next/image'
import Image from 'next/image'
import BigHeader from '@/components/BigHeader';
import { styled } from '@mui/material/styles';

Expand All @@ -12,10 +12,6 @@ const StyledBigHeader = styled(BigHeader)(() => ({
margin: '0 0 2rem',
}));

const imageLoader = ({ src, width, quality }: ImageLoaderProps) => {
return `https://www.elderbrew.com/${src}?w=${width}&q=${quality || 75}`
}

export default function About() {
return (
<>
Expand All @@ -33,14 +29,12 @@ export default function About() {
width="500"
height="333"
alt="Elderbrew"
loader={imageLoader}
/>
<Image
src="elderbrew-00608.jpg"
width="500"
height="333"
alt="Elderbrew"
loader={imageLoader}
/>
</Stack>
<Stack spacing={4}>
Expand Down
8 changes: 1 addition & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ import Nav from "@/components/Nav";
import { Container, Box, Stack, Typography } from "@mui/material";
import Divider from '@mui/material/Divider';
import { styled } from '@mui/material/styles';
import Image, { ImageLoader, ImageLoaderProps } from 'next/image'
import Image from 'next/image'
import Link from "next/link";
import FacebookIcon from '@mui/icons-material/Facebook';
import InstagramIcon from '@mui/icons-material/Instagram';

const robotoCondensed = Roboto_Condensed({ subsets: ["latin"] });

const imageLoader = ({ src, width, quality }: ImageLoaderProps) => {
return `https://www.elderbrew.com/${src}?w=${width}&q=${quality || 75}`
}

const Footer = styled(Box)(() => ({
backgroundColor: '#000',
// boxShadow: '0 .2rem 25px rgba(255, 0, 0, 1)',
Expand Down Expand Up @@ -48,7 +44,6 @@ export default function RootLayout({
width="200"
height="127"
alt="Elderbrew"
loader={imageLoader}
/>
</Link>
<Nav />
Expand Down Expand Up @@ -125,7 +120,6 @@ export default function RootLayout({
width="500"
height="250"
alt="Elderbrew"
loader={imageLoader}
/>
</Box>
<Stack justifyContent="flex-end" alignItems={{ xs: 'center', sm: 'flex-end' }} spacing={2}>
Expand Down
30 changes: 11 additions & 19 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
import BigHeader from '@/components/BigHeader';
import { Box } from '@mui/material';
import Stack from '@mui/material/Stack';
import Image, { ImageLoaderProps } from 'next/image';
import Image from 'next/image';
import { styled } from 'styled-components';

const StyledBigHeader = styled(BigHeader)`
letter-spacing: -.2rem;
`;

const imageLoader = ({ src, width, quality }: ImageLoaderProps) => {
return `https://www.elderbrew.com/${src}?w=${width}&q=${quality || 75}`
}

export default function About() {
return (
<>
Expand All @@ -28,52 +24,48 @@ export default function About() {
'& img': {
width: { xs: '100%' },
height: { xs: 'auto' },
maxHeight: { xs: 'auto', md: '530px' },
maxHeight: { xs: 'initial', md: '530px' },
}
}}>
<Image
src="outside.jpg"
alt="Elderbrew"
sizes="100vw"
width="600"
height="900"
width="200"
height="300"
style={{ width: '100%', height: 'auto' }}
loader={imageLoader}
/>
<Image
src="gray-worry.jpg"
alt="Elderbrew"
sizes="100vw"
width="900"
height="600"
width="300"
height="200"
style={{ width: '100%', height: 'auto' }}
loader={imageLoader}
/>
</Stack>
<Stack direction={{ xs: 'column', md: 'row' }} justifyContent='center' sx={{
'& img': {
width: { xs: '100%' },
height: { xs: 'auto' },
maxHeight: { xs: 'auto', md: '530px' },
maxHeight: { xs: 'initial', md: '530px' },
}
}}>
<Image
src="merch.jpg"
alt="Elderbrew"
sizes="100vw"
width="900"
height="600"
width="300"
height="200"
style={{ width: '100%', height: 'auto' }}
loader={imageLoader}
/>
<Image
src="game.jpg"
alt="Elderbrew"
sizes="100vw"
width="600"
height="900"
width="200"
height="300"
style={{ width: '100%', height: 'auto' }}
loader={imageLoader}
/>
</Stack>
</>
Expand Down
28 changes: 0 additions & 28 deletions src/components/BigHeader.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions src/components/Nav.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions src/imageLoader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use client'

import { ImageLoaderProps } from "next/image"

export default function imageLoader({ src, width, quality }: ImageLoaderProps) {
return process.env.NODE_ENV === 'production'
? `https://www.elderbrew.com/${src}?w=${width}&q=${quality || 75}`
: `/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
}

0 comments on commit 24edd07

Please sign in to comment.