Compare commits

..

No commits in common. "main" and "0.1.10pre1" have entirely different histories.

260 changed files with 837 additions and 5357 deletions

View file

@ -40,14 +40,13 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- name: Release New Version - name: Release New Version
uses: https://code.forgejo.org/actions/forgejo-release@v1 uses: actions/forgejo-release@v1
with: with:
direction: upload direction: upload
url: https://forgejo.neshweb.net url: https://forgejo.neshweb.net
release-dir: release release-dir: release
token: ${{ secrets.FORGEJO_TOKEN }} token: ${{ secrets.FORGEJO_TOKEN }}
tag: ${{ github.ref_name }} tag: ${{ github.ref_name }}
prerelease: true
# doesn't work atm # doesn't work atm
# unlighthouse: # unlighthouse:

View file

@ -2,6 +2,9 @@ on:
push: push:
tags: tags:
- '[0-9]+\.[0-9]+\.[0-9]+' - '[0-9]+\.[0-9]+\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+a[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+b[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+'
jobs: jobs:
checking: checking:
@ -40,7 +43,7 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- name: Release New Version - name: Release New Version
uses: https://code.forgejo.org/actions/forgejo-release@v1 uses: actions/forgejo-release@v1
with: with:
direction: upload direction: upload
url: https://forgejo.neshweb.net url: https://forgejo.neshweb.net

View file

@ -7,7 +7,7 @@ on:
jobs: jobs:
unlighthouse: unlighthouse:
runs-on: docker runs-on: docker
container: forgejo.neshweb.net/ci-docker-images/unlighthouse:latest container: forgejo.neshweb.net/firq/unlighthouse-docker:latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: https://code.forgejo.org/actions/checkout@v3 uses: https://code.forgejo.org/actions/checkout@v3
@ -23,7 +23,6 @@ jobs:
deploy-unlighthouse-files: deploy-unlighthouse-files:
needs: [ unlighthouse ] needs: [ unlighthouse ]
if: success()
runs-on: docker runs-on: docker
env: env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
@ -68,7 +67,6 @@ jobs:
deploy-unlighthouse-site: deploy-unlighthouse-site:
needs: [ deploy-unlighthouse-files ] needs: [ deploy-unlighthouse-files ]
if: success()
runs-on: docker runs-on: docker
env: env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
@ -93,6 +91,5 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }} key: ${{ secrets.SSH_PRIVATE_KEY }}
script: | script: |
PATH="$HOME/.local/bin:$PATH" PATH="$HOME/.local/bin:$PATH"
screen -ls | grep 'firq_dev-unlighthouse' | awk '{print $1}' | xargs -I % -t screen -X -S % quit
cd firq_dev cd firq_dev
screen -S firq_dev-unlighthouse -dm serve unlighthouse/ -p ${{ secrets.UNLIGHTHOUSE_DEPLOY_PORT }} screen -S firq_dev-unlighthouse -dm serve unlighthouse/ -p ${{ secrets.UNLIGHTHOUSE_DEPLOY_PORT }}

12
.vscode/settings.json vendored
View file

@ -1,12 +0,0 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/__pycache__": true
},
"hide-files.files": []
}

View file

@ -4,11 +4,11 @@ COPY . .
RUN npm i RUN npm i
RUN npm run build RUN npm run build
FROM forgejo.neshweb.net/ci-docker-images/website-serve:latest AS runtime FROM forgejo.neshweb.net/firq/website-serve-docker:latest AS runtime
COPY --from=build /app/dist /public COPY --from=build /app/dist /public
COPY --from=build /app/serve.json /public/serve.json COPY --from=build /app/serve.json /public/serve.json
RUN rm -r /public/data/ RUN rm -r /public/assets/data/
ENV PORT 8081 ENV PORT 8081
EXPOSE 8081 EXPOSE 8081

View file

@ -1,7 +1,7 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
// https://astro.build/config
import sitemap from "@astrojs/sitemap"; import sitemap from "@astrojs/sitemap";
import mdx from "@astrojs/mdx";
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
@ -10,5 +10,5 @@ export default defineConfig({
outDir: 'dist', outDir: 'dist',
publicDir: 'static', publicDir: 'static',
site: 'https://firq.dev/', site: 'https://firq.dev/',
integrations: [sitemap(), mdx()] integrations: [sitemap()]
}); });

4510
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{ {
"name": "@firq/fgosite", "name": "@firq/fgosite",
"type": "module", "type": "module",
"version": "0.1.27", "version": "0.1.10",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",
@ -11,18 +11,10 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astro-community/astro-embed-youtube": "^0.4.3",
"@astrojs/check": "^0.3.3", "@astrojs/check": "^0.3.3",
"@astrojs/mdx": "^2.0.3",
"@astrojs/sitemap": "^3.0.3", "@astrojs/sitemap": "^3.0.3",
"astro": "^4.2.1", "astro": "^4.0.7",
"autoprefixer": "^10.4.16", "iconoir": "^6.1.0",
"iconoir": "^7.2.0",
"postcss-preset-env": "^9.3.0",
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, }
"browserslist": [
"last 2 versions",
">0.5% and not dead"
]
} }

View file

@ -1,13 +0,0 @@
module.exports = {
plugins: {
"postcss-preset-env": {
autoprefixer: { flexbox: "no-2009" },
stage: 2,
features: {
"custom-properties": false,
"custom-media-queries": true,
"nesting-rules": true
}
}
}
};

View file

@ -14,14 +14,14 @@
"source" : "**/*.css", "source" : "**/*.css",
"headers" : [{ "headers" : [{
"key" : "Cache-Control", "key" : "Cache-Control",
"value" : "max-age=31536000" "value" : "max-age=86400"
}] }]
}, },
{ {
"source" : "**/*.@(jpg|jpeg|gif|png|webp|svg)", "source" : "**/*.@(jpg|jpeg|gif|png|webp|svg)",
"headers" : [{ "headers" : [{
"key" : "Cache-Control", "key" : "Cache-Control",
"value" : "max-age=31536000" "value" : "max-age=86400"
}] }]
} }
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

View file

@ -1,29 +1,27 @@
--- ---
import { Image } from 'astro:assets'
import mlb_ce from '../assets/ce/mlb.webp'
import type { GlobImage } from '../types/generic'
import { plsLoadImage } from '../utils/tools'
export interface Props { export interface Props {
name: string name: string
imageFile: string link: string
mlb: boolean mlb: string
} }
const { mlb, imageFile, name } = Astro.props const { mlb, link, name } = Astro.props
const imagePath = `/src/assets/ce/${imageFile}`
const images_ces = import.meta.glob<GlobImage>('/src/assets/ce/*.png')
const loadedCEImage = plsLoadImage(images_ces, imagePath)
const mlb_image = mlb ? 'mlbalign' : 'hidemlb' const ce_img: string = `/assets/ce/${link}.webp`
const mlb_ce: string = `/assets/ce/mlb.webp`
let mlb_image: string = 'mlbalign'
if (mlb === 'false') {
mlb_image = 'hidemlb'
}
--- ---
<article> <article>
<div> <div>
<Image src={loadedCEImage} alt={name} class="ce-crop" /> <img class="ce-crop" src={ce_img} alt={name} />
</div> </div>
<div class={mlb_image}> <div class={mlb_image}>
<Image src={mlb_ce} alt="Max-limit broken" class="mlb" /> <img class="mlb" src={mlb_ce} alt="Max-limit broken" />
</div> </div>
</article> </article>
@ -88,7 +86,6 @@ const mlb_image = mlb ? 'mlbalign' : 'hidemlb'
.mlb { .mlb {
width: 5.5rem; width: 5.5rem;
height: auto;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }

View file

@ -1,36 +1,22 @@
--- ---
import { Image } from 'astro:assets'
import type { GlobImage } from '../types/generic'
import { plsLoadImage } from '../utils/tools'
export interface Props { export interface Props {
site: string site: string
link: string link: string
imageFile: string image: string
} }
const { imageFile, link, site } = Astro.props const { image, link, site } = Astro.props
const logoAltText = `${site} Logo` const icon: string = `background-image: url('/assets/social/${image}.webp')`
const imagePath = `/src/assets/social/${imageFile}`
const images_logos = import.meta.glob<GlobImage>(
'/src/assets/social/*.{png,webp}'
)
const loadedLogoImage = plsLoadImage(images_logos, imagePath)
--- ---
<a <a href={link} target="_blank" rel="noopener noreferrer" aria-label={site}>
href={link}
target="_blank"
rel="noopener noreferrer"
aria-label=`${site} - new window`
>
<article class="contact do-hover"> <article class="contact do-hover">
<Image src={loadedLogoImage} alt={logoAltText} /> <div style={icon}>
<div> <span>
<h2>{site}</h2> <h2>{site}</h2>
</span>
</div> </div>
</article> </article>
<span class="visually-hidden">{logoAltText}</span>
</a> </a>
<style> <style>
@ -38,29 +24,18 @@ const loadedLogoImage = plsLoadImage(images_logos, imagePath)
text-decoration: none; text-decoration: none;
} }
article { article div {
--size-value: 6.25rem;
border-radius: 1.25rem; border-radius: 1.25rem;
background-size: contain;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
background-color: var(--c-darkergray); justify-content: center;
border-color: var(--c-darkgray); --size-value: 6.25rem;
padding: 10px;
text-align: center;
transition: transform var(--speed) var(--ease);
height: auto;
width: auto;
position: relative;
}
article img {
border-radius: 1.25rem;
width: var(--size-value); width: var(--size-value);
height: var(--size-value); height: var(--size-value);
} }
article:hover div { article:hover span {
border-radius: 1.25rem; border-radius: 1.25rem;
padding: 0 0.5rem; padding: 0 0.5rem;
display: flex; display: flex;
@ -68,11 +43,9 @@ const loadedLogoImage = plsLoadImage(images_logos, imagePath)
justify-content: center; justify-content: center;
text-align: center; text-align: center;
background-color: var(--c-darkgray); background-color: var(--c-darkgray);
height: calc(var(--size-value)); height: calc(var(--size-value) + 0.1rem);
width: calc(var(--size-value) - 1rem); width: calc(var(--size-value) + 0.1rem);
opacity: 90%; opacity: 90%;
z-index: 100;
position: absolute;
} }
article:hover h2 { article:hover h2 {
@ -84,14 +57,25 @@ const loadedLogoImage = plsLoadImage(images_logos, imagePath)
} }
article h2 { article h2 {
position: absolute;
display: none; display: none;
} }
article div { article span {
display: none; display: none;
} }
article {
border-radius: 1.25rem;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--c-darkergray);
border-color: var(--c-darkgray);
padding: 10px;
text-align: center;
transition: transform var(--speed) var(--ease);
height: auto;
width: auto;
}
a:hover { a:hover {
transform: scale(var(--hover-scale)); transform: scale(var(--hover-scale));
} }

View file

@ -1,31 +1,19 @@
--- ---
import { Image } from 'astro:assets'
import type { GlobImage } from '../types/generic'
import { plsLoadImage } from '../utils/tools'
export interface Props { export interface Props {
name: string name: string
origin: string origin: string
imageFile: string image: string
link: string link: string
} }
const { link, imageFile, origin, name } = Astro.props const { link, image, origin, name } = Astro.props
const imagePath = `/src/assets/favourites/${imageFile}`
const images = import.meta.glob<GlobImage>( const img: string = `/assets/favourites/${image}.webp`
'/src/assets/favourites/*.{png,webp}'
)
const loadedImage = plsLoadImage(images, imagePath)
--- ---
<a <a href={link} target="_blank" rel="noopener noreferrer">
href={link}
target="_blank"
rel="noopener noreferrer"
aria-label=`${name} - new window`
>
<div class="heading">{name}</div> <div class="heading">{name}</div>
<Image src={loadedImage} alt={name} /> <img src={img} alt={name} />
<h2 class="subtext"> <h2 class="subtext">
{origin} {origin}
</h2> </h2>
@ -45,6 +33,10 @@ const loadedImage = plsLoadImage(images, imagePath)
align-items: center; align-items: center;
} }
a:hover {
transform: scale(var(--hover-scale));
}
a { a {
border-radius: 1rem; border-radius: 1rem;
display: flex; display: flex;
@ -60,16 +52,12 @@ const loadedImage = plsLoadImage(images, imagePath)
text-align: center; text-align: center;
transition: transform var(--speed) var(--ease); transition: transform var(--speed) var(--ease);
text-decoration: none; text-decoration: none;
}
&:hover { a > img {
transform: scale(var(--hover-scale)); padding: 0px 0.25em;
} width: 90%;
height: auto;
img {
padding: 0px 0.25em;
width: 90%;
height: auto;
}
} }
@media (min-width: 512px) { @media (min-width: 512px) {
@ -77,10 +65,12 @@ const loadedImage = plsLoadImage(images, imagePath)
padding: 10px 10px; padding: 10px 10px;
width: auto; width: auto;
height: auto; height: auto;
img { }
padding: 0px 1.5em;
width: 200px; a > img {
} padding: 0px 1.5em;
width: 200px;
height: auto;
} }
} }

View file

@ -1,27 +0,0 @@
---
---
<div>
<span>
I am currently working on a site to catalogue past and future TAs.<br/>
Check it out at <a href="https://fgo-ta.com">fgo-ta.com</a>
</span>
</div>
<style>
div {
display: flex;
width: 100%;
height: 5em;
background-color: var(--c-gray);
text-align: center;
align-items: center;
justify-content: center;
color: white;
font-size: 1.5em;
}
a {
color: var(--c-darkpurple);
text-decoration: none;
}
</style>

View file

@ -1,28 +1,23 @@
--- ---
import { Image } from 'astro:assets';
import logo from '../assets/logo.svg'
import hamburger from 'iconoir/icons/menu.svg'
const hamburger_src_url = `url("${hamburger.src}")`;
--- ---
<header> <header>
<a href="/" rel="noopener noreferrer" aria-label="Home" role="navigation"> <a href="/" rel="noopener noreferrer" aria-label="Home">
<Image src={logo} alt="Firq Website Logo"/> <img src="/assets/logo.svg" alt="" />
<span class="visually-hidden">Firq Website Logo</span>
</a> </a>
<ul class="desktop"> <ul class="desktop">
<slot name="desktop"/> <slot />
</ul> </ul>
<button class="mobile" aria-label="Navigation Button" tabindex="0" onclick="this.focus()" role="navigation"> <button class="mobile" aria-label="Navigation Button" tabindex="0" onclick="this.focus()">
<ul> <ul>
<slot name="mobile"/> <slot />
</ul> </ul>
<div class="placeholder"></div> <div class="placeholder"></div>
<div class="hamburger-menu" role="navigation"></div> <i class="iconoir-menu"></i>
</button> </button>
</header> </header>
<style define:vars={{ hamburger_src_url }}> <style>
header { header {
z-index: 1000; z-index: 1000;
position: sticky; position: sticky;
@ -35,7 +30,7 @@ const hamburger_src_url = `url("${hamburger.src}")`;
line-height: 1.5em; line-height: 1.5em;
} }
header > a { header > a {
margin-left: 16px; padding-left: 16px;
padding-top: 8px; padding-top: 8px;
display: block; display: block;
height: 48px; height: 48px;
@ -84,6 +79,16 @@ const hamburger_src_url = `url("${hamburger.src}")`;
height: 64px; height: 64px;
} }
.mobile > i {
position: static;
color: white;
font-weight: bold;
font-size: 2em;
align-self: flex-start;
padding-right: 1em;
padding-top: 1.15rem;
}
.mobile > ul { .mobile > ul {
display: none; display: none;
padding: 0px; padding: 0px;
@ -106,17 +111,6 @@ const hamburger_src_url = `url("${hamburger.src}")`;
justify-self: top; justify-self: top;
} }
.hamburger-menu {
mask: var(--hamburger_src_url) no-repeat center;
background-color: white;
width: 2rem;
height: 2rem;
position: static;
align-self: flex-start;
margin-right: 1rem;
margin-top: 1rem;
}
@media (min-width: 1140px) { @media (min-width: 1140px) {
.mobile { .mobile {
display: none; display: none;

View file

@ -1,13 +1,12 @@
--- ---
export interface Props { export interface Props {
currentPage?: string currentPage?: string
navtype: "mobile" | "desktop"
link: string link: string
text: string text: string
icon: ImageMetadata icon: string
} }
const { icon, text, link, navtype, currentPage } = Astro.props const { icon, text, link, currentPage } = Astro.props
let currPage = '' let currPage = ''
const slug = link.replace(new RegExp('/', 'g'), '') const slug = link.replace(new RegExp('/', 'g'), '')
@ -18,10 +17,7 @@ if (currentPage === slug) {
currPage = 'current' currPage = 'current'
} }
const icon_src_url = `url("${icon.src}")`;
const fulllink = `/${slug}` const fulllink = `/${slug}`
let extraattributes = navtype === "mobile" ? { tabindex: "0"} : {}
--- ---
<li> <li>
@ -30,15 +26,14 @@ let extraattributes = navtype === "mobile" ? { tabindex: "0"} : {}
rel="noopener noreferrer" rel="noopener noreferrer"
aria-label={text} aria-label={text}
class={currPage} class={currPage}
role="navigation" tabindex="0"
{...extraattributes}
> >
<div class="icon"></div> <i class={icon}></i>
{text} {text}
</a> </a>
</li> </li>
<style define:vars={{ icon_src_url }}> <style>
li { li {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -46,7 +41,6 @@ let extraattributes = navtype === "mobile" ? { tabindex: "0"} : {}
display: flex; display: flex;
width: 200px; width: 200px;
} }
li > a { li > a {
display: inline-flex; display: inline-flex;
color: white; color: white;
@ -58,27 +52,10 @@ let extraattributes = navtype === "mobile" ? { tabindex: "0"} : {}
font-weight: bold; font-weight: bold;
gap: 0.2em; gap: 0.2em;
} }
li > a:hover { li > a:hover {
color: var(--c-purplepink); color: var(--c-purplepink);
} }
li > a:hover > .icon {
background-color: var(--c-purplepink);
}
.current { .current {
color: var(--c-darkpurple) !important; color: var(--c-darkpurple) !important;
} }
.current > .icon {
background-color: var(--c-darkpurple) !important;
}
.icon {
mask: var(--icon_src_url) no-repeat center;
background-color: white;
width: 1.4em;
height: 1.4em;
}
</style> </style>

View file

@ -1,43 +1,36 @@
--- ---
import { Image } from 'astro:assets';
import type { GlobImage } from '../types/generic'
import { plsLoadImage } from '../utils/tools'
export interface Props { export interface Props {
name: string name: string
level: string level: string
skills: string skills: string
np: string np: string
servantImageFile: string image_servant: string
bondceImageFile: string image_bond: string
ml: string ml: string
bond10: boolean bond10: string
} }
const { bond10, ml, bondceImageFile, servantImageFile, np, skills, level, name } = Astro.props const { bond10, ml, image_bond, image_servant, np, skills, level, name } =
const servantImagePath = `/src/assets/servant/${servantImageFile}` Astro.props
const bondceImagePath = `/src/assets/ce/bond-ce/${bondceImageFile}`
const images_servants = import.meta.glob<GlobImage>('/src/assets/servant/*.{png,webp}')
const images_bond_ces = import.meta.glob<GlobImage>('/src/assets/ce/bond-ce/*.{png,webp}')
const loadedServantImage = plsLoadImage(images_servants, servantImagePath)
const loadedBondCEImage = plsLoadImage(images_bond_ces, bondceImagePath)
const servant_img: string = `/assets/servant/${image_servant}.webp`
const bondce_img: string = `/assets/ce/bond-ce/${image_bond}.webp`
let bondce_css: string = 'bond-ce' let bondce_css: string = 'bond-ce'
if (bond10 === false) { if (bond10 === 'false') {
bondce_css += ' unobtained' bondce_css += ' unobtained'
} }
--- ---
<article> <article>
<Image src={loadedServantImage} alt={name} /> <img src={servant_img} alt={name} />
<h2 class="subtext"> <h2 class="subtext">
Level {level}<br /> Level {level}<br />
{skills}<br /> {skills}<br />
NP {np} NP {np}
</h2> </h2>
<div class="expand-on-hover"> <div class="expand-on-hover">
<Image src={loadedBondCEImage} alt="" class={bondce_css}/> <img class={bondce_css} src={bondce_img} alt="" />
<h2 class="subtext">Mana Loading: {ml === 'Not Unlocked' && <br />}{ml}</h2> <h2 class="subtext">Mana Loading: {ml === 'Not Unlocked' && <br />}{ml}</h2>
</div> </div>
</article> </article>
@ -117,7 +110,6 @@ if (bond10 === false) {
.bond-ce { .bond-ce {
padding-top: 0.75rem; padding-top: 0.75rem;
width: auto;
height: 3rem; height: 3rem;
} }

View file

@ -1,20 +1,15 @@
--- ---
import { Image } from 'astro:assets'
import type { GlobImage } from '../types/generic'
import { plsLoadImage } from '../utils/tools'
export interface Props { export interface Props {
date: string date: string
title: string title: string
link: string link: string
targetImageFile: string image: string
user?: string user?: string
servantImageFile?: string ta_servant?: string
turns?: string turns?: string
} }
const { turns, targetImageFile, user, date, servantImageFile, link, title } = const { turns, ta_servant, user, date, image, link, title } = Astro.props
Astro.props
const options_date: Intl.DateTimeFormatOptions = { const options_date: Intl.DateTimeFormatOptions = {
year: 'numeric', year: 'numeric',
@ -22,19 +17,9 @@ const options_date: Intl.DateTimeFormatOptions = {
day: '2-digit', day: '2-digit',
} }
const targetImagePath = `/src/assets/ta_icons/${targetImageFile}`
const servantImagePath = `/src/assets/ta_icons/ta_servants/${servantImageFile}`
const formatted_date = new Date(date).toLocaleDateString('de-DE', options_date) const formatted_date = new Date(date).toLocaleDateString('de-DE', options_date)
const target_images = import.meta.glob<GlobImage>( const icon: string = `background-image: url('/assets/ta_icons/${image}.webp')`
'/src/assets/ta_icons/*.{png,webp}' const servant: string = `/assets/ta_icons/ta_servants/${ta_servant}.webp`
)
const servant_images = import.meta.glob<GlobImage>(
'/src/assets/ta_icons/ta_servants/*.{png,webp}'
)
const loadedServantImage = plsLoadImage(servant_images, servantImagePath)
const loadedTargetImage = plsLoadImage(target_images, targetImagePath)
let hasuser = '' let hasuser = ''
if (user !== undefined) { if (user !== undefined) {
@ -44,9 +29,10 @@ if (user !== undefined) {
<a href={link} target="_blank" rel="noopener noreferrer" aria-label={title}> <a href={link} target="_blank" rel="noopener noreferrer" aria-label={title}>
<article> <article>
<Image src={loadedTargetImage} alt={title} class="icon" /> <div class="icon" style={icon}>
<div class="title"> <span>
<h2>{title}</h2> <h2>{title}</h2>
</span>
</div> </div>
<p> <p>
<span class={hasuser}> <span class={hasuser}>
@ -55,29 +41,22 @@ if (user !== undefined) {
{formatted_date} {formatted_date}
</p> </p>
<div class="expand-on-hover"> <div class="expand-on-hover">
<Image src={loadedServantImage} alt="" /> <img src={servant} alt="" />
<h2>{turns}</h2> <h2>{turns}</h2>
</div> </div>
</article> </article>
</a> </a>
<style> <style>
div {
display: none;
}
span { span {
display: none; display: none;
} }
.hasuser { .hasuser {
display: flex; display: flex;
} }
a { a {
text-decoration: none; text-decoration: none;
} }
article { article {
background-color: var(--c-darkergray); background-color: var(--c-darkergray);
border-color: var(--c-darkgray); border-color: var(--c-darkgray);
@ -86,28 +65,23 @@ if (user !== undefined) {
transition: transform var(--speed) var(--ease); transition: transform var(--speed) var(--ease);
height: auto; height: auto;
width: auto; width: auto;
max-width: 8rem;
border-radius: 1.25rem; border-radius: 1.25rem;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
--size-value: 7rem;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
} }
article:hover { article:hover {
transform: scale(var(--hover-scale)); transform: scale(var(--hover-scale));
} }
article > .icon { article > .icon {
border-radius: 1.25rem; border-radius: 1.25rem;
--size-value: 7rem;
width: var(--size-value); width: var(--size-value);
height: var(--size-value); height: var(--size-value);
margin: 0.5rem; margin: 0.5rem;
background-size: var(--size-value);
background-position: center center;
} }
article:hover .title { article:hover .icon span {
display: flex; display: flex;
position: absolute; position: absolute;
align-items: center; align-items: center;
@ -118,10 +92,9 @@ if (user !== undefined) {
width: calc(var(--size-value) + 0.1rem); width: calc(var(--size-value) + 0.1rem);
opacity: 90%; opacity: 90%;
border-radius: 1.25rem; border-radius: 1.25rem;
top: 1.1em;
} }
article:hover .title h2 { article:hover span h2 {
margin: 0; margin: 0;
display: inline-flex; display: inline-flex;
font-weight: bold; font-weight: bold;
@ -131,11 +104,11 @@ if (user !== undefined) {
padding: 0.5rem; padding: 0.5rem;
} }
article .title h2 { article span h2 {
display: none; display: none;
} }
article .title { article .icon span {
display: none; display: none;
} }

Some files were not shown because too many files have changed in this diff Show more