This commit is contained in:
Atilla
2024-03-06 11:16:05 +01:00
4 changed files with 38 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ body .mainContainer .goodgarden-logo {
position: absolute; position: absolute;
width: 10vw; width: 10vw;
left: 50%; left: 50%;
top: 2.5rem; top: 4.1rem;
transform: translateX(-50%); transform: translateX(-50%);
} }
body .mainContainer .informatie-kas-main-container { body .mainContainer .informatie-kas-main-container {

View File

@@ -71,7 +71,7 @@ body
position: absolute; position: absolute;
width: 10vw; width: 10vw;
left: 50%; left: 50%;
top: 2.5rem; top: 4.1rem;
transform: translateX(-50%); transform: translateX(-50%);
} }

View File

@@ -6,6 +6,7 @@
<title>Document</title> <title>Document</title>
<link rel="stylesheet" href="../src/css/style.css"> <link rel="stylesheet" href="../src/css/style.css">
<script src="../src/js/main.js" defer></script> <script src="../src/js/main.js" defer></script>
<script src="../src/js/planten.class.js"></script>
</head> </head>
<body> <body>
<section class="mainContainer"> <section class="mainContainer">
@@ -21,7 +22,7 @@
<a href="../src/kas_informatie.html"> <a href="../src/kas_informatie.html">
<article class="article-1"> <article class="article-1">
<img src="images/Icon awesome-apple-alt.png" alt=""> <img src="images/Icon awesome-apple-alt.png" alt="">
<h2>Tomaat</h2> <h2 class="plant-naam"></h2>
</article> </article>
</a> </a>
</td> </td>
@@ -79,7 +80,7 @@
</table> </table>
<div id="myModal" class="modal"> <div id="myModal" class="modal">
<span class="close">&times;</span> <span class="close">&times;</span>
<form action="http://localhost:3000/submit-form" method="post"> <form action="http://localhost:3000/submit-form" method="post" onsubmit="return addplant()">
<input type="text" name="plant_naam" id="plantNaam"> <input type="text" name="plant_naam" id="plantNaam">
<label for="plantNaam">Naam van de plant</label> <label for="plantNaam">Naam van de plant</label>
@@ -97,10 +98,10 @@
</form> </form>
</div> </div>
<div id="overlay" onclick="closeOverlay"></div>
</section> </section>
<!-- White space --> <!-- White space -->
<section> <section>
<p>a</p>
</section> </section>
<section class="kant-rechts"> <section class="kant-rechts">
<section id="sectie-1"> <section id="sectie-1">

32
src/js/planten.class.js Normal file
View File

@@ -0,0 +1,32 @@
dataHardObject = {
"id": 1,
"plantnaam": "Tomaat",
"plantensoort": "Groente",
"plantGeteelt": 1
}
// Nieuwe planten aanmaken in de table
// function hardcodeData(dataHardObject)
// {
// dataHardObject => "id"
// }
class Plant {
constructor(dataHardObject) {
this.id = dataHardObject.id;
this.plantNaam = dataHardObject.plantNaam;
this.plantensoort = dataHardObject.plantensoort;
this.plantGeteelt = dataHardObject.plantGeteelt;
}
htmlData(plantNaam) {
if (this.plantGeteelt)
{
const titel = document.querySelector(".plant-naam");
titel.textContent = this.plantNaam;
}
}
}
const tomaatPlant = new Plant(dataHardObject);
tomaatPlant.htmlData();