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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- Added the required column `isColorful` to the `Board` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "Board" ADD COLUMN "isColorful" BOOLEAN NOT NULL;
1 change: 1 addition & 0 deletions src/lib/api/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type BoardListItem = {
name: string;
createdAt: string;
preview: number[][];
isColorful: boolean;
};

export async function fetchBoardList(isJapanese: boolean): Promise<BoardListItem[] | undefined> {
Expand Down
9 changes: 6 additions & 3 deletions src/lib/components/BoardModals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
selectedBoardId = null;
}

function getCellColor(cell: number): string {
function getCellColor(cell: number, isColorful: boolean): string {
const WHITE = 0xffffff;

if (isColorful) {
Expand Down Expand Up @@ -71,7 +71,10 @@
{#each manager.saveState.preview as row, i (i)}
<div class="preview-row">
{#each row as cell, j (j)}
<div class="preview-cell" style="background-color: {getCellColor(cell)}"></div>
<div
class="preview-cell"
style="background-color: {getCellColor(cell, isColorful)}"
></div>
{/each}
</div>
{/each}
Expand Down Expand Up @@ -129,7 +132,7 @@
{#each row as cell, j (j)}
<div
class="preview-cell"
style="background-color: {getCellColor(cell)}"
style="background-color: {getCellColor(cell, item.isColorful)}"
></div>
{/each}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/routes/api/board/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export async function GET({ url }) {
name: true,
createdAt: true,
preview: true,
isColorful: true,
},
});

Expand Down