-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
77 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,3 @@ jobs: | |
project: "arronmccror-photography-89" | ||
entrypoint: "main.ts" | ||
root: "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
# Fresh project | ||
# Photograph Portfolio | ||
|
||
[![Made with Fresh](https://fresh.deno.dev/fresh-badge-dark.svg)](https://fresh.deno.dev) | ||
|
||
An easy to deploy photography portfolio | ||
|
||
Your new Fresh project is ready to go. You can follow the Fresh "Getting | ||
Started" guide here: https://fresh.deno.dev/docs/getting-started | ||
|
||
### Usage | ||
|
||
Make sure to install Deno: https://deno.land/manual/getting_started/installation | ||
Put all your high resolution photo files into the `/static/gallery folder` | ||
|
||
run `deno task img` | ||
|
||
Your photo files will have thumbnails created using https://deno.land/x/[email protected] | ||
|
||
The thumbnails are saved to `/static/gallery-opt` | ||
|
||
Then start the project: | ||
A `static/gallery-opt/images.ts` will also be generated that contains an array of all your images. You can import the `images` variable from this file into any UI file. | ||
|
||
``` | ||
deno task start | ||
``` | ||
### Gallery.tsx | ||
The Gallery.tsx island uses https://github.com/dimsemenov/photoswipe | ||
|
||
This will watch the project directory and restart as necessary. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { Image } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { join } from "https://deno.land/[email protected]/path/mod.ts"; | ||
|
||
const imgQuality = 70; | ||
const thumbWidth = 300; | ||
const inputDir = join(Deno.cwd(), "static", "gallery"); | ||
const outputDir = join(Deno.cwd(), "static", "gallery-opt"); | ||
|
||
|
@@ -47,7 +49,7 @@ async function optimizeImages() { | |
async function optimizeImgForWeb( | ||
inputPath, | ||
outputPath, | ||
quality = 70, | ||
quality = imgQuality, | ||
fileName, | ||
) { | ||
try { | ||
|
@@ -58,7 +60,8 @@ async function optimizeImgForWeb( | |
const image = await Image.decode(inputBuffer); | ||
const widthFull = image.width; | ||
const heightFull = image.height; | ||
image.resize(300, Image.RESIZE_AUTO); | ||
|
||
image.resize(thumbWidth, Image.RESIZE_AUTO); | ||
|
||
const outputImg = await image.encodeJPEG(quality); | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,23 @@ export default function App({ Component }: PageProps) { | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>photo-ez</title> | ||
<link rel="stylesheet" href="/styles.css" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"></link> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
</link> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Edu+AU+VIC+WA+NT+Pre:[email protected]&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" | ||
rel="stylesheet" | ||
> | ||
</link> | ||
</head> | ||
<body> | ||
<Component /> | ||
<body class="bg-white dark:bg-slate-800 text-slate-900 dark:text-white leading-loose"> | ||
<div class="px-4 py-8 mx-auto "> | ||
<nav class="text-center flex gap-3 justify-center"> | ||
<a href="/">Home</a> | ||
<a href="/about">About</a> | ||
</nav> | ||
<Component /> | ||
</div> | ||
</body> | ||
</html> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { RouteContext } from "$fresh/server.ts"; | ||
|
||
export default function MyPage(req: Request, ctx: RouteContext) { | ||
return ( | ||
<> | ||
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center"> | ||
<h1 class="text-4xl py-4"> | ||
About | ||
</h1> | ||
<p>My photography is often what catches my eye. The juxtaposition of nature and human made objects is what I find interesting. We build tall sky scrapers so we can see beyond the trees. We build televisions so we can watch birds inside of a box.</p> | ||
<p>I try to capture the balance between our human existence and the existence of Earth itself.</p> | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
import { Gallery } from "../islands/Gallery.tsx"; | ||
import "jsr:@std/dotenv/load"; | ||
import { Head } from "$fresh/runtime.ts"; | ||
import { Gallery } from "../islands/Gallery.tsx"; | ||
|
||
export default function Home() { | ||
const SiteName = Deno.env.get("SITE_NAME"); | ||
return ( | ||
<> | ||
<Head> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"></link> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
</link> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Edu+AU+VIC+WA+NT+Pre:[email protected]&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" | ||
rel="stylesheet" | ||
> | ||
</link> | ||
</Head> | ||
<div class="px-4 py-8 mx-auto bg-white dark:bg-slate-800 text-slate-900 dark:text-white"> | ||
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center"> | ||
<h1 class="text-4xl py-4"> | ||
{SiteName ?? "Arron McCrory Photography"} | ||
</h1> | ||
<Gallery /> | ||
</div> | ||
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center"> | ||
<h1 class="text-4xl py-4"> | ||
{SiteName ?? "Photography Portfolio"} | ||
</h1> | ||
<Gallery /> | ||
</div> | ||
</> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters