Skip to content

Commit

Permalink
new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jochemloedeman committed Sep 8, 2024
1 parent b95f23e commit dd9ff47
Show file tree
Hide file tree
Showing 63 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
name: Deploy web app to Azure Static Web Apps

env:
APP_LOCATION: "/" # location of your client code
APP_LOCATION: "/app" # location of your client code
OUTPUT_LOCATION: "build" # location of client code build output


Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ _site/
# counterproductive to check this file into the repository.
# Details at https://github.com/github/pages-gem/issues/768
Gemfile.lock

/images
File renamed without changes.
Binary file added app/images/lightbox/image_0.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 added app/images/lightbox/image_1.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 added app/images/lightbox/image_10.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 added app/images/lightbox/image_11.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 added app/images/lightbox/image_12.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 added app/images/lightbox/image_13.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 added app/images/lightbox/image_14.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 added app/images/lightbox/image_15.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 added app/images/lightbox/image_2.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 added app/images/lightbox/image_3.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 added app/images/lightbox/image_4.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 added app/images/lightbox/image_5.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 added app/images/lightbox/image_6.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 added app/images/lightbox/image_7.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 added app/images/lightbox/image_8.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 added app/images/lightbox/image_9.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 added app/images/thumbnail/image_0.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 added app/images/thumbnail/image_1.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 added app/images/thumbnail/image_10.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 added app/images/thumbnail/image_11.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 added app/images/thumbnail/image_12.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 added app/images/thumbnail/image_13.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 added app/images/thumbnail/image_14.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 added app/images/thumbnail/image_15.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 added app/images/thumbnail/image_2.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 added app/images/thumbnail/image_3.jpg
Binary file added app/images/thumbnail/image_4.jpg
Binary file added app/images/thumbnail/image_5.jpg
Binary file added app/images/thumbnail/image_6.jpg
Binary file added app/images/thumbnail/image_7.jpg
Binary file added app/images/thumbnail/image_8.jpg
Binary file added app/images/thumbnail/image_9.jpg
File renamed without changes.
34 changes: 17 additions & 17 deletions scripts/distribute_images.js → app/scripts/distribute_images.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Array of image sources
const images = [
'images/P1070378-Enhanced-RD Large.jpeg',
'images/DSCF4429-Enhanced-RD Large.jpeg',
'images/P1070333-Enhanced-RD Large.jpeg',
'images/DSCF4744-Enhanced-RD Large.jpeg',
'images/P1070384-Enhanced-RD Large.jpeg',
'images/P1070444 Large.jpeg',
'images/DSCF4570-Enhanced-RD-2 Large.jpeg',
'images/DSC09328-Enhanced-NR Large.jpeg',
'images/P1070347-Enhanced-RD Large.jpeg',
'images/P1070303-Enhanced-RD Large.jpeg',
'images/DSCF4602-Enhanced-RD-2 Large.jpeg',
'images/DSC08987 Large.jpeg',
'images/DSC09061 Large.jpeg',
'images/DSC08870 Large.jpeg',
'images/DSCF4310-Enhanced-RD Large.jpeg',
"image_8.jpg",
"image_4.jpg",
"image_12.jpg",
"image_6.jpg",
"image_13.jpg",
"image_2.jpg",
"image_7.jpg",
"image_0.jpg",
"image_1.jpg",
"image_9.jpg",
"image_10.jpg",
"image_15.jpg",
"image_3.jpg",
"image_11.jpg",
"image_14.jpg",
];

const twoColumnThreshold = 768;
Expand Down Expand Up @@ -46,8 +46,8 @@ function distributeImages() {
images.forEach((src, index) => {
const hyperlink = document.createElement('a');
const img = document.createElement('img');
img.src = src;
hyperlink.href = src;
img.src = `/images/thumbnail/${src}`;
hyperlink.href = `/images/lightbox/${src}`;
hyperlink.setAttribute('data-lightbox', 'gallery');
hyperlink.appendChild(img);
columns[index % columnCount].appendChild(hyperlink);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file removed images/DSC08870 Large.jpeg
Diff not rendered.
Binary file removed images/DSC08987 Large.jpeg
Diff not rendered.
Binary file removed images/DSC09061 Large.jpeg
Diff not rendered.
Binary file removed images/DSC09328-Enhanced-NR Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4310-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4429-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4570-Enhanced-RD-2 Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4602-Enhanced-RD-2 Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4667-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/DSCF4744-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070303-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070333-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070347-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070378-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070384-Enhanced-RD Large.jpeg
Diff not rendered.
Binary file removed images/P1070444 Large.jpeg
Diff not rendered.
15 changes: 0 additions & 15 deletions jsconfig.json

This file was deleted.

Binary file removed tailwindcss
Binary file not shown.
1 change: 1 addition & 0 deletions utils/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
34 changes: 34 additions & 0 deletions utils/prepare_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from pathlib import Path
from PIL import Image

LIGHTBOX_RATIO = 0.8
THUMBNAIL_RATIO = 0.3

if __name__ == "__main__":
# List all the images in the images folder
image_folder = Path(__file__).parents[1] / "images"
app_image_folder = Path(__file__).parents[1] / "app" / "images"
lightbox_folder = app_image_folder / "lightbox"
thumbnail_folder = app_image_folder / "thumbnail"
app_image_folder.mkdir(exist_ok=True)
lightbox_folder.mkdir(exist_ok=True)
thumbnail_folder.mkdir(exist_ok=True)

images = list(image_folder.glob("*.j*pg"))

for index, image in enumerate(images):
# Create lightbox version
with Image.open(image) as img:
width, height = img.size
new_height = int(height * LIGHTBOX_RATIO)
new_width = int(width * LIGHTBOX_RATIO)
img = img.resize((new_width, new_height))
img.save(app_image_folder / "lightbox" / f"image_{index}.jpg")

# Create thumbnail version
with Image.open(image) as img:
width, height = img.size
new_height = int(height * THUMBNAIL_RATIO)
new_width = int(width * THUMBNAIL_RATIO)
img = img.resize((new_width, new_height))
img.save(app_image_folder / "thumbnail" / f"image_{index}.jpg")
1 change: 1 addition & 0 deletions utils/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pillow==10.4.0

0 comments on commit dd9ff47

Please sign in to comment.