Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ typings/
# Nuxt generate
dist

# Nuxt 3 build output
.output

# vuepress build output
.vuepress/dist

Expand Down
5 changes: 5 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
11 changes: 0 additions & 11 deletions components/NuxtLogo.vue

This file was deleted.

52 changes: 0 additions & 52 deletions components/Tutorial.vue

This file was deleted.

22 changes: 0 additions & 22 deletions components/VuetifyLogo.vue

This file was deleted.

24 changes: 0 additions & 24 deletions jest.config.js

This file was deleted.

77 changes: 8 additions & 69 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
<template>
<v-app dark>
<!-- <v-navigation-drawer
v-model="drawer"
:mini-variant="miniVariant"
:clipped="clipped"
fixed
app
>
<v-list>
<v-list-item
v-for="(item, i) in items"
:key="i"
:to="item.to"
router
exact
>
<v-list-item-action>
<v-icon>{{ item.icon }}</v-icon>
</v-list-item-action>
<v-list-item-content>
<v-list-item-title v-text="item.title" />
</v-list-item-content>
</v-list-item>
</v-list>
</v-navigation-drawer> -->
<v-app-bar :clipped-left="clipped" fixed app>
<!-- <v-app-bar-nav-icon @click.stop="drawer = !drawer" /> -->
<v-toolbar-title v-text="title" />
<v-app>
<v-app-bar :clipped-left="clipped" app>
<v-toolbar-title>{{ title }}</v-toolbar-title>
<v-spacer />
<!-- <v-btn icon @click.stop="rightDrawer = !rightDrawer">
<v-icon>mdi-menu</v-icon>
</v-btn> -->
<v-btn
icon
href="https://github.com/granterickson/gravity"
Expand All @@ -41,50 +13,17 @@
</v-app-bar>
<v-main>
<v-container>
<Nuxt />
<slot />
</v-container>
</v-main>
<!-- <v-navigation-drawer v-model="rightDrawer" :right="right" temporary fixed>
<v-list>
<v-list-item @click.native="right = !right">
<v-list-item-action>
<v-icon light> mdi-repeat </v-icon>
</v-list-item-action>
<v-list-item-title>Switch drawer (click me)</v-list-item-title>
</v-list-item>
</v-list>
</v-navigation-drawer> -->
<v-footer :absolute="!fixed" app>
<span>&copy; {{ new Date().getFullYear() }}</span>
</v-footer>
</v-app>
</template>

<script>
export default {
name: "DefaultLayout",
data() {
return {
clipped: false,
drawer: false,
fixed: false,
items: [
{
icon: "mdi-apps",
title: "Welcome",
to: "/",
},
{
icon: "mdi-chart-bubble",
title: "Inspire",
to: "/inspire",
},
],
miniVariant: false,
right: true,
rightDrawer: false,
title: "Gravity Simulator",
};
},
};
<script setup lang="ts">
const clipped = ref(false)
const fixed = ref(false)
const title = ref("Gravity Simulator")
</script>
37 changes: 14 additions & 23 deletions layouts/error.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-app dark>
<v-app>
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
Expand All @@ -12,30 +12,21 @@
</v-app>
</template>

<script>
export default {
name: 'EmptyLayout',
layout: 'empty',
props: {
error: {
type: Object,
default: null
}
},
data () {
return {
pageNotFound: '404 Not Found',
otherError: 'An error occurred'
}
},
head () {
const title =
this.error.statusCode === 404 ? this.pageNotFound : this.otherError
return {
title
}
<script setup lang="ts">
interface ErrorProps {
error: {
statusCode: number
}
}

const props = defineProps<ErrorProps>()

const pageNotFound = ref('404 Not Found')
const otherError = ref('An error occurred')

useHead(() => ({
title: props.error.statusCode === 404 ? pageNotFound.value : otherError.value
}))
</script>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions models/binary.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Body from "~/models/body";
import Vector from "~/models/vector";
import Setup from "~/models/setup";
import { Setup } from "~/models/setup";

export default class Binary implements Setup {
export default class Binary extends Setup {
title = "Binary";

bodies(): Body[] {
Expand Down
4 changes: 2 additions & 2 deletions models/chaos.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Body from "~/models/body";
import Vector from "~/models/vector";
import Setup from "~/models/setup";
import { Setup } from "~/models/setup";

export default class Chaos implements Setup {
export default class Chaos extends Setup {
title = "Chaos";

bodies(): Body[] {
Expand Down
4 changes: 2 additions & 2 deletions models/earthMoon.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Body from "~/models/body";
import Vector from "~/models/vector";
import Setup from "~/models/setup";
import { Setup } from "~/models/setup";

export default class EarthMoon implements Setup {
export default class EarthMoon extends Setup {
title = "Earth and Moon";

bodies(): Body[] {
Expand Down
4 changes: 2 additions & 2 deletions models/earthMoonAndOthers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Body from "~/models/body";
import Vector from "~/models/vector";
import Setup from "~/models/setup";
import { Setup } from "~/models/setup";

export default class EarthMoonAndOthers implements Setup {
export default class EarthMoonAndOthers extends Setup {
title = "Earth, Moon and Others";

bodies(): Body[] {
Expand Down
4 changes: 2 additions & 2 deletions models/geometryMapping.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Vector from "~/models/vector";
import * as THREE from "three";

export default interface GeometryMapping {
export type GeometryMapping = {
lastPoint: Vector | null;
sphere: THREE.Mesh;
arrow: THREE.ArrowHelper;
trails: THREE.Line<THREE.BufferGeometry, THREE.LineBasicMaterial>[];
}
};
6 changes: 3 additions & 3 deletions models/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Body from "~/models/body";

export default interface Setup {
title: string;
bodies(): Body[];
export abstract class Setup {
abstract title: string;
abstract bodies(): Body[];
}
Loading
Loading