diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..c741881 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file diff --git a/cardStyle.css b/cardStyle.css index 4e024c3..1b8f906 100644 --- a/cardStyle.css +++ b/cardStyle.css @@ -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; @@ -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; @@ -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 { diff --git a/displayCard.html b/displayCard.html index a8ee226..6b777e7 100644 --- a/displayCard.html +++ b/displayCard.html @@ -1,48 +1,8 @@ - - - - - - - Document - - - -
-
Your Blog Posts
- -
-
-
- -
- - - -
- -
-
-
- - -

Your Post

-
- - - - -
-
- - - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/script.js b/script.js index e60691b..c977c6d 100644 --- a/script.js +++ b/script.js @@ -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") +} \ No newline at end of file