Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To Astro #236

Merged
merged 71 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
62b207e
とりあえず移動してみる
Hiroshiba Nov 8, 2024
649126c
init
Hiroshiba Nov 8, 2024
dd19a39
とりあえず1ページ作ってみる
Hiroshiba Nov 8, 2024
a3892ef
とりあえずmarkdownを表示してみる
Hiroshiba Nov 8, 2024
dc21d90
SEO情報作る
Hiroshiba Nov 9, 2024
5087e44
キャラクター一覧を表示してみる
Hiroshiba Nov 10, 2024
5e6728f
トップイラストコンテナを追加
Hiroshiba Nov 10, 2024
edd063e
とりあえず1人表示できるように
Hiroshiba Nov 11, 2024
4a8b8dd
ファイル移動
Hiroshiba Nov 11, 2024
00806de
とりあえずボイボ寮ページが表示できるように
Hiroshiba Nov 12, 2024
0c347d9
データの転写
Hiroshiba Nov 12, 2024
1839e30
ボイボ寮ページのトップイラストとイベント情報を追加し、レイアウトを改善
Hiroshiba Nov 14, 2024
88cb37f
ボイボ寮呼称表
Hiroshiba Nov 14, 2024
bb4f0cf
ボイボ寮ページのスタイルと構造を改善し、画像のインポートを整理
Hiroshiba Nov 15, 2024
c0820fc
再生ボタンを追加してみる
Hiroshiba Nov 15, 2024
b3c6a24
フッターやサムネのデザインを調整
Hiroshiba Nov 17, 2024
206b86d
markdown系追加
Hiroshiba Nov 17, 2024
6208e48
更新履歴追加
Hiroshiba Nov 17, 2024
56b90fb
Nemoページ追加
Hiroshiba Nov 17, 2024
3e09ff1
アセットの持ち方を変更
Hiroshiba Nov 18, 2024
76d936f
ソングページ追加
Hiroshiba Nov 18, 2024
5e31e27
トークページ追加
Hiroshiba Nov 18, 2024
6425d1b
製品ページ追加
Hiroshiba Nov 19, 2024
dcb225d
プライバシーポリシーのモーダルを追加し、関連するスタイルとストアを実装
Hiroshiba Nov 20, 2024
b0f0d6f
modalの一部を移動
Hiroshiba Nov 20, 2024
3ace3ae
すべてのモーダルに対応
Hiroshiba Nov 21, 2024
f3ed75b
モーダルの表示の仕方を変更
Hiroshiba Nov 21, 2024
e77e25f
画像表示のスタイルを改善し、モーダルの構造を整理
Hiroshiba Nov 21, 2024
6cd5be0
ヘッダーの改善
Hiroshiba Nov 22, 2024
fd9542a
表示を整える、eslintとか導入する
Hiroshiba Nov 23, 2024
46d23a6
Google Analyticsの設定を追加し、モーダルでのイベント送信を実装。不要なコードを削除し、スタイルを整理。
Hiroshiba Nov 24, 2024
21905d0
環境設定ファイルを削除し、グローバルスタイルを整理。sitemapの比較タスクを追加し、viteを依存関係に追加。faviconとwebm…
Hiroshiba Nov 24, 2024
c114d47
サムネ作成を可能に
Hiroshiba Nov 24, 2024
0ecb986
Google AnalyticsのPartytownをなくす
Hiroshiba Nov 24, 2024
9fb0783
ボイボ寮のサムネイル画像を追加
Hiroshiba Nov 24, 2024
48381e1
メニューの挙動整理
Hiroshiba Nov 24, 2024
d67ac30
旧ファイル少し整理
Hiroshiba Nov 24, 2024
9e90eef
旧ファイルREADME以外整理
Hiroshiba Nov 24, 2024
8713d22
更新ツールを更新
Hiroshiba Nov 25, 2024
5c43cd7
プレビュービルドを可能にする
Hiroshiba Nov 25, 2024
57c9494
Google Analyticsの読み込み条件を修正
Hiroshiba Nov 25, 2024
5904fcc
画像コンポーネントにdensitiesプロパティを追加し、依存関係のバージョンを更新
Hiroshiba Nov 26, 2024
6915655
Playwrightの設定を更新、メタデータのスナップショットテストを追加
Hiroshiba Nov 28, 2024
4471733
フォントのURLを相対パスから絶対パスに変更
Hiroshiba Nov 28, 2024
a770d80
キャラクターページのスクリーンショットを追加
Hiroshiba Nov 28, 2024
d66af0a
ページのスクリーンショットを追加、スマホ画面も追加
Hiroshiba Nov 29, 2024
e6cecf5
テストworkflowを追加
Hiroshiba Nov 29, 2024
b9063da
sitemapPathの定義を相対パスからpath.joinを使用した形式に変更
Hiroshiba Nov 29, 2024
4591b4a
uiテストも追加
Hiroshiba Nov 30, 2024
c784267
改行コードを\nに
Hiroshiba Dec 3, 2024
121efb3
モードを整備
Hiroshiba Dec 5, 2024
0cb91d2
微調整
Hiroshiba Dec 5, 2024
f33b296
ミス修正
Hiroshiba Dec 5, 2024
81a52e1
meta descriptから<br />タグを削除
Hiroshiba Dec 5, 2024
2cf8054
calls_name で、自分自身への呼び方は背景色がつかないようにする
Hiroshiba Dec 5, 2024
61207c2
コードブロック周り変更
Hiroshiba Dec 5, 2024
9e642cb
コードの整形とインポート順序の整理
Hiroshiba Dec 5, 2024
ef3d319
ビルドコマンドを preview-build から test-build に変更
Hiroshiba Dec 5, 2024
8e135c7
@/に
Hiroshiba Dec 5, 2024
426e579
assetのパス変更
Hiroshiba Dec 5, 2024
2306538
assetのインポートパスを変更
Hiroshiba Dec 5, 2024
14f6080
nemo assetのディレクトリ変更
Hiroshiba Dec 5, 2024
1c00357
コンポーネントのデフォルトエクスポートを関数形式に変更
Hiroshiba Dec 6, 2024
9de2445
再生ボタンに音声ストアを追加し、最後に再生した音声を管理する機能を実装
Hiroshiba Dec 6, 2024
85513b8
呼び方表のテーブルセルにコピー機能を追加し、スタイルを改善
Hiroshiba Dec 6, 2024
a33891c
スマホビューでボタンを縦配置にするスタイルを追加
Hiroshiba Dec 6, 2024
7d28910
スナップショットを更新
Hiroshiba Dec 6, 2024
5577488
Nemoの方もダウンロード選択しやすいように
Hiroshiba Dec 6, 2024
bee99f1
ニュースページをnoindexで作る
Hiroshiba Dec 23, 2024
33ae750
スナップショット更新
Hiroshiba Dec 23, 2024
e1d31d0
Merge remote-tracking branch 'upstream/master' into to-stro
Hiroshiba Dec 23, 2024
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
Prev Previous commit
Next Next commit
とりあえずボイボ寮ページが表示できるように
Hiroshiba committed Nov 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 00806de14250aa8e88f3173b8b70125cde01b01c
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ pnpm start

### TODO

- [ ] FontAwesomeIcon の設定
- [ ] favicon 等の設定
- [ ] sitemap 確認
- [ ] ニュースの RSS?
1,065 changes: 0 additions & 1,065 deletions old-gatsby/src/hooks/useDetailedCharacterInfo.ts

Large diffs are not rendered by default.

42 changes: 37 additions & 5 deletions src/constants/characaterAsset.ts
Original file line number Diff line number Diff line change
@@ -8,12 +8,16 @@ import {

/**
* キャラクターごとに複数のアセットを分配する。
* 元のパスも返す。
* 1つもない場合は空配列を返す。
*/
export function makeCharacterAssetsRecord<T>(
export function makeCharacterAssetsRecordWithPath<T>(
globRecord: Record<string, () => Promise<T>>,
): Record<CharacterKey, Promise<T>[]> {
const record = {} as Record<CharacterKey, Promise<T>[]>;
): Record<CharacterKey, { path: string; asset: Promise<T> }[]> {
const record = {} as Record<
CharacterKey,
{ path: string; asset: Promise<T> }[]
>;
for (const key of characterKeys) {
record[key] = [];
}
@@ -23,7 +27,25 @@ export function makeCharacterAssetsRecord<T>(
path.includes(characterEntries[key].id),
);
if (key == undefined) throw new Error(`Unknown character: ${path}`);
record[key].push(globRecord[path]());
record[key].push({ path, asset: globRecord[path]() });
}
return record;
}

/**
* キャラクターごとに複数のアセットを分配する。
* 1つもない場合は空配列を返す。
*/
export function makeCharacterAssetsRecord<T>(
globRecord: Record<string, () => Promise<T>>,
): Record<CharacterKey, Promise<T>[]> {
const baseRecord = makeCharacterAssetsRecordWithPath(globRecord);
const record: Record<CharacterKey, Promise<T>[]> = {} as Record<
CharacterKey,
Promise<T>[]
>;
for (const key of characterKeys) {
record[key] = baseRecord[key].map(({ asset }) => asset);
}
return record;
}
@@ -91,7 +113,17 @@ export const portraitImages = makeCharacterAssetsRecordSingle(
import.meta.glob<AstroImage>("./portrait-images/*.png"),
);

/** トーク用音声とそのパス。1つもないときもある。 */
export const talkAudiosAndPaths = makeCharacterAssetsRecordWithPath(
import.meta.glob<string>("./talk-audios/*.wav"),
);

/** ソング用音声とそのパス。1つもないときもある。 */
export const songAudiosAndPaths = makeCharacterAssetsRecordWithPath(
import.meta.glob<string>("./song-audios/*.wav"),
);

/** ボイボ寮用音声。1つもないときもある。 */
export const dormitoryAudioArrays = makeCharacterAssetsRecordOptional(
export const dormitoryAudios = makeCharacterAssetsRecordOptional(
import.meta.glob<string>("./dormitory-audios/*.wav"),
);
1,043 changes: 1,043 additions & 0 deletions src/constants/characterInfos/callNameInfo.ts

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions src/constants/characterInfos/helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { CharacterKey } from "@constants/characterEntry";
import type { Styles } from "../type";
import {
songAudiosAndPaths,
talkAudiosAndPaths,
} from "@constants/characaterAsset";

/** トーク用音声をスタイルごとに分ける */
export function makeTalkVoiceUrls(styles: Styles, key: CharacterKey) {
return styles
.filter((v) => v.type == "talk")
.map((v) => ({
style: v.name,
urls: talkAudiosAndPaths[key]
.filter((obj) => obj.path.includes(v.id))
.map((obj) => obj.asset),
}));
}

/** ソング音声をスタイルごとに分ける */
export function makeSongVoiceUrls(styles: Styles, key: CharacterKey) {
return styles
.filter((v) => ["song", "humming"].includes(v.type))
.map((v) => ({
style: v.name,
styleType: v.type as "song" | "humming",
urls: songAudiosAndPaths[key]
.filter((obj) => obj.path.includes(v.id))
.map((obj) => obj.asset),
}));
}
14 changes: 7 additions & 7 deletions src/constants/characterInfos/voidoll.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type { CharacterKey } from "@constants/characterEntry";
import type { CharacterInfo, StyleNames } from "../type";
import type { CharacterInfo, Styles } from "../type";
import {
bustupImages,
portraitImages,
dormitoryAudioArrays,
dormitoryAudios,
} from "@constants/characaterAsset";
import { makeSongVoiceUrls, makeTalkVoiceUrls } from "./helper";

const key = "Voidoll" satisfies CharacterKey;

const styleNames = [
{ name: "ノーマル", id: "normal", type: "talk" },
] as const satisfies StyleNames;
] satisfies Styles;

export default {
key,
@@ -19,7 +20,6 @@ export default {
rubyName: "<ruby>Voidoll<rp>(</rp><rt>ぼいどーる</rt><rp>)</rp></ruby>",
voiceFeature: "慎ましやかで電子的な声",
bustupImage: bustupImages[key],
// bustupImageSmall: AstroImage;
portraitImage: portraitImages[key],
// ogpImage: AstroImage;
color: "#1D86AE",
@@ -28,16 +28,16 @@ export default {
"「#コンパス」を管理するAIロボ<br />人間の戦い方を監視/分析している。",
additionalProductDescription:
"話速:0.90、音高:0.03、抑揚:0.90とすれば、「#コンパス 戦闘摂理解析システム」ゲーム内のボイスに近い仕上がりとなります。",
talkVoiceUrls: [], // TODO: あとで変える
songVoiceUrls: [], // TODO: あとで変える
talkVoiceUrls: makeTalkVoiceUrls(styleNames, key),
songVoiceUrls: makeSongVoiceUrls(styleNames, key),
labelInfos: [
{ label: "CV", value: "丹下桜", size: 2 },
{ label: "アビリティ", value: "緊急回避プログラム", size: 2 },
{ label: "年齢", value: "???", size: 2 },
{ label: "身長", value: "???", size: 1 },
{ label: "誕生日", value: "???", size: 1 },
],
dormitoryVoiceUrls: dormitoryAudioArrays[key],
dormitoryVoiceUrls: dormitoryAudios[key],
// infoImages: AstroImage[],
policyUrl: "https://blog.nicovideo.jp/niconews/224589.html",
detailUrl: "https://app.nhn-playart.com/compass/index.nhn",
13 changes: 6 additions & 7 deletions src/constants/type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CharacterKey } from "@constants/characterEntry";
import type { AstroImage } from "@types";

export type StyleNames = {
export type Styles = {
name: string;
id: string;
type: "talk" | "song" | "humming";
@@ -14,22 +14,21 @@ export type CharacterInfo = {
rubyName: string;
voiceFeature: string | undefined;
bustupImage: Promise<AstroImage>;
// bustupImageSmall: Promise<AstroImage>;
portraitImage: Promise<AstroImage>;
// ogpImage: Promise<AstroImage>;
color: string;
lightColor: string;
description: string; // ボイボ寮ページでの紹介文
additionalProductDescription?: string; // 製品ページでの追加の紹介文
labelInfos: readonly { label: string; value: string; size: 1 | 2 }[];
talkVoiceUrls: { style: string; urls: readonly string[] }[];
labelInfos: { label: string; value: string; size: 1 | 2 }[];
talkVoiceUrls: { style: string; urls: Promise<string>[] }[];
songVoiceUrls: {
style: string;
styleType: "song" | "humming";
urls: readonly string[];
urls: Promise<string>[];
}[];
dormitoryVoiceUrls?: readonly Promise<string>[];
infoImages?: readonly Promise<AstroImage>[];
dormitoryVoiceUrls?: Promise<string>[];
infoImages?: Promise<AstroImage>[];
detailUrl: string | undefined;
policyUrl: string | undefined;
releaseDate?: string;
8 changes: 8 additions & 0 deletions src/helper.ts
Original file line number Diff line number Diff line change
@@ -4,3 +4,11 @@ export function sortedImportGlob<T>(record: Record<string, T>) {
.sort(([key1], [key2]) => key1.localeCompare(key2))
.map(([_, value]) => value);
}

/** 到達しないであろうコードに到達したことを示すエラー */
export class UnreachableError extends Error {
constructor(message?: string) {
super(message || "Unreachable code was executed.");
this.name = "UnreachableError";
}
}
233 changes: 233 additions & 0 deletions src/pages/dormitory/[characterId]/[...descriptionType].astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
---
import type { InferGetStaticPropsType, GetStaticPaths } from "astro";
import { characterEntries, characterKeys } from "@constants/characterEntry";
import { characterInfos } from "@constants/characterInfo";
import { descriptionTypes } from "./constants";
export const getStaticPaths = (async () => {
return characterKeys.flatMap((key) =>
descriptionTypes.map((d) => ({
params: {
characterId: characterEntries[key].id,
descriptionType: d == "profile" ? undefined : d, // NOTE: 以前に合わせるため、プロフィールページはURLをネストしない
},
props: { characterInfo: characterInfos[key], descriptionType: d },
})),
);
}) satisfies GetStaticPaths;
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
import { Image } from "astro:assets";
import Base from "@layouts/Base.astro";
import CallBox from "./_CallBox.astro";
import TypeButton from "./_TypeButton.astro";
import { callNameInfos } from "@constants/characterInfos/callNameInfo";
const { characterInfo, descriptionType } = Astro.props;
const characterKey = characterInfo.key;
---

<Base
title={`${characterInfo.name} | ボイボ寮 | VOICEVOX`}
description={characterInfo.description}
>
<!-- TODO: image={selectedCharacterInfo.ogpImage.images.fallback?.src} -->
<div class="dormitory-character">
<main class="section py-1">
<div class="container is-max-desktop">
<div class="box" style={{ borderColor: characterInfo.color }}>
<div class="columns m-0" style={{ height: "100%" }}>
<div
class="column is-4 portrait-column"
style={{ borderColor: characterInfo.color }}
>
<Image
src={characterInfo.portraitImage}
alt={characterInfo.name}
style={{ height: "100%", width: "100%" }}
/>
</div>
<div class="column description-column">
<div class="section">
<div class="description-top">
<h1 class="title" set:html={characterInfo.rubyName} />
<a
class="button description-top-button"
style={{
color: characterInfo.color,
borderColor: characterInfo.color,
visibility: characterInfo.detailUrl
? "visible"
: "hidden",
}}
href={characterInfo.detailUrl}
aria-label={`${characterInfo.name}の詳細ページ`}
target="_blank"
rel="noreferrer"
>
<!-- TODO: <FontAwesomeIcon icon={faHome} /> -->
</a>
</div>
<div class="buttons has-addons">
<TypeButton
characterInfo={characterInfo}
selectedType={descriptionType}
targetType="profile"
/>
<TypeButton
characterInfo={characterInfo}
selectedType={descriptionType}
targetType="calls"
/>
</div>
{
descriptionType === "profile" && (
<>
<div
class="description-profile"
set:html={characterInfo.description}
/>
<div class="columns is-variable is-1 is-multiline">
{characterInfo.labelInfos.map((labelInfo, index) => (
<div
key={index}
class={`column ${
labelInfo.size == 1 ? "is-6" : "is-12"
} description-box`}
>
<span
class="description-label"
style={{ backgroundColor: characterInfo.color }}
>
{labelInfo.label}
</span>
<span
class="description-text"
set:html={labelInfo.value}
/>
</div>
))}
<div class="column is-12 description-box">
<span
class="description-label"
style={{ backgroundColor: characterInfo.color }}
>
音声サンプル
</span>
{characterInfo.dormitoryVoiceUrls ? (
<div class="description-samples">
{characterInfo.dormitoryVoiceUrls.map(
(url, index) => (
// <PlayButton
// key={index}
// url={url}
// name={`${
// characterInfo.name
// }のサンプルボイス${index + 1}`}
// color={characterInfo.color}
// class="ml-1 mr-1"
// />
// TODO: PlayButton
<div>TODO</div>
),
)}
</div>
) : (
<span class="description-text">準備中</span>
)}
</div>
</div>
{characterInfo.infoImages && (
<div class="description-info-images">
{characterInfo.infoImages.map((image, index) => (
<Image
src={image}
alt={characterInfo.name}
style={{
maxHeight: "8rem",
objectFit: "contain",
}}
/>
))}
</div>
)}
</>
)
}
{
descriptionType === "calls" && (
<div class="columns description-call">
<div class="column is-3 description-call-other-column">
<div class="description-call-other-cell">
<div>
<span>一人称</span>
</div>
<div>
{callNameInfos[characterKey].me.map((callName) => (
<p>{callName}</p>
))}
</div>
</div>
<div class="description-call-other-cell">
<div>
<span>二人称</span>
</div>
<div>
{callNameInfos[characterKey].you.map((callName) => (
<p>{callName}</p>
))}
</div>
</div>
</div>
<div class="column is-9 description-call-character">
{characterKeys
.filter(
(targetCharacterKey) =>
targetCharacterKey !== characterKey,
)
.map((targetCharacterKey, index) => (
<CallBox
characterInfo={characterInfo}
baseCharacterKey={characterKey}
targetCharacterKey={targetCharacterKey}
/>
))}
</div>
</div>
)
}
</div>
</div>
</div>
</div>
<div class="link-buttons has-text-weight-bold">
{
/*
TODO:
<Link
to={getProductPageUrl(characterInfo)}
class="button is-normal is-rounded character-list-button"
style={{ borderColor: characterInfo.color }}
>
ダウンロードページ
</Link>
<Link
to={// ボイボ寮ページから遷移した場合は前のキャラクターへ戻る
// 検索流入や共有されたページから直接飛んだ場合は先頭へ戻る
location.state?.fromDormitory
? `/dormitory/#${characterInfo.id}`
: `/dormitory/`}
class="button is-normal is-rounded character-list-button"
style={{ borderColor: characterInfo.color }}
>
キャラクター一覧
</Link>*/
}
</div>
</div>
</main>
</div>
</Base>
72 changes: 72 additions & 0 deletions src/pages/dormitory/[characterId]/_CallBox.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
import type { CharacterKey } from "@constants/characterEntry";
import type { CharacterInfo } from "@constants/type";
interface Props {
characterInfo: CharacterInfo;
baseCharacterKey: CharacterKey;
targetCharacterKey: CharacterKey;
}
import { Image } from "astro:assets";
import { characterInfos } from "@constants/characterInfo";
import { callNameInfos } from "@constants/characterInfos/callNameInfo";
const { characterInfo, baseCharacterKey, targetCharacterKey } = Astro.props;
const callTo: string | undefined =
// @ts-ignore UnreachableError
callNameInfos[baseCharacterKey][targetCharacterKey];
const callFrom: string | undefined =
// @ts-ignore UnreachableError
callNameInfos[targetCharacterKey][baseCharacterKey];
---

<div
class="columns is-mobile is-vcentered is-variable is-1 description-call-box"
>
<div class="column description-call-line">
<div class="description-call-one">
<span
class={`description-call-text ${callTo ? "" : "unknown"}`}
style={{ borderColor: characterInfo.color }}
>
{callTo || ""}
</span>
<span
class="description-call-arrow"
style={{ color: characterInfo.color }}
>
</span>
</div>
<div class="description-call-one">
<span
class="description-call-arrow"
style={{ color: characterInfos[targetCharacterKey].color }}
>
</span>
<span
class={`description-call-text ${callFrom ? "" : "unknown"}`}
style={{ borderColor: characterInfos[targetCharacterKey].color }}
>
{callFrom || ""}
</span>
</div>
</div>
<div class="column is-narrow py-1" style={{ height: "100%" }}>
<Image
class="border-icon"
src={characterInfos[targetCharacterKey].bustupImage}
alt={characterInfos[targetCharacterKey].name}
style={{
borderColor: characterInfos[targetCharacterKey].color,
height: "100%",
aspectRatio: "1/1",
objectFit: "contain",
}}
/>
</div>
</div>
30 changes: 30 additions & 0 deletions src/pages/dormitory/[characterId]/_TypeButton.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
import type { CharacterInfo } from "@constants/type";
import type { descriptionTypes } from "./constants";
interface Props {
characterInfo: CharacterInfo;
selectedType: (typeof descriptionTypes)[number];
targetType: (typeof descriptionTypes)[number];
}
const { characterInfo, selectedType, targetType } = Astro.props;
const selected = selectedType == targetType;
---

<a
class={`button is-rounded description-type-button ${
selected && "description-type-button-selected"
}`}
style={{
color: characterInfo.color,
borderColor: characterInfo.color,
backgroundColor: selected ? characterInfo.lightColor : undefined,
}}
href={`/dormitory/${characterInfo.id}/${
targetType == "profile" ? "" : targetType + "/"
}`}
type="button"
>
<span>{targetType == "profile" ? "プロフィール" : "呼び方"}</span>
</a>
1 change: 1 addition & 0 deletions src/pages/dormitory/[characterId]/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const descriptionTypes = ["profile", "calls"] as const;
13 changes: 5 additions & 8 deletions src/pages/dormitory/_CharacterCard.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
import type { CharacterKey } from "@constants/characterEntry";
import type { CharacterInfo } from "@constants/type";
interface Props {
characterKey: CharacterKey;
characterInfo: CharacterInfo;
additionalClass?: string;
}
import { Image } from "astro:assets";
import { getDormitoryCharacterPageUrl } from "@/constants/url";
import { characterInfos } from "@constants/characterInfo";
const { characterKey, additionalClass } = Astro.props;
const { characterInfo, additionalClass } = Astro.props;
const characterInfo = characterInfos[characterKey];
const color = characterInfo.color || "black";
const href = getDormitoryCharacterPageUrl(characterInfo);
---
@@ -32,11 +30,10 @@ const href = getDormitoryCharacterPageUrl(characterInfo);
class="card-image"
src={characterInfo.bustupImage}
alt={characterInfo.name}
width={128}
height={128}
width={256}
height={256}
style={{ objectFit: "contain" }}
/>
<!-- TODO: src={characterInfo.bustupImageSmall} -->
<div
class="card-content has-text-centered"
style={{ borderColor: color }}
3 changes: 2 additions & 1 deletion src/pages/dormitory/index.astro
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import TopIllustContainer from "./_TopIllustContainer.astro";
import CharacterCard from "./_CharacterCard.astro";
import shareThumb from "./top-illusts/top-illust-009.png";
import { characterInfos } from "@constants/characterInfo";
---

<Base
@@ -42,7 +43,7 @@ import shareThumb from "./top-illusts/top-illust-009.png";
</h2>
</div>

<CharacterCard characterKey={"Voidoll"} />
<CharacterCard characterInfo={characterInfos.Voidoll} />
</div>

<!--