Files
Epic-The-Musical-Timeline/src/shared/video-cards.ts
T

17 lines
442 B
TypeScript

import type { Song } from "../data/types";
export function createVideoCards(song: Song): HTMLElement {
const root = document.createElement("div");
root.className = "video-cards";
for (const v of song.videos) {
const a = document.createElement("a");
a.className = "video-card";
a.href = v.url;
a.target = "_blank";
a.rel = "noopener noreferrer";
a.textContent = v.title;
root.append(a);
}
return root;
}