diff --git a/js/customElements/newComment.js b/js/customElements/newComment.js index b150dd82916c2afe3fe4997f8ece5873f375d52d..30b301c71d2efdfcd06ac12ae3b277c97671bcee 100644 --- a/js/customElements/newComment.js +++ b/js/customElements/newComment.js @@ -1,13 +1,16 @@ class newComment extends HTMLElement { constructor() { super(); - this.setupForm(); + this.innerHTML = ` + <button class="bigButton" id="showCommentButton">Neues Kommentar verfassen</button> + `; + document.getElementById("showCommentButton").onclick = this.setupForm; } async setupForm(){ let sitekey = await (await fetch("/API/config.php?name=sitekey")).text(); - this.innerHTML = ` + this.parentElement.innerHTML = ` <form action="/API/newComment.php" method="post"> <label for="name">Name:</label><br> <input type="text" id="name" name="name"><br><br> diff --git a/scss/_comments.scss b/scss/_comments.scss index 98d4de1d77abe8dcbbcb29174cc7c85dab45783c..10b4e8c3aeecb42744158dd87eef2ed06e9dd337 100644 --- a/scss/_comments.scss +++ b/scss/_comments.scss @@ -65,3 +65,16 @@ .emailBox { display: inline; } + +.bigButton { + background-color: $accent-color; + color: #fff; + text-transform: uppercase; + padding: 15px; + font-size: 14px; + cursor: pointer; + outline: 0; + border: 0; + transition: background-color $link-hover-animation-time linear; + width: 100%; +} \ No newline at end of file