Skip to content

Commit d51310e

Browse files
committed
change footer
1 parent cf0a507 commit d51310e

4 files changed

Lines changed: 46 additions & 50 deletions

File tree

src/lib/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export function filterCharts(charts: ChartDetails[], stepstype: string): ChartDe
1919
* @param query
2020
*/
2121
export function filterSongs(packDict: { [key: string]: PackDetails }, query: string, filters: { [key: string]: string }) {
22-
console.log("packdict: ", packDict);
23-
console.log(filters);
2422
let filteredDict: { [key: string]: { name: string; banner: string; songs: { [key: string]: SongDetails } } } = {};
2523
for (const [packName, packDetails] of Object.entries(packDict)) {
2624
let filteredSongs: { [key: string]: SongDetails } = {};

src/routes/footer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
});
2525
</script>
2626

27-
<div id="footer" class="w-screen bg-black p-4 text-white">
27+
<div id="footer" class="w-screen bg-black p-4 text-white text-sm">
2828
<div
2929
class="flex flex-col-reverse md:flex-row sm:11/12 md:10/12 max-w-5xl m-auto justify-between items-center"
3030
>

src/routes/songlist/List.svelte

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<script lang="ts">
22
import { onMount } from "svelte";
3-
import type { PackDetails, SongDetails, FocusedSong } from "../../lib/types";
4-
import { filterSongs } from '../../lib/utils';
3+
import type {
4+
PackDetails,
5+
SongDetails,
6+
FocusedSong,
7+
} from "../../lib/types";
8+
import { filterSongs } from "../../lib/utils";
59
import Search from "./Search.svelte";
610
711
export let currentIndex: number;
@@ -44,10 +48,10 @@
4448
});
4549
4650
// updates CSS to show focus on the current element
47-
async function updateFocus(
48-
focusedData: PackDetails | SongDetails
49-
) {
50-
focusedSong.title = focusedData?.name ? focusedData.name : focusedData.title;
51+
async function updateFocus(focusedData: PackDetails | SongDetails) {
52+
focusedSong.title = focusedData?.name
53+
? focusedData.name
54+
: focusedData.title;
5155
focusedSong.banner = focusedData?.banner || "";
5256
focusedSong.artist = focusedData?.artist ? focusedData.artist : "";
5357
focusedSong.charts = focusedData?.charts ? focusedData.charts : [];
@@ -147,7 +151,6 @@
147151
}
148152
149153
const handleHover = (event: MouseEvent) => {
150-
console.log("hovering");
151154
if (scrollable.length === 0) {
152155
return;
153156
}
@@ -168,46 +171,45 @@
168171
id="packs"
169172
class="w-screen md:w-1/2 h-full flex flex-col bg-navy z-1 overflow-y-auto"
170173
bind:this={listContainer}
171-
172174
>
173-
<Search bind:query bind:filters/>
175+
<Search bind:query bind:filters />
174176
<ul>
175177
<!-- <li class="font-semibold text-darknavy text-center bg-yellow-500">
176178
Note: the current songlist is a placeholder and it will be up to date
177179
soon.
178180
</li> -->
179-
{#each Object.entries(filteredPackDict).sort( ([, a], [, b]) => a.name.localeCompare(b.name), ) as [_, packDetails]}
180-
<li
181-
class="pack scroll-item font-semibold text-blue-300 text-center"
182-
>
183-
<!-- TODO: not critical but might change, was kinda breaking when using enter to just trigger onclick but it would be nice to make it work -->
184-
<button
185-
type="button"
186-
class="p-2 w-full"
187-
on:click|preventDefault={() =>
188-
handleClick(packDetails.name)}
189-
on:keydown={(event) => {
190-
if (event.key === "Enter") {
191-
event.stopPropagation();
192-
event.preventDefault();
193-
handleEnter(event);
194-
}
195-
}}
181+
{#each Object.entries(filteredPackDict).sort( ([, a], [, b]) => a.name.localeCompare(b.name), ) as [_, packDetails]}
182+
<li
183+
class="pack scroll-item font-semibold text-blue-300 text-center"
196184
>
197-
{packDetails.name}
198-
</button>
199-
</li>
200-
{#if openPack === packDetails.name}
201-
<div class="bg-darknavy">
202-
<ul>
203-
{#each Object.entries(packDetails.songs).sort( (a, b) => a[1].title.localeCompare(b[1].title), ) as [songName, songDetails]}
204-
<li class="song scroll-item text-center p-2">
205-
<p>{songDetails.title}</p>
206-
</li>
207-
{/each}
208-
</ul>
209-
</div>
210-
{/if}
211-
{/each}
185+
<!-- TODO: not critical but might change, was kinda breaking when using enter to just trigger onclick but it would be nice to make it work -->
186+
<button
187+
type="button"
188+
class="p-2 w-full"
189+
on:click|preventDefault={() =>
190+
handleClick(packDetails.name)}
191+
on:keydown={(event) => {
192+
if (event.key === "Enter") {
193+
event.stopPropagation();
194+
event.preventDefault();
195+
handleEnter(event);
196+
}
197+
}}
198+
>
199+
{packDetails.name}
200+
</button>
201+
</li>
202+
{#if openPack === packDetails.name}
203+
<div class="bg-darknavy">
204+
<ul>
205+
{#each Object.entries(packDetails.songs).sort( (a, b) => a[1].title.localeCompare(b[1].title), ) as [songName, songDetails]}
206+
<li class="song scroll-item text-center p-2">
207+
<p>{songDetails.title}</p>
208+
</li>
209+
{/each}
210+
</ul>
211+
</div>
212+
{/if}
213+
{/each}
212214
</ul>
213215
</div>

src/server.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,18 @@ import cors from 'cors';
55

66
dotenv.config();
77

8-
const assetsPath = './data/assets';
9-
108
const app = express();
9+
1110
const corsOptions = {
1211
origin: '*',
1312
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
1413
allowedHeaders: '*',
1514
credentials: true
1615
};
1716
app.use(cors(corsOptions));
17+
1818
app.use(express.json());
1919

20-
// serve assets dynamically
21-
app.use(express.static(assetsPath))
22-
23-
// let sveltekit handle everything
2420
app.use(handler);
2521

2622
app.listen(3000, () => {

0 commit comments

Comments
 (0)