Skip to content

Commit 99ece6e

Browse files
committed
fix stop media position value update interval or setting if getValueFromHass is false, update music player example with expressive slider
1 parent 7753625 commit 99ece6e

File tree

6 files changed

+65
-74
lines changed

6 files changed

+65
-74
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ custom_actions:
16851685
icon: mdi:volume-high
16861686
tap_action:
16871687
action: eval
1688-
eval: >-
1688+
eval: |-
16891689
const card = this.parentNode.parentNode;
16901690
const volume = card.querySelector("#volume")
16911691
if (volume.hasAttribute("enabled")) {
@@ -1837,23 +1837,29 @@ custom_actions:
18371837
step: 1
18381838
styles: |-
18391839
:host {
1840-
height: calc(3 * var(--height));
1841-
--height: 4px;
1840+
height: calc(2.5 * var(--height));
18421841
justify-content: flex-start;
18431842
font-size: 12px;
18441843
font-weight: 300;
1844+
1845+
--height: 10px;
18451846
--tooltip-display: none;
18461847
}
18471848
.container {
1848-
--thumb-width: 1px;
1849-
--thumb-border-radius: 0;
1849+
overflow: visible;
1850+
overflow-x: clip;
1851+
1852+
--thumb-width: 4px;
1853+
--thumb-border-radius: 4px;
18501854
}
18511855
18521856
.background {
18531857
background: white;
18541858
opacity: 0.2;
1859+
height: 4px;
1860+
top: 33%;
18551861
}
1856-
input {
1862+
.slider {
18571863
margin: 0;
18581864
}
18591865
@media (hover: hover) {
@@ -1865,6 +1871,19 @@ custom_actions:
18651871
--color: var(--active-color);
18661872
}
18671873
1874+
.thumb {
1875+
height: 24px;
1876+
top: -66%;
1877+
}
1878+
.thumb .active {
1879+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='610 1101 1220 75'%3E%3Cpath fill='%23D0BCFF' d='M1870.425 1173.746c-29.448 0-58.665-7.477-84.493-21.622-.03-.016-.061-.032-.09-.049-43.555-23.82-95.546-23.809-139.091.039a4.079 4.079 0 0 1-.113.062c-25.803 14.109-54.984 21.567-84.394 21.568-29.449 0-58.667-7.478-84.495-21.623-43.554-23.852-95.539-23.865-139.089-.052-.03.018-.062.034-.092.051-25.83 14.146-55.048 21.623-84.497 21.623-29.423 0-58.613-7.463-84.425-21.584l-.077-.042c-43.572-23.863-95.596-23.862-139.164-.001l-.085.046c-25.809 14.117-55.001 21.581-84.418 21.581h-.001c-29.45-.001-58.669-7.479-84.498-21.625-43.534-23.845-95.513-23.863-139.063-.058l-.108.06c-25.829 14.146-55.047 21.623-84.496 21.623-29.398 0-58.566-7.451-84.362-21.551-.048-.024-.095-.05-.142-.075-43.568-23.863-95.593-23.863-139.163 0l-.081.043c-25.811 14.12-55.001 21.583-84.421 21.583-29.45 0-58.668-7.478-84.497-21.624-7.521-4.118-10.278-13.554-6.159-21.074s13.554-10.277 21.074-6.158c43.57 23.862 95.593 23.864 139.163 0l.098-.053c25.807-14.114 54.991-21.573 84.406-21.573 29.398 0 58.567 7.451 84.364 21.55l.14.076c43.534 23.843 95.508 23.864 139.056.059l.113-.063c25.828-14.145 55.049-21.622 84.496-21.622h.002c29.449 0 58.668 7.478 84.497 21.625 43.57 23.863 95.595 23.862 139.165.001.021-.013.043-.024.065-.036 25.813-14.124 55.011-21.591 84.438-21.591 29.42 0 58.61 7.463 84.421 21.582l.082.045c43.539 23.847 95.521 23.862 139.074.049l.096-.053c25.829-14.146 55.047-21.623 84.496-21.623s58.667 7.477 84.496 21.623c43.58 23.867 95.604 23.866 139.172.005l.118-.064c25.803-14.108 54.98-21.564 84.389-21.564 29.448-.001 58.666 7.476 84.494 21.62l.114.063c43.549 23.807 95.528 23.791 139.063-.051 7.52-4.121 16.955-1.361 21.073 6.159 4.119 7.521 1.361 16.955-6.159 21.073-25.828 14.146-55.045 21.622-84.492 21.622z'%3E%3CanimateTransform attributeName='transform' calcMode='linear' dur='1s' from='0 0' repeatCount='indefinite' to='312.5 0' type='translate'/%3E%3C/path%3E%3C/svg%3E");
1880+
mask-position: 0 50%;
1881+
mask-repeat: repeat-x;
1882+
mask-size: auto 100%;
1883+
height: var(--height);
1884+
top: 7px
1885+
}
1886+
18681887
:host::before {
18691888
content: '{% set minutes = (value / 60) | int %}{% set seconds = (value - 60 * minutes)
18701889
| int %}{{ minutes }}:{{ 0 if seconds < 10 else "" }}{{ seconds | int }}';
@@ -1879,7 +1898,7 @@ custom_actions:
18791898
right: 0;
18801899
bottom: 0;
18811900
}
1882-
value_from_hass_delay: 5000
1901+
value_from_hass_delay: 2000
18831902
grid_options:
18841903
columns: 12
18851904
rows: auto

assets/music_controls.png

-185 KB
Loading

dist/universal-remote-card.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)