Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .github/workflows/build_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build Only

on:
push:
branches-ignore:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Build only
uses: wykies/zola-deploy-action@master
env:
OUT_DIR: docs
BUILD_DIR: .
BUILD_ONLY: true
20 changes: 20 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy Prod

on:
push:
branches:
- main

jobs:
build_and_deploy_prod:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Build and deploy
uses: wykies/zola-deploy-action@master
env:
OUT_DIR: docs
BUILD_DIR: .
PAGES_BRANCH: gh-pages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Test

on:
pull_request:
branches:
- main

jobs:
build_and_deploy_test:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Build and deploy
uses: wykies/zola-deploy-action@master
env:
OUT_DIR: docs
BUILD_DIR: .
PAGES_BRANCH: gh-pages-test
REPOSITORY: wykies/web_test
BUILD_FLAGS: --base-url https://wykies.github.io/web_test/
GITHUB_TOKEN: ${{ secrets.TOKEN }}
57 changes: 0 additions & 57 deletions .github/workflows/main.yml

This file was deleted.

Binary file modified static/banner_imgs/NAPA00.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 static/banner_imgs/NAPA01.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 static/banner_imgs/NAPA02.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 static/banner_imgs/NAPA03.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 removed static/banner_imgs/NAPA04.jpg
Binary file not shown.
47 changes: 24 additions & 23 deletions static/js/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,37 @@ let currImgIndex = -1;
let timerCarousel;
let carouselImgs;


function advanceCarousel() {
carouselImgs[currImgIndex].style.display = "none";
currImgIndex = ++currImgIndex % carouselImgs.length;
carouselImgs[currImgIndex].style.display = "block";
let adjCurrImgIndex = (currImgIndex % 2 === 0) ? 0 : currImgIndex;
carouselImgs[adjCurrImgIndex].style.display = "none";
currImgIndex = ++currImgIndex % carouselImgs.length;
adjCurrImgIndex = (currImgIndex % 2 === 0) ? 0 : currImgIndex;
carouselImgs[adjCurrImgIndex].style.display = "block";
}

function onClickHandlerAdvance() {
clearInterval(timerCarousel);
advanceCarousel();
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
clearInterval(timerCarousel);
advanceCarousel();
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
}

(function setupCarousel() {
carouselImgs = document.getElementsByClassName(IMGS_CLASS);
if (carouselImgs.length <= 0) { // To prevent call back on pages with no images
console.log("No Images found with class: " + IMGS_CLASS);
return; // Do nothing no images found
}
carouselImgs = document.getElementsByClassName(IMGS_CLASS);
if (carouselImgs.length <= 0) { // To prevent call back on pages with no images
console.log("No Images found with class: " + IMGS_CLASS);
return; // Do nothing no images found
}

// Hide all images
for (let i = 0; i < carouselImgs.length; i++) {
carouselImgs[i].style.display = "none";
}
// Hide all images
for (let i = 0; i < carouselImgs.length; i++) {
carouselImgs[i].style.display = "none";
}

currImgIndex = carouselImgs.length - 1; // Initialize last image
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
advanceCarousel();
currImgIndex = carouselImgs.length - 1; // Initialize last image
timerCarousel = setInterval(advanceCarousel, BANNER_TIMEOUT);
advanceCarousel();

// Set onclick handler to advance photo
let container = document.getElementById(IMGS_CONTAINER_ID);
container.onclick = onClickHandlerAdvance;
})();
// Set onclick handler to advance photo
let container = document.getElementById(IMGS_CONTAINER_ID);
container.onclick = onClickHandlerAdvance;
})();
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<header>
<div>
<div class="logo_container">
<a href="{{ config.base_url | safe }}"><img id="logo_img" src="{{ get_url(path=config.extra.logo) }}"/></a>
<a aria-label="logo, click to go to home" href="{{ config.base_url | safe }}"><img id="logo_img" alt="logo" src="{{ get_url(path=config.extra.logo) }}"/></a>
</div>
<div id="org_name">
<span>Wykies&nbsp;Auto&nbsp;Co</span>
Expand Down
18 changes: 9 additions & 9 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{% extends "base.html" %}
{% block content %}

{%- set num_banner_imgs = 5 -%}
{%- set num_banner_imgs = 4 -%}

<div id="photo-container">
<!-- TODO 5: Add next and previous buttons for image change (buttons could appear on hover prev on the left and next on the right)-->
{% for i in range(end=num_banner_imgs) -%}
{% if i < 10 -%}
{% set img_num = '0' ~ i | as_str -%}
{% else -%}
{% set img_num = i | as_str -%}
{% endif -%}
{% set img_fn = 'banner_imgs/NAPA' ~ img_num ~ '.jpg' -%}
{% set img = resize_image(path=img_fn, width=2400, height=1600, op="fill") -%}
<img alt="banner image{{img_num}}" class="mySlides fade" src="{{ img.url }}">
{% if i < 10 -%}
{% set img_num = '0' ~ i | as_str -%}
{% else -%}
{% set img_num = i | as_str -%}
{% endif -%}
{% set img_fn = 'banner_imgs/NAPA' ~ img_num ~ '.jpg' -%}
{% set img = resize_image(path=img_fn, width=2400, height=1600, op="fill") -%}
<img alt="banner image{{img_num}}" class="mySlides fade" src="{{ img.url }}">
{% endfor -%}
</div>

Expand Down
Loading