mirror of
https://github.com/Rainyy21/Front-end-Design-Project.git
synced 2026-10-11 00:30:23 -04:00
change how the form work
This commit is contained in:
@@ -43,3 +43,21 @@
|
|||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dialog{
|
||||||
|
border:none;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px;
|
||||||
|
width: 300px;
|
||||||
|
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog::backdrop {
|
||||||
|
background: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// open log button
|
||||||
|
const modal = document.getElementById("#formModal");
|
||||||
|
const openbtn = document.getElementById("#openForm");
|
||||||
|
const closebtn = document.getElementsByClassName("#closeForm");
|
||||||
|
|
||||||
|
openbtn.addEventListener("click", function() {
|
||||||
|
modal.showModal();
|
||||||
|
});
|
||||||
|
|
||||||
|
closebtn.addEventListener("click", function() {
|
||||||
|
modal.close();
|
||||||
|
}) ;
|
||||||
+26
-17
@@ -50,7 +50,7 @@
|
|||||||
<div id = "seach_bar">
|
<div id = "seach_bar">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id = "addLog_button">
|
<div id = "openForm">
|
||||||
+ log a book/show
|
+ log a book/show
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,22 +79,31 @@
|
|||||||
<div class = "header-secton">
|
<div class = "header-secton">
|
||||||
<h1>📚 My Library</h1>
|
<h1>📚 My Library</h1>
|
||||||
|
|
||||||
<form action ="/add" method ="POST" enctype="multipart/form-data">
|
{% comment %} button {% endcomment %}
|
||||||
<input type="text" name="title" placeholder="Title" required>
|
<button id= "openForm">Add New Entry</button>
|
||||||
<select name="type">
|
|
||||||
<option value="Book">Book</option>
|
{% comment %} this is the form {% endcomment %}
|
||||||
<option value="Show">Show</option>
|
<dialog id="formModal">
|
||||||
</select>
|
|
||||||
<input type="number" name="year" placeholder="Year">
|
<form action ="/add" method ="dialog" enctype="multipart/form-data">
|
||||||
<input type="text" name="extra_info" placeholder="Author/Network">
|
<input type="text" name="title" placeholder="Title" required>
|
||||||
<select name="genre_id">
|
<select name="type">
|
||||||
{% for g in genres %}
|
<option value="Book">Book</option>
|
||||||
<option value="{{ g.id }}">{{ g.name }}</option>
|
<option value="Show">Show</option>
|
||||||
{% endfor %}
|
</select>
|
||||||
</select>
|
<input type="number" name="year" placeholder="Year">
|
||||||
<input type="file" name="cover_image">
|
<input type="text" name="extra_info" placeholder="Author/Network">
|
||||||
<button type="submit">Add Entry</button>
|
<select name="genre_id">
|
||||||
</form>
|
{% for g in genres %}
|
||||||
|
<option value="{{ g.id }}">{{ g.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<input type="file" name="cover_image">
|
||||||
|
<button type="submit">Add Entry</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--the card area-->
|
<!--the card area-->
|
||||||
|
|||||||
Reference in New Issue
Block a user