Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
14 changes: 7 additions & 7 deletions cardStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ nav ul a {
cursor: pointer;
}

/* .fa-plus-circle {
.fa-plus-circle {
margin-right: 0.8em;
} */
}

/* .body-div1, .body-div2 {
.body-div1, .body-div2 {
margin-left: 150px;
margin-right: 150px;
} */
}

.body-div1 {
margin-top: 25px;
Expand All @@ -68,7 +68,7 @@ nav ul a {

.article-card {
width: 320px;
margin: 30rem 0;
margin: 0rem 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
Expand Down Expand Up @@ -140,13 +140,13 @@ div#popupContact {
display: flex;
justify-content: flex-center;
align-items: center;
/* width: 920px; height : 572px; */
width: 920px; height : 572px;
padding: 108px 0px 0px 18px;
flex-direction: column;
border: 2px solid gray;
font-family: raleway;
background-color: #fff;
/* height: 572px; */
height: 572px;
}

h2 {
Expand Down
56 changes: 8 additions & 48 deletions displayCard.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="cardStyle.css">
<title>Document</title>
</head>
<body>
<nav>
<img src="/assets/logo.svg" alt="logo" />
<ul>
<li> <a href="/displayCard.html">My Blogs</a></li>
<li> <a href="/displayCard.html">Login</a></li>
<li> <a href="/displayCard.html">Sign Up</a></li>
</ul>
</nav>
<div class="body-div1">
<div>Your Blog Posts</div>
<a ><button class="button" id="addBlog" ><i class="fas fa-plus-circle"></i>Add New Post</button></a>
</div>
<div class="body-div2">
<div class="article-card" id="flashcard">
<!-- <img src="./assets/java card image.svg" alt=""> -->
<div class="card-text" id="card-text">
<!-- <h1 id="blog-title">sda</h1> -->
<!-- <p id="blog-description">da</p> -->
<!-- <p>Posted on</p> -->
</div>
<!-- <div class="card-buttons">
<a><button type="button" id="edit">EDIT</button></a> <span>|</span><a ><button id="delete">DELETE</button></a>
</div> -->
</div>
</div>
<div id="popupContact">
<button id="close"> <img id="close" src="./assets/close-button.svg"></button>
<img id="rect" src=./assets/rect.svg>
<h2>Your Post</h2>
<div id="card" >
<input type="hidden" name="blogId" value="" />
<input id="title" name="title" value="" placeholder="Title" type="text"/>
<textarea id="detail" name="message" placeholder="Description" value=""></textarea>
<button id="post" type="submit" >POST</button>
</div>
</div>
</body>
<script src="/script.js"></script>
</html>
<input type="hidden" name="blogId" value="" />
<input id="title" name="title" value="" placeholder="Title" type="text"/>
<textarea id="detail" name="message" placeholder="Description" value=""></textarea>
<button id="post" type="submit" >POST</button>
<button id="post" type="submit">POST</button>
</div>
</div>
</body>
45 changes: 44 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
/* Fill your code*/
class Blog{
constuctor(title,detail){
this.title = title
this.detail = detail
}
addTitle(){
var title_card = document.createElement('h1');
title_card.setAttribute("id","blog-title");
console.log(title_card);
document.getElementById('card-text').appendChild(title_card);
title_card.innerHTML += this.title;
}
addDescription(){
var detail_card = document.createElement('p');
detail_card.setAttribute("id","blog-description");
console.log(detail_card);
document.getElementById('card-text').appendChild(detail_card);
detail_card.innerHTML += this.detail;
}
}


document.getElementById("addBlog").addEventListener("click", addPost)
document.getElementById("close").addEventListener("click", close)
document.getElementById("post").addEventListener("click", addBlog)

function addPost(){
var unhide = document.getElementById("popupContact")
unhide.style.display = "flex"
}
function close(){
var unhide = document.getElementById("popupContact")
unhide.style.display = "none"
}
function addBlog(){
const obj = new Blog
obj.title = document.getElementById("title").value
obj.detail = document.getElementById("detail").value
if((obj.title != "")&&(obj.detail!="")){
obj.addTitle()
obj.addDescription()
}
else alert("TITLE OR DESCRIPTION CANNOT BE EMPTY")
}