Skip to content

Commit

Permalink
Merge pull request #11 from paranoidPhantom/dev
Browse files Browse the repository at this point in the history
Production release - RC 1
  • Loading branch information
paranoidPhantom authored Oct 7, 2024
2 parents 81ab726 + 80ce171 commit 2e28db2
Show file tree
Hide file tree
Showing 135 changed files with 6,024 additions and 4,133 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.nuxt/**
.vscode/**
.output/**
node_modules/**
db/**
nginx/**
supabase/**
.git/**
README.md
18 changes: 0 additions & 18 deletions .env.example

This file was deleted.

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dist
node_modules

# Logs
logs
./logs
*.log

# Misc
Expand All @@ -21,4 +21,7 @@ logs
# Local env files
.env
.env.*
!.env.example
!.env.example
bundled/README.md

.kv
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"tabWidth": 4,
"useTabs": true
}
28 changes: 14 additions & 14 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "bun: dev",
"detail": "nuxt dev",
"group": {
"kind": "test",
"isDefault": true
}
}
]
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "bun: dev",
"detail": "nuxt dev",
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:20 AS build
WORKDIR /usr/src/frontend

RUN npm install -g bun
RUN npm install -g nuxi

COPY package.json .
RUN bun install


COPY . .

RUN nuxi build

FROM node:20 AS release
WORKDIR /usr/src/frontend

COPY --from=build /usr/src/frontend/.output .output

# run the app
ENTRYPOINT [ "node", ".output/server/index.mjs" ]
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ The official website for School 550 in Saint-Petersburg, Russia.

## Powered by:

### [<img src="https://nuxt.com/assets/design-kit/logo-green-white.svg" width="100" title="Nuxt 4">](https://nuxt.com)

### [<svg aria-label="Vercel logotype" role="img" viewBox="0 0 283 64" width="100"><path d="M141.68 16.25c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zm117.14-14.5c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zm-39.03 3.5c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9v-46h9zM37.59.25l36.95 64H.64l36.95-64zm92.38 5l-27.71 48-27.71-48h10.39l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10v14.8h-9v-34h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="white"></path></svg>](https://vercel.com/home)
### [<img src="https://nuxt.com/assets/design-kit/logo-green-white.svg" width="100" title="Nuxt 4">](https://nuxt.com)
24 changes: 12 additions & 12 deletions app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default defineAppConfig({
ui: {
primary: "blue",
gray: "neutral",
icons: {
dynamic: true,
},
commandPalette: {
default: {
loadingIcon: "fluent:spinner-ios-16-filled",
},
},
},
ui: {
primary: "blue",
gray: "neutral",
icons: {
dynamic: true,
},
commandPalette: {
default: {
loadingIcon: "fluent:spinner-ios-16-filled",
},
},
},
});
88 changes: 54 additions & 34 deletions app/app.vue
Original file line number Diff line number Diff line change
@@ -1,44 +1,64 @@
<script lang="ts" setup>
import { SpeedInsights } from "@vercel/speed-insights/nuxt";
const route = useRoute();
onMounted(async () => {
if (
!route.path.startsWith("/manage") ||
route.path.startsWith("/manage/auth")
)
return;
const valid = await $fetch("/api/auth/validate");
if (!valid) {
navigateTo("/manage/auth");
}
});
useSeoMeta({
ogImage: "/images/exterior.png",
ogImage: "/images/exterior.png",
});
useHead({
htmlAttrs: {
lang: "ru",
},
link: [
{
rel: "icon",
type: "image/png",
href: "/favicon.png",
},
],
htmlAttrs: {
lang: "ru",
},
link: [
{
rel: "icon",
type: "image/png",
href: "/favicon.png",
},
],
});
const visuallyImpaired = useCookie("visImpairmentMode");
if (visuallyImpaired.value === undefined) visuallyImpaired.value = false;
onMounted(() => {
document.documentElement.style.filter = visuallyImpaired.value
? "saturate(0)"
: "none";
});
watch(visuallyImpaired, (newValue) => {
document.documentElement.style.filter = newValue ? "saturate(0)" : "none";
});
</script>

<template>
<NuxtLoadingIndicator color="rgb(var(--color-primary-500))" />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<SearchPalette />
<UNotifications />
<SpeedInsights />
<div :class="{ 'visually-impaired': visuallyImpaired }">
<NuxtRouteAnnouncer />
<NuxtLoadingIndicator color="rgb(var(--color-primary-500))" />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<!-- <SearchPalette /> -->
<UNotifications />
</div>
</template>

<style lang="scss">
/* Visually impaired mode */
.visually-impaired {
img,
.hero-bg,
.dashed-circles {
display: none !important;
}
.invert-if-impaired {
@apply text-black dark:text-white;
}
.aos-init {
transform: translate(0) scale(1) !important;
transition-property: none !important;
opacity: 1 !important;
}
}
</style>
17 changes: 10 additions & 7 deletions app/assets/style.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
:root {
font-family: Raleway, sans-serif;
scroll-behavior: smooth;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
scroll-behavior: smooth;
}

.page-enter-from,
.page-leave-to {
opacity: 0;
opacity: 0;
}

.page-enter-active,
.page-leave-active {
transition: opacity 0.5s;
transition: opacity 0.5s ease-in-out;
}

.layout-enter-from,
.layout-leave-to {
opacity: 0;
transform: translateY(-50px);
opacity: 0;
transform: translateY(-50px);
}

.layout-enter-active,
.layout-leave-active {
transition: opacity 0.5s, transform 0.5s;
transition:
opacity 0.5s,
transform 0.5s;
}
21 changes: 16 additions & 5 deletions app/components/AppLogo.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<script lang="ts" setup>
const route = useRoute();
const colorMode = useColorMode();
</script>

<template>
<NuxtLink :to="route.path === '/' ? '/logo' : '/'">
<UIcon name="fluent:draw-image-24-regular" class="text-2xl" />
</NuxtLink>
<NuxtLink to="/" aria-label="Перейти на главную" class="home-btn">
<NuxtImg
:style="`filter: invert(${colorMode.value === 'dark' ? 0 : 1})`"
src="/logo.png"
width="60px"
/>
</NuxtLink>
</template>

<style lang="scss" scoped></style>
<style lang="scss" scoped>
.home-btn {
@apply transition-all duration-1000;
&:active {
@apply scale-95 transition-all duration-200;
}
}
</style>
Loading

0 comments on commit 2e28db2

Please sign in to comment.