이모지 풍성함

:discourse2: Summary Adds optional variations or animations to emojis.
:eyeglasses: Preview Preview on theme-creator.discourse.org
:hammer_and_wrench: Repository Link https://github.com/arkshine/discourse-emoji-fluff
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

:information_source: This component requires Discourse to be current as of 2024-11-26T23:00:00Z. [1]

Description

Emoji Fluff allows users to put mirrored or animated emojis in their posts.
It allows users to post fancy emoji work such as:

flexing emoji

You can choose these decorations from the emoji autocompletion pop-up, from the emoji picker, or by appending keywords directly after the emoji shortcode:

Examples: :bike:f-slide , :smile:f-bounce

Horizontal and vertical flips can be combined with other decorations.

Examples:

  • :horse:f-slide,flip:
  • :spider:f-float,flip_v:

Screenshots

Available emoji fluff

Fluff list

How to add fluff to an emoji

From the emoji autocompletion pop-up

fluff autocompletion

From the emoji picker

Fluff emoji picker

By typing manually the fluff suffix

Fluff suffix

Features

  • Horizontally or vertically mirrored emojis

  • Animated emojis (bounce, rotate, pulse, etc)

  • Setting to choose which emoji decorations should be available to users

  • Setting to choose inserting a decorations selector in autocomplete or emoji picker.

  • Allow admins to create new fluffs

Settings

Setting Description
enabled Turn on or off the component’s functionalities.
Default value: true
Disabling will prevent the emoji decoration from being applied.
This is useful if you want to pause or plan to remove the component but don’t want to see the decoration code, such as :slightly_smiling_face:spin:, in posts.
For more information, check out Reverting emoji decorations in the topic.
allow decorations List of allowed decorations.
Default value: flip|flip_v|spin|pulse|bounce|wobble|float|slide|fade|negative|hue|gray
allow selector in Where the fluff selector should be available.
Default value: both
none – disable the selectors.
both – enable the selector in the autocomplete and the emoji picker.
autocomplete – enable the selector only in the autocomplete.
emoji-picker – enable the selector only in the emoji picker.

:globe_showing_europe_africa: Additionally, the theme component strings are translatable from the settings.

Reverting emoji decorations

If you disable the component, these suffixes remain, resulting in emojis like this: :smile:f-spin:

Due to theme component limitations and design choices, we add straightforward suffixes to emojis to give them these decorative effects. The fluff prefix f- helps identify these decorations, making them easy to remove through the script available below.

You can download and run a rake task to remove fluff suffixes definitely from posts.

wget -P lib/tasks/ https://raw.githubusercontent.com/Arkshine/discourse-emoji-fluff/refs/heads/main/tasks/fluff.rake
rake fluff:delete_all

:information_source: The rake task doesn’t create post revisions by default. You can add false as an argument to change this behavior: rake fluff:delete_all[false]

Read Administrative Bulk Operations for instructions on entering the container to run the rake task.

:warning: Always make a backup before running this task. There is no guarantee that it won’t remove unwanted strings. Use it at your own risk, and review the code if in doubt.

Creating your fluffs

Fluff creation requires CSS knowledge.

When a fluff is added to an emoji inside a post, the emoji is wrapped by a <span> tag with a fluff class:

<span class="fluff fluff--bounce">
  <img src="https://your.discourse.com/images/emoji/twitter/kangaroo.png?v=12" title=":kangaroo:" class="emoji" alt=":kangaroo:" loading="lazy" width="20" height="20" style="aspect-ratio: 20 / 20;">
</span>

Add custom CSS to your theme or a new theme component to add new fluffs.
Here are two examples of new fluff:

Tilt 90° an emoji

Emoji tilt

.fluff--tilt img {
  transform: rotate(90deg);
}

Do a 3D spin effect

Emoji 3D spin

.fluff--spin3d img {
  animation: f-spin3d 2s infinite linear;
}

@keyframes f-spin3d {
  0% {
    transform: perspective(50em) rotateY(0deg);
    filter: brightness(1);
  }
  50% {
    transform: perspective(50em) rotateY(90deg);
    filter: brightness(0.85);
  }
  51% {
    transform: perspective(50em) rotateY(91deg);
    filter: brightness(1.15);
  }
  100% {
    transform: perspective(50em) rotateY(180deg);
    filter: brightness(1);
  }
}

Then, you need to add the fluff suffix in the Emoji Fluff allowed decorations:

That’s all; your new fluffs should now be available to users. Enjoy!

Credit

  • @Canapin: Original idea, general help preparing and testing this TC.

  1. To be precise, TC requires at least a Discourse version after October 30, and specifically the support of emoji picker, a current version as of 2024-11-26T23:00:00Z (thanks to the team for adding a plugin outlet a few days ago!) ↩︎

40개의 좋아요

haha this is awesome! très bien! :star_struck:

10개의 좋아요

I have a feeling that it conflicts with this component Omit Emoji component causing the UI for the one that selects the emoji to not show the component’s magic wand


2개의 좋아요

I don’t use that component, but I’m using iPad and drafting has done that couple times now — I’m writing a help for users. Publishing fixes it.

2개의 좋아요

This is amazing! Well done!! :star_struck:

(small nitpick, would “negative” be a better description than “invert”?)

5개의 좋아요

Did you update Discourse? You only receive a notification to update when a new beta is released, but new commits are added every day.

4개의 좋아요

Thanks! :smile:

You’re right; it has been renamed now!

https://github.com/Arkshine/discourse-emoji-fluff/commit/c6090b2ac295639249636b6c43a136010485ed1e

As stated by Moin, you will need to update Discourse.
I looked at the Theme component code and tested it; once you update Discourse, they should work together without issues! :+1:

8개의 좋아요

Hi, I can no longer see the option to add the Emoji Fluff component. Is it still supported?

1개의 좋아요

I’ve pushed a partial fix to make it work with the latest Discourse version. However, this fix only addresses the autocomplete feature. :slight_smile:

Currently, I am unable to resolve the issue with the emoji picker. Recently, the team has unified the emoji picker with the chat in https://github.com/discourse/discourse/pull/28277. Unfortunately, the plugin outlet in the emoji picker footer, which was previously used to insert a toggle, has been removed in the new version. At this moment, I do not have a solution. Sorry for the inconvenience! :pray:

2개의 좋아요

PR a new one? I believe they welcome such things?

2개의 좋아요

Yes, I will!

I’m still thinking of possible alternatives.
If you look at the new emoji picker, a few spaces are available. You probably don’t want to cut the placeholder text, but this is the only space that makes sense:

It might be okay for one icon. But I feel like making a plugin outlet here doesn’t seem reasonable. :smile:

2개의 좋아요

Great fun!

Stretch goal:

3D animation :wink:

2개의 좋아요

To answer this, I did here:
https://github.com/discourse/discourse/pull/30976

One of the good things about the unified emoji picker is that Fluff will work with chat!

The image shows a chat message at 2:20 PM from a user named "arkshine" containing an Easter egg and a grinning face emoji. (Captioned by AI)

Hopefully, the PR will get some attention!

By 3D animation, do you mean pure CSS with 3D transformation?
Like that:
The image displays a screenshot of a text formatting interface with a highlighted shortcut command for horizontal flipping of an image, accompanied by an emoji with a neutral expression. (Captioned by AI)

3개의 좋아요

No, I meant a fully 3D effect of someone shaking their head which of course is not trivial.

Possibly better addressed by using stickers?

3개의 좋아요

More like that then?

chrome_Xmd6KEmSLH


EDIT:

Oh, @merefield, I see what you mean by Plugin for animated stickers!

I guess that would be out of the scope for this TC. It would not be easy to find the 3D version of every emoji.

I really like the falco’s sticker idea!

4개의 좋아요

TC가 최신 Discourse 버전과 완전히 호환되도록 업데이트되었습니다.

이로써 채팅 지원 기능도 추가되었습니다!

메신저 플랫폼 인터페이스의 스크린샷. 하단에 "#Staff에서 채팅" 버튼과 텍스트 박스가 표시된 빈 흰색 영역이 보입니다. (AI가 캡션을 붙임)

7개의 좋아요

새 TC 'Emoji-fluff Extras’를 생성하고 2개의 새로운 플러프 효과를 추가했습니다.

spin3d와 tilt를 허용된 이모지 플러프 목록에 추가했습니다. 새로운 이모지 플러프 샘플이 작동하지 않습니다. 커스텀 TC에서 CSS를 common에 추가했습니다. 모든 테마에 추가되었는지 확인했습니다.

1개의 좋아요

예를 들어 설정에 tilt를 추가했는데 플러프(fluff)가 작동하지 않는다면, 오타가 없는 한 CSS가 사용 가능하지 않을 가능성이 큽니다. CSS를 한 번 더 확인해 주시겠어요?

(포럼을 보고 싶었는데 로그인할 수 없어요. 이메일도 오지 않고, Steam으로 로그인하려고 해도 안 되네요. (어떤 이유인지는 모르겠지만, 여전히 이메일을 확인하라고 합니다))

1개의 좋아요

계정을 활성화했습니다.

이메일 전송 문제를 조사해 보겠습니다. 스팀 로그인을 추가하려면 먼저 계정이 있어야 합니다.

CSS는 코드 블록의 빠른 복사 기능을 사용하여 복사되었습니다.

tilt에 대해 제가 한 일은 두 번 복제해서 "tilt45"와 "tilt90"으로 변경한 것뿐입니다. "spin3d"는 변경 사항이 없습니다.

이모지 장식 설정

공용(Common)에 있는 이모지 장식 추가 CSS 내용

.fluff--tilt45 img {
  transform: rotate(45deg);
}
.fluff--tilt90 img {
  transform: rotate(90deg);
}
.fluff--spin3d img {
  animation: f-spin3d 2s infinite linear;
}

@keyframes f-spin3d {
  0% {
    transform: perspective(50em) rotateY(0deg);
    filter: brightness(1);
  }
  50% {
    transform: perspective(50em) rotateY(90deg);
    filter: brightness(0.85);
  }
  51% {
    transform: perspective(50em) rotateY(91deg);
    filter: brightness(1.15);
  }
  100% {
    transform: perspective(50em) rotateY(180deg);
    filter: brightness(1);
  }
}

참고 이메일 전송 문제를 확인했습니다. 300일 한도를 109일 정도 초과했습니다. 곧 유료 플랜으로 업그레이드해야 할 것 같습니다. 알려주셔서 감사합니다.

1개의 좋아요

문제를 해결하셨나요?

제 환경에서는 정상적으로 작동합니다:

The image shows a screenshot of a text editor with the topic title "XR Hardware" entered and an emoji of a smiling face next to it. (Captioned by AI)

2개의 좋아요