mirror of
https://github.com/GeorgeSG/lovelace-time-picker-card.git
synced 2026-09-06 02:18:44 +00:00
Use hass-chevron icons. Update README and screenshots
This commit is contained in:
@@ -66,9 +66,9 @@ hide:
|
||||
|
||||
| Name | Default | Description |
|
||||
| ------------------------------- | --------------------------- | ------------------------------------------- |
|
||||
| --tpc-elements-background-color | `var(--dark-primary-color)` | Background colro for header and ui elements |
|
||||
| --tpc-elements-background-color | `var(--dark-primary-color)` | Background color for header and ui elements |
|
||||
| --tpc-icon-color | `var(--primary-text-color)` | Arrow color |
|
||||
| --tpc-text-color | `var(--primary-text-color)` | Text color |
|
||||
| --tpc-text-color | `white` | Text color |
|
||||
| --tpc-accent-color | `var(--accent-color)` | AM / PM active color |
|
||||
|
||||
## Meta
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 17 KiB |
@@ -16,8 +16,16 @@ export class TimePeriodComponent extends LitElement {
|
||||
|
||||
@property() private period!: Period;
|
||||
|
||||
private get amClass(): ClassInfo {
|
||||
return { 'time-period': true, active: this.period === Period.AM };
|
||||
}
|
||||
|
||||
private get pmClass(): ClassInfo {
|
||||
return { 'time-period': true, active: this.period === Period.PM };
|
||||
}
|
||||
|
||||
render(): TemplateResult {
|
||||
return html` <div class="time-period-selector">
|
||||
return html`<div class="time-period-selector">
|
||||
<div class=${classMap(this.amClass)} @click=${this.onTimePeriodChange}>
|
||||
AM<mwc-ripple></mwc-ripple>
|
||||
</div>
|
||||
@@ -32,14 +40,6 @@ export class TimePeriodComponent extends LitElement {
|
||||
this.dispatchEvent(event);
|
||||
}
|
||||
|
||||
private get amClass(): ClassInfo {
|
||||
return { 'time-period': true, active: this.period === Period.AM };
|
||||
}
|
||||
|
||||
private get pmClass(): ClassInfo {
|
||||
return { 'time-period': true, active: this.period === Period.PM };
|
||||
}
|
||||
|
||||
static get styles(): CSSResult {
|
||||
return css`
|
||||
.time-period-selector {
|
||||
|
||||
@@ -52,7 +52,7 @@ export class TimeUnitComponent extends LitElement {
|
||||
private renderStepChanger(direction: Direction): TemplateResult {
|
||||
return html`
|
||||
<div class="time-picker-icon" @click=${() => this.onStepChangerClick(direction)}>
|
||||
<ha-icon .icon="mdi:arrow-${direction}"></ha-icon>
|
||||
<ha-icon .icon="hass:chevron-${direction}"></ha-icon>
|
||||
<mwc-ripple id="ripple"></mwc-ripple>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -134,13 +134,13 @@ export class TimePickerCard extends LitElement {
|
||||
);
|
||||
|
||||
--tpc-icon-color: var(--time-picker-icon-color, var(--primary-text-color));
|
||||
--tpc-text-color: var(--time-picker-text-color, var(--primary-text-color));
|
||||
--tpc-text-color: var(--time-picker-text-color, #fff);
|
||||
--tpc-accent-color: var(--time-picker-accent-color, var(--accent-color));
|
||||
}
|
||||
|
||||
.time-picker-header {
|
||||
padding: 16px;
|
||||
color: var(--tpc-text-color, #fff);
|
||||
color: var(--tpc-text-color);
|
||||
background-color: var(--tpc-elements-background-color);
|
||||
font-size: 1em;
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user