diff --git a/src/components/note.svelte b/src/components/note.svelte new file mode 100644 index 0000000..0644807 --- /dev/null +++ b/src/components/note.svelte @@ -0,0 +1,44 @@ + + +
+{#if !onlyContent}   {/if} +{#each note.outgoingLinks ?? [] as {name, link}} +{@const color = outgoingLinkColors[name]} +{name} +{/each} +
\ No newline at end of file diff --git a/src/lib/notes.ts b/src/lib/notes.ts index 03d30b0..9b73188 100644 --- a/src/lib/notes.ts +++ b/src/lib/notes.ts @@ -65,4 +65,4 @@ export const readNotesList = (): NoteId[] => { } export const writeNotesList = (note_ids: NoteId[]) => { writeFileSync(notesListFile, JSON.stringify(note_ids)) -} +} \ No newline at end of file diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 7f0c474..3b28ffe 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -1,4 +1,5 @@ import { lastFmGetNowPlaying } from "$lib/lastfm" +import { readNote, readNotesList } from "$lib/notes.js" import { steamGetNowPlaying } from "$lib/steam" export const load = async ({}) => { @@ -9,7 +10,9 @@ export const load = async ({}) => { const no = getBannerNo(banners) banners.push(no) } - return {banners, lastTrack, lastGame} + const lastNoteId = readNotesList()[0] + const lastNote = readNote(lastNoteId) + return {banners, lastTrack, lastGame, lastNote, lastNoteId} } const getBannerNo = (others: number[]) => { diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0ea3ffb..2ccb709 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,10 +1,21 @@ -
@@ -131,83 +142,88 @@
  • random project moon art
  • -
  • - gitea - (if i like you ask me for an acc ;3) -
  • - - {#if data.lastTrack} -
    - - {#if data.lastTrack.image} - - {:else} - - {/if} -
    -

    - listening to - {data.lastTrack.name} -

    -

    - by - {data.lastTrack.artist} -

    -
    + +
    +
    + last log + published on {renderDate(data.lastNote.published)}
    - {/if} - {#if data.lastGame} -
    - +
    + +
    +
    + {#if data.lastTrack} +
    + + {#if data.lastTrack.image} -
    -

    - playing - {data.lastGame.name} -

    - + {:else} + + {/if} +
    +

    + listening to - steam profile{data.lastTrack.name} -

    +

    +

    + by + {data.lastTrack.artist} +

    +
    {/if} - {#if !data.lastGame && !data.lastTrack} -

    nothing, apparently.

    + {#if data.lastGame} +
    + + +
    +

    + playing + {data.lastGame.name} +

    + + + steam profile +
    +
    {/if}
    diff --git a/src/routes/log/+page.svelte b/src/routes/log/+page.svelte index 72fa70e..52a26c2 100644 --- a/src/routes/log/+page.svelte +++ b/src/routes/log/+page.svelte @@ -1,37 +1,11 @@ @@ -55,15 +29,9 @@ gazesystems

    -{#each data.notes as [noteId, note], index} -{@const isHighlighted = noteId === data.highlightedNote} -
    -    -{#each note.outgoingLinks ?? [] as {name, link}} -{@const color = outgoingLinkColors[name]} -{name} -{/each} -
    +{#each data.notes as [id, note], index} +{@const isHighlighted = id === data.highlightedNote} + {#if index < data.notes.size - 1}
    {/if}