Added basic stuff for Nuxt

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2022-11-09 17:47:19 +00:00
parent 20f681aa3c
commit db9fa44439
Signed by: lucxjo
GPG key ID: B140F8923EF88DA9
30 changed files with 4163 additions and 3028 deletions

View file

@ -1,3 +0,0 @@
{
"extends": ["next", "next/core-web-vitals"]
}

26
.gitignore vendored
View file

@ -1,20 +1,8 @@
# build output node_modules
dist/ *.log*
.output/ .nuxt
.nitro
# dependencies .cache
node_modules/ .output
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env .env
.env.production dist
# macOS-specific files
.DS_Store

View file

@ -1,4 +1,6 @@
{ {
"recommendations": ["astro-build.astro-vscode"], "recommendations": [
"vue.vscode-typescript-vue-plugin"
],
"unwantedRecommendations": [] "unwantedRecommendations": []
} }

5
app.vue Normal file
View file

@ -0,0 +1,5 @@
<template>
<div>
<NuxtPage />
</div>
</template>

View file

@ -1,7 +0,0 @@
import { defineConfig } from 'astro/config';
import vue from "@astrojs/vue";
// https://astro.build/config
export default defineConfig({
integrations: [vue()]
});

4
nuxt.config.ts Normal file
View file

@ -0,0 +1,4 @@
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
})

View file

@ -1,22 +1,17 @@
{ {
"name": "friends-best",
"type": "module",
"version": "3.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "astro dev", "build": "nuxt build",
"start": "deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs", "dev": "nuxt dev",
"build": "astro build", "generate": "nuxt generate",
"preview": "astro preview", "preview": "nuxt preview",
"astro": "astro" "postinstall": "nuxt prepare"
},
"dependencies": {
"@astrojs/deno": "1.1.0",
"@astrojs/vue": "1.1.0",
"astro": "^1.4.2",
"vue": "^3.2.30"
}, },
"devDependencies": { "devDependencies": {
"sass": "1.55.0" "nuxt": "3.0.0-rc.13"
},
"dependencies": {
"@typegoose/typegoose": "9.12.1",
"mongoose": "6.7.2"
} }
} }

5
pages/index.vue Normal file
View file

@ -0,0 +1,5 @@
<template>
<div>
<h1>Index</h1>
</div>
</template>

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

View file

@ -1,13 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 36 36">
<path fill="#000" d="M22.25 4h-8.5a1 1 0 0 0-.96.73l-5.54 19.4a.5.5 0 0 0 .62.62l5.05-1.44a2 2 0 0 0 1.38-1.4l3.22-11.66a.5.5 0 0 1 .96 0l3.22 11.67a2 2 0 0 0 1.38 1.39l5.05 1.44a.5.5 0 0 0 .62-.62l-5.54-19.4a1 1 0 0 0-.96-.73Z"/>
<path fill="url(#gradient)" d="M18 28a7.63 7.63 0 0 1-5-2c-1.4 2.1-.35 4.35.6 5.55.14.17.41.07.47-.15.44-1.8 2.93-1.22 2.93.6 0 2.28.87 3.4 1.72 3.81.34.16.59-.2.49-.56-.31-1.05-.29-2.46 1.29-3.25 3-1.5 3.17-4.83 2.5-6-.67.67-2.6 2-5 2Z"/>
<defs>
<linearGradient id="gradient" x1="16" x2="16" y1="32" y2="24" gradientUnits="userSpaceOnUse">
<stop stop-color="#000"/>
<stop offset="1" stop-color="#000" stop-opacity="0"/>
</linearGradient>
</defs>
<style>
@media (prefers-color-scheme:dark){:root{filter:invert(100%)}}
</style>
</svg>

Before

Width:  |  Height:  |  Size: 873 B

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>

Before

Width:  |  Height:  |  Size: 312 B

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>

Before

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

View file

@ -1,3 +0,0 @@
$bg-colour-light: rgb(187, 187, 187);
$accent-colour-light: rgb(24, 96, 231);
$filter-accent-colour-light: invert(34%) sepia(96%) saturate(4970%) hue-rotate(216deg) brightness(95%) contrast(91%);

View file

@ -1,20 +0,0 @@
@use 'colours';
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap');
body {
font-family: 'Ubuntu', sans-serif !important;
background-color: colours.$bg-colour-light;
}
.container {
min-height: 80vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 3rem;
}

View file

@ -1,3 +0,0 @@
@use 'colours';

View file

@ -1,62 +0,0 @@
---
export 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.15rem;
background-color: white;
background-image: var(--accent-gradient);
background-size: 400%;
border-radius: 0.5rem;
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;
}
.link-card:is(:hover, :focus-within) h2 {
color: rgb(var(--accent));
}
</style>

View file

@ -1,58 +0,0 @@
---
export interface Props {
title: string;
to: string;
}
const { to, title } = Astro.props;
const isExternal = to.startsWith('http');
---
{ isExternal == true ? (
<a href={to} target="_blank" rel="noopener noreferrer" class="card">
<p>{title} →</p>
</a>
) : (
<a href={to} class="card">
<p>{title} →</p>
</a>
)
}
<style lang="scss">
@use '../assets/styles/colours';
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 2px solid #000;
border-radius: 20px;
transition: color 0.15s ease, border-color 0.15s ease;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.card:link,
.card:visited {
color: #000;
}
.card:hover,
.card:focus,
.card:active {
color: colours.$accent-colour-light !important;
border-color: colours.$accent-colour-light;
}
@media (max-width: 600px) {
.card {
margin: 0.5rem;
padding: 1.25rem;
width: 9rem;
}
}
</style>

View file

@ -1,57 +0,0 @@
---
export interface Props {
links: {
to: string;
name: string;
img: {
src: string;
alt: string;
}
}[]
}
const { links } = Astro.props;
---
<nav>
{ links.map(link => (
<div class="nav-button">
<a href={link.to}>
<img src={link.img.src} alt={link.img.alt} />
<p>{ link.name }</p>
</a>
</div>
))
}
</nav>
<style lang="scss">
@use '../assets/styles/colours';
nav {
margin: 0 auto;
position: -webkit-sticky;
position: sticky;
display: flex;
justify-content: center;
align-items: center;
}
nav :hover {
filter: colours.$filter-accent-colour-light;
}
nav a {
text-decoration: none;
color: black;
}
p {
padding: 0;
margin: 0;
}
.nav-button {
margin: 0 1rem;
padding: 0.5rem;
}
</style>

View file

@ -1,40 +0,0 @@
<script setup lang="ts">
import { defineComponent } from 'vue'
type TimeFormatProps = {
day: string | undefined,
month: string | undefined,
year: string | undefined,
hour: string | undefined,
minute: string | undefined,
second: string | undefined,
weekday: string | undefined,
}
const props = defineProps({
formats: {
type: Array<TimeFormatProps>,
required: true,
},
dFormat: {
type: String,
required: true,
},
})
const crntTime = Date.now();
</script>
<template>
<code>
{{ `<t:${Math.floor(crntTime / 1000)}:${props.dFormat}>` }}
</code>
<span>
to get
<code>
<span v-for="format in props.formats" :key="Math.floor(Math.random()*1000)">
{{Intl.DateTimeFormat(Intl.Locale, format).format(crntTime) + ' '}}
</span>
</code>
</span>
</template>

View file

@ -1,4 +0,0 @@
<template>
<span>{{Intl.DateTimeFormat().resolvedOptions().timeZone}}</span>
</template>

View file

@ -1,9 +0,0 @@
<script setup lang="ts">
import { defineProps } from 'vue';
const crntTime = Date.now();
</script>
<template>
<p>The current time in Unix Epoch: <code>{{ Math.floor(crntTime / 1000) }}</code> <br /> or <code>{{crntTime}}</code> in Unix millis</p>
</template>

1
src/env.d.ts vendored
View file

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

View file

@ -1,98 +0,0 @@
---
import NavBar from '../components/NavBar.astro';
export interface Props {
title: string;
navLinks: {
to: string;
name: string;
img: {
src: string;
alt: string;
}
}[] | undefined
}
const { title, navLinks } = Astro.props;
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
{ navLinks != undefined ? (
<NavBar links={navLinks} />
) : (<!-- If there were NavLinks, they would be here -->)
}
<slot />
</body>
</html>
<style lang="scss" is:global>
@use "../assets/styles/colours";
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap');
body {
font-family: 'Ubuntu', sans-serif !important;
background-color: colours.$bg-colour-light;
}
.container {
min-height: 80vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 3rem;
}
.footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
.footer a:hover {
color: #0070f3;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
color: #eaeaea;
}
.grid-2 {
display: grid;
align-items: center;
justify-content: center;
grid-template-columns: 1fr 1fr;
}
.grid-3 {
display: grid;
align-items: center;
justify-content: center;
grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 600px) {
.grid-3 {
width: 90%;
grid-template-columns: 1fr 1fr;
}
}
</style>

View file

@ -1,37 +0,0 @@
---
import Layout from '../layouts/Layout.astro';
import LinkCard from '../components/LinkCard.astro';
---
<Layout title="Vänner Bästa">
<main>
<div class="container">
<h1 class="title">Vänner Bästa</h1>
<p>
A Young Royals fan website with links to different discussion
spaces.
</p>
<strong>Season 2 coming out 1st November 2022</strong>
<div class="grid-3">
<LinkCard
title="Watch"
to="https://www.netflix.com/title/81210762"
/>
<LinkCard title="Discord" to="https://discord.gg/hyKVDeRJ8Y" />
<LinkCard
title="Reddit"
to="https://www.reddit.com/r/YoungRoyals/"
/>
<LinkCard
title="Babbel (ref)"
to="https://www.talkable.com/x/IchxFl"
/>
<LinkCard
title="Matrix"
to="https://matrix.to/#/#young-royals:matrix.org"
/>
<LinkCard title="Discord Utilities" to="/utilities" />
</div>
</div>
</main>
</Layout>

View file

@ -1,40 +0,0 @@
---
import TimeZone from "../../components/TimeZone.vue";
import Layout from "../../layouts/Layout.astro";
const navLinks = [
{
img: {
src: '/icons/arrow-left.svg',
alt: 'Back to Utilities',
},
to: '/utilities',
name: "Utilities",
},
{
img: {
src: '/icons/home.svg',
alt: 'Go Home',
},
to: '/',
name: "Home",
},
];
---
<Layout title="Vänner Bästa | Birthdays" navLinks={navLinks}>
<div class="container">
<h1 class="title">Birthdays</h1>
<p>
Discord bots are changing. <br />
This means that we can no longer provide you with the command to set
your birthday. <br />
Instead, this page now gives you your timezone for use with Discord
bots.
</p>
<h2>
Your timezone:
<TimeZone client:load/>
</h2>
</div>
</Layout>

View file

@ -1,25 +0,0 @@
---
import LinkCard from "../../components/LinkCard.astro";
import NavBar from "../../components/NavBar.astro";
import Layout from '../../layouts/Layout.astro';
const navLinks = [
{
img: {
src: '/icons/home.svg',
alt: 'Go Home',
},
to: '/',
name: "Home",
},
];
---
<Layout title="Vänner Bästa | Utilities" navLinks={navLinks}>
<div class="container">
<h1 class="title">Utilities for the Discord Server</h1>
<div class="grid-2">
<LinkCard title="Birthdays" to="/utilities/birthdays" />
<LinkCard title="Time" to="/utilities/time" />
</div>
</div>
</Layout>

View file

@ -1,78 +0,0 @@
---
import NavBar from "../../components/NavBar.astro";
import TimeZone from "../../components/TimeZone.vue";
import Layout from "../../layouts/Layout.astro";
import TimeFormat from "../../components/TimeFormat.vue";
import UnixTime from "../../components/UnixTime.vue";
const navLinks = [
{
img: {
src: '/icons/arrow-left.svg',
alt: 'Back to Utilities',
},
to: '/utilities',
name: 'Utilities',
},
{
img: {
src: '/icons/home.svg',
alt: 'Go Home',
},
to: '/',
name: 'Home',
},
];
---
<Layout title="VännerBästa | Time" navLinks={navLinks}>
<div class="container">
<h1 class="title">Time Utilities</h1>
<p>
Your current timezone:
<TimeZone client:load />
</p>
<UnixTime client:load/>
<p>
To format the time for Discord, you can use: <br />
<TimeFormat formats={[{
day: 'numeric',
month: 'long',
year: 'numeric',
}, {hour: '2-digit', minute: '2-digit'}]} dFormat="f" client:only />
<br />
<TimeFormat formats={[{
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric',
}, { hour: '2-digit', minute: '2-digit', }]} dFormat="F" client:only />
<br />
<TimeFormat formats={[{
hour: '2-digit',
minute: '2-digit',
}]} dFormat="t" client:only />
<br />
<TimeFormat formats={[{
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
}]} dFormat="T" client:only />
<br />
<TimeFormat formats={[{
day: '2-digit',
month: '2-digit',
year: 'numeric',
}]} dFormat="d" client:only />
<br />
<TimeFormat formats={[{
day: 'numeric',
month: 'long',
year: 'numeric',
}]} dFormat="D" client:only />
</p>
</div>
</Layout>

View file

@ -1,3 +1,8 @@
{ {
"extends": "astro/tsconfigs/strict" // https://v3.nuxtjs.org/concepts/typescript
} "extends": "./.nuxt/tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
}
}