test first commit

This commit is contained in:
Firq 2023-07-17 23:34:53 +02:00
parent 7bc2057f5c
commit 93ad10a1d5
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
23 changed files with 6404 additions and 75 deletions

63
src/components/Card.astro Normal file
View file

@ -0,0 +1,63 @@
---
interface Props {
title: string;
body: string;
href: string;
}
const { href, title, body } = Astro.props;
---
<li class="link-card">
<a href={href}>
<h2>
{title}
<span>&rarr;</span>
</h2>
<p>
{body}
</p>
</a>
</li>
<style>
.link-card {
list-style: none;
display: flex;
padding: 0.25rem;
background-color: white;
background-image: none;
background-size: 400%;
border-radius: 0.6rem;
background-position: 100%;
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.link-card > a {
width: 100%;
text-decoration: none;
line-height: 1.4;
padding: 1rem 1.3rem;
border-radius: 0.35rem;
color: #111;
background-color: white;
opacity: 0.8;
}
h2 {
margin: 0;
font-size: 1.25rem;
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
p {
margin-top: 0.5rem;
margin-bottom: 0;
color: #444;
}
.link-card:is(:hover, :focus-within) {
background-position: 0;
background-image: var(--accent-gradient);
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent));
}
</style>

34
src/components/hero.astro Normal file
View file

@ -0,0 +1,34 @@
---
---
<div>
<span>
This site is a WIP project by Firq.
<br />
In the future, it will be used to catalogue information around FGO TA and the
game in general.
<br />
<a href="https://firq.dev" target="_blank" rel="noopener noreferrer">Feel free to check out my own site.</a>
</span>
<slot />
</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;
padding: 2rem 0rem;
margin-top: 7.5rem;
}
a {
text-align: center;
text-decoration: none;
}
</style>

131
src/components/navbar.astro Normal file
View file

@ -0,0 +1,131 @@
---
---
<header>
<a href="/" rel="noopener noreferrer" aria-label="Home">
<img src="/assets/logo.svg" alt="" />
</a>
<ul class="desktop">
<slot />
</ul>
<button class="mobile" aria-label="Navigation Button" tabindex="0" onclick="this.focus()">
<ul>
<slot />
</ul>
<div class="placeholder"></div>
<i class="iconoir-menu"></i>
</button>
</header>
<style>
header {
z-index: 1000;
position: sticky;
top: 0px;
background-color: var(--c-darkgray);
display: flex;
height: auto;
width: 100%;
align-items: flex-start;
line-height: 1.5em;
}
header > a {
padding-left: 16px;
padding-top: 8px;
display: block;
height: 48px;
width: 48px;
}
a > img {
height: 100%;
width: 100%;
object-fit: contain;
}
.desktop {
align-items: center;
justify-content: space-around;
display: none;
flex-wrap: wrap;
flex-direction: row;
height: 64px;
width: 100%;
list-style-type: none;
row-gap: 0.5em;
column-gap: 0.5ch;
margin: 0px;
line-height: 1.5em;
}
.mobile > ul {
background-color: var(--c-darkgray);
align-items: center;
flex-wrap: wrap;
flex-direction: column;
display: flex;
width: 100%;
list-style-type: none;
line-height: 3em;
}
.placeholder {
display: flex;
width: 100%;
}
.mobile {
display: flex;
background-color: var(--c-darkgray);
border: 0px;
width: 100%;
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 {
display: none;
padding: 0px;
}
.mobile:focus-within > ul {
display: flex;
}
.mobile:focus-within > .placeholder {
display: none;
}
.mobile:focus-within {
justify-content: top;
height: auto;
}
header:focus-within > a {
display: flex;
justify-self: top;
}
@media (min-width: 1140px) {
.mobile {
display: none;
}
.desktop {
display: flex;
}
header {
height: 64px;
align-items: center;
}
header > a {
padding-top: 0px;
}
}
</style>

View file

@ -0,0 +1,59 @@
---
export interface Props {
currentPage?: string
link: string
text: string
icon: string
}
const { icon, text, link, currentPage } = Astro.props
let currPage = ''
const slug = link.replace(new RegExp('/', 'g'), '')
if (currentPage === slug) {
currPage = 'current'
} else if (currentPage === 'home' && link === '/') {
currPage = 'current'
}
const fulllink = `/${slug}`
---
<li>
<a
href={fulllink}
rel="noopener noreferrer"
aria-label={text}
class={currPage}
tabindex="0"
>
<i class={icon}></i>
{text}
</a>
</li>
<style>
li {
align-items: center;
justify-content: center;
text-align: left;
display: flex;
width: 200px;
}
li > a {
color: white;
text-decoration: none;
justify-content: center;
align-items: center;
font-size: 1.4em;
height: 100%;
font-weight: bold;
}
li > a:hover {
color: var(--c-purplepink);
}
.current {
color: var(--c-darkpurple);
}
</style>

1
src/env.d.ts vendored Normal file
View file

@ -0,0 +1 @@
/// <reference types="astro/client" />

81
src/layouts/Layout.astro Normal file
View file

@ -0,0 +1,81 @@
---
import Navbar from '../components/navbar.astro'
import NavbarEntry from '../components/navbarEntry.astro'
import navdata from '../../static/assets/data/_navdata.json'
export interface Props {
title: string
currentpage: string
descriptionOverride?: string
}
const { descriptionOverride, currentpage, title } = Astro.props
let description
if (descriptionOverride === undefined) {
description = 'FGO TA Catalogue'
} else {
description = descriptionOverride
}
let currPage = 'https://fgo-ta.com/'
if (currentpage !== 'home') {
currPage += currentpage
}
---
<!DOCTYPE html>
<html lang="en">
<head>
<title>{title}</title>
<!-- Meta Tags -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:url" content={currPage} />
<meta property="og:description" content={description} />
<meta property="og:image" content="/assets/embed.png" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_US" />
<meta name="theme-color" content="#b86cff" />
<!-- Links -->
<link rel="icon" type="image/ico" href="/assets/favicon.ico" />
<link rel="sitemap" href="/sitemap-index.xml" />
<link href="https://mastodon.neshweb.net/@Firq" rel="me" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css"
/>
</head>
<body>
<Navbar>
{
navdata.map((item) => (
<NavbarEntry currentPage={currentpage} {...item} />
))
}
</Navbar>
<slot />
</body>
</html>
<style is:global>
:root {
--hover-scale: 1.05;
--speed: 50%;
--ease: 50%;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
--c-darkgray: #1e1e1e;
--c-duskgray: #242424;
--c-gray: #2e2e2e;
--c-lightgray: #3e3e3e;
--c-darkpurple: #b86cff;
--c-purplepink: #c105ff;
--c-darkergray: #1b1b1b;
}
body {
background: var(--c-lightgray);
margin: 0px;
}
</style>

View file

@ -0,0 +1,73 @@
---
export interface Props {
title: string
}
const { title } = Astro.props
---
<div class="base">
<h1>{title}</h1>
<div>
<slot />
</div>
</div>
<style>
div {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
div > div {
row-gap: 1em;
column-gap: 1em;
justify-content: center;
align-self: center;
display: flex;
flex-flow: row wrap;
padding: 1em;
position: relative;
}
div h1 {
font-size: 40px;
line-height: 48px;
letter-spacing: -1px;
color: white;
margin-top: 2rem;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
padding: 0.25rem 1.5rem;
border-radius: 0.5rem;
max-width: max-content;
background-color: var(--c-darkgray);
padding-bottom: 0.5rem;
}
@media (min-width: 512px) {
div {
row-gap: 1.5em;
column-gap: 1.5em;
}
}
.base {
margin-left: 1rem;
margin-right: 1rem;
}
@media (min-width: 1000px) {
.base {
margin-left: 3rem;
margin-right: 3rem;
}
}
@media (min-width: 1500px) {
.base {
margin-left: 10%;
margin-right: 10%;
}
}
</style>

17
src/pages/index.astro Normal file
View file

@ -0,0 +1,17 @@
---
import Layout from '../layouts/Layout.astro'
import Hero from '../components/hero.astro'
const description =
'This site is a WIP project by Firq. In the future, it will be used to catalogue information around FGO TA and the game in general.'
---
<Layout
title="Home - FGO TA"
currentpage="home"
descriptionOverride={description}
>
<Hero />
</Layout>
<style></style>