diff --git a/assets/javascripts/discourse/components/reports/reading-time.gjs b/assets/javascripts/discourse/components/reports/reading-time.gjs index 6e0ad3d..c8ec0fd 100644 --- a/assets/javascripts/discourse/components/reports/reading-time.gjs +++ b/assets/javascripts/discourse/components/reports/reading-time.gjs @@ -20,7 +20,7 @@ export default class ReadingTime extends Component {
diff --git a/assets/javascripts/discourse/components/reports/word-card.gjs b/assets/javascripts/discourse/components/reports/word-card.gjs index 5eae43a..f2f32b1 100644 --- a/assets/javascripts/discourse/components/reports/word-card.gjs +++ b/assets/javascripts/discourse/components/reports/word-card.gjs @@ -1,29 +1,54 @@ import Component from "@glimmer/component"; import { fn } from "@ember/helper"; +import { concat } from "@ember/helper"; import { on } from "@ember/modifier"; import { action } from "@ember/object"; import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import emoji from "discourse/helpers/emoji"; export default class WordCard extends Component { + // const mysteryEmojis = [ + // "mag", // 🔍 + // "question", // ❓ + // "8ball", // 🎱 + // "crystal_ball", // 🔮 + // "crescent_moon", // 🌙 + // ]; + + // const backgroundColors = [ + // "#FBF5AF", + // "#28ABE2", + // "#F0794A", + // "#E84A51", + // "#FBF5AF", + // ]; + get randomStyle() { return `--rand: ${Math.random()}`; } - get mysteryEmoji() { + get mysteryData() { const mysteryEmojis = [ "mag", // 🔍 - "man_detective", // 🕵️ "question", // ❓ "8ball", // 🎱 "crystal_ball", // 🔮 - "key", // 🗝️ "crescent_moon", // 🌙 - "milky_way", // 🌌 + ]; + + const backgroundColors = [ + "#FBF5AF", + "#28ABE2", + "#F0794A", + "#E84A51", + "#FBF5AF", ]; const randomIndex = Math.floor(Math.random() * mysteryEmojis.length); - return mysteryEmojis[randomIndex]; + return { + emoji: mysteryEmojis[randomIndex], + color: `--mystery-color: ${backgroundColors[randomIndex]}`, + }; } @action @@ -40,12 +65,20 @@ export default class WordCard extends Component {
- {{emoji this.mysteryEmoji}} + {{emoji + this.mysteryData.emoji + }} + {{emoji + this.mysteryData.emoji + }} + {{emoji + this.mysteryData.emoji + }}
{{@word}} diff --git a/assets/javascripts/discourse/components/reports/word-cards.gjs b/assets/javascripts/discourse/components/reports/word-cards.gjs index 31f1127..fa72bd8 100644 --- a/assets/javascripts/discourse/components/reports/word-cards.gjs +++ b/assets/javascripts/discourse/components/reports/word-cards.gjs @@ -5,9 +5,10 @@ import WordCard from "discourse/plugins/discourse-rewind/discourse/components/re export default class WordCards extends Component {