Big formatting spree
Deploy with Docker Compose / deploy (push) Successful in 3m50s

This commit is contained in:
2026-04-29 09:06:41 +01:00
parent b41e67fe1a
commit 3844a32751
76 changed files with 3146 additions and 2788 deletions
+11 -11
View File
@@ -1,13 +1,13 @@
<template>
<main class="flex flex-col items-center">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<h1>404</h1>
<RouterLink to="/" class="bdr-2">
<img src="/img/memes/epic.jpeg" loading="lazy" />
</RouterLink>
<h1>Click her, she will take you home</h1>
</div>
</main>
<main class="flex flex-col items-center">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<h1>404</h1>
<RouterLink to="/" class="bdr-2">
<img src="/img/memes/epic.jpeg" loading="lazy" />
</RouterLink>
<h1>Click her, she will take you home</h1>
</div>
</main>
</template>
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,17 +1,17 @@
<script setup></script>
<template>
<div class="flex flex-col sm:flex-row">
<div class="sm:w-2/7 mt-auto mb-auto ml-0">
<slot name="left" />
</div>
<div class="w-full p-2">
<div
class="flex-row flex place-content-between m-auto place-items-center"
>
<slot name="top" />
</div>
<slot />
</div>
<div class="flex flex-col sm:flex-row">
<div class="sm:w-2/7 mt-auto mb-auto ml-0">
<slot name="left" />
</div>
<div class="w-full p-2">
<div
class="flex-row flex place-content-between m-auto place-items-center"
>
<slot name="top" />
</div>
<slot />
</div>
</div>
</template>
+11 -11
View File
@@ -9,15 +9,15 @@ import ManageRadio from "./ManageRadio.vue";
</script>
<template>
<main class="justify-center flex flex-row w-full h-full">
<div class="bdr-1 flex flex-col">
<CreateUser class="bdr-2 bg-bg_primary" />
<CreatePost class="bdr-2 bg-bg_primary" />
<CreateFavorite class="bdr-2 bg-bg_primary" />
<CreateActivity class="bdr-2 bg-bg_primary" />
<CreateRowing class="bdr-2 bg-bg_primary" />
<ManageUsers class="bdr-2 bg-bg_primary" />
<ManageRadio class="bdr-2 bg-bg_primary" />
</div>
</main>
<main class="justify-center flex flex-row w-full h-full">
<div class="bdr-1 flex flex-col">
<CreateUser class="bdr-2 bg-bg_primary" />
<CreatePost class="bdr-2 bg-bg_primary" />
<CreateFavorite class="bdr-2 bg-bg_primary" />
<CreateActivity class="bdr-2 bg-bg_primary" />
<CreateRowing class="bdr-2 bg-bg_primary" />
<ManageUsers class="bdr-2 bg-bg_primary" />
<ManageRadio class="bdr-2 bg-bg_primary" />
</div>
</main>
</template>
+27 -21
View File
@@ -11,29 +11,35 @@ const name = ref("");
const link = ref("");
async function post() {
try {
const data = await gql(
`mutation CreateActivity($input: CreateActivityInput!) { createActivity(input: $input) { id } }`,
{ input: { type: type.value, name: name.value, link: link.value || undefined } },
);
type.value = "";
name.value = "";
link.value = "";
console.log(data.createActivity);
emit("done");
} catch (err) {
console.error(err);
}
try {
const data = await gql(
`mutation CreateActivity($input: CreateActivityInput!) { createActivity(input: $input) { id } }`,
{
input: {
type: type.value,
name: name.value,
link: link.value || undefined,
},
},
);
type.value = "";
name.value = "";
link.value = "";
console.log(data.createActivity);
emit("done");
} catch (err) {
console.error(err);
}
}
</script>
<template>
<div class="flex flex-col">
<h1>Create Activity</h1>
<input type="text" v-model="type" placeholder="Type" @keyup.enter="post" />
<input type="text" v-model="name" placeholder="Name" @keyup.enter="post" />
<input type="text" v-model="link" placeholder="Link" @keyup.enter="post" />
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
<div class="flex flex-col">
<h1>Create Activity</h1>
<input type="text" v-model="type" placeholder="Type" @keyup.enter="post" />
<input type="text" v-model="name" placeholder="Name" @keyup.enter="post" />
<input type="text" v-model="link" placeholder="Link" @keyup.enter="post" />
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
</template>
+32 -20
View File
@@ -10,28 +10,40 @@ const name = ref("");
const link = ref("");
async function submit() {
try {
await gql(
`mutation CreateBookmark($input: CreateBookmarkInput!) { createBookmark(input: $input) { id } }`,
{ input: { category: category.value, name: name.value, link: link.value } },
);
category.value = "";
name.value = "";
link.value = "";
emit("done");
} catch (err) {
console.error(err);
}
try {
await gql(
`mutation CreateBookmark($input: CreateBookmarkInput!) { createBookmark(input: $input) { id } }`,
{
input: { category: category.value, name: name.value, link: link.value },
},
);
category.value = "";
name.value = "";
link.value = "";
emit("done");
} catch (err) {
console.error(err);
}
}
</script>
<template>
<div class="flex flex-col">
<h1>Create Bookmark</h1>
<input type="text" v-model="category" placeholder="Category" />
<input type="text" v-model="name" placeholder="Name" @keyup.enter="submit" />
<input type="text" v-model="link" placeholder="Link" @keyup.enter="submit" />
<Button @click="submit">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
<div class="flex flex-col">
<h1>Create Bookmark</h1>
<input type="text" v-model="category" placeholder="Category" />
<input
type="text"
v-model="name"
placeholder="Name"
@keyup.enter="submit"
/>
<input
type="text"
v-model="link"
placeholder="Link"
@keyup.enter="submit"
/>
<Button @click="submit">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
</template>
+27 -21
View File
@@ -11,29 +11,35 @@ const name = ref("");
const link = ref("");
async function post() {
try {
const data = await gql(
`mutation CreateFavorite($input: CreateFavoriteInput!) { createFavorite(input: $input) { id } }`,
{ input: { type: type.value, name: name.value, link: link.value || undefined } },
);
type.value = "";
name.value = "";
link.value = "";
console.log(data.createFavorite);
emit("done");
} catch (err) {
console.error(err);
}
try {
const data = await gql(
`mutation CreateFavorite($input: CreateFavoriteInput!) { createFavorite(input: $input) { id } }`,
{
input: {
type: type.value,
name: name.value,
link: link.value || undefined,
},
},
);
type.value = "";
name.value = "";
link.value = "";
console.log(data.createFavorite);
emit("done");
} catch (err) {
console.error(err);
}
}
</script>
<template>
<div class="flex flex-col">
<h1>Create Favorite</h1>
<input type="text" v-model="type" placeholder="Type" @keyup.enter="post" />
<input type="text" v-model="name" placeholder="Name" @keyup.enter="post" />
<input type="text" v-model="link" placeholder="Link" @keyup.enter="post" />
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
<div class="flex flex-col">
<h1>Create Favorite</h1>
<input type="text" v-model="type" placeholder="Type" @keyup.enter="post" />
<input type="text" v-model="name" placeholder="Name" @keyup.enter="post" />
<input type="text" v-model="link" placeholder="Link" @keyup.enter="post" />
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
</template>
+24 -23
View File
@@ -9,31 +9,32 @@ const title = ref("");
const content = ref("");
async function post() {
try {
const data = await gql(
`mutation CreatePost($input: CreatePostInput!) { createPost(input: $input) { id } }`,
{ input: { title: title.value, content: content.value } },
);
title.value = "";
content.value = "";
console.log(data.createPost);
emit("done");
} catch (err) {
console.error(err);
}
try {
const data = await gql(
`mutation CreatePost($input: CreatePostInput!) { createPost(input: $input) { id } }`,
{ input: { title: title.value, content: content.value } },
);
title.value = "";
content.value = "";
console.log(data.createPost);
emit("done");
} catch (err) {
console.error(err);
}
}
</script>
<template>
<div class="flex flex-col">
<h1>Create Post</h1>
<input type="text" v-model="title" placeholder="Title" @keyup.enter="post" />
<textarea
class="h-50"
v-model="content"
placeholder="Content"
></textarea>
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
<div class="flex flex-col">
<h1>Create Post</h1>
<input
type="text"
v-model="title"
placeholder="Title"
@keyup.enter="post"
/>
<textarea class="h-50" v-model="content" placeholder="Content"></textarea>
<Button @click="post">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
</div>
</template>
+46 -33
View File
@@ -9,47 +9,60 @@ const images = ref([]);
const results = ref([]);
function onFileChange(e) {
images.value = Array.from(e.target.files);
results.value = [];
images.value = Array.from(e.target.files);
results.value = [];
}
async function submit() {
if (!images.value.length) return;
results.value = images.value.map((f) => ({ name: f.name, status: "Uploading..." }));
if (!images.value.length) return;
results.value = images.value.map((f) => ({
name: f.name,
status: "Uploading...",
}));
await Promise.all(
images.value.map(async (file, i) => {
const formData = new FormData();
formData.append("image", file);
try {
const res = await axios.post("/api/rowing", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
const mins = Math.floor(res.data.Time / 1e9 / 60);
const secs = String(Math.floor((res.data.Time / 1e9) % 60)).padStart(2, "0");
results.value[i].status = `${res.data.Distance}m in ${mins}:${secs}`;
results.value[i].ok = true;
} catch (err) {
results.value[i].status = err.response?.data?.error || "Upload failed";
results.value[i].ok = false;
}
})
);
await Promise.all(
images.value.map(async (file, i) => {
const formData = new FormData();
formData.append("image", file);
try {
const res = await axios.post("/api/rowing", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
const mins = Math.floor(res.data.Time / 1e9 / 60);
const secs = String(Math.floor((res.data.Time / 1e9) % 60)).padStart(
2,
"0",
);
results.value[i].status = `${res.data.Distance}m in ${mins}:${secs}`;
results.value[i].ok = true;
} catch (err) {
results.value[i].status = err.response?.data?.error || "Upload failed";
results.value[i].ok = false;
}
}),
);
images.value = [];
emit("done");
images.value = [];
emit("done");
}
</script>
<template>
<div class="flex flex-col gap-2">
<h1>Create Rowing</h1>
<input type="file" accept="image/jpeg,image/png,image/gif,image/webp" multiple @change="onFileChange" />
<Button @click="submit">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
<div v-for="r in results" :key="r.name">
<span class="text-primary">{{ r.name }}: </span>
<span :class="r.ok ? 'text-secondary' : 'text-red-500'">{{ r.status }}</span>
</div>
<div class="flex flex-col gap-2">
<h1>Create Rowing</h1>
<input
type="file"
accept="image/jpeg,image/png,image/gif,image/webp"
multiple
@change="onFileChange"
/>
<Button @click="submit">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
<div v-for="r in results" :key="r.name">
<span class="text-primary">{{ r.name }}: </span>
<span :class="r.ok ? 'text-secondary' : 'text-red-500'">{{
r.status
}}</span>
</div>
</div>
</template>
+37 -27
View File
@@ -11,35 +11,45 @@ const message = ref("");
const error = ref("");
async function handleCreate() {
message.value = "";
error.value = "";
try {
const data = await gql(
`mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id username } }`,
{ input: { username: username.value, password: password.value } },
);
message.value = `User "${data.createUser.username}" created successfully.`;
username.value = "";
password.value = "";
} catch (err) {
error.value = err.message || "Failed to create user.";
}
message.value = "";
error.value = "";
try {
const data = await gql(
`mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id username } }`,
{ input: { username: username.value, password: password.value } },
);
message.value = `User "${data.createUser.username}" created successfully.`;
username.value = "";
password.value = "";
} catch (err) {
error.value = err.message || "Failed to create user.";
}
}
</script>
<template>
<div v-if="auth.loggedIn && auth.user.admin" class="flex flex-col">
<h1>Create User</h1>
<p v-if="message" class="text-green-500">{{ message }}</p>
<p v-if="error" class="text-red-500">{{ error }}</p>
<input type="text" v-model="username" placeholder="Username" @keyup.enter="handleCreate" />
<input type="password" v-model="password" placeholder="Password" @keyup.enter="handleCreate" />
<Button @click="handleCreate">Create Account</Button>
</div>
<div v-else-if="auth.loggedIn" class="flex flex-col">
<p>You do not have permission to create users.</p>
</div>
<div v-else class="flex flex-col">
<p>You must be logged in as an admin to create users.</p>
</div>
<div v-if="auth.loggedIn && auth.user.admin" class="flex flex-col">
<h1>Create User</h1>
<p v-if="message" class="text-green-500">{{ message }}</p>
<p v-if="error" class="text-red-500">{{ error }}</p>
<input
type="text"
v-model="username"
placeholder="Username"
@keyup.enter="handleCreate"
/>
<input
type="password"
v-model="password"
placeholder="Password"
@keyup.enter="handleCreate"
/>
<Button @click="handleCreate">Create Account</Button>
</div>
<div v-else-if="auth.loggedIn" class="flex flex-col">
<p>You do not have permission to create users.</p>
</div>
<div v-else class="flex flex-col">
<p>You must be logged in as an admin to create users.</p>
</div>
</template>
+28 -18
View File
@@ -12,29 +12,39 @@ const username = ref("");
const password = ref("");
async function handleLogin() {
await auth.logIn(username.value, password.value);
if (auth.loggedIn && route.query.redirect) {
router.push(route.query.redirect);
}
await auth.logIn(username.value, password.value);
if (auth.loggedIn && route.query.redirect) {
router.push(route.query.redirect);
}
}
function handleLogout() {
auth.logOut();
auth.logOut();
}
</script>
<template>
<div v-if="auth.loggedIn" class="flex flex-col">
<h1>Logged in</h1>
<p>{{ auth.user.id }}</p>
<p>{{ auth.user.username }}</p>
<p>{{ auth.user.admin }}</p>
<Button @click="handleLogout">Log Out</Button>
</div>
<div v-else class="flex flex-col">
<h1>Login</h1>
<input type="text" v-model="username" placeholder="Username" @keyup.enter="handleLogin" />
<input type="password" v-model="password" placeholder="Password" @keyup.enter="handleLogin" />
<Button @click="handleLogin">Log In</Button>
</div>
<div v-if="auth.loggedIn" class="flex flex-col">
<h1>Logged in</h1>
<p>{{ auth.user.id }}</p>
<p>{{ auth.user.username }}</p>
<p>{{ auth.user.admin }}</p>
<Button @click="handleLogout">Log Out</Button>
</div>
<div v-else class="flex flex-col">
<h1>Login</h1>
<input
type="text"
v-model="username"
placeholder="Username"
@keyup.enter="handleLogin"
/>
<input
type="password"
v-model="password"
placeholder="Password"
@keyup.enter="handleLogin"
/>
<Button @click="handleLogin">Log In</Button>
</div>
</template>
+80 -66
View File
@@ -9,94 +9,108 @@ const results = ref([]);
const loading = ref(false);
async function fetchSongs() {
try {
const res = await axios.get("/api/radio/songs");
songs.value = res.data.songs;
} catch (err) {
console.error(err);
}
try {
const res = await axios.get("/api/radio/songs");
songs.value = res.data.songs;
} catch (err) {
console.error(err);
}
}
function onFileChange(e) {
files.value = Array.from(e.target.files);
results.value = [];
files.value = Array.from(e.target.files);
results.value = [];
}
async function upload() {
if (!files.value.length) return;
loading.value = true;
results.value = files.value.map((f) => ({ name: f.name, status: "Uploading..." }));
if (!files.value.length) return;
loading.value = true;
results.value = files.value.map((f) => ({
name: f.name,
status: "Uploading...",
}));
await Promise.all(
files.value.map(async (file, i) => {
const formData = new FormData();
formData.append("file", file);
try {
await axios.post("/api/radio/upload", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
results.value[i].status = "Uploaded";
results.value[i].ok = true;
} catch (err) {
results.value[i].status = err.response?.data?.error || "Upload failed";
results.value[i].ok = false;
}
})
);
await Promise.all(
files.value.map(async (file, i) => {
const formData = new FormData();
formData.append("file", file);
try {
await axios.post("/api/radio/upload", formData, {
headers: { "Content-Type": "multipart/form-data" },
});
results.value[i].status = "Uploaded";
results.value[i].ok = true;
} catch (err) {
results.value[i].status = err.response?.data?.error || "Upload failed";
results.value[i].ok = false;
}
}),
);
files.value = [];
loading.value = false;
await fetchSongs();
files.value = [];
loading.value = false;
await fetchSongs();
}
async function deleteSong(name) {
try {
await axios.delete(`/api/radio/songs/${encodeURIComponent(name)}`);
await fetchSongs();
} catch (err) {
console.error(err);
}
try {
await axios.delete(`/api/radio/songs/${encodeURIComponent(name)}`);
await fetchSongs();
} catch (err) {
console.error(err);
}
}
async function toggleSong(song) {
const action = song.disabled ? "enable" : "disable";
try {
await axios.patch(`/api/radio/songs/${encodeURIComponent(song.name)}/${action}`);
await fetchSongs();
} catch (err) {
console.error(err);
}
const action = song.disabled ? "enable" : "disable";
try {
await axios.patch(
`/api/radio/songs/${encodeURIComponent(song.name)}/${action}`,
);
await fetchSongs();
} catch (err) {
console.error(err);
}
}
function formatSize(bytes) {
if (bytes < 1024) return bytes + " B";
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + " KB";
return (bytes / (1024 * 1024)).toFixed(1) + " MB";
if (bytes < 1024) return bytes + " B";
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + " KB";
return (bytes / (1024 * 1024)).toFixed(1) + " MB";
}
onMounted(fetchSongs);
</script>
<template>
<div class="flex flex-col gap-2">
<h1>Manage Radio</h1>
<input type="file" accept=".mp3,.ogg,.flac,.wav,.m4a,.opus" multiple @change="onFileChange" />
<Button @click="upload" :disabled="loading">Upload</Button>
<div v-for="r in results" :key="r.name">
<span class="text-primary">{{ r.name }}: </span>
<span :class="r.ok ? 'text-secondary' : 'text-red-500'">{{ r.status }}</span>
</div>
<div
v-for="song in songs"
:key="song.name"
class="flex flex-row items-center gap-2"
:class="{ 'opacity-50': song.disabled }"
>
<span :class="{ 'line-through': song.disabled }">{{ song.name }}</span>
<span class="text-secondary text-sm">{{ formatSize(song.size) }}</span>
<span v-if="song.disabled" class="text-red-400 text-xs">disabled</span>
<Button @click="toggleSong(song)">{{ song.disabled ? "Enable" : "Disable" }}</Button>
<Button @click="deleteSong(song.name)">Delete</Button>
</div>
<div class="flex flex-col gap-2">
<h1>Manage Radio</h1>
<input
type="file"
accept=".mp3,.ogg,.flac,.wav,.m4a,.opus"
multiple
@change="onFileChange"
/>
<Button @click="upload" :disabled="loading">Upload</Button>
<div v-for="r in results" :key="r.name">
<span class="text-primary">{{ r.name }}: </span>
<span :class="r.ok ? 'text-secondary' : 'text-red-500'">{{
r.status
}}</span>
</div>
<div
v-for="song in songs"
:key="song.name"
class="flex flex-row items-center gap-2"
:class="{ 'opacity-50': song.disabled }"
>
<span :class="{ 'line-through': song.disabled }">{{ song.name }}</span>
<span class="text-secondary text-sm">{{ formatSize(song.size) }}</span>
<span v-if="song.disabled" class="text-red-400 text-xs">disabled</span>
<Button @click="toggleSong(song)">{{
song.disabled ? "Enable" : "Disable"
}}</Button>
<Button @click="deleteSong(song.name)">Delete</Button>
</div>
</div>
</template>
+25 -24
View File
@@ -8,38 +8,39 @@ const auth = useAuthStore();
const users = ref([]);
async function fetchUsers() {
try {
const data = await gql(`query { users { id username admin } }`);
users.value = data.users;
} catch (err) {
console.error(err);
}
try {
const data = await gql(`query { users { id username admin } }`);
users.value = data.users;
} catch (err) {
console.error(err);
}
}
async function toggleAdmin(user) {
try {
const data = await auth.setUserAdmin(user.id, !user.admin);
user.admin = data.admin;
} catch (err) {
console.error(err);
}
try {
const data = await auth.setUserAdmin(user.id, !user.admin);
user.admin = data.admin;
} catch (err) {
console.error(err);
}
}
onMounted(fetchUsers);
</script>
<template>
<div class="flex flex-col">
<h1>Manage Users</h1>
<div v-for="user in users" :key="user.id" class="flex flex-row items-center gap-2">
<span>{{ user.username }}</span>
<span v-if="user.admin">(admin)</span>
<Button
v-if="user.id !== auth.user.id"
@click="toggleAdmin(user)"
>
{{ user.admin ? "Demote" : "Promote" }}
</Button>
</div>
<div class="flex flex-col">
<h1>Manage Users</h1>
<div
v-for="user in users"
:key="user.id"
class="flex flex-row items-center gap-2"
>
<span>{{ user.username }}</span>
<span v-if="user.admin">(admin)</span>
<Button v-if="user.id !== auth.user.id" @click="toggleAdmin(user)">
{{ user.admin ? "Demote" : "Promote" }}
</Button>
</div>
</div>
</template>
+21 -17
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useTemplateRef, ref, onMounted, onUnmounted } from 'vue';
import { useTemplateRef, ref, onMounted, onUnmounted } from "vue";
const display = useTemplateRef('display')
const display = useTemplateRef("display");
const displayText = ref("");
const charHeight: number = 14;
@@ -10,33 +10,37 @@ let n: number;
let m: number;
function setup() {
display.value.style.fontSize = `${charHeight}px`;
display.value.style.lineHeight = `${charHeight}px`;
fillDisplay()
display.value.style.fontSize = `${charHeight}px`;
display.value.style.lineHeight = `${charHeight}px`;
fillDisplay();
}
function fillDisplay() {
// M rows N columns
m = Math.floor(display.value.offsetHeight / charHeight);
n = Math.floor(display.value.offsetWidth / charWidth);
const row = ' '.repeat(n);
displayText.value = (row + '\n').repeat(m - 1) + row
// M rows N columns
m = Math.floor(display.value.offsetHeight / charHeight);
n = Math.floor(display.value.offsetWidth / charWidth);
const row = " ".repeat(n);
displayText.value = (row + "\n").repeat(m - 1) + row;
}
function close() {
displayText.value = ""
displayText.value = "";
}
onMounted(() => {
setup()
})
setup();
});
onUnmounted(() => {
close()
})
close();
});
</script>
<template>
<pre class="overflow-scroll w-full h-full bg-black text-white m-0 p-0" id="container" ref="display">{{ displayText
}}</pre>
<pre
class="overflow-scroll w-full h-full bg-black text-white m-0 p-0"
id="container"
ref="display"
>{{ displayText }}</pre
>
</template>
+43 -32
View File
@@ -5,7 +5,9 @@ import Header from "@/components/text/Header.vue";
import { useHomeDataStore } from "@/stores/homeData";
import { useAuthStore } from "@/stores/auth";
const CreateBookmark = defineAsyncComponent(() => import("@/views/admin/CreateBookmark.vue"));
const CreateBookmark = defineAsyncComponent(
() => import("@/views/admin/CreateBookmark.vue"),
);
const homeData = useHomeDataStore();
const authStore = useAuthStore();
@@ -13,48 +15,57 @@ const authStore = useAuthStore();
const showCreate = ref(false);
const groupedBookmarks = computed(() => {
const groups = {};
for (const b of homeData.bookmarks) {
if (!groups[b.category]) groups[b.category] = [];
groups[b.category].push(b);
}
return Object.entries(groups);
const groups = {};
for (const b of homeData.bookmarks) {
if (!groups[b.category]) groups[b.category] = [];
groups[b.category].push(b);
}
return Object.entries(groups);
});
</script>
<template>
<div class="bookmarks-wrapper">
<Header class="text-left">
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Bookmark" : "Bookmarks" }}
<button v-if="authStore.user.admin" class="text-sm px-1" @click="showCreate = !showCreate">
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateBookmark v-if="showCreate" class="flex-1 min-h-0 p-1" @done="showCreate = false" @cancel="showCreate = false" />
<div v-if="!showCreate" class="bookmarks-scroll">
<LinkTable
v-for="group in groupedBookmarks"
:key="group[0]"
:title="group[0]"
:items="group[1]"
/>
</div>
<div class="bookmarks-wrapper">
<Header class="text-left">
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Bookmark" : "Bookmarks" }}
<button
v-if="authStore.user.admin"
class="text-sm px-1"
@click="showCreate = !showCreate"
>
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateBookmark
v-if="showCreate"
class="flex-1 min-h-0 p-1"
@done="showCreate = false"
@cancel="showCreate = false"
/>
<div v-if="!showCreate" class="bookmarks-scroll">
<LinkTable
v-for="group in groupedBookmarks"
:key="group[0]"
:title="group[0]"
:items="group[1]"
/>
</div>
</div>
</template>
<style scoped>
.bookmarks-wrapper {
display: flex;
flex-direction: column;
min-height: 0;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
flex: 1;
}
.bookmarks-scroll {
flex: 1;
min-height: 0;
overflow-y: auto;
flex: 1;
min-height: 0;
overflow-y: auto;
}
</style>
+6 -6
View File
@@ -2,14 +2,14 @@
import Slideshow from "@/components/util/Slideshow.vue";
const images = [
{ url: "/img/memes/pidgeon.gif", comment: "鸟" },
// { url: "/img/memes/no_slip.png" },
// { url: "/img/memes/epic.jpeg" },
// { url: "/img/bedroom/img2.png", comment: "办公桌" },
// { url: "/img/bedroom/img1.png", comment: "床" },
{ url: "/img/memes/pidgeon.gif", comment: "鸟" },
// { url: "/img/memes/no_slip.png" },
// { url: "/img/memes/epic.jpeg" },
// { url: "/img/bedroom/img2.png", comment: "办公桌" },
// { url: "/img/bedroom/img1.png", comment: "床" },
];
</script>
<template>
<Slideshow :images="images" />
<Slideshow :images="images" />
</template>
+30 -15
View File
@@ -7,7 +7,9 @@ import { ref, defineAsyncComponent } from "vue";
import { useActivityStore } from "@/stores/activity";
import { useAuthStore } from "@/stores/auth";
const CreateActivity = defineAsyncComponent(() => import("@/views/admin/CreateActivity.vue"));
const CreateActivity = defineAsyncComponent(
() => import("@/views/admin/CreateActivity.vue"),
);
const activityStore = useActivityStore();
const authStore = useAuthStore();
@@ -15,18 +17,31 @@ const showCreate = ref(false);
</script>
<template>
<div class="flex flex-col items-center">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Activity" : "Consumption" }}
<button v-if="authStore.user.admin" class="text-sm px-1" @click="showCreate = !showCreate">
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateActivity v-if="showCreate" class="flex-1 w-full p-1" @done="showCreate = false" @cancel="showCreate = false" />
<AutoScroll v-if="!showCreate" class="flex-1 w-full">
<LinkTable variant="table" class="w-full" :items="activityStore.activity" />
</AutoScroll>
</div>
<div class="flex flex-col items-center">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Activity" : "Consumption" }}
<button
v-if="authStore.user.admin"
class="text-sm px-1"
@click="showCreate = !showCreate"
>
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateActivity
v-if="showCreate"
class="flex-1 w-full p-1"
@done="showCreate = false"
@cancel="showCreate = false"
/>
<AutoScroll v-if="!showCreate" class="flex-1 w-full">
<LinkTable
variant="table"
class="w-full"
:items="activityStore.activity"
/>
</AutoScroll>
</div>
</template>
+30 -19
View File
@@ -7,7 +7,9 @@ import { ref, defineAsyncComponent } from "vue";
import { useFavoritesStore } from "@/stores/favorites";
import { useAuthStore } from "@/stores/auth";
const CreateFavorite = defineAsyncComponent(() => import("@/views/admin/CreateFavorite.vue"));
const CreateFavorite = defineAsyncComponent(
() => import("@/views/admin/CreateFavorite.vue"),
);
const favoritesStore = useFavoritesStore();
const authStore = useAuthStore();
@@ -15,22 +17,31 @@ const showCreate = ref(false);
</script>
<template>
<div class="flex flex-col items-center">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Favorite" : "favs" }}
<button v-if="authStore.user.admin" class="text-sm px-1" @click="showCreate = !showCreate">
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateFavorite v-if="showCreate" class="w-full flex-1 p-1" @done="showCreate = false" @cancel="showCreate = false" />
<AutoScroll v-if="!showCreate" class="w-full flex-1">
<LinkTable
variant="table"
class="w-full"
:items="favoritesStore.favorites"
/>
</AutoScroll>
</div>
<div class="flex flex-col items-center">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Favorite" : "favs" }}
<button
v-if="authStore.user.admin"
class="text-sm px-1"
@click="showCreate = !showCreate"
>
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateFavorite
v-if="showCreate"
class="w-full flex-1 p-1"
@done="showCreate = false"
@cancel="showCreate = false"
/>
<AutoScroll v-if="!showCreate" class="w-full flex-1">
<LinkTable
variant="table"
class="w-full"
:items="favoritesStore.favorites"
/>
</AutoScroll>
</div>
</template>
+49 -52
View File
@@ -7,7 +7,9 @@ import { ref, computed, defineAsyncComponent } from "vue";
import { useAuthStore } from "@/stores/auth";
import { usePostsStore } from "@/stores/posts";
const CreatePost = defineAsyncComponent(() => import("@/views/admin/CreatePost.vue"));
const CreatePost = defineAsyncComponent(
() => import("@/views/admin/CreatePost.vue"),
);
const authStore = useAuthStore();
const postsStore = usePostsStore();
@@ -20,75 +22,70 @@ const rightCap = computed(() => idx.value === postsStore.postsCount - 1);
const post = computed(() => postsStore.posts[idx.value]);
const userOwnsPost = computed(
() => post.value.author.username == authStore.user.username,
() => post.value.author.username == authStore.user.username,
);
function nextPost() {
if (idx.value < postsStore.postsCount - 1) {
idx.value++;
}
if (idx.value < postsStore.postsCount - 1) {
idx.value++;
}
}
function prevPost() {
if (idx.value > 0) {
idx.value--;
}
if (idx.value > 0) {
idx.value--;
}
}
function deletePost() {
postsStore.deletePost(post.value);
postsStore.deletePost(post.value);
}
</script>
<template>
<div class="flex flex-col flex-1 min-h-0">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Post" : post.title }}
<button v-if="authStore.user.admin" class="text-sm px-1" @click="showCreate = !showCreate">
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreatePost v-if="showCreate" class="flex-1 min-h-0 p-1" @done="showCreate = false" @cancel="showCreate = false" />
<div
v-if="!showCreate"
class="flex flex-col flex-1 min-h-0 p-1 overflow-auto text-left items-start justify-start"
<div class="flex flex-col flex-1 min-h-0">
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Create Post" : post.title }}
<button
v-if="authStore.user.admin"
class="text-sm px-1"
@click="showCreate = !showCreate"
>
<small
>Created at:
{{ new Date(post.createdAt).toLocaleString() }}</small
>
<small>By: {{ post.author.username }}</small>
<Markdown
class="flex-1 border-box text-wrap"
:source="post.content"
/>
<div class="flex flex-row w-full">
<Button
class="flex-1 border-box"
v-if="!leftCap"
@click="prevPost"
>
Prev
</Button>
<Button
class="flex-1 border-box"
v-if="!rightCap"
@click="nextPost"
>
Next
</Button>
</div>
<Button class="w-full" v-if="userOwnsPost" @click="deletePost"
>Delete</Button
>
</div>
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreatePost
v-if="showCreate"
class="flex-1 min-h-0 p-1"
@done="showCreate = false"
@cancel="showCreate = false"
/>
<div
v-if="!showCreate"
class="flex flex-col flex-1 min-h-0 p-1 overflow-auto text-left items-start justify-start"
>
<small>Created at: {{ new Date(post.createdAt).toLocaleString() }}</small>
<small>By: {{ post.author.username }}</small>
<Markdown class="flex-1 border-box text-wrap" :source="post.content" />
<div class="flex flex-row w-full">
<Button class="flex-1 border-box" v-if="!leftCap" @click="prevPost">
Prev
</Button>
<Button class="flex-1 border-box" v-if="!rightCap" @click="nextPost">
Next
</Button>
</div>
<Button class="w-full" v-if="userOwnsPost" @click="deletePost"
>Delete</Button
>
</div>
</div>
</template>
<style scoped>
img {
width: 100%;
width: 100%;
}
</style>
+11 -11
View File
@@ -2,25 +2,25 @@
import Header from "@/components/text/Header.vue";
import LinkTable from "@/components/util/LinkTable.vue";
const gym = [
{ name: "Row", type: "30 min" },
{ name: "Run", type: "5k" },
{ name: "Pushup & Squat", type: "50" },
{ name: "Row", type: "30 min" },
{ name: "Run", type: "5k" },
{ name: "Pushup & Squat", type: "50" },
];
</script>
<template>
<div class="flex flex-col place-content-between items-center">
<Header>Gym</Header>
<p>I'm not a gym geek</p>
<p>4/7 days I do:</p>
<div class="overflow-scroll w-full border-box">
<LinkTable variant="table" class="w-full" :items="gym" />
</div>
<div class="flex flex-col place-content-between items-center">
<Header>Gym</Header>
<p>I'm not a gym geek</p>
<p>4/7 days I do:</p>
<div class="overflow-scroll w-full border-box">
<LinkTable variant="table" class="w-full" :items="gym" />
</div>
</div>
</template>
<style scoped>
img {
width: 100%;
width: 100%;
}
</style>
+14 -3
View File
@@ -5,7 +5,9 @@ import { useHomeDataStore } from "@/stores/homeData";
import { useAuthStore } from "@/stores/auth";
import { storeToRefs } from "pinia";
const CreateRowing = defineAsyncComponent(() => import("@/views/admin/CreateRowing.vue"));
const CreateRowing = defineAsyncComponent(
() => import("@/views/admin/CreateRowing.vue"),
);
const store = useHomeDataStore();
const authStore = useAuthStore();
@@ -117,13 +119,22 @@ function formatValue(key, val) {
<Header>
<span class="flex items-center justify-between w-full">
{{ showCreate ? "Upload Rowing" : "Rowing" }}
<button v-if="authStore.user.admin" class="text-sm px-1" @click="showCreate = !showCreate">
<button
v-if="authStore.user.admin"
class="text-sm px-1"
@click="showCreate = !showCreate"
>
{{ showCreate ? "x" : "+" }}
</button>
</span>
</Header>
<CreateRowing v-if="showCreate" class="flex-1 p-1" @done="showCreate = false" @cancel="showCreate = false" />
<CreateRowing
v-if="showCreate"
class="flex-1 p-1"
@done="showCreate = false"
@cancel="showCreate = false"
/>
<div v-else-if="loading" class="flex-1 flex items-center justify-center">
<p>Loading...</p>
</div>
+155 -159
View File
@@ -25,223 +25,219 @@ import Bookmarks from "./Bookmarks.vue";
</script>
<template>
<main class="justify-center flex flex-row w-full h-full overflow-x-hidden">
<div class="outerWrap flex flex-row">
<div class="sidebar">
<Time class="time-sidebar sidebar-cell" />
<Timer class="timer-sidebar sidebar-cell" />
<Radio class="radio-sidebar sidebar-cell" />
<CommitHistory class="commits-sidebar flex-1 sidebar-cell" />
<main class="justify-center flex flex-row w-full h-full overflow-x-hidden">
<div class="outerWrap flex flex-row">
<div class="sidebar">
<Time class="time-sidebar sidebar-cell" />
<Timer class="timer-sidebar sidebar-cell" />
<Radio class="radio-sidebar sidebar-cell" />
<CommitHistory class="commits-sidebar flex-1 sidebar-cell" />
<!-- <Elle class="flex-1" /> -->
<!-- <MusicPlayer /> -->
<img
src="/img/memes/fire-woman.gif"
alt=""
width="178"
height="178"
class="border-tertiary border-2 sidebar-image box-border w-full bg-tertiary"
loading="lazy"
/>
</div>
<div
class="a4page-portrait homeGrid relative bdr-1 border-quaternary"
>
<!-- <Intro class="intro" /> -->
<Intro2 class="intro grid-cell" />
<!-- <BadApple class="intro" /> -->
<Listening class="listening grid-cell" />
<Stamps class="stamps grid-cell" />
<Feed class="feed grid-cell" />
<Links class="links grid-cell" />
<Collage class="collage grid-cell" />
<Consumption class="consumption grid-cell" />
<Favorites class="favorites grid-cell" />
<!-- <Gym class="gym" /> -->
<Gym2 class="gym grid-cell" />
</div>
<div class="sidebar">
<Steam class="steam-sidebar sidebar-cell" />
<Bookmarks class="bookmarks-sidebar sidebar-cell" />
<Chat
class="chat-sidebar flex-1 min-h-0 chat-home sidebar-cell"
/>
<Miku
class="sidebar-image miku-image box-border border-tertiary border-2 bg-bg_primary"
/>
</div>
</div>
</main>
<!-- <Elle class="flex-1" /> -->
<!-- <MusicPlayer /> -->
<img
src="/img/memes/fire-woman.gif"
alt=""
width="178"
height="178"
class="border-tertiary border-2 sidebar-image box-border w-full bg-tertiary"
loading="lazy"
/>
</div>
<div class="a4page-portrait homeGrid relative bdr-1 border-quaternary">
<!-- <Intro class="intro" /> -->
<Intro2 class="intro grid-cell" />
<!-- <BadApple class="intro" /> -->
<Listening class="listening grid-cell" />
<Stamps class="stamps grid-cell" />
<Feed class="feed grid-cell" />
<Links class="links grid-cell" />
<Collage class="collage grid-cell" />
<Consumption class="consumption grid-cell" />
<Favorites class="favorites grid-cell" />
<!-- <Gym class="gym" /> -->
<Gym2 class="gym grid-cell" />
</div>
<div class="sidebar">
<Steam class="steam-sidebar sidebar-cell" />
<Bookmarks class="bookmarks-sidebar sidebar-cell" />
<Chat class="chat-sidebar flex-1 min-h-0 chat-home sidebar-cell" />
<Miku
class="sidebar-image miku-image box-border border-tertiary border-2 bg-bg_primary"
/>
</div>
</div>
</main>
</template>
<style scoped>
.grid-cell {
background-color: var(--bg_primary);
border-width: 2px;
border-style: solid;
border-color: var(--quaternary);
background-color: var(--bg_primary);
border-width: 2px;
border-style: solid;
border-color: var(--quaternary);
}
.intro {
grid-area: intro;
grid-area: intro;
}
.listening {
grid-area: listening;
grid-area: listening;
}
.stamps {
grid-area: stamps;
grid-area: stamps;
}
.feed {
grid-area: feed;
grid-area: feed;
}
.links {
grid-area: links;
grid-area: links;
}
.collage {
grid-area: collage;
grid-area: collage;
}
.consumption {
grid-area: consumption;
grid-area: consumption;
}
.gym {
grid-area: gym;
grid-area: gym;
}
.favorites {
grid-area: favorites;
grid-area: favorites;
}
.sidebar-cell {
background-color: var(--bg_primary);
border-width: 2px;
border-style: solid;
border-color: var(--quaternary);
background-color: var(--bg_primary);
border-width: 2px;
border-style: solid;
border-color: var(--quaternary);
}
.sidebar {
margin: 0;
flex: 1;
display: flex;
flex-direction: column;
width: 15rem;
min-height: 0;
gap: 5px;
margin: 0;
flex: 1;
display: flex;
flex-direction: column;
width: 15rem;
min-height: 0;
gap: 5px;
}
.outerWrap {
height: 310mm;
gap: 10px;
height: 310mm;
gap: 10px;
}
.homeGrid {
display: grid;
gap: 5px;
grid-template-columns: repeat(10, 1fr);
grid-template-rows: repeat(10, 1fr);
grid-template-areas:
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro stamps stamps stamps stamps"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"consumption consumption consumption consumption gym gym gym favorites favorites favorites"
"consumption consumption consumption consumption gym gym gym favorites favorites favorites";
display: grid;
gap: 5px;
grid-template-columns: repeat(10, 1fr);
grid-template-rows: repeat(10, 1fr);
grid-template-areas:
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro listening listening listening listening"
"intro intro intro intro intro intro stamps stamps stamps stamps"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"feed feed feed links links collage collage collage collage collage"
"consumption consumption consumption consumption gym gym gym favorites favorites favorites"
"consumption consumption consumption consumption gym gym gym favorites favorites favorites";
}
.chat-home {
max-height: 800px;
max-height: 800px;
}
.miku-image {
height: 15rem;
height: 15rem;
}
@media (max-width: 1360px) {
.outerWrap {
flex-direction: column;
align-items: center;
height: auto;
}
.outerWrap {
flex-direction: column;
align-items: center;
height: auto;
}
.homeGrid {
order: -1;
width: 95vw;
height: 297mm;
margin-inline: 0;
box-sizing: border-box;
}
.homeGrid {
order: -1;
width: 95vw;
height: 297mm;
margin-inline: 0;
box-sizing: border-box;
}
.sidebar {
width: 95vw;
flex-direction: column;
align-items: center;
flex: unset;
justify-content: space-around;
}
.sidebar {
width: 95vw;
flex-direction: column;
align-items: center;
flex: unset;
justify-content: space-around;
}
.commits-sidebar,
.steam-sidebar,
.bookmarks-sidebar {
width: 100%;
max-height: 300px;
}
.commits-sidebar,
.steam-sidebar,
.bookmarks-sidebar {
width: 100%;
max-height: 300px;
}
.chat-sidebar {
width: 100%;
min-height: 400px;
max-height: 800px;
height: 25vh;
}
.chat-sidebar {
width: 100%;
min-height: 400px;
max-height: 800px;
height: 25vh;
}
.time-sidebar,
.sidebar-image,
.radio-sidebar,
.timer-sidebar {
display: none;
}
.time-sidebar,
.sidebar-image,
.radio-sidebar,
.timer-sidebar {
display: none;
}
/* .sidebar-image { */
/* max-height: 150px; */
/* max-width: 150px; */
/* object-fit: contain; */
/* } */
/* .sidebar-image { */
/* max-height: 150px; */
/* max-width: 150px; */
/* object-fit: contain; */
/* } */
}
@media (max-width: 700px) {
.homeGrid {
border-image: none;
border-width: 0;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: repeat(11, 1fr);
height: 150vh;
grid-template-areas:
"intro intro intro"
"intro intro intro"
"listening stamps stamps"
"listening feed feed"
"links feed feed"
"links feed feed"
"links feed feed"
"favorites feed feed"
"favorites consumption consumption"
"favorites consumption consumption"
"favorites consumption consumption";
}
.homeGrid {
border-image: none;
border-width: 0;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: repeat(11, 1fr);
height: 150vh;
grid-template-areas:
"intro intro intro"
"intro intro intro"
"listening stamps stamps"
"listening feed feed"
"links feed feed"
"links feed feed"
"links feed feed"
"favorites feed feed"
"favorites consumption consumption"
"favorites consumption consumption"
"favorites consumption consumption";
}
.collage {
display: none;
}
.collage {
display: none;
}
.gym {
display: none;
}
.gym {
display: none;
}
}
.bg-random {
background-color: var(--bg_primary);
background-image: url("/img/miku/miku2.gif");
background-size: 10px 10px;
background-color: var(--bg_primary);
background-image: url("/img/miku/miku2.gif");
background-size: 10px 10px;
}
</style>
+25 -23
View File
@@ -4,27 +4,29 @@ import Paragraph from "@/components/text/Paragraph.vue";
</script>
<template>
<div class="flex-1 border-box flex flex-col p-1 text-left items-start justify-start">
<Header>Yo</Header>
<!-- <Header>Intro</Header> -->
<!-- <Paragraph> -->
<!-- Hi, I'm Adam, thank you for visiting my website. -->
<!-- </Paragraph> -->
<!-- <Header>Getting around</Header> -->
<!-- <Paragraph> -->
<!-- Pages available can be traversed through links below. I am hoping to -->
<!-- add some shrines, code-walkthoughs, live chat and page transitions -->
<!-- at a later date. -->
<!-- </Paragraph> -->
<!-- <Header>Contact</Header> -->
<!-- <Paragraph> -->
<!-- Please email me <a href="mailto:[email protected]">here</a>, -->
<!-- or contact me though any of the social medias linked. -->
<!-- </Paragraph> -->
<!-- <Header>A Quote</Header> -->
<!-- <Paragraph> -->
<!-- One crossed wire, one wayward pinch of potassium chlorate, one -->
<!-- errant twitch, and KA-BLOOIE! -->
<!-- </Paragraph> -->
</div>
<div
class="flex-1 border-box flex flex-col p-1 text-left items-start justify-start"
>
<Header>Yo</Header>
<!-- <Header>Intro</Header> -->
<!-- <Paragraph> -->
<!-- Hi, I'm Adam, thank you for visiting my website. -->
<!-- </Paragraph> -->
<!-- <Header>Getting around</Header> -->
<!-- <Paragraph> -->
<!-- Pages available can be traversed through links below. I am hoping to -->
<!-- add some shrines, code-walkthoughs, live chat and page transitions -->
<!-- at a later date. -->
<!-- </Paragraph> -->
<!-- <Header>Contact</Header> -->
<!-- <Paragraph> -->
<!-- Please email me <a href="mailto:[email protected]">here</a>, -->
<!-- or contact me though any of the social medias linked. -->
<!-- </Paragraph> -->
<!-- <Header>A Quote</Header> -->
<!-- <Paragraph> -->
<!-- One crossed wire, one wayward pinch of potassium chlorate, one -->
<!-- errant twitch, and KA-BLOOIE! -->
<!-- </Paragraph> -->
</div>
</template>
+77 -80
View File
@@ -3,46 +3,46 @@ import { rand } from "@vueuse/core";
import { ref, onMounted, onUnmounted, nextTick } from "vue";
interface Item {
x: number;
y: number;
dx: number;
dy: number;
content: string;
x: number;
y: number;
dx: number;
dy: number;
content: string;
}
const container = ref<HTMLDivElement | null>(null);
const itemEls = ref<HTMLDivElement[]>([]);
const phrases = [
"Welcome to my website",
"I'm looking to do a big revamp",
"A4 sheets of paper are what I'm used to",
"I'd love to know your recommendations",
"for very short books",
"Message me by any means necessary",
"I like anime, all kinds of music and sci fic",
"Welcome to my website",
"I'm looking to do a big revamp",
"A4 sheets of paper are what I'm used to",
"I'd love to know your recommendations",
"for very short books",
"Message me by any means necessary",
"I like anime, all kinds of music and sci fic",
];
// Non-reactive animation state to avoid triggering Vue re-renders every frame
const animState = phrases.map((text, i) => ({
x: 0,
y: i * 20,
dx: rand(0, 60) / 100,
dy: 1.0,
content: text,
cachedW: 0,
cachedH: 0,
x: 0,
y: i * 20,
dx: rand(0, 60) / 100,
dy: 1.0,
content: text,
cachedW: 0,
cachedH: 0,
}));
// Reactive items only for initial render
const items = ref<Item[]>(
animState.map((s) => ({
x: s.x,
y: s.y,
dx: s.dx,
dy: s.dy,
content: s.content,
})),
animState.map((s) => ({
x: s.x,
y: s.y,
dx: s.dx,
dy: s.dy,
content: s.content,
})),
);
let rafId = 0;
@@ -52,79 +52,76 @@ let lastFrameTime = 0;
const FRAME_INTERVAL = 1000 / 30;
function measureSizes() {
const c = container.value;
if (c) {
cachedCW = c.clientWidth;
cachedCH = c.clientHeight;
const c = container.value;
if (c) {
cachedCW = c.clientWidth;
cachedCH = c.clientHeight;
}
itemEls.value.forEach((el, i) => {
if (el && animState[i]) {
animState[i].cachedW = el.offsetWidth;
animState[i].cachedH = el.offsetHeight;
}
itemEls.value.forEach((el, i) => {
if (el && animState[i]) {
animState[i].cachedW = el.offsetWidth;
animState[i].cachedH = el.offsetHeight;
}
});
});
}
function animate(timestamp: number) {
if (!cachedCW || !cachedCH) {
rafId = requestAnimationFrame(animate);
return;
}
if (timestamp - lastFrameTime < FRAME_INTERVAL) {
rafId = requestAnimationFrame(animate);
return;
}
lastFrameTime = timestamp;
for (let i = 0; i < animState.length; i++) {
const s = animState[i];
const el = itemEls.value[i];
if (!el) continue;
s.x += s.dx;
s.y += s.dy;
if (s.x < 0 || s.x > cachedCW - s.cachedW) s.dx *= -1;
if (s.y < 0 || s.y > cachedCH - s.cachedH) s.dy *= -1;
el.style.transform = `translate(${s.x}px, ${s.y}px)`;
}
if (!cachedCW || !cachedCH) {
rafId = requestAnimationFrame(animate);
return;
}
if (timestamp - lastFrameTime < FRAME_INTERVAL) {
rafId = requestAnimationFrame(animate);
return;
}
lastFrameTime = timestamp;
for (let i = 0; i < animState.length; i++) {
const s = animState[i];
const el = itemEls.value[i];
if (!el) continue;
s.x += s.dx;
s.y += s.dy;
if (s.x < 0 || s.x > cachedCW - s.cachedW) s.dx *= -1;
if (s.y < 0 || s.y > cachedCH - s.cachedH) s.dy *= -1;
el.style.transform = `translate(${s.x}px, ${s.y}px)`;
}
rafId = requestAnimationFrame(animate);
}
let resizeObserver: ResizeObserver;
onMounted(async () => {
await nextTick();
measureSizes();
rafId = requestAnimationFrame(animate);
await nextTick();
measureSizes();
rafId = requestAnimationFrame(animate);
resizeObserver = new ResizeObserver(measureSizes);
resizeObserver.observe(container.value!);
resizeObserver = new ResizeObserver(measureSizes);
resizeObserver.observe(container.value!);
});
onUnmounted(() => {
cancelAnimationFrame(rafId);
resizeObserver?.disconnect();
cancelAnimationFrame(rafId);
resizeObserver?.disconnect();
});
</script>
<template>
<div ref="container" class="w-full h-full relative overflow-hidden">
<div
ref="container"
class="w-full h-full relative overflow-hidden"
v-for="(item, i) in items"
:key="i"
ref="itemEls"
class="absolute w-fit h-fit"
>
<div
v-for="(item, i) in items"
:key="i"
ref="itemEls"
class="absolute w-fit h-fit"
>
<h1>
{{ item.content }}
</h1>
</div>
<h1>
{{ item.content }}
</h1>
</div>
</div>
</template>
+19 -19
View File
@@ -4,31 +4,31 @@ import LinkTable from "@/components/util/LinkTable.vue";
import Header from "@/components/text/Header.vue";
const site_links = [
{ name: "CV", link: "/cv" },
{ name: "Bookmarks", link: "/bookmarks" },
{ name: "Shrines", link: "/shrines" },
{ name: "Admin", link: "/admin" },
{ name: "CV", link: "/cv" },
{ name: "Bookmarks", link: "/bookmarks" },
{ name: "Shrines", link: "/shrines" },
{ name: "Admin", link: "/admin" },
];
const social_links = [
{ name: "Gitea", link: "/gitea/explore/repos" },
{ name: "Steam", link: "https://steamcommunity.com/id/SteveThePug" },
{ name: "Github", link: "https://github.com/SteveThePug" },
{ name: "Spotify", link: "https://open.spotify.com/user/stevethepug" },
{ name: "Notes", link: "/notes/" },
{ name: "Gitea", link: "/gitea/explore/repos" },
{ name: "Steam", link: "https://steamcommunity.com/id/SteveThePug" },
{ name: "Github", link: "https://github.com/SteveThePug" },
{ name: "Spotify", link: "https://open.spotify.com/user/stevethepug" },
{ name: "Notes", link: "/notes/" },
];
</script>
<template>
<div class="flex flex-col overflow-auto">
<Header>Links</Header>
<div class="flex flex-col justify-between flex-1">
<div class="flex flex-col gap-1">
<RouterTable :linkArr="site_links" />
</div>
<div class="flex flex-col gap-1">
<LinkTable :items="social_links" />
</div>
</div>
<div class="flex flex-col overflow-auto">
<Header>Links</Header>
<div class="flex flex-col justify-between flex-1">
<div class="flex flex-col gap-1">
<RouterTable :linkArr="site_links" />
</div>
<div class="flex flex-col gap-1">
<LinkTable :items="social_links" />
</div>
</div>
</div>
</template>
+41 -40
View File
@@ -11,75 +11,76 @@ let nextId = null;
let refreshId = null;
function nextSong() {
clearTimeout(nextId);
nextId = setTimeout(nextSong, 5000);
idx.value = (idx.value + 1) % songsStore.songsCount;
clearTimeout(nextId);
nextId = setTimeout(nextSong, 5000);
idx.value = (idx.value + 1) % songsStore.songsCount;
}
onMounted(() => {
songsStore.fetchSongs();
nextId = setTimeout(nextSong, 5000);
refreshId = setInterval(songsStore.fetchSongs, 120000);
songsStore.fetchSongs();
nextId = setTimeout(nextSong, 5000);
refreshId = setInterval(songsStore.fetchSongs, 120000);
});
onUnmounted(() => {
clearTimeout(nextId);
clearInterval(refreshId);
clearTimeout(nextId);
clearInterval(refreshId);
});
</script>
<template>
<div class="listening-wrapper">
<div class="listening-wrapper">
<Transition name="fade">
<div
@click="nextSong"
:key="song.track.name"
class="flex flex-col items-center pt-2"
>
<Header>Listening To</Header>
<img :src="song.track.album.images[0].url" :alt="song.track.album.name + ' album art'" />
<p class="text-center">
<strong>Song:</strong> {{ song.track.name }}
</p>
<p class="text-center">
<strong>Artist:</strong> {{ song.track.artists[0].name }}
</p>
</div>
<div
@click="nextSong"
:key="song.track.name"
class="flex flex-col items-center pt-2"
>
<Header>Listening To</Header>
<img
:src="song.track.album.images[0].url"
:alt="song.track.album.name + ' album art'"
/>
<p class="text-center"><strong>Song:</strong> {{ song.track.name }}</p>
<p class="text-center">
<strong>Artist:</strong> {{ song.track.artists[0].name }}
</p>
</div>
</Transition>
</div>
</div>
</template>
<style scoped>
.listening-wrapper {
position: relative;
width: 100%;
height: 100%;
min-width: 0;
overflow-y: auto;
position: relative;
width: 100%;
height: 100%;
min-width: 0;
overflow-y: auto;
}
img {
width: 70%;
max-width: 100%;
height: auto;
width: 70%;
max-width: 100%;
height: auto;
}
p {
width: 100%;
margin: 0 auto;
width: 100%;
margin: 0 auto;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
}
.fade-leave-active {
position: absolute;
top: 0;
left: 0;
right: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
opacity: 0;
}
</style>
+4 -4
View File
@@ -2,12 +2,12 @@
import Slideshow from "@/components/util/Slideshow.vue";
const images = [
{ url: "/img/miku/miku1.gif" },
{ url: "/img/miku/miku2.gif" },
// { url: "/img/miku/miku2.png" },
{ url: "/img/miku/miku1.gif" },
{ url: "/img/miku/miku2.gif" },
// { url: "/img/miku/miku2.png" },
];
</script>
<template>
<Slideshow class="p-5" :images="images" :interval="10000" />
<Slideshow class="p-5" :images="images" :interval="10000" />
</template>
+63 -58
View File
@@ -6,20 +6,20 @@ import Link from "@/components/text/Link.vue";
import { shuffleArray } from "@/js/utils.js";
let srcs = [
"/img/stamps/portal.gif",
"/img/stamps/miku.gif",
"/img/stamps/utau.gif",
"/img/stamps/teto.webp",
"/img/stamps/3ds.jpg",
"/img/stamps/fry.png",
"/img/stamps/ai.png",
"/img/stamps/rei.png",
"/img/stamps/tetris.gif",
"/img/stamps/tf2.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
"/img/stamps/portal.gif",
"/img/stamps/miku.gif",
"/img/stamps/utau.gif",
"/img/stamps/teto.webp",
"/img/stamps/3ds.jpg",
"/img/stamps/fry.png",
"/img/stamps/ai.png",
"/img/stamps/rei.png",
"/img/stamps/tetris.gif",
"/img/stamps/tf2.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
"/img/stamps/demo.gif",
];
shuffleArray(srcs);
@@ -31,71 +31,76 @@ let dx = 0.2;
let dy = 0.12;
function bounce() {
const el = touchscreen.value?.$el;
if (!el) return;
const el = touchscreen.value?.$el;
if (!el) return;
const maxX = el.scrollWidth - el.clientWidth;
const maxY = el.scrollHeight - el.clientHeight;
const maxX = el.scrollWidth - el.clientWidth;
const maxY = el.scrollHeight - el.clientHeight;
if (maxX > 0) {
posX += dx;
if (posX <= 0) {
posX = 0;
dx = -dx;
} else if (posX >= maxX) {
posX = maxX;
dx = -dx;
}
el.scrollLeft = posX;
if (maxX > 0) {
posX += dx;
if (posX <= 0) {
posX = 0;
dx = -dx;
} else if (posX >= maxX) {
posX = maxX;
dx = -dx;
}
if (maxY > 0) {
posY += dy;
if (posY <= 0) {
posY = 0;
dy = -dy;
} else if (posY >= maxY) {
posY = maxY;
dy = -dy;
}
el.scrollTop = posY;
el.scrollLeft = posX;
}
if (maxY > 0) {
posY += dy;
if (posY <= 0) {
posY = 0;
dy = -dy;
} else if (posY >= maxY) {
posY = maxY;
dy = -dy;
}
el.scrollTop = posY;
}
animId = requestAnimationFrame(bounce);
animId = requestAnimationFrame(bounce);
}
onMounted(() => {
animId = requestAnimationFrame(bounce);
animId = requestAnimationFrame(bounce);
});
onUnmounted(() => {
if (animId) cancelAnimationFrame(animId);
if (animId) cancelAnimationFrame(animId);
});
</script>
<template>
<Touchscreen ref="touchscreen">
<div class="flex flex-wrap tst">
<Link bare href="https://www.adam-french.co.uk">
<img src="https://www.adam-french.co.uk/img/stamps/mine.gif" alt="adam-french.co.uk" />
</Link>
<Link bare href="https://jacobbarron.xyz">
<img
src="https://jacobbarron.xyz/Banneh.gif"
alt="jacobbarron.xyz"
/>
</Link>
<img v-for="src in srcs" :src="src" :alt="src.split('/').pop().split('.')[0]" loading="lazy" />
</div>
</Touchscreen>
<Touchscreen ref="touchscreen">
<div class="flex flex-wrap tst">
<Link bare href="https://www.adam-french.co.uk">
<img
src="https://www.adam-french.co.uk/img/stamps/mine.gif"
alt="adam-french.co.uk"
/>
</Link>
<Link bare href="https://jacobbarron.xyz">
<img src="https://jacobbarron.xyz/Banneh.gif" alt="jacobbarron.xyz" />
</Link>
<img
v-for="src in srcs"
:src="src"
:alt="src.split('/').pop().split('.')[0]"
loading="lazy"
/>
</div>
</Touchscreen>
</template>
<style scoped>
img {
width: 89px;
height: 59px;
width: 89px;
height: 59px;
}
.tst {
min-width: calc(89px * 4);
min-width: calc(89px * 4);
}
</style>
+70 -70
View File
@@ -17,116 +17,116 @@ let nextId = null;
let refreshId = null;
function nextGame() {
clearTimeout(nextId);
nextId = setTimeout(nextGame, 5000);
if (steamStatus.value.recentGames.length) {
idx.value = (idx.value + 1) % steamStatus.value.recentGames.length;
}
clearTimeout(nextId);
nextId = setTimeout(nextGame, 5000);
if (steamStatus.value.recentGames.length) {
idx.value = (idx.value + 1) % steamStatus.value.recentGames.length;
}
}
onMounted(() => {
nextId = setTimeout(nextGame, 5000);
refreshId = setInterval(() => steamStore.fetchSteam(), 5 * 60 * 1000);
nextId = setTimeout(nextGame, 5000);
refreshId = setInterval(() => steamStore.fetchSteam(), 5 * 60 * 1000);
});
onUnmounted(() => {
clearTimeout(nextId);
clearInterval(refreshId);
clearTimeout(nextId);
clearInterval(refreshId);
});
function formatHours(minutes) {
const hrs = (minutes / 60).toFixed(1);
return `${hrs}h`;
const hrs = (minutes / 60).toFixed(1);
return `${hrs}h`;
}
</script>
<template>
<div class="steam-wrapper">
<Header class="text-left">
<span class="flex items-center gap-2">
Steam
<span
class="inline-block w-2 h-2 rounded-full"
:class="steamStatus.online ? 'bg-green-500' : 'bg-gray-400'"
:title="steamStatus.online ? 'Online' : 'Offline'"
/>
</span>
</Header>
<div class="steam-wrapper">
<Header class="text-left">
<span class="flex items-center gap-2">
Steam
<span
class="inline-block w-2 h-2 rounded-full"
:class="steamStatus.online ? 'bg-green-500' : 'bg-gray-400'"
:title="steamStatus.online ? 'Online' : 'Offline'"
/>
</span>
</Header>
<div v-if="!loaded" class="p-2 text-sm">Loading...</div>
<div v-if="!loaded" class="p-2 text-sm">Loading...</div>
<div v-else-if="game" class="game-container">
<Transition name="fade">
<div
@click="nextGame"
:key="game.appId"
class="flex flex-col items-center pt-2"
>
<img
:src="game.headerImageUrl"
:alt="game.name"
width="145"
height="68"
class="game-img"
/>
<p class="text-center">
<strong>{{ game.name }}</strong>
</p>
<p class="text-center text-tertiary text-xs">
{{ formatHours(game.playtime2Weeks) }} last 2 weeks
</p>
</div>
</Transition>
<div v-else-if="game" class="game-container">
<Transition name="fade">
<div
@click="nextGame"
:key="game.appId"
class="flex flex-col items-center pt-2"
>
<img
:src="game.headerImageUrl"
:alt="game.name"
width="145"
height="68"
class="game-img"
/>
<p class="text-center">
<strong>{{ game.name }}</strong>
</p>
<p class="text-center text-tertiary text-xs">
{{ formatHours(game.playtime2Weeks) }} last 2 weeks
</p>
</div>
<div v-else class="p-2 text-sm">No recent games.</div>
</Transition>
</div>
<div v-else class="p-2 text-sm">No recent games.</div>
</div>
</template>
<style scoped>
.steam-wrapper {
position: relative;
height: 54mm;
display: flex;
flex-direction: column;
position: relative;
height: 54mm;
display: flex;
flex-direction: column;
}
.game-container {
position: relative;
flex: 1;
min-height: 0;
overflow-y: scroll;
position: relative;
flex: 1;
min-height: 0;
overflow-y: scroll;
}
.game-img {
width: 90%;
max-width: 300px;
height: auto;
width: 90%;
max-width: 300px;
height: auto;
}
p {
width: 100%;
margin: 0 auto;
width: 100%;
margin: 0 auto;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
}
.fade-leave-active {
position: absolute;
top: 0;
left: 0;
right: 0;
position: absolute;
top: 0;
left: 0;
right: 0;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
opacity: 0;
}
@media (max-width: 850px) {
.steam-wrapper {
height: auto;
min-height: 120px;
}
.steam-wrapper {
height: auto;
min-height: 120px;
}
}
</style>
+17 -19
View File
@@ -3,27 +3,25 @@ import VideoTable from "@/components/util/VideoTable.vue";
import Link from "@/components/text/Link.vue";
const videoSources = [
{ name: "demoman", link: "/img/demoman/1760582395316219.webm" },
{ name: "demoman", link: "/img/demoman/1761052136609718.webm" },
{ name: "demoman", link: "/img/demoman/1761088452011210.mp4" },
{ name: "demoman", link: "/img/demoman/1761570214170465.webm" },
{ name: "demoman", link: "/img/demoman/1761828457509465.webm" },
{ name: "demoman", link: "/img/demoman/1760582395316219.webm" },
{ name: "demoman", link: "/img/demoman/1761052136609718.webm" },
{ name: "demoman", link: "/img/demoman/1761088452011210.mp4" },
{ name: "demoman", link: "/img/demoman/1761570214170465.webm" },
{ name: "demoman", link: "/img/demoman/1761828457509465.webm" },
];
</script>
<template>
<main class="items-center flex flex-col">
<div
class="a4page-portrait bdr-1 flex flex-row relative overflow-scroll items-center"
>
<p>
<Link href="https://wiki.teamfortress.com/wiki/Demoman"
>The goat</Link
>
</p>
<div>
<VideoTable :sourceArr="videoSources" />
</div>
</div>
</main>
<main class="items-center flex flex-col">
<div
class="a4page-portrait bdr-1 flex flex-row relative overflow-scroll items-center"
>
<p>
<Link href="https://wiki.teamfortress.com/wiki/Demoman">The goat</Link>
</p>
<div>
<VideoTable :sourceArr="videoSources" />
</div>
</div>
</main>
</template>
+7 -7
View File
@@ -3,11 +3,11 @@ import Wip from "@/components/util/Wip.vue";
</script>
<template>
<main class="items-center flex flex-col">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<Wip />
</div>
</main>
<main class="items-center flex flex-col">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<Wip />
</div>
</main>
</template>
+3 -1
View File
@@ -4,7 +4,9 @@ import Wip from "@/components/util/Wip.vue";
<template>
<main class="items-center flex flex-col">
<div class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<Wip />
</div>
</main>
+12 -12
View File
@@ -1,20 +1,20 @@
<script setup>
import RouterTable from "@/components/util/RouterTable.vue";
const shrine_links = [
{ name: "Demoman", link: "/shrines/demoman" },
{ name: "Evangelion", link: "/shrines/evangelion" },
{ name: "GTO", link: "/shrines/gto" },
{ name: "Skipskipbenben", link: "/shrines/skipskipbenben" },
{ name: "Demoman", link: "/shrines/demoman" },
{ name: "Evangelion", link: "/shrines/evangelion" },
{ name: "GTO", link: "/shrines/gto" },
{ name: "Skipskipbenben", link: "/shrines/skipskipbenben" },
];
</script>
<template>
<main class="items-center flex flex-col">
<div class="background" />
<div
class="a4page-portrait bdr-1 flex flex-col relative overflow-scroll gap-1"
>
<RouterTable :linkArr="shrine_links" />
</div>
</main>
<main class="items-center flex flex-col">
<div class="background" />
<div
class="a4page-portrait bdr-1 flex flex-col relative overflow-scroll gap-1"
>
<RouterTable :linkArr="shrine_links" />
</div>
</main>
</template>
@@ -3,11 +3,11 @@ import Wip from "@/components/util/Wip.vue";
</script>
<template>
<main class="items-center flex flex-col">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<Wip />
</div>
</main>
<main class="items-center flex flex-col">
<div
class="a4page-portrait items-center bdr-1 flex flex-col relative overflow-scroll"
>
<Wip />
</div>
</main>
</template>
+36 -37
View File
@@ -5,52 +5,51 @@ import Header from "@/components/text/Header.vue";
import Paragraph from "@/components/text/Paragraph.vue";
const links = [
{ name: "GitHub", href: "https://github.com/SteveThePug" },
{ name: "Gitea", href: "/gitea/explore/repos" },
{ name: "Spotify", href: "https://open.spotify.com/user/stevethepug" },
{ name: "GitHub", href: "https://github.com/SteveThePug" },
{ name: "Gitea", href: "/gitea/explore/repos" },
{ name: "Spotify", href: "https://open.spotify.com/user/stevethepug" },
];
</script>
<template>
<main class="flex justify-center px-4 py-16">
<div class="max-w-xl w-full flex flex-col gap-12">
<section>
<Header>Adam French</Header>
<Paragraph>
Junior software engineer focused on full-stack development,
systems programming, and infrastructure. First Class Honours
in Computer Science with Mathematics from Leeds and
Waterloo.
</Paragraph>
</section>
<main class="flex justify-center px-4 py-16">
<div class="max-w-xl w-full flex flex-col gap-12">
<section>
<Header>Adam French</Header>
<Paragraph>
Junior software engineer focused on full-stack development, systems
programming, and infrastructure. First Class Honours in Computer
Science with Mathematics from Leeds and Waterloo.
</Paragraph>
</section>
<section>
<Header>About</Header>
<Paragraph>
This website is self-hosted and has a lot more on it than it
needs to. Please have a look at my
<InlineLink to="/cv">CV</InlineLink> for a full breakdown of
my experience, projects, and skills. Please visit
<InlineLink to="/stp">STP</InlineLink> for the prefered but
less professional experience.
</Paragraph>
</section>
<section>
<Header>About</Header>
<Paragraph>
This website is self-hosted and has a lot more on it than it needs to.
Please have a look at my
<InlineLink to="/cv">CV</InlineLink> for a full breakdown of my
experience, projects, and skills. Please visit
<InlineLink to="/stp">STP</InlineLink> for the prefered but less
professional experience.
</Paragraph>
</section>
<nav class="navRow flex flex-row flex-wrap gap-4 justify-around">
<Link to="/cv"> CV </Link>
<Link to="/stp"> STP </Link>
<Link href="mailto:[email protected]"> Email </Link>
<Link v-for="link in links" :key="link.name" :href="link.href">
{{ link.name }}
</Link>
</nav>
</div>
</main>
<nav class="navRow flex flex-row flex-wrap gap-4 justify-around">
<Link to="/cv"> CV </Link>
<Link to="/stp"> STP </Link>
<Link href="mailto:[email protected]"> Email </Link>
<Link v-for="link in links" :key="link.name" :href="link.href">
{{ link.name }}
</Link>
</nav>
</div>
</main>
</template>
<style scoped>
.navRow > a {
padding: 0.5rem 1rem;
border: 1px solid currentColor;
padding: 0.5rem 1rem;
border: 1px solid currentColor;
}
</style>
+60 -62
View File
@@ -1,72 +1,70 @@
<template>
<main>
<table id="cover-nav" class="cover-nav no-print">
<thead>
<tr>
<th>Companies</th>
<th>Completed</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#LloydsBank">Lloyds</a></td>
<td>YES</td>
</tr>
</tbody>
</table>
<main>
<table id="cover-nav" class="cover-nav no-print">
<thead>
<tr>
<th>Companies</th>
<th>Completed</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#LloydsBank">Lloyds</a></td>
<td>YES</td>
</tr>
</tbody>
</table>
<div class="no-print m-1 w-full text-center"></div>
<div id="LloydsBank" class="a5page">
<div class="contact">
<h1>Adam French</h1>
<!-- <a href="index.html"><img width=25 height=50 src="img/rune.png"></a> -->
<div class="contact-details">
<p>+447563266931</p>
<p>adam.a.french@outlook.com</p>
</div>
</div>
<h2>BAE graduate digital intelligence software engineer</h2>
<p>
I am writing to express my interest in your software engineering
position. BAE Systems has hosted multiple stools at the
University of Leeds and have always exhibited their development
of leading-edge software and technology. This is where the
origin of my interest in BAE systems emerged and I'm hopeful
that this interest shall continue.
</p>
<p>
I'm confidient im a strong fit for this role. My technical
background includes extensive experience with frontend
frameworks such as React. My devotion however lies more in
backend development as has more potential to graple problems
related to optimisation and designing coherent interfaces.
</p>
<p>
<em> The C# Programming Yellow Book </em> was my first
introduction to C# during A-Level, Java was our vessel for
teaching object-orientated programming at university. I am
confident I have the relevant experience to grasp the languages
stated for the role I am applying for.
</p>
<p>
My academic background in Computer Science and Mathematics has
honed my ability to translate abstract concepts into structured,
logical solutions. Just as I have transformed theoretical
hypotheses into formal proofs, I aim to transform business
requirements into robust, maintainable software systems through
collaboration and rigorous reasoning.
</p>
<p>Thank you for reading - Adam F</p>
<div class="no-print m-1 w-full text-center"></div>
<div id="LloydsBank" class="a5page">
<div class="contact">
<h1>Adam French</h1>
<!-- <a href="index.html"><img width=25 height=50 src="img/rune.png"></a> -->
<div class="contact-details">
<p>+447563266931</p>
<p>adam.a.french@outlook.com</p>
</div>
</main>
</div>
<h2>BAE graduate digital intelligence software engineer</h2>
<p>
I am writing to express my interest in your software engineering
position. BAE Systems has hosted multiple stools at the University of
Leeds and have always exhibited their development of leading-edge
software and technology. This is where the origin of my interest in BAE
systems emerged and I'm hopeful that this interest shall continue.
</p>
<p>
I'm confidient im a strong fit for this role. My technical background
includes extensive experience with frontend frameworks such as React. My
devotion however lies more in backend development as has more potential
to graple problems related to optimisation and designing coherent
interfaces.
</p>
<p>
<em> The C# Programming Yellow Book </em> was my first introduction to
C# during A-Level, Java was our vessel for teaching object-orientated
programming at university. I am confident I have the relevant experience
to grasp the languages stated for the role I am applying for.
</p>
<p>
My academic background in Computer Science and Mathematics has honed my
ability to translate abstract concepts into structured, logical
solutions. Just as I have transformed theoretical hypotheses into formal
proofs, I aim to transform business requirements into robust,
maintainable software systems through collaboration and rigorous
reasoning.
</p>
<p>Thank you for reading - Adam F</p>
</div>
</main>
</template>
<style scoped>
@import "@/assets/css/cv_styles.css";
@media print {
@page {
size: A5 landscape;
margin: 0;
}
@page {
size: A5 landscape;
margin: 0;
}
}
</style>
+39 -39
View File
@@ -16,60 +16,60 @@ const path = Array.isArray(pathArray) ? pathArray.join("/") : pathArray;
const url = `/api/notes/${path}`;
function getFilename(headers) {
const disposition = headers["content-disposition"];
if (!disposition) return null;
const disposition = headers["content-disposition"];
if (!disposition) return null;
const match = disposition.match(/filename="?([^"]+)"?/);
return match ? match[1] : null;
const match = disposition.match(/filename="?([^"]+)"?/);
return match ? match[1] : null;
}
async function fetchFile() {
const response = await axios.get(url, { responseType: "blob" });
filename.value = getFilename(response.headers);
const response = await axios.get(url, { responseType: "blob" });
filename.value = getFilename(response.headers);
const lastModified = response.headers["last-modified"];
last_edited.value = lastModified ? new Date(lastModified) : null;
const lastModified = response.headers["last-modified"];
last_edited.value = lastModified ? new Date(lastModified) : null;
if (filename.value.toLowerCase().endsWith(".md")) {
const text = await response.data.text();
file.value = fixLinks(text);
} else {
file.value = response.data;
}
if (filename.value.toLowerCase().endsWith(".md")) {
const text = await response.data.text();
file.value = fixLinks(text);
} else {
file.value = response.data;
}
}
function fixLinks(filedata) {
return filedata.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
if (
url.startsWith("http://") ||
url.startsWith("https://") ||
url.startsWith("#") ||
url.startsWith("./") ||
url.startsWith("../") ||
url.startsWith("//")
) {
return match;
}
return filedata.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
if (
url.startsWith("http://") ||
url.startsWith("https://") ||
url.startsWith("#") ||
url.startsWith("./") ||
url.startsWith("../") ||
url.startsWith("//")
) {
return match;
}
return `[${text}](/notes/${url})`;
});
return `[${text}](/notes/${url})`;
});
}
onMounted(fetchFile);
</script>
<template>
<main class="items-center flex flex-col">
<div class="background" />
<div
v-if="file"
class="a4page-portrait border-primary-1 flex flex-col relative overflow-scroll gap-1 bg-bg_primary"
>
<h1>{{ filename }}</h1>
<small>{{ last_edited }}</small>
<Markdown class="flex-1 border-box text-wrap" :source="file" />
</div>
<main class="items-center flex flex-col">
<div class="background" />
<div
v-if="file"
class="a4page-portrait border-primary-1 flex flex-col relative overflow-scroll gap-1 bg-bg_primary"
>
<h1>{{ filename }}</h1>
<small>{{ last_edited }}</small>
<Markdown class="flex-1 border-box text-wrap" :source="file" />
</div>
<div v-else>Loading…</div>
</main>
<div v-else>Loading…</div>
</main>
</template>