Skip to content

Commit

Permalink
Add option for create post on Homepage
Browse files Browse the repository at this point in the history
* added post link

* added post option in navbar

* updated css for add-btn
  • Loading branch information
SaiChithra333 authored Oct 23, 2024
1 parent a0d15fb commit 80c0ae6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
39 changes: 39 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,42 @@ img {
border-radius: 5px;
text-align: center;
}

/* css for add-btn */

.add-btn a {
position: fixed;
bottom: 6vh;
right: 5vw;
z-index: 100;
background-color: black;
color: white;
height: 10vw;
width: 10vw;
max-width: 60px;
max-height: 60px;
border-radius: 50%;
font-size: clamp(1rem, 4vw, 2.5rem);
animation: 3s infinite pulse;
text-decoration: none;
display: flex;
justify-content: center;
align-items: center;

}

@keyframes pulse {
0% {
transform: scale(0.9);
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.306);
}
70% {
transform: scale(1);
box-shadow: 0 0 0 50px transparent;
}
100% {
transform: scale(0.9);
box-shadow: 0 0 0 0 transparent;
}
}

4 changes: 2 additions & 2 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% }) %>
</ul>


<button class="add-btn"><a href="/add-post" %> ">+</a></button>
<% if (nextPage !== null) { %>
<a href="/?page=<%= nextPage %>" class="pagination">&lt; View Older Posts</a>
<% } %>
Expand All @@ -29,4 +29,4 @@



</section>
</section>
3 changes: 3 additions & 0 deletions views/partials/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<li>
<a href="/admin" class="<%= isActiveRoute('/admin', currentRoute) %>">Login</a>
</li>
<li>
<a href="/add-post" class="<%= isActiveRoute('/admin', currentRoute) %>">Post</a>
</li>
</ul>

</nav>
Expand Down

0 comments on commit 80c0ae6

Please sign in to comment.