Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Bao Zhiyuan committed Aug 29, 2024
1 parent 0bdbd5f commit dd40a85
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .src/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ const games = fs
.filter(d => d.isDirectory() && !d.name.startsWith('.'))
.map(d => d.name)

const lis = games.map(d => `<li><a href='${d}'>${d}</a></li>`)
const gameCards = games
.map(d =>
/*html*/ `
<div>
<a href='${d}/index.html'>${d}</a>
</div>
`.trim(),
)
.join('\n')

const index = /*html*/ `
<!DOCTYPE html>
Expand All @@ -17,11 +25,23 @@ const index = /*html*/ `
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MoonBit Code JAM 2024</title>
<style>
:root {
font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
}
*, *::before, *::after {
box-sizing: border-box;
}
h1 {
text-align: center;
}
</style>
</head>
<body>
<ul>
${lis}
</ul>
<h1>MoonBit Code JAM 2024</h1>
<div>
${gameCards}
</div>
</body>
</html>
`
Expand Down

0 comments on commit dd40a85

Please sign in to comment.