create review site

This commit is contained in:
Mikkel 2023-02-09 13:05:18 +01:00
parent 1d41948720
commit 7e8d7e1b11
4 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="anmeldelser/style.css">
<script src="/frontend/bundle.js" defer></script>
<title>Postnummer App</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
</head>
<body>
<div id="topbar">
<h1>Postnummer App</h1>
<div class="spacer"></div>
<button id="dropdown-button"></button>
<div id="dropdown">
<a href="https://mtkonge.dk">more based site</a>
<a href="https://mtkonge.dk">more based site</a>
</div>
</div>
<h2 id="reviews-title">Anmeldelser</h2>
<div id="reviews-container"></div>
</body>
</html>

View File

@ -0,0 +1,4 @@
#anmeldelser {
display: flex;
justify-content: center;
}

View File

@ -33,6 +33,7 @@
<div id="info"> <div id="info">
<p id="zip-code">Postnummer ikke fundet</p> <p id="zip-code">Postnummer ikke fundet</p>
<p id="mouse-position"></p> <p id="mouse-position"></p>
<a href="/anmeldelser">anmeldelser</a>
<p id="coords"></p> <p id="coords"></p>
</div> </div>
</main> </main>

16
frontend/src/review.ts Normal file
View File

@ -0,0 +1,16 @@
const reviewContainer = document.getElementById("review-container")!
function addReview(location: string, title: string, content: string, stars: number, ) {
const id = Math.random() * 1000000
reviewContainer.innerHTML +=
`<div id="review${id}">
<h3>${title}</h3>
<p>${location}</p>
<p>${content}</p>
<p>${stars} stjerner</p>
</div>`
}
addReview("Odense", "meget fint pitstop af motorvejen", "en lille sidevej fra motorvejen hvor det bliver serveret god brunsviger, meget fint sted :)", 5)