diff --git a/src/App.vue b/src/App.vue index 89bb503..7e386a0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,6 +7,8 @@
{{ $t('nav.others') }}
·
+ {{ $t('nav.photo') }} +
·
{{ $t('nav.blog') }}
·
{{ $t('nav.life') }} @@ -14,8 +16,7 @@ {{ $t('nav.about') }}
·
- -
·
+
@@ -95,6 +96,7 @@ class App extends Vue calculateBookmarkCss(): void { + console.log('CalculateBookmarkCss called', this.currentRoute, this.$refs) if (this.currentRoute in this.$refs) this.currentLink = (this.$refs[this.currentRoute] as ComponentPublicInstance).$el else return diff --git a/src/scripts/messages.ts b/src/scripts/messages.ts index a43227d..0cc2949 100644 --- a/src/scripts/messages.ts +++ b/src/scripts/messages.ts @@ -8,7 +8,8 @@ export const messages = { blog: '记事本', life: '生活', projects: 'Projects', - others: '更多' + others: '更多', + photo: '相册' } }, zh: { diff --git a/src/scripts/router.ts b/src/scripts/router.ts index 2a32bae..1e4b5e1 100644 --- a/src/scripts/router.ts +++ b/src/scripts/router.ts @@ -27,6 +27,12 @@ const routes: Array = [ component: () => import('../views/Blog.vue'), props: route => (route.query) }, + { + path: '/photo', + name: 'Photo', + meta: {title: '相册', nav: true}, + component: () => import('../views/Photo.vue') + }, { path: '/others', name: 'Others', @@ -51,12 +57,6 @@ const routes: Array = [ meta: {title: '我做的', navBookmark: 'Others'}, component: () => import('../views/others/Projects.vue') }, - { - path: '/photo', - name: 'Photo', - meta: {title: '摄影', navBookmark: 'Others'}, - component: () => import('../views/Photo.vue') - }, ] export const router = createRouter({ diff --git a/src/views/Photo.vue b/src/views/Photo.vue index 0a1c6fc..9660875 100644 --- a/src/views/Photo.vue +++ b/src/views/Photo.vue @@ -24,10 +24,10 @@ export default class Photos extends Vue { async created() { this.photos = await (await fetch('https://p.aza.moe/photos')).json() - this.photos.sort((a, b) => (b.upload_time < a.upload_time ? 1 : -1)) + this.photos.sort((a, b) => (a.exif.DateTime < b.exif.DateTime ? 1 : -1)) let rowProbabilityTable = { - 1: 0, 2: 0.5, 3: 0.5 + 1: 0, 2: 0.3, 3: 0.5 } // Generate photo rows: there is a 10% chance that a photo will be the only photo in its row @@ -65,7 +65,7 @@ export default class Photos extends Vue {