From 72a9611f1af1a14a58193e7be03203fab0442b5b Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Wed, 21 Jun 2023 00:12:55 +0200 Subject: [PATCH] (songs) delete songs for now --- src/components/headers/Article.astro | 41 ------------ src/components/headers/Base.astro | 12 ---- src/components/songs/AlbumGrid.astro | 19 ------ src/components/songs/Info.astro | 19 ------ src/components/songs/Lyrics.astro | 27 -------- src/components/songs/Ruby.astro | 14 ----- src/components/songs/SongInfo.astro | 61 ------------------ src/content/config.ts | 15 ----- src/content/songs/arcd0054/07 - Don't Lose.md | 37 ----------- .../songs/arcd0054/09 - Eyes of Truth.md | 37 ----------- src/content/songs/arcd0054/beautiful sky.md | 13 ---- src/content/songs/arcd0054/dream-again.md | 22 ------- src/content/songs/black-eyes.md | 39 ------------ src/data/circles.json | 15 ----- src/layouts/Base.astro | 17 +++++ src/layouts/List.astro | 36 ----------- src/pages/songs/[circle]/[cat]/[song].astro | 56 ----------------- src/styles/_root.scss | 6 +- src/types.d.ts | 16 ----- src/utils/songs/data.ts | 47 -------------- src/utils/songs/parse.ts | 63 ------------------- 21 files changed, 22 insertions(+), 590 deletions(-) delete mode 100644 src/components/headers/Article.astro delete mode 100644 src/components/headers/Base.astro delete mode 100644 src/components/songs/AlbumGrid.astro delete mode 100644 src/components/songs/Info.astro delete mode 100644 src/components/songs/Lyrics.astro delete mode 100644 src/components/songs/Ruby.astro delete mode 100644 src/components/songs/SongInfo.astro delete mode 100644 src/content/songs/arcd0054/07 - Don't Lose.md delete mode 100644 src/content/songs/arcd0054/09 - Eyes of Truth.md delete mode 100644 src/content/songs/arcd0054/beautiful sky.md delete mode 100644 src/content/songs/arcd0054/dream-again.md delete mode 100644 src/content/songs/black-eyes.md delete mode 100644 src/data/circles.json delete mode 100644 src/layouts/List.astro delete mode 100644 src/pages/songs/[circle]/[cat]/[song].astro delete mode 100644 src/types.d.ts delete mode 100644 src/utils/songs/data.ts delete mode 100644 src/utils/songs/parse.ts diff --git a/src/components/headers/Article.astro b/src/components/headers/Article.astro deleted file mode 100644 index f5c3497..0000000 --- a/src/components/headers/Article.astro +++ /dev/null @@ -1,41 +0,0 @@ ---- -import type { Dayjs } from "dayjs"; -import Base from "./Base.astro"; - -interface Props { - title: string; - date: Dayjs; - tags?: string[]; - github?: string; -} - -const { title, date, tags = [], github } = Astro.props; ---- - - -
- - - - - - -
- -
    - {tags.map(tag =>
  • {tag}
  • )} -
-
-
- - - {github && ( - - - - )} - diff --git a/src/components/headers/Base.astro b/src/components/headers/Base.astro deleted file mode 100644 index 8475d5d..0000000 --- a/src/components/headers/Base.astro +++ /dev/null @@ -1,12 +0,0 @@ ---- -interface Props { - title: string; -} - -const { title } = Astro.props; ---- - -
-

{title}

- -
diff --git a/src/components/songs/AlbumGrid.astro b/src/components/songs/AlbumGrid.astro deleted file mode 100644 index e66f5fe..0000000 --- a/src/components/songs/AlbumGrid.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- -interface Props { - albums: Array<{ - title: string; - cover: string; - url: string; - }> -} - -const { albums } = Astro.props; ---- -
- {albums.map(album => - - -
{album.title}
-
- )} -
diff --git a/src/components/songs/Info.astro b/src/components/songs/Info.astro deleted file mode 100644 index ae8d3ec..0000000 --- a/src/components/songs/Info.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- -interface Props { - image: string; - title: string; - small: string; -} - -const { image, title, small } = Astro.props; ---- - -
- -
-

{title}

- {small} -
- - -
diff --git a/src/components/songs/Lyrics.astro b/src/components/songs/Lyrics.astro deleted file mode 100644 index cea79b0..0000000 --- a/src/components/songs/Lyrics.astro +++ /dev/null @@ -1,27 +0,0 @@ ---- -import Ruby from "./Ruby.astro"; -import { transform } from "../../utils/songs/parse"; - - -interface Props { - markdown?: boolean; - song?: string; -} - -const data = Astro.props.song || await Astro.slots.render('default'); -const markdown = Astro.props.markdown; - -const lyrics = transform(data, markdown); -const cols = lyrics.length ? Object.keys(lyrics[0]) : []; ---- - - - {cols.map(col => )} - {lyrics.map(row => - {cols.map(col => - - )} - )} -
{col}
- {row[col].map(line =>
)} -
diff --git a/src/components/songs/Ruby.astro b/src/components/songs/Ruby.astro deleted file mode 100644 index 02f4157..0000000 --- a/src/components/songs/Ruby.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -import { transform } from '../../utils/ruby'; - - -interface Props { - text: string; -} - -const text = transform(Astro.props.text); ---- -{text.map(annotated => typeof annotated === 'object' - ? {annotated.text}({annotated.ruby}) - : annotated -)} diff --git a/src/components/songs/SongInfo.astro b/src/components/songs/SongInfo.astro deleted file mode 100644 index d16921c..0000000 --- a/src/components/songs/SongInfo.astro +++ /dev/null @@ -1,61 +0,0 @@ ---- -interface Props { - metadata: { - cover: string; - title: string; - track: number; - name: string; - composer?: string; - lyrics?: string; - vocal?: string[]; - other: Array<{ - cat: string; - }>; - origin?: string[] - } -} - -const { metadata } = Astro.props; ---- - - - - - - - - - - - - - - - - - - {!!metadata.vocal?.length && - - - - - } - {!!metadata.origin?.length && - - - - - } - {!!metadata.other?.length && - - - - - } -
Track{metadata.track}
Circle{metadata.name}
Composer{metadata.composer}
Lyrics{metadata.lyrics}
Vocal -
    {metadata.vocal.map(vocalist =>
  • {vocalist}
  • )}
-
Origin -
    {metadata.origin.map(title =>
  • {title}
  • )}
-
Other versions -
    {metadata.other.map(version =>
  • {version.cat}
  • )}
-
diff --git a/src/content/config.ts b/src/content/config.ts index cbd20d7..0a6017e 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -16,21 +16,6 @@ export const collections = { tags: z.array(z.string()).optional(), }) }), - songs: defineCollection({ - schema: z.object({ - title: z.string(), - composer: z.string().optional(), - lyrics: z.string().optional(), - origin: z.array(z.string()).optional(), - album: z.record( - z.string(), - z.object({ - track: z.number(), - vocal: z.array(z.string()).optional() - }) - ) - }) - }), wiki: defineCollection({ schema: z.object({ title: z.string(), diff --git a/src/content/songs/arcd0054/07 - Don't Lose.md b/src/content/songs/arcd0054/07 - Don't Lose.md deleted file mode 100644 index bfc6687..0000000 --- a/src/content/songs/arcd0054/07 - Don't Lose.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -slug: dont-lose -title: "Don't lose" -composer: Masayoshi Minoshima -lyrics: Mei Ayakura -origin: - - 亡き王女の為のセプテット -album: - ARCD0054: - track: 7 - vocal: - - nomico ---- - -# Japanese -- こんなにも 綺麗な月は -- どうしても 届かないけど -- どんなにも 赤さは絶えず -- いつまでも 燃え続けていて -- あんなにも 求めてるのに -- なんどでも 深く底まで -- そんなにも 堕ちてくのなら -- なにもかも 終わりにするから ---- -- 飲み込んだ 暗闇の奥 -- 寂しいの 独りにしないで -- 暖かな 揺らめきがまだ -- ほんの僅かに 視界に -- 消えないで 夢なら醒めて -- 壊してしまう 無くさないように -- 必要と してしまうほど -- 離れていくの どこまでも ---- -- 愛してた 閉じ込めるほどに -- 哀してた 閉じ込めるほどに -- 「I」してた 閉じ込めるほどに -- だけどもう 違うから diff --git a/src/content/songs/arcd0054/09 - Eyes of Truth.md b/src/content/songs/arcd0054/09 - Eyes of Truth.md deleted file mode 100644 index 6fd649d..0000000 --- a/src/content/songs/arcd0054/09 - Eyes of Truth.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -slug: eyes-of-truth -title: Eyes of Truth (ALR Remix) -composer: Masayoshi Minoshima -lyrics: 溝口ゆうま -origin: - - ラストリモート -album: - ARCD0054: - track: 9 - vocal: - - KUMI(ヲタみん) ---- - -# Japanese -- 回る 運命の歯車 人の手に委ねては -- 未来さえ 創られてゆく 決められた -- 朝を迎えて繰り返す生命 - -- 「心」繋ぐ希望などエゴが纏わりついて -- 命さえ0と1で守られては死の行く先へ道連れを探して - -- 彷徨う「瞳」は殻の中で微睡み -- 世界に真実よあれ 涙の答えは -- 切り刻んだ 心の奥底で笑う -- Eyes of Truth - -- 回る 地上の歯車 人の手に染められて -- もういいよ 欲しいモノは全て消えて -- 朝を忘れて 「瞳」は死を語る - -- 答え知らずに突き進む命の愚かさ - -- 彷徨う「瞳」は殻の中で微睡み -- 世界に真実よあれ 涙の答えは -- 切り刻んだ 心の奥底で笑う -- Eyes of Truth \ No newline at end of file diff --git a/src/content/songs/arcd0054/beautiful sky.md b/src/content/songs/arcd0054/beautiful sky.md deleted file mode 100644 index 0ff9fdc..0000000 --- a/src/content/songs/arcd0054/beautiful sky.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -slug: beautiful-sky -title: Beautiful Sky -composer: Masayoshi Minoshima -lyrics: Mei Ayakura -origin: - - U.N.オーエンは彼女なのか? -album: - ARCD0054: - track: 2 - vocal: - - nachi ---- diff --git a/src/content/songs/arcd0054/dream-again.md b/src/content/songs/arcd0054/dream-again.md deleted file mode 100644 index 6a628ee..0000000 --- a/src/content/songs/arcd0054/dream-again.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -slug: dream-again -title: "Dream Again" -composer: Camellia -lyrics: Camellia -origin: - - the Last Judgment -album: - ARCD0054: - track: 5 - vocal: - - Mei Ayakura ---- - -# Japanese -- 秒針の音が響空間 狭くて安心するほど -- 割り込んだ感覚に目を閉じる 光がまた眩かしすぎて - -- どこまでも続いていく階段 [降]{くだ}った途方もないほど -- 行きたい場所はもう決まっている 幻想の声のする所 - -- 夢溢れる海へ \ No newline at end of file diff --git a/src/content/songs/black-eyes.md b/src/content/songs/black-eyes.md deleted file mode 100644 index ea1762a..0000000 --- a/src/content/songs/black-eyes.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -slug: black-eyes -title: Black Eyes -composer: Kirin (EastNewSound) -lyrics: Mei Ayakura -origin: - - 天狗が見ている 〜 Black Eyes -album: - ARCD0051: - track: 7 - vocal: - - Mei Ayakura ---- - -# Japanese -- 瞬きをして 切り取る時間 -- 何気なくても 大切な今を -- 忘れないで 居られるように -- いつか 頭の中 -- 掻き消して しまっても -# Romaji -- Matataki wo shite kiritoru jikan -- Nanigenakutemo taisetsuna ima wo -- Wasurenaide irareru you ni -- Itsuka atama no naka -- Kakikeshite shimattemo ---- -# Japanese -- 瞬きをして 焼き付ける空 -- 永遠の折り 縁取らせたら -- 綺麗なまま 残されてく -- いつか 思い出して -- 色褪せて しまっても -# Romaji -- Matataki wo shite yakitsukeru sora -- Eien no ori fuchidorasetara -- Kireina mama nokosareteku -- Itsuka omoidashite -- Iroasete shimattemo diff --git a/src/data/circles.json b/src/data/circles.json deleted file mode 100644 index 226f837..0000000 --- a/src/data/circles.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "alstroemeria-records": { - "name": "Alstroemeria Records", - "albums": { - "ARCD0051": { - "title": "Engaged Dancehall", - "cover": "/static/albums/ARCD0051.jpg" - }, - "ARCD0054": { - "title": "Ignition Dancehall", - "cover": "/static/albums/ARCD0054.jpg" - } - } - } -} \ No newline at end of file diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index b04c34f..5e55e44 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -7,6 +7,23 @@ import Footer from "../components/base/Footer.astro"; + +
diff --git a/src/layouts/List.astro b/src/layouts/List.astro deleted file mode 100644 index 411f500..0000000 --- a/src/layouts/List.astro +++ /dev/null @@ -1,36 +0,0 @@ ---- -import type { Dayjs } from "dayjs"; -import Base from "./Base.astro"; -import Header from "../components/headers/Base.astro"; - -interface Props { - title: string; - pages: Array<{ - title: string; - slug: string; - date?: Dayjs; - }>; -} - -const { title, pages } = Astro.props; -const dates = pages.every(page => page.date); ---- - - -
-
-
-
- {pages.map(page => (<> - {dates && ( - - )} - {page.title} - - ))} -
-
-
- diff --git a/src/pages/songs/[circle]/[cat]/[song].astro b/src/pages/songs/[circle]/[cat]/[song].astro deleted file mode 100644 index da3fdf3..0000000 --- a/src/pages/songs/[circle]/[cat]/[song].astro +++ /dev/null @@ -1,56 +0,0 @@ ---- -import Base from "@layouts/Base.astro"; -import Info from "@components/songs/Info.astro"; -import SongInfo from "@components/songs/SongInfo.astro"; -import Lyrics from "@components/songs/Lyrics.astro"; -import { CollectionEntry, getCollection } from "astro:content"; -import { ALBUMS } from "@utils/songs/data"; - - -export async function getStaticPaths() { - return []; /*(await getCollection('songs')) - .map(song => Object.keys(song.data.album) - .map(cat => ({ - params: { circle: ALBUMS[cat].circle, cat, song: song.slug}, - props: { song, cat } - }))) - .flat()*/ -} - - -interface Props { - cat: string; - song: CollectionEntry<'songs'>; -} - -const { cat, song } = Astro.props; - -/** Other versions of this song */ -const other = Object.keys(song.data.album) - .filter(other => other != cat) - .map(cat => ({ cat, title: ALBUMS[cat].title })); - -const metadata = { - ...song.data, - ...song.data.album[cat], - ...ALBUMS[cat], - other -} ---- - - -
-
-
-

{song.data.title}

-
- -
- - -
- diff --git a/src/styles/_root.scss b/src/styles/_root.scss index 537f4bf..4653594 100644 --- a/src/styles/_root.scss +++ b/src/styles/_root.scss @@ -46,4 +46,8 @@ 40.4px 36px 54.8px -3.2px hsl(var(--c-shadow) / 0.26); --momiji: url("/static/svg/momiji.svg") 0 0, url("/static/svg/momiji.svg") 16px 16px; -} \ No newline at end of file +} + +body.dark { + // todo dark mode +} diff --git a/src/types.d.ts b/src/types.d.ts deleted file mode 100644 index 4f2af3f..0000000 --- a/src/types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -type TODO = any; - -/** @file src/data/circles.json */ -interface CirclesSchema { - /** slug */ - [key: string]: { - name: string, - albums: { - /** catalog number */ - [key: string]: { - title: string; - cover: string; - } - } - } -} diff --git a/src/utils/songs/data.ts b/src/utils/songs/data.ts deleted file mode 100644 index a547c79..0000000 --- a/src/utils/songs/data.ts +++ /dev/null @@ -1,47 +0,0 @@ -import circles from "../../data/circles.json"; -import type { CollectionEntry } from "astro:content"; - - -type Song = CollectionEntry<'songs'>; - -interface Metadata { - [key: string]: { - /** Circle slug */ - circle: string; - /** Circle name */ - name: string, - /** Album title */ - title: string, - /** Path to album cover image */ - cover: string, - } -} - - -export function order(cat: string) { - return (a: Song, b: Song) => a.data.album[cat].track < b.data.album[cat].track ? -1 : 1; -} - -export function getAllCats(songs: Song[]): Set { - return songs.reduce( - (cats, next) => ( - Object.keys(next.data.album).forEach(cat => cats.add(cat)), - cats - ), - new Set() - ); -} - -function createMetadata(circles: CirclesSchema): Metadata { - const metadata: Metadata = {}; - - for (const circle of Object.keys(circles)) { - const data = circles[circle]; - for (const cat of Object.keys(data.albums)) - metadata[cat] = { circle, name: data.name, ...data.albums[cat] } - } - return metadata; -} - -export const CIRCLES: CirclesSchema = circles; -export const ALBUMS: Metadata = createMetadata(circles); diff --git a/src/utils/songs/parse.ts b/src/utils/songs/parse.ts deleted file mode 100644 index 722be22..0000000 --- a/src/utils/songs/parse.ts +++ /dev/null @@ -1,63 +0,0 @@ -interface Stack { - [key: string]: string[][]; -} - -interface Verse { - [key: string]: string[]; -} - - -function increaseStack(data: Stack, lang: string) { - lang in data - ? data[lang].push([]) - : data[lang] = [[]]; -} - -function fromMarkdown(markdown: string): Stack { - const stack: Stack = {}; - if (!markdown) return stack; - - let space = true; - let lang = ''; - for (const line of markdown.split('\n').map(x => x.trim())) { - if (line.startsWith('#')) { - lang = line.match(/#+ (.+)/)![1]; - space = true; - } - - if (line === '' || line.startsWith('---')) - space = true; - - if (line.startsWith('- ')) { - if (space === true) { - increaseStack(stack, lang); - space = false; - } - - const text = line.match(/- (.+)/)![1]; - stack[lang].at(-1)!.push(text); - } - } - - return stack -} - -function reduceStack(stack: Stack): Verse[] { - const langs = Object.keys(stack); - const length = langs.reduce((acc, lang) => Math.max(acc, stack[lang].length), 0); - const verses: Verse[] = []; - - for (const _ of Array(length)) { - const verse: Verse = {}; - for (const lang of langs) { - const lines = stack[lang].pop(); - verse[lang] = lines ? lines : []; - } - verses.push(verse); - } - return verses.reverse(); -} - -export function transform(data: string, markdown = false) { - return reduceStack(fromMarkdown(data)); -}