Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment section #1580

Merged
merged 2 commits into from
Oct 31, 2024
Merged
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
Binary file added 25a7f6e52f7d373e7db6d63c4bdb38d1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (10).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (11).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (12).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (13).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (5).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (6).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (7).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (8).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OIP (9).jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"license": "ISC",
"description": "",
"dependencies": {
"backend": "file:",
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
Expand Down
145 changes: 145 additions & 0 deletions comment.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
*{
box-sizing:border-box ;
}
/* body{
display: block;
margin: 0;
padding: 0;
font-family: "Montserrat", sans-serif;
font-size: 16px;
background-color:rgb(230 224 216);
margin-top: 20px;
} */
.flex{
display:flex ;
justify-content: space-between;
width: 100%;
}
img{
width: 100%;
height: 100%;
}
.comment-box, .comment-list{
background: #fff;
border-radius: 4px;
box-shadow: 0 8px 8px #0002;
position: relative;
animation: float 4s ease-in-out infinite;

}
.comment-box, .comment-list:hover{
box-sizing: inherit;
}
.comment-session{
width: 650px;
height: auto;
margin: 0 auto;
}
.comment-list{
width: 100%;
margin-bottom: 12px;
}

.comment-list .user{
display:flex ;
padding: 8px;
overflow: hidden;
}
.comment-list .user img{
height: 38px;
width: 38px;
border-radius: 50%;
margin-right: 10px;
}
.comment-list .name{
text-transform: uppercase;
font-weight: 600;
}
.comment-list .day{
font-size: 12px;
}
.reply{
display: flex;
align-items: center;
gap: 10px;
justify-content: center;
padding:10px ;
gap:10px;
}

.icons {
display: flex;
align-items: center;
justify-content: center;
height: 24px;
color:#777;
gap: 5px;

}
/* .icon:hover{
color: #009cff;
cursor: pointer;
} */
body.dark-mode { --background-color: #121212; --text-color: #ffffff; --comment-bg-color: #1e1e1e; --border-color: #333; --box-shadow-color: rgba(255, 255, 255, 0.1); --icon-color: #bbbbbb; --icon-hover-color: #ffffff; --link-color: #82b1ff; --button-bg-color: #1e88e5; --button-hover-bg-color: #1565c0; --text-area-bg-color: #2e2e2e; --text-area-border-color: #555; }
.icons.like:hover, .icons.like.active {
color: #1e90ff;
cursor: pointer;
}
.icons.dislike:hover, .icons.dislike.active {
color: #ff6347;
cursor: pointer;
}
.post-comment .comment{
padding: 0 0 15px 58px;
}
.comment-box{
padding: 10px;
overflow: hidden;

}
.comment-box .user{
display: flex;
width: min-content;
}
.comment-box .image img{
width: 24px;
height: 24px;
margin-right: 10px;
border-radius: 50%;
}
.comment-box textarea{
background: #eee;
width:-webkit-fill-available;
height: 152px;
margin: 10px 0;
padding: 10px;
border: none;
border-radius: 4px;
box-shadow: 0 0 0 0.5px #0003;
}
.comment-box textarea:focus{
outline-color: #009cff;

}
.comment-box .comment-submit{
float:right ;
padding: 6px 14px;
border: none;
background: #009cff;
color:#fff;
cursor: pointer;
border-radius: 2px;

}
.comment-box .comment-submit:hover{
background-color: #027ecc;
}
.re-comment:hover {
text-decoration: underline;
}
@keyframes float {
0%, 100% {
transform: translateY(0);
} 50% {
transform: translateY(-10px);
} }
23 changes: 23 additions & 0 deletions comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let likeCount = 420;

function toggleLike(element) {
if (element.classList.contains('active')) {
element.classList.remove('active');
likeCount--;
} else {
element.classList.add('active');
likeCount++;
}
element.querySelector('.count').innerText = likeCount;
}

element.classList.toggle('active');


document.querySelector('.like').addEventListener('click', function() {
toggleLike(this);
});

document.querySelector('.dislike').addEventListener('click', function() {
toggleDislike(this);
});
Loading
Loading