Skip to content

Commit 8c223c3

Browse files
Sebastian Fellner 💯Sebastian Fellner 💯
authored andcommitted
feat: migrate frontend to Nuxt 4 and Vue 3
1 parent e35524e commit 8c223c3

61 files changed

Lines changed: 12652 additions & 10815 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ parserOptions:
1313
sourceType: module
1414
plugins:
1515
- vue
16+
globals:
17+
defineI18nConfig: readonly
18+
defineNuxtConfig: readonly
19+
defineNuxtPlugin: readonly
20+
queryCollection: readonly
21+
useAsyncData: readonly
22+
useRuntimeConfig: readonly
23+
useSeoMeta: readonly
1624
rules: {}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ typings/
7373

7474
# nuxt.js build output
7575
.nuxt
76+
.data
77+
.output
7678

7779
# Nuxt generate
7880
dist

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ dist
44
node_modules
55
coverage
66
pnpm-lock.yaml
7+
playwright-report
8+
test-results
79
test/*
810
static/sw.js
911
.direnv
1012
.idea
1113
.nuxt
14+
.output
1215
node_modules
1316
nuxt.config.js

assets/_theme-variables.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Whatsapp theme colors
2+
$whatsappThemeColor: #07bc4c;
3+
$darkBackgroundColor: #0d1418;
4+
$lightBackgroundColor: #e5ddd5;
5+
6+
// Monotone colors
7+
$c-dark: #022e40;
8+
$c-dark-accent: #032859;
9+
$c-white: #f2f2f2;
10+
$c-white-dark: #bfbfbf;
11+
$c-white-accent: #e1e1e1;
12+
13+
// Blue colors
14+
$c-blue-accent: #21a68d;
15+
$c-blue-accent-light: #60d8bd;
16+
$c-blue-accent-dark: #227373;
17+
$c-blue-secondary: #0c808c;
18+
$c-blue-secondary-light: #51b0bc;
19+
$c-blue-secondary-dark: #00535f;
20+
$c-blue-dark: #11538c;
21+
22+
// Green colors
23+
$c-green: #88a825;
24+
$c-green-accent: #b3f94f;
25+
26+
// Yellow colors
27+
$c-yellow: #ffd45c;
28+
$c-yellow-accent: #ffa35c;
29+
$c-yellow-bright: #ffd800;
30+
$c-yellow-bright-accent: #fd9924;
31+
32+
// Orange colors
33+
$c-orange: #fe6a2c;
34+
$c-orange-accent: #ffbf5c;
35+
$c-orange-dark: #cf4a30;
36+
$c-orange-dark-accent: #ed8c2b;
37+
38+
// Red colors
39+
$c-red: #ff675c;
40+
$c-red-light: #ff855c;
41+
$c-red-dark: #d93b3b;
42+
$c-red-dark-accent: #911146;

assets/variables.scss

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,4 @@
1-
// ---- COLORS -----
2-
3-
// Whatsapp Theme color
4-
$whatsappThemeColor: #07bc4c;
5-
$darkBackgroundColor: #0d1418;
6-
$lightBackgroundColor: #e5ddd5;
7-
8-
// MONOTONE
9-
// -- dark colors
10-
$c-dark: #022e40;
11-
$c-dark-accent: #032859;
12-
13-
// -- light colors
14-
$c-white: #f2f2f2;
15-
$c-white-dark: #bfbfbf;
16-
$c-white-accent: #e1e1e1;
17-
18-
// BLUE
19-
$c-blue-accent: #21a68d;
20-
$c-blue-accent-light: #60d8bd;
21-
$c-blue-accent-dark: #007660;
22-
23-
$c-blue-secondary: #0c808c;
24-
$c-blue-secondary-light: #51b0bc;
25-
$c-blue-secondary-dark: #00535f;
26-
27-
$c-blue-dark: #11538c;
28-
$c-blue-accent-dark: #227373;
29-
30-
// WHITE
31-
$c-green: #88a825;
32-
$c-green-accent: #b3f94f;
33-
34-
// YELLOW
35-
$c-yellow: #ffd45c;
36-
$c-yellow-accent: #ffa35c;
37-
38-
$c-yellow-bright: #ffd800;
39-
$c-yellow-bright-accent: #fd9924;
40-
41-
// ORANGE
42-
$c-orange: #fe6a2c;
43-
$c-orange-accent: #ffbf5c;
44-
$c-orange-dark: #cf4a30;
45-
$c-orange-dark-accent: #ed8c2b;
46-
47-
// RED
48-
$c-red: #ff675c;
49-
$c-red-light: #ff855c;
50-
$c-red-dark: #d93b3b;
51-
$c-red-dark-accent: #911146;
1+
@use "theme-variables" as *;
522

533
.top-color {
544
background-color: $c-blue-accent;
@@ -58,8 +8,6 @@ $c-red-dark-accent: #911146;
588
display: none;
599
}
6010

61-
@import "~vuetify/src/styles/styles.sass";
62-
6311
.cta {
6412
background: $c-white;
6513
width: 100%;

components/About.vue

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,42 +57,38 @@
5757
</template>
5858

5959
<script>
60+
import adrianImage from "~/assets/img/us/Adrian_WA.jpg";
61+
import moritzImage from "~/assets/img/us/Moritz_WA.jpeg";
62+
import paulImage from "~/assets/img/us/Paul_WA.jpg";
63+
import sebastianImage from "~/assets/img/us/Sebastian_WA.jpg";
64+
import osloLogo from "~/assets/img/uni/Oslo_Logo.png";
65+
import otagoLogo from "~/assets/img/uni/Otago_Logo.png";
66+
import stockholmLogo from "~/assets/img/uni/Stockholm_Logo.png";
67+
import tumLogo from "~/assets/img/uni/TUM_Logo.png";
68+
6069
export default {
6170
name: "About",
6271
data() {
6372
return {
64-
universities: [
65-
// eslint-disable-next-line no-undef
66-
require("~/assets/img/uni/TUM_Logo.png"),
67-
// eslint-disable-next-line no-undef
68-
require("~/assets/img/uni/Oslo_Logo.png"),
69-
// eslint-disable-next-line no-undef
70-
require("~/assets/img/uni/Otago_Logo.png"),
71-
// eslint-disable-next-line no-undef
72-
require("~/assets/img/uni/Stockholm_Logo.png"),
73-
],
73+
universities: [tumLogo, osloLogo, otagoLogo, stockholmLogo],
7474
persons: [
7575
{
76-
// eslint-disable-next-line no-undef
77-
image: require("~/assets/img/us/Sebastian_WA.jpg"),
76+
image: sebastianImage,
7877
name: "Sebastian Fellner",
7978
description: ["Computer Science MSc", "AI Enthusiast"],
8079
},
8180
{
82-
// eslint-disable-next-line no-undef
83-
image: require("~/assets/img/us/Paul_WA.jpg"),
81+
image: paulImage,
8482
name: "Paul Kehnel",
8583
description: ["Computer Science MSc", "Bicycle Dude"],
8684
},
8785
{
88-
// eslint-disable-next-line no-undef
89-
image: require("~/assets/img/us/Adrian_WA.jpg"),
86+
image: adrianImage,
9087
name: "Adrian Thiesen",
9188
description: ["Information Systems BSc", "The Product Enthusiast"],
9289
},
9390
{
94-
// eslint-disable-next-line no-undef
95-
image: require("~/assets/img/us/Moritz_WA.jpeg"),
91+
image: moritzImage,
9692
name: "Moritz Wolf",
9793
description: ["Robotics MSc", "Outdoor Specialist"],
9894
},

components/ArrowDown.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
</template>
1414

1515
<script>
16+
import { scrollTo } from "~/utils/scroll";
17+
1618
export default {
1719
name: "ArrowDown",
1820
props: { animate: { default: false, type: Boolean } },
1921
methods: {
2022
goToExportExplainer() {
21-
this.$vuetify.goTo(".exportexplainer", { duration: 300 });
23+
scrollTo(".exportexplainer");
2224
},
2325
},
2426
};

components/ChatVisualization/Payment.vue

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,29 @@ export default {
2222
data() {
2323
return {};
2424
},
25-
head() {
26-
return {
27-
script: [
28-
{
29-
hid: "paypal",
30-
src:
31-
"https://www.paypal.com/sdk/js?currency=" +
32-
this.currency +
33-
"&client-id=" +
34-
// eslint-disable-next-line no-undef
35-
this.$config.paypalClientId,
36-
defer: true,
37-
// Changed after script load
38-
callback: () => {
39-
this.initPayPalButton(this);
40-
},
41-
},
42-
],
43-
};
25+
mounted() {
26+
this.loadPayPalScript();
4427
},
4528
methods: {
29+
loadPayPalScript() {
30+
if (window.paypal) {
31+
this.initPayPalButton(this);
32+
return;
33+
}
34+
35+
const script = document.createElement("script");
36+
script.id = "paypal-sdk";
37+
script.src =
38+
"https://www.paypal.com/sdk/js?currency=" +
39+
this.currency +
40+
"&client-id=" +
41+
this.$config.paypalClientId;
42+
script.defer = true;
43+
script.addEventListener("load", () => this.initPayPalButton(this), {
44+
once: true,
45+
});
46+
document.head.appendChild(script);
47+
},
4648
initPayPalButton(context) {
4749
// eslint-disable-next-line no-undef
4850
paypal

components/ChatVisualization/PdfDownloadPopup.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
></div>
99

1010
<v-row>
11-
<v-img
12-
:src="require('static/pdf-example.jpg')"
13-
class="ma-auto my-4"
14-
max-width="100%"
15-
/>
11+
<v-img src="/pdf-example.jpg" class="ma-auto my-4" max-width="100%" />
1612
</v-row>
1713
<!-- Loading section -->
1814
<v-row v-show="isLoading" class="ma-3">
@@ -185,7 +181,7 @@
185181
<!-- eslint-enable vue/no-v-html -->
186182
<script>
187183
import { GTAG_PAYMENT, GTAG_PDF, gtagEvent } from "~/utils/gtagValues";
188-
import PDFWorker from "worker-loader!~/assets/js/pdf.worker.js";
184+
import PDFWorker from "~/assets/js/pdf.worker.js?worker";
189185
import { loadImage, objectToDictionary } from "~/utils/utils";
190186
import { saveAs } from "file-saver";
191187
import SubscriptionChecker from "~/components/SubscriptionChecker.vue";

components/Content.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,28 @@
44
{{ page.title }}
55
</div>
66
<!-- toc -->
7-
<div class="toc" v-if="page.toc">
7+
<div v-if="toc.length" class="toc">
88
<ol>
9-
<li v-for="heading in page.toc" :key="heading.id">
9+
<li v-for="heading in toc" :key="heading.id">
1010
<a :href="'#' + heading.id">
1111
{{ heading.text }}
1212
</a>
1313
</li>
1414
</ol>
1515
</div>
1616
<!-- main content -->
17-
<nuxt-content :document="page" />
17+
<ContentRenderer class="nuxt-content" :value="page" />
1818
</article>
1919
</template>
2020

2121
<script>
2222
export default {
2323
props: ["page"],
24+
computed: {
25+
toc() {
26+
return this.page.body?.toc?.links || this.page.toc || [];
27+
},
28+
},
2429
};
2530
</script>
2631

0 commit comments

Comments
 (0)