Skip to content
Open
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
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap" rel="stylesheet">
<!-- Importing local CSS file -->
<link href="./style.css" rel="stylesheet">
<!-- Importing local JS file -->
<script src="main.js" defer></script>
</head>

<body>
<header>
<h1>ChatVenture</h1>
<p>Hello PLAYER! Welcome to the text adventure game where the story is made up by GPT :)</p>
</header>

<div class="genres">
<button class="genre" data-genre="horror">👻</button>
<button class="genre" data-genre="spy film">🕵🏻‍</button>
<button class="genre" data-genre="marvel superheros">🦸🏻</button>
</div>
</body>

</html>
9 changes: 9 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const init = () => {
const genres = document.querySelectorAll('.genre');
genres.forEach((button) => button.addEventListener(
'click',
() => alert(`You selected the genre: ${button.dataset.genre}`))
)
}

init()
24 changes: 24 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,27 @@ header {
color: #e9f45b;
padding: 32px;
}

.genres {
display: grid;
grid-template-columns: repeat(3, 100px);
justify-content: center;
gap: 10px;
}

.genre {
background-color: transparent;
width: 100px;
height: 100px;
overflow: hidden;
font-size: 40px;
text-align: center;
line-height: 2.4;
border: 4px solid #a1d2ff;
cursor: pointer;
}

.genre:hover {
background-color: rgba(255,255,255,0.7);
border: 4px solid #f1c82d;
}