Merge branch 'Renzo' of https://github.com/6028570/GoodGarden
This commit is contained in:
@@ -32,7 +32,7 @@ body .mainContainer .goodgarden-logo {
|
||||
position: absolute;
|
||||
width: 10vw;
|
||||
left: 50%;
|
||||
top: 2.5rem;
|
||||
top: 4.1rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
body .mainContainer .informatie-kas-main-container {
|
||||
|
||||
@@ -71,7 +71,7 @@ body
|
||||
position: absolute;
|
||||
width: 10vw;
|
||||
left: 50%;
|
||||
top: 2.5rem;
|
||||
top: 4.1rem;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="../src/css/style.css">
|
||||
<script src="../src/js/main.js" defer></script>
|
||||
<script src="../src/js/planten.class.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section class="mainContainer">
|
||||
@@ -21,7 +22,7 @@
|
||||
<a href="../src/kas_informatie.html">
|
||||
<article class="article-1">
|
||||
<img src="images/Icon awesome-apple-alt.png" alt="">
|
||||
<h2>Tomaat</h2>
|
||||
<h2 class="plant-naam"></h2>
|
||||
</article>
|
||||
</a>
|
||||
</td>
|
||||
@@ -79,7 +80,7 @@
|
||||
</table>
|
||||
<div id="myModal" class="modal">
|
||||
<span class="close">×</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">
|
||||
<label for="plantNaam">Naam van de plant</label>
|
||||
@@ -97,10 +98,10 @@
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div id="overlay" onclick="closeOverlay"></div>
|
||||
</section>
|
||||
<!-- White space -->
|
||||
<section>
|
||||
<p>a</p>
|
||||
</section>
|
||||
<section class="kant-rechts">
|
||||
<section id="sectie-1">
|
||||
|
||||
32
src/js/planten.class.js
Normal file
32
src/js/planten.class.js
Normal 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();
|
||||
Reference in New Issue
Block a user