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 new color for spoilers links #473

Merged
merged 1 commit into from
May 29, 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
5 changes: 5 additions & 0 deletions assets/chat/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ hr {
border-color: transparent transparent $color-underline-nsfl transparent;
border-width: 1px 0 1px 0;
}
.spoilers-link {
border-style: dashed;
border-color: transparent transparent $color-underline-spoilers transparent;
border-width: 1px 0 1px 0;
}
.hidden {
display: none !important;
}
Expand Down
3 changes: 2 additions & 1 deletion assets/chat/js/formatters/EmbedUrlFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default class EmbedUrlFormatter {
let extraclass = '';

if (/\b(?:NSFL)\b/i.test(str)) extraclass = 'nsfl-link';
else if (/\b(?:NSFW|SPOILERS?)\b/i.test(str)) extraclass = 'nsfw-link';
else if (/\b(?:NSFW)\b/i.test(str)) extraclass = 'nsfw-link';
else if (/\b(?:SPOILERS)\b/i.test(str)) extraclass = 'spoilers-link';

const baseUrl = chat.config.dggOrigin + chat.bigscreenPath;
return str.replace(
Expand Down
3 changes: 2 additions & 1 deletion assets/chat/js/formatters/UrlFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default class UrlFormatter {
let extraclass = '';

if (/\b(?:NSFL)\b/i.test(str)) extraclass = 'nsfl-link';
else if (/\b(?:NSFW|SPOILERS?)\b/i.test(str)) extraclass = 'nsfw-link';
else if (/\b(?:NSFW)\b/i.test(str)) extraclass = 'nsfw-link';
else if (/\b(?:SPOILERS)\b/i.test(str)) extraclass = 'spoilers-link';

return str.replace(linkregex, (url, scheme) => {
const decodedUrl = self.elem.html(url).text();
Expand Down
1 change: 1 addition & 0 deletions assets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ $color-link-visited: #a66be5;
$color-text-broadcast: #edea12;
$color-underline-nsfl: #fff000;
$color-underline-nsfw: #ff0000;
$color-underline-spoilers: #ff80ce;

$color-green: #61bd4f;
$color-darkgreen: #4c7c42;
Expand Down