diff --git a/files/assets/css/main.css b/files/assets/css/main.css index af8f375a3..924eb6fd7 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5551,13 +5551,13 @@ img[src$="/i/hand.webp"] { width: 90%; height: 90%; margin-top: -10%; - z-index: 1; + z-index: 101; } img[src$="/i/talking.webp"] { position: absolute; width: 70%; } -img[src$="/i/hand.webp"]+img { +img[src$="/i/hand.webp"]~img { animation: pat-pfp-anim 0.3s infinite; transform-origin: bottom center; margin-top: 10%; @@ -5568,14 +5568,17 @@ img[src$="/i/hand.webp"]+img[src$="/i/talking.webp"] { padding-top: 20%; padding-right: 5%; } -img[src$="/i/hand.webp"]+img[src$="/i/talking.webp"]+img { +img[src$="/i/hand.webp"]+img[src$="/i/talking.webp"]~img { animation: pat-pfp-anim 0.3s infinite; transform-origin: bottom center; margin-top: 20%; text-align: center; object-fit: contain; } -img[src$="/i/talking.webp"]+img { +img[src$="/i/talking.webp"]~img { + margin-top: 22%; +} +img[src$="/i/talking.webp"]+img+img[src$="/i/love-background.webp"] { margin-top: 22%; } img[src$="/i/talking.webp"]+img[src$="/i/hand.webp"] { @@ -5588,6 +5591,31 @@ img[src$="/i/hand.webp"]+img[src^="/pp/"], img[src$="/i/hand.webp"]+img[src$="/p border-radius: 50%; object-fit: cover; } + +.love-preview { + bottom: calc(2px + 2%) !important; +} + +img[src$="/i/love-foreground.webp"]+img[src$="/i/love-background.webp"]+img { + position: absolute; + z-index: 50; + height: 40%; + width: 40%; + bottom: -2%; + left: 40%; +} + +img[src$="/i/love-foreground.webp"] { + position: absolute; + z-index: 100; +} +img[src$="/i/love-background.webp"] { + position: relative; + z-index: 1; +} + + + @keyframes pat-pfp-anim { 0% { transform: scale(1, 0.8) } 50% { transform: scale(0.8, 1) } diff --git a/files/assets/images/love-background.webp b/files/assets/images/love-background.webp new file mode 100644 index 000000000..3a42590c4 Binary files /dev/null and b/files/assets/images/love-background.webp differ diff --git a/files/assets/images/love-foreground.webp b/files/assets/images/love-foreground.webp new file mode 100644 index 000000000..4083a0ebb Binary files /dev/null and b/files/assets/images/love-foreground.webp differ diff --git a/files/assets/js/markdown.js b/files/assets/js/markdown.js index b34d37811..0f7257115 100644 --- a/files/assets/js/markdown.js +++ b/files/assets/js/markdown.js @@ -73,6 +73,7 @@ const MODIFIERS = { USER: 5, REVERSED_MODIFIER: 6, GENOCIDE: 7, + LOVE: 8, }; const findAllEmoteEndings = (word) => { @@ -110,6 +111,16 @@ const findAllEmoteEndings = (word) => { continue; } + if(currWord.endsWith('heart')) { + if(currEndings.indexOf(MODIFIERS.LOVE) !== -1) { + hasReachedNonModifer = true; + continue; + } + currWord = currWord.slice(0, -5); + currEndings.push(MODIFIERS.LOVE); + continue; + } + hasReachedNonModifer = true; } @@ -186,17 +197,20 @@ function markdown(t) { const mirroredClass = 'mirrored'; const genocideClass = modifiers.has(MODIFIERS.GENOCIDE) ? 'cide' : ''; const emojiClass = modifiers.has(MODIFIERS.LARGE) ? 'emoji-lg' : 'emoji'; + const patClass = modifiers.has(MODIFIERS.PAT) ? 'pat-preview' : ''; // patted emotes cannot be flipped back easily so they don't support double flipping const spanClass = modifiers.has(MODIFIERS.REVERSED) && (modifiers.has(MODIFIERS.PAT) || !modifiers.has(MODIFIERS.REVERSED_MODIFIER)) ? mirroredClass : ''; const imgClass = modifiers.has(MODIFIERS.REVERSED) && modifiers.has(MODIFIERS.REVERSED_MODIFIER) ? mirroredClass : '' - - if (modifiers.has(MODIFIERS.PAT) || modifiers.has(MODIFIERS.TALKING) || modifiers.has(MODIFIERS.GENOCIDE)) { + const lovedClass = modifiers.has(MODIFIERS.LOVE) ? 'love-preview' : ''; + + if ([MODIFIERS.TALKING, MODIFIERS.GENOCIDE, MODIFIERS.PAT, MODIFIERS.LOVE].some((modifer) => modifiers.has(modifer))) { const talkingHtml = modifiers.has(MODIFIERS.TALKING) ? `` : ''; const patHtml = modifiers.has(MODIFIERS.PAT) ? `` : ''; + const loveHtml = modifiers.has(MODIFIERS.LOVE) ? `` : ''; const url = modifiers.has(MODIFIERS.USER) ? `/@${emoji}/pic` : `${SITE_FULL_IMAGES}/e/${emoji}.webp`; - const modifierHtml = isTalkingFirst ? `${talkingHtml}${patHtml}` : `${patHtml}${talkingHtml}`; - input = input.replace(old, `${modifierHtml}`); + const modifierHtml = isTalkingFirst ? `${talkingHtml}${patHtml}${loveHtml}` : `${patHtml}${talkingHtml}${loveHtml}`; + input = input.replace(old, `${modifierHtml}`); } else { input = input.replace(old, ``); } diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 20b742600..a942a37cc 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -243,6 +243,14 @@ def find_all_emote_endings(word): curr_word = curr_word[:-8] continue + if curr_word.endswith('heart'): + if 'heart' in endings: + is_non_ending_found = True + continue + endings.append('heart') + curr_word = curr_word[:-5] + continue + is_non_ending_found = True return endings, curr_word @@ -286,7 +294,7 @@ def render_emoji(html, regexp, golden, emojis_used, b=False, is_title=False): is_talking = 'talking' in ending_modifiers is_patted = 'pat' in ending_modifiers is_talking_first = ending_modifiers.index('pat') > ending_modifiers.index('talking') if is_talking and is_patted else False - + is_loved = 'heart' in ending_modifiers is_genocided = 'genocide' in ending_modifiers is_user = emoji.startswith('@') @@ -295,6 +303,7 @@ def render_emoji(html, regexp, golden, emojis_used, b=False, is_title=False): hand_html = f'' if is_patted and emoji != 'marseyunpettable' else '' talking_html = f'' if is_talking else '' + loved_html = f'' genocide_attr = ' cide' if is_genocided else '' modifier_html = '' @@ -304,8 +313,11 @@ def render_emoji(html, regexp, golden, emojis_used, b=False, is_title=False): modifier_html = hand_html elif (is_talking): modifier_html = talking_html + + if(is_loved): + modifier_html = f'{modifier_html}{loved_html}' - if (is_patted and emoji != 'marseyunpettable') or is_talking or is_genocided: + if (is_patted and emoji != 'marseyunpettable') or is_talking or is_genocided or is_loved: if path.isfile(f"files/assets/images/emojis/{emoji}.webp"): emoji_html = f'{modifier_html}{emoji_partial_pat.format(old, f"{SITE_FULL_IMAGES}/e/{emoji}.webp", attrs)}' elif is_user: diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 0c7b35edc..04a968284 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -107,6 +107,11 @@ Text 2