Skip to content

Instantly share code, notes, and snippets.

import { el } from "./elements/el.js";
import { type Game } from "../types/index.js";
export function createCard(props: Game): HTMLElement {
const card = el("div", { className: "game-card" }, [
el("hr", {}),
el("h3", { textContent: props.name }),
el("img", {
src: props.background_image || "dist/project/css/images/none-img.jpg",
className: "game-image",
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Movie library</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/main.js" defer></script>
</head>
import { el } from "./elements/el.js";
import { type Game } from "../types/index.js";
export function createCard(props: Game): HTMLElement {
const card = el("div", { className: "game-card" }, [
el("hr", {}),
el("h3", { textContent: props.name }),
el("img", {
src: props.background_image || "css/images/no-image.jpg",
className: "game-image",