2020-05-28 10:32:57 -05:00
|
|
|
import Component from "@ember/component";
|
|
|
|
|
|
2024-11-29 15:42:50 +00:00
|
|
|
export default class SubscribeCard extends Component {
|
2019-10-11 12:26:01 +11:00
|
|
|
didInsertElement() {
|
2024-11-29 15:42:50 +00:00
|
|
|
super.didInsertElement(...arguments);
|
2019-10-11 12:26:01 +11:00
|
|
|
this.cardElement.mount("#card-element");
|
2022-06-24 21:18:38 +05:30
|
|
|
this.setCardElementStyles();
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|
2022-06-24 21:18:38 +05:30
|
|
|
|
|
|
|
|
setCardElementStyles() {
|
|
|
|
|
const root = document.querySelector(":root");
|
|
|
|
|
const computedStyle = getComputedStyle(root);
|
|
|
|
|
const primaryColor = computedStyle.getPropertyValue("--primary");
|
|
|
|
|
const placeholderColor =
|
|
|
|
|
computedStyle.getPropertyValue("--secondary-medium");
|
|
|
|
|
this.cardElement.update({
|
|
|
|
|
style: {
|
|
|
|
|
base: {
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
"::placeholder": {
|
|
|
|
|
color: placeholderColor,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|
2024-01-16 17:51:44 +01:00
|
|
|
|
|
|
|
|
didDestroyElement() {
|
2024-11-29 15:42:50 +00:00
|
|
|
super.didDestroyElement(...arguments);
|
|
|
|
|
}
|
2025-06-05 12:40:13 +02:00
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div id="card-element"></div>
|
|
|
|
|
</template>
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|