This commit is contained in:
Jordan Vidrine 2025-01-13 13:19:31 -06:00
commit 135af147fa
2 changed files with 13 additions and 4 deletions

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import { concat, fn } from "@ember/helper";
import { on } from "@ember/modifier"; import { on } from "@ember/modifier";
import { action } from "@ember/object"; import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { htmlSafe } from "@ember/template";
import emoji from "discourse/helpers/emoji"; import emoji from "discourse/helpers/emoji";
import discourseLater from "discourse-common/lib/later"; import discourseLater from "discourse-common/lib/later";
@ -45,6 +45,10 @@ export default class WordCard extends Component {
}; };
} }
get cardStyle() {
return htmlSafe(`${this.randomStyle}; ${this.mysteryData.color};`);
}
@action @action
registerCardContainer(element) { registerCardContainer(element) {
this.cardContainer = element; this.cardContainer = element;
@ -66,11 +70,12 @@ export default class WordCard extends Component {
<template> <template>
<div <div
{{on "click" (fn this.handleClick)}} {{on "click" this.handleClick}}
{{on "mouseleave" (fn this.handleLeave)}} {{on "mouseleave" this.handleLeave}}
class="rewind-card__wrapper" class="rewind-card__wrapper"
style={{concat this.randomStyle "; " this.mysteryData.color ";"}} style={{this.cardStyle}}
{{didInsert this.registerCardContainer}} {{didInsert this.registerCardContainer}}
role="button"
> >
<div class="rewind-card__inner"> <div class="rewind-card__inner">
<div class="rewind-card -front"> <div class="rewind-card -front">

View File

@ -4,6 +4,10 @@
gap: 0.5em; gap: 0.5em;
flex-wrap: wrap; flex-wrap: wrap;
} }
.rewind-card {
@include rewind-border;
}
} }
.favorite-categories__category { .favorite-categories__category {