feat: Implement comments, notifications, and custom emojis with new API routes, UI components, and database migrations.

This commit is contained in:
x
2026-01-25 03:48:24 +01:00
parent 595118c2c8
commit d903ce8b98
18 changed files with 1900 additions and 44 deletions

View File

@@ -788,18 +788,277 @@ html[theme="f0ck95"] #next {
}
/* removing in favor of new appearance */
/* html[theme="f0ck95"] .navbar-brand:hover {
background: #80808059;
} */
/*
html[theme="f0ck95"] span.f0ck::after {
content: "95";
font-size: 14px;
font-family: vcr;
vertical-align: super;
color: teal;
/* Notifications */
.nav-item-rel {
position: relative;
display: inline-block;
}
.notif-count {
position: absolute;
top: 0px;
right: -5px;
background: var(--badge-nsfw);
color: white;
font-size: 10px;
padding: 2px 2px;
border-radius: 3px;
line-height: 1;
}
.notif-dropdown {
display: none;
position: absolute;
top: 100%;
left: 50%;
/* Center horizontally relative to bell */
transform: translateX(-50%);
/* Center trick */
width: 300px;
background: var(--dropdown-bg);
border: 1px solid var(--nav-border-color);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
z-index: 1000;
margin-top: 10px;
}
.notif-dropdown.visible {
display: block;
}
.notif-header {
padding: 10px;
border-bottom: 1px solid var(--nav-border-color);
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.9rem;
color: var(--white);
background: var(--nav-bg);
}
.notif-header button {
background: none;
border: none;
color: var(--accent);
cursor: pointer;
font-size: 0.8rem;
padding: 0;
}
.notif-list {
max-height: 300px;
overflow-y: auto;
}
.notif-item {
padding: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
background: var(--dropdown-bg);
cursor: pointer;
transition: background 0.2s;
font-size: 0.85rem;
color: var(--white);
display: block;
text-decoration: none;
}
.notif-item:hover {
background: var(--dropdown-item-hover);
text-decoration: none;
color: var(--white);
}
.notif-item.unread {
border-left: 3px solid var(--accent);
background: rgba(255, 255, 255, 0.02);
}
.notif-time {
font-size: 0.75rem;
color: #888;
margin-top: 3px;
display: block;
}
.notif-empty {
padding: 20px;
text-align: center;
color: #888;
font-size: 0.9rem;
}
#comments-container {
margin-top: 20px;
padding: 10px;
color: var(--white);
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}
.comments-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
border-bottom: 1px solid var(--nav-border-color);
padding-bottom: 10px;
}
.comments-controls {
display: flex;
gap: 10px;
}
.comments-controls button,
.comments-controls select {
background: rgba(255, 255, 255, 0.1);
border: 1px solid var(--nav-border-color);
color: var(--white);
padding: 5px 10px;
cursor: pointer;
border-radius: 0;
/* No rounded corners */
}
.comment-input {
margin-bottom: 20px;
background: rgba(255, 255, 255, 0.05);
/* Light seethrough */
padding: 10px;
border: 1px solid var(--nav-border-color);
border-radius: 0;
/* No rounded corners */
}
.comment-input textarea {
width: 100%;
background: rgba(0, 0, 0, 0.2);
border: 1px solid var(--nav-border-color);
color: var(--white);
padding: 10px;
min-height: 80px;
resize: vertical;
border-radius: 0;
/* No rounded corners */
}
.input-actions {
margin-top: 10px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.submit-comment {
background: var(--accent);
color: var(--black);
border: none;
padding: 5px 15px;
font-weight: bold;
cursor: pointer;
border-radius: 0;
/* No rounded corners */
}
.cancel-reply {
background: transparent;
color: var(--white);
border: 1px solid var(--nav-border-color);
margin-left: 10px;
padding: 5px 10px;
cursor: pointer;
border-radius: 0;
}
.comments-list {
display: flex;
flex-direction: column;
gap: 15px;
}
.comment {
display: flex;
gap: 15px;
padding: 10px;
background: rgba(255, 255, 255, 0.03);
/* Very light seethrough */
border: 1px solid rgba(255, 255, 255, 0.05);
border-radius: 0;
/* No rounded corners */
}
.comment.deleted {
opacity: 0.5;
}
.comment-avatar img {
width: 40px;
height: 40px;
object-fit: cover;
border-radius: 0;
/* Square avatars */
}
.comment-body {
flex: 1;
}
.comment-meta {
margin-bottom: 5px;
font-size: 0.9em;
color: #888;
}
.comment-author {
font-weight: bold;
color: var(--accent);
margin-right: 10px;
}
.comment-time {
font-size: 0.8em;
margin-right: 10px;
}
.reply-btn {
background: none;
border: none;
color: #888;
cursor: pointer;
font-size: 0.8em;
text-decoration: underline;
padding: 0;
}
.comment-content {
line-height: 1.4;
word-break: break-word;
}
.comment-children {
margin-top: 15px;
margin-left: 10px;
border-left: 1px solid var(--nav-border-color);
padding-left: 15px;
}
.loading,
.error {
text-align: center;
padding: 20px;
color: #888;
}
.deleted-msg {
color: #666;
font-style: italic;
}
html[theme="f0ck95"] #tags .badge>a:first-child {
text-shadow: 1px 1px #8080805e;
}
@@ -2237,10 +2496,117 @@ body[type='login'] {
background: var(--bg);
border: 1px solid var(--black);
padding: 5px;
color: #fff;
margin: 6px 0;
/* Markdown Styles */
.comment-content .greentext {
color: #789922;
font-family: monospace;
display: inline-block;
}
.comment-content blockquote {
border-left: 3px solid var(--accent);
margin: 5px 0;
padding-left: 10px;
opacity: 0.8;
}
.comment-content pre {
background: #222;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}
.comment-content code {
background: #333;
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
}
.comment-content ul,
.comment-content ol {
padding-left: 20px;
}
.comment-content a {
text-decoration: underline;
}
margin-bottom: 10px;
border-radius: 0;
width: max-content;
max-width: 300px;
}
/* Emoji Picker */
.input-actions {
position: relative;
/* Context for picker */
}
.emoji-picker {
position: absolute;
bottom: 40px;
right: 0;
width: 350px;
max-height: 300px;
background: var(--dropdown-bg);
border: 1px solid var(--black);
padding: 10px;
z-index: 1000;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
gap: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
border-radius: 8px;
}
.emoji-picker img {
width: 60px;
height: 60px;
object-fit: contain;
cursor: pointer;
transition: transform 0.1s, background 0.1s;
padding: 4px;
border-radius: 4px;
}
.emoji-picker img:hover {
transform: scale(1.1);
background: rgba(255, 255, 255, 0.1);
}
.emoji-trigger {
background: none;
border: none;
color: var(--white);
font-size: 20px;
cursor: pointer;
margin-right: 10px;
padding: 0 5px;
vertical-align: middle;
transition: text-shadow 0.2s;
}
.emoji-trigger:hover {
text-shadow: 0 0 8px var(--accent);
}
.emoji-picker::after {
content: '';
position: absolute;
top: 100%;
right: 15px;
border-width: 6px;
border-style: solid;
border-color: var(--dropdown-bg) transparent transparent transparent;
}
/* visualizer */
canvas {
position: absolute;
@@ -3474,4 +3840,192 @@ input#s_avatar {
#register-modal-close:hover {
opacity: 1;
color: var(--accent);
}
/* Comments System */
#comments-container {
margin-top: 20px;
padding: 15px;
background: var(--metadata-bg);
border-radius: 5px;
color: var(--white);
font-family: var(--font);
}
.comments-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
border-bottom: 1px solid var(--gray);
padding-bottom: 10px;
}
.comments-controls button,
.comments-controls select {
background: var(--badge-bg);
border: 1px solid var(--black);
color: var(--white);
padding: 5px 10px;
cursor: pointer;
font-family: inherit;
}
.comment {
margin-bottom: 15px;
padding: 10px;
background: rgba(0, 0, 0, 0.2);
border-radius: 4px;
display: flex;
gap: 15px;
}
.comment.deleted .comment-content {
color: #888;
font-style: italic;
}
.comment-avatar img {
width: 40px;
height: 40px;
border-radius: 4px;
}
.comment-body {
flex: 1;
}
.comment-meta {
font-size: 0.85em;
color: #aaa;
margin-bottom: 5px;
}
.comment-author {
font-weight: bold;
color: var(--accent);
margin-right: 10px;
}
.comment-permalink {
color: #666;
text-decoration: none;
margin-left: 5px;
}
.comment-content {
margin-bottom: 10px;
line-height: 1.4;
word-break: break-word;
}
.reply-btn {
background: none;
border: none;
color: #888;
cursor: pointer;
font-size: 0.9em;
padding: 0;
margin-left: 10px;
}
.reply-btn:hover {
color: var(--white);
text-decoration: underline;
}
.comment-children {
margin-top: 10px;
padding-left: 15px;
border-left: 2px solid var(--gray);
}
.comment-input textarea {
width: 100%;
min-height: 80px;
background: var(--bg);
border: 1px solid var(--gray);
color: var(--white);
padding: 10px;
border-radius: 4px;
font-family: inherit;
resize: vertical;
}
.input-actions {
margin-top: 5px;
text-align: right;
}
.submit-comment,
.cancel-reply {
background: var(--accent);
color: var(--black);
border: none;
padding: 6px 12px;
border-radius: 3px;
cursor: pointer;
font-weight: bold;
}
.cancel-reply {
background: #666;
color: white;
margin-left: 5px;
}
.comment-input.reply-input {
margin-top: 10px;
margin-bottom: 10px;
}
.loading,
.error {
text-align: center;
padding: 20px;
color: #888;
}
.login-placeholder {
padding: 15px;
text-align: center;
background: rgba(0, 0, 0, 0.1);
margin-bottom: 15px;
}
/* Markdown Styles */
.comment-content .greentext {
color: #789922;
font-family: monospace;
display: inline-block;
}
.comment-content blockquote {
border-left: 3px solid var(--accent);
margin: 5px 0;
padding-left: 10px;
opacity: 0.8;
}
.comment-content pre {
background: #222;
padding: 10px;
border-radius: 4px;
overflow-x: auto;
}
.comment-content code {
background: #333;
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
}
.comment-content ul,
.comment-content ol {
padding-left: 20px;
}
.comment-content a {
text-decoration: underline;
}