Xsoldier2000

HA Wall Calendar

Nov 6th, 2026
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 51.13 KB | None | 0 0
  1. # PUBLIC SHARING COPY - replace example_wall_user and calendar.*_example IDs
  2. # with your actual Home Assistant username and calendar entity IDs before use.
  3. kiosk_mode:
  4. user_settings:
  5. - users:
  6. - example_wall_user
  7. hide_header: true
  8. hide_sidebar: true
  9. button_card_templates:
  10. fx:
  11. show_icon: false
  12. show_name: false
  13. show_state: false
  14. tap_action:
  15. action: none
  16. hold_action:
  17. action: none
  18. variables:
  19. cal: |
  20. [[[ return {
  21. 'calendar.family_example': {c: '#1e6f7a', i: 'mdi:account-group'},
  22. 'calendar.child_example': {c: '#7a3a30', i: 'mdi:account'},
  23. 'calendar.sports_team_example': {c: '#3b5a80', i: 'mdi:football'},
  24. 'calendar.sports_club_example': {c: '#b03a3a', i: 'mdi:soccer'},
  25. 'calendar.birthdays': {c: '#7d3d68', i: 'mdi:cake-variant'},
  26. 'calendar.holidays': {c: '#5a5a72', i: 'mdi:flag'},
  27. 'calendar.holidays_in_united_states': {c: '#5a5a72', i: 'mdi:flag'},
  28. }; ]]]
  29. wx: |
  30. [[[ return {
  31. 'sunny': 'weather-sunny', 'clear-night': 'weather-night',
  32. 'partlycloudy': 'weather-partly-cloudy', 'cloudy': 'weather-cloudy',
  33. 'fog': 'weather-fog', 'rainy': 'weather-rainy', 'pouring': 'weather-pouring',
  34. 'snowy': 'weather-snowy', 'snowy-rainy': 'weather-snowy-rainy', 'hail': 'weather-hail',
  35. 'lightning': 'weather-lightning', 'lightning-rainy': 'weather-lightning-rainy',
  36. 'windy': 'weather-windy', 'windy-variant': 'weather-windy-variant',
  37. }; ]]]
  38. styles:
  39. card:
  40. - border: none
  41. - border-radius: 0
  42. - box-shadow: none
  43. - height: 100%
  44. - box-sizing: border-box
  45. - overflow: hidden
  46. - font-family: >-
  47. 'Inter', -apple-system, 'SF Pro Text', 'Segoe UI', Roboto,
  48. sans-serif
  49. grid:
  50. - align-content: stretch
  51. - height: 100%
  52. themed:
  53. template: fx
  54. variables:
  55. night: |
  56. [[[ const m = states['input_select.wall_display_mode']?.state;
  57. return m === 'Night' || (m !== 'Day' && states['sun.sun']?.state === 'below_horizon'); ]]]
  58. styles:
  59. card:
  60. - background: var(--c-bg)
  61. - color: var(--c-text)
  62. - --c-bg: '[[[ return variables.night ? ''#000000'' : ''#ffffff'' ]]]'
  63. - --c-text: '[[[ return variables.night ? ''#f2f2f7'' : ''#1d1d1f'' ]]]'
  64. - --c-sub: '[[[ return variables.night ? ''#98989d'' : ''#6e6e73'' ]]]'
  65. - --c-line: '[[[ return variables.night ? ''#48484a'' : ''#d1d1d6'' ]]]'
  66. - --c-grp: '[[[ return variables.night ? ''#2c2c2e'' : ''#ffffff'' ]]]'
  67. - --c-icon: '[[[ return variables.night ? ''#e5e5ea'' : ''#000000'' ]]]'
  68. views:
  69. - title: Wall
  70. path: wall
  71. type: panel
  72. background: '#000000'
  73. cards:
  74. - type: custom:layout-card
  75. layout_type: custom:grid-layout
  76. layout:
  77. grid-template-columns: calc(20% - 40px) 1fr
  78. grid-template-rows: 48px minmax(0, 1fr) 40px
  79. grid-template-areas: |
  80. "side top"
  81. "side cal"
  82. "side leg"
  83. grid-gap: 0
  84. height: 100vh
  85. margin: 0
  86. padding: 0
  87. card_mod:
  88. style: >
  89. :host { --masonry-view-card-margin: 0px; display: block; height:
  90. 100vh; overflow: hidden; container-type: inline-size; }
  91. cards:
  92. - type: custom:button-card
  93. template: fx
  94. view_layout:
  95. grid-area: side
  96. place-self: stretch
  97. entity: sensor.wall_calendar_events
  98. triggers_update:
  99. - sensor.time
  100. - sensor.wall_weather_daily
  101. - sensor.wall_chores
  102. custom_fields:
  103. side: |
  104. [[[
  105. const {cal, wx} = variables;
  106. const evs = states['sensor.wall_calendar_events']?.attributes?.events || [];
  107. const fc = states['sensor.wall_weather_daily']?.attributes?.forecast || [];
  108. const chores = states['sensor.wall_chores']?.attributes?.items || [];
  109. const esc = s => String(s ?? '').replace(/[&<>"]/g, c => ({'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;'}[c]));
  110. const col = c => cal[c]?.c || '#888';
  111. const ico = c => cal[c]?.i || 'mdi:calendar';
  112.  
  113. const now = new Date();
  114. const mid = d => new Date(d.getFullYear(), d.getMonth(), d.getDate());
  115. const addD = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
  116. const key = d => `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
  117. const parse = s => s.includes('T') ? new Date(s)
  118. : new Date(+s.slice(0, 4), +s.slice(5, 7) - 1, +s.slice(8, 10));
  119. const today = mid(now);
  120.  
  121. // events grouped by day (all-day events on every day they cover);
  122. // the same event on two calendars (e.g. both holiday calendars) is shown once
  123. const byDay = {};
  124. const seen = new Set();
  125. const add = (d, e) => (byDay[key(d)] = byDay[key(d)] || []).push(e);
  126. for (const e of evs) {
  127. const id = `${e.summary}|${e.start}|${e.end}`;
  128. if (seen.has(id)) continue;
  129. seen.add(id);
  130. const allDay = !e.start.includes('T');
  131. const ev = {...e, s: parse(e.start), en: parse(e.end), allDay};
  132. if (!allDay) { add(mid(ev.s), ev); continue; }
  133. const last = addD(mid(ev.en), -1);
  134. for (let d = mid(ev.s), n = 0; d <= last && n < 62; d = addD(d, 1), n++) add(d, ev);
  135. }
  136.  
  137. // title
  138. const y = now.getFullYear(), m = now.getMonth();
  139. const title = `<div class="title"><span class="m">${now.toLocaleDateString('en-US', {month: 'long'})}</span>`
  140. + `<span class="y">${y}</span><span class="nav">‹&nbsp;&nbsp;›</span></div>`;
  141.  
  142. // mini month: 6 weeks with up to 3 event dots per day
  143. const first = new Date(y, m, 1);
  144. const start = addD(first, -first.getDay());
  145. const DOW = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
  146. let mini = `<div class="mrow mh">`
  147. + DOW.map((d, i) => `<div class="${i === now.getDay() ? 'cur' : ''}">${d}</div>`).join('') + `</div>`;
  148. for (let w = 0; w < 6; w++) {
  149. const ws = addD(start, w * 7);
  150. const thisWeek = today >= ws && today < addD(ws, 7);
  151. mini += `<div class="mrow${thisWeek ? ' wk' : ''}">`;
  152. for (let i = 0; i < 7; i++) {
  153. const d = addD(ws, i);
  154. const dots = [...new Set((byDay[key(d)] || []).map(e => e.cal))].slice(0, 3)
  155. .map(c => `<b style="background:${col(c)}"></b>`).join('');
  156. mini += `<div class="mn${d.getMonth() !== m ? ' out' : ''}${+d === +today ? ' today' : ''}">`
  157. + `<span>${d.getDate()}</span><i>${dots}</i></div>`;
  158. }
  159. mini += `</div>`;
  160. }
  161.  
  162. // agenda: today, tomorrow + the next 2 days. Items that don't fit above the
  163. // Chores list are hidden whole — a longer Chores list shrinks the agenda.
  164. const AGENDA_DAYS = 4;
  165. const hm = d => `${d.getHours() % 12 || 12}:${String(d.getMinutes()).padStart(2, '0')}`;
  166. const ap = d => d.getHours() < 12 ? 'AM' : 'PM';
  167. const range = (s, e) => ap(s) === ap(e) ? `${hm(s)} - ${hm(e)} ${ap(e)}` : `${hm(s)} ${ap(s)} - ${hm(e)} ${ap(e)}`;
  168. const md = d => `${d.getMonth() + 1}/${d.getDate()}/${String(d.getFullYear()).slice(2)}`;
  169. const items = [];
  170. for (let i = 0; i < AGENDA_DAYS; i++) {
  171. const d = addD(today, i);
  172. const list = (byDay[key(d)] || []).filter(e => i > 0 || e.allDay || e.en > now)
  173. .sort((a, b) => (b.allDay - a.allDay) || (a.s - b.s));
  174. const label = i === 0 ? 'Today' : i === 1 ? 'Tomorrow' : d.toLocaleDateString('en-US', {weekday: 'long'});
  175. const f = fc.find(f => key(mid(new Date(f.datetime))) === key(d));
  176. const fw = f ? `<span class="wx">${Math.round(f.temperature)}°/${Math.round(f.templow)}°`
  177. + `<ha-icon icon="mdi:${wx[f.condition] || 'weather-cloudy'}"></ha-icon></span>` : '';
  178. const head = `<div class="dh${i === 0 ? ' now' : ''}"><span><b>${label}</b> ${md(d)}</span>${fw}</div>`;
  179. const lines = list.map(e => {
  180. const loc = e.location ? `<div class="tl">${esc(e.location)}</div>` : '';
  181. return e.allDay
  182. ? `<div class="ad"><span style="background:${col(e.cal)}">${esc(e.summary)}</span>${loc}</div>`
  183. : `<div class="te"><b style="background:${col(e.cal)}"><ha-icon icon="${ico(e.cal)}"></ha-icon></b>`
  184. + `<div class="tx"><div class="tt">${range(e.s, e.en)}</div><div class="tn">${esc(e.summary)}</div>${loc}</div></div>`;
  185. });
  186. if (!lines.length) lines.push(`<div class="none">${i === 0 ? 'No more events today' : 'Nothing scheduled'}</div>`);
  187. items.push(`<div>${head}${lines[0]}</div>`, ...lines.slice(1)); // day header stays glued to its first item
  188. }
  189.  
  190. // chores
  191. const MAX_TODO = 10;
  192. const todo = !chores.length ? `<div class="none">All done ✓</div>`
  193. : chores.slice(0, MAX_TODO).map(t => `<div class="td"><b></b><span>${esc(t)}</span></div>`).join('')
  194. + (chores.length > MAX_TODO ? `<div class="none">+${chores.length - MAX_TODO} more</div>` : '');
  195.  
  196. return `${title}<div class="mc">${mini}</div><div class="ag">${items.join('')}</div>`
  197. + `<div class="chh">Chores</div><div class="chl">${todo}</div>`;
  198. ]]]
  199. styles:
  200. card:
  201. - width: calc(20cqw - 40px)
  202. - background: '#000000'
  203. - color: '#fff'
  204. - padding: 12px 16px 10px
  205. grid:
  206. - grid-template-areas: '"side"'
  207. extra_styles: >
  208. #side { width: 100%; height: 100%; display: flex; flex-direction:
  209. column; text-align: left; white-space: normal; }
  210.  
  211.  
  212. /* month title */
  213.  
  214. .title { display: flex; align-items: baseline; gap: 8px;
  215. font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em;
  216. padding: 4px 2px 10px; }
  217.  
  218. .title .y { color: #ff453a; font-weight: 600; }
  219.  
  220. .title .nav { margin-left: auto; color: #8e8e93; font-size:
  221. 1.5rem; font-weight: 400; }
  222.  
  223.  
  224. /* mini month */
  225.  
  226. .mc { margin-bottom: 10px; }
  227.  
  228. .mrow { display: grid; grid-template-columns: repeat(7, 1fr);
  229. align-items: start; text-align: center; border-radius: 8px;
  230. padding: 2px 0; }
  231.  
  232. .mrow.wk { background: #3a3a3c; }
  233.  
  234. .mh { font-size: 0.7rem; font-weight: 600; color: #8e8e93;
  235. padding-bottom: 4px; }
  236.  
  237. .mh .cur { color: #0a84ff; }
  238.  
  239. .mn { display: flex; flex-direction: column; align-items: center;
  240. height: 31px; }
  241.  
  242. .mn span { width: 24px; height: 24px; line-height: 24px;
  243. border-radius: 50%; font-size: 0.9rem; font-weight: 600; }
  244.  
  245. .mn.out span { color: #636366; font-weight: 400; }
  246.  
  247. .mn.today span { background: #0a84ff; color: #fff; }
  248.  
  249. .mn i { display: flex; gap: 2px; height: 5px; margin-top: 1px; }
  250.  
  251. .mn i b { width: 4px; height: 4px; border-radius: 50%; }
  252.  
  253.  
  254. /* agenda + chores: column-wrap with a huge gap pushes overflow
  255. out of view, so items hide whole */
  256.  
  257. .ag { flex: 1; min-height: 0; display: flex; flex-direction:
  258. column; flex-wrap: wrap; align-content: flex-start;
  259. column-gap: 400px; overflow: hidden; border-top: 1px solid #3a3a3c; }
  260. .ag > *, .chl > * { width: 100%; flex: none; }
  261.  
  262. .dh { display: flex; justify-content: space-between; align-items:
  263. center; font-size: 0.92rem; color: #aeaeb2; margin: 12px 0 7px; }
  264.  
  265. .dh b { text-transform: uppercase; font-weight: 700; color:
  266. #e5e5ea; margin-right: 4px; }
  267.  
  268. .dh.now, .dh.now b { color: #0a84ff; }
  269.  
  270. .dh .wx { display: flex; align-items: center; gap: 6px; color:
  271. #e5e5ea; font-weight: 600; }
  272.  
  273. .dh ha-icon { --mdc-icon-size: 22px; color: #e5e5ea; }
  274.  
  275.  
  276. /* timed events */
  277.  
  278. .te { display: flex; gap: 10px; align-items: flex-start; margin: 0
  279. 0 9px 2px; }
  280.  
  281. .te > b { flex: none; width: 20px; height: 20px; border-radius:
  282. 50%; margin-top: 1px; display: flex; align-items: center;
  283. justify-content: center; }
  284.  
  285. .te > b ha-icon { --mdc-icon-size: 13px; width: 13px; height:
  286. 13px; display: flex; color: #fff; }
  287.  
  288. .tx { min-width: 0; }
  289.  
  290. .tt { font-size: 0.82rem; font-weight: 600; color: #aeaeb2; }
  291.  
  292. .tn { font-size: 1rem; font-weight: 600; line-height: 1.2; }
  293.  
  294. .tl { font-size: 0.8rem; font-weight: 400; color: #8e8e93;
  295. line-height: 1.25; margin-top: 1px;
  296. white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  297.  
  298. /* all-day events */
  299.  
  300. .ad { margin: 0 0 8px; }
  301.  
  302. .ad .tl { margin-top: 3px; }
  303.  
  304. .ad span { display: inline-block; max-width: 100%; padding: 2px
  305. 8px; border-radius: 4px; font-size: 0.95rem; font-weight: 600;
  306. white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
  307. .none { color: #636366; font-size: 0.9rem; margin-bottom: 6px; }
  308.  
  309.  
  310. /* chores */
  311.  
  312. .chh { border-top: 1px solid #3a3a3c; padding-top: 9px;
  313. margin-top: auto; font-size: 0.9rem; font-weight: 700;
  314. text-transform: uppercase; color: #e5e5ea; }
  315.  
  316. .chl { max-height: 48vh; display: flex; flex-direction: column;
  317. flex-wrap: wrap; align-content: flex-start; column-gap: 400px;
  318. overflow: hidden; padding-top: 7px; }
  319.  
  320. .td { display: flex; gap: 10px; align-items: flex-start;
  321. margin-bottom: 6px; font-size: 0.95rem; font-weight: 600; }
  322.  
  323. .td > b { flex: none; width: 10px; height: 10px; border: 1.5px
  324. solid #0a84ff; border-radius: 50%; margin-top: 4px; } /* CHORE
  325. CIRCLE colour */
  326. - type: custom:button-card
  327. template: themed
  328. view_layout:
  329. grid-area: top
  330. place-self: stretch
  331. entity: sensor.time
  332. triggers_update:
  333. - sensor.wall_calendar_events
  334. - sun.sun
  335. - input_select.wall_display_mode
  336. custom_fields:
  337. bar: |
  338. [[[
  339. // HIDE IDLE POINTER: after IDLE_MS without movement the mouse pointer is hidden;
  340. // any movement, tap or key press brings it straight back.
  341. // Self-healing: re-checked on every clock tick, so if the page re-renders and drops
  342. // the hiding layer (or the listeners), it is put back within a minute.
  343. const IDLE_MS = 2000;
  344. const W = window.__wallIdle = window.__wallIdle || {};
  345. if (!W.style || !document.head.contains(W.style)) {
  346. W.style = document.createElement('style');
  347. W.style.textContent = 'html.wall-idle, html.wall-idle * { cursor: none !important; }';
  348. document.head.appendChild(W.style);
  349. }
  350. if (!W.veil || !document.body.contains(W.veil)) {
  351. W.veil = document.createElement('div');
  352. W.veil.style.cssText = 'position:fixed;inset:0;z-index:2147483647;cursor:none;background:transparent;display:none';
  353. document.body.appendChild(W.veil);
  354. }
  355. if (!W.wake) {
  356. W.wake = () => {
  357. W.veil.style.display = 'none';
  358. document.documentElement.classList.remove('wall-idle');
  359. clearTimeout(W.t);
  360. W.t = setTimeout(() => {
  361. W.veil.style.display = 'block';
  362. document.documentElement.classList.add('wall-idle');
  363. }, IDLE_MS);
  364. };
  365. ['mousemove', 'pointermove', 'pointerdown', 'touchstart', 'keydown', 'wheel'].forEach(ev =>
  366. window.addEventListener(ev, W.wake, {passive: true, capture: true}));
  367. W.wake();
  368. }
  369.  
  370. const {cal} = variables;
  371. const evs = states['sensor.wall_calendar_events']?.attributes?.events || [];
  372. const esc = s => String(s ?? '').replace(/[&<>"]/g, c => ({'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;'}[c]));
  373. const OUTLINE = {'mdi:cake-variant': 'mdi:cake-variant-outline', 'mdi:flag': 'mdi:flag-outline'};
  374. const badge = c => { const i = cal[c]?.i || 'mdi:calendar'; return `<span class="badge" style="color:${variables.night ? 'var(--c-icon)' : (cal[c]?.c || 'var(--c-icon)')}"><ha-icon icon="${OUTLINE[i] || i}"></ha-icon></span>`; };
  375. const now = new Date();
  376. const parse = s => s.includes('T') ? new Date(s) : new Date(+s.slice(0, 4), +s.slice(5, 7) - 1, +s.slice(8, 10));
  377. const mid = d => new Date(d.getFullYear(), d.getMonth(), d.getDate());
  378. const dd = d => Math.round((mid(d) - mid(now)) / 864e5);
  379.  
  380. // COUNTDOWNS: next birthday, then next holiday (within 120 days)
  381. const nextOf = cals => evs
  382. .filter(x => cals.includes(x.cal))
  383. .map(x => ({...x, d: dd(parse(x.start))}))
  384. .filter(x => x.d >= 0 && x.d <= 120)
  385. .sort((a, b) => a.d - b.d)[0];
  386. const chip = (label, x) => {
  387. if (!x) return '';
  388. const name = esc(x.summary.replace(/'s birthday$/i, ''));
  389. const when = x.d === 0 ? 'today' : x.d === 1 ? 'tomorrow' : `${x.d} days`;
  390. return `<div class="item"><span class="lbl">${label}</span><span class="chip">${badge(x.cal)}<span class="cn">${name}</span><em>${when}</em></span></div>`;
  391. };
  392. const cds = chip('Next Birthday:', nextOf(['calendar.birthdays']))
  393. + chip('Next Holiday:', nextOf(['calendar.holidays', 'calendar.holidays_in_united_states']));
  394.  
  395. // CLOCK
  396. const time = `${now.getHours() % 12 || 12}:${String(now.getMinutes()).padStart(2, '0')} <span class="ap">${now.getHours() < 12 ? 'AM' : 'PM'}</span>`;
  397.  
  398. // empty 3rd column keeps the countdowns centred
  399. return `<div class="row"><div class="clk">${time}</div><div class="items">${cds}</div><div></div></div>`;
  400. ]]]
  401. mode:
  402. card:
  403. type: custom:button-card
  404. entity: input_select.wall_display_mode
  405. show_icon: false
  406. show_name: false
  407. show_state: false
  408. tap_action:
  409. action: perform-action
  410. perform_action: input_select.select_next
  411. target:
  412. entity_id: input_select.wall_display_mode
  413. hold_action:
  414. action: more-info
  415. custom_fields:
  416. seg: |
  417. [[[
  418. const m = entity?.state || 'Auto';
  419. const opts = [['Auto', 'mdi:theme-light-dark'], ['Day', 'mdi:white-balance-sunny'], ['Night', 'mdi:weather-night']];
  420. return `<div class="sw">${opts.map(([n, i]) =>
  421. `<span class="${n === m ? 'on' : ''}" title="${n}"><ha-icon icon="${i}"></ha-icon></span>`).join('')}</div>`;
  422. ]]]
  423. styles:
  424. card:
  425. - background: none
  426. - border: none
  427. - box-shadow: none
  428. - padding: 0
  429. - border-radius: 6px
  430. - overflow: visible
  431. grid:
  432. - grid-template-areas: '"seg"'
  433. extra_styles: >
  434. .sw { display: inline-flex; border: 1px solid var(--c-line);
  435. border-radius: 6px; overflow: hidden; background:
  436. var(--c-grp); }
  437.  
  438. .sw span { display: flex; align-items: center;
  439. justify-content: center; width: 30px; height: 26px;
  440. border-right: 1px solid var(--c-line); color: var(--c-sub); }
  441. .sw span:last-child { border-right: none; }
  442.  
  443. .sw span.on { background: #0a84ff; color: #fff; }
  444.  
  445. .sw ha-icon { --mdc-icon-size: 16px; }
  446. styles:
  447. card:
  448. - width: calc(80cqw + 40px)
  449. - padding: 0 16px
  450. grid:
  451. - grid-template-areas: '"bar mode"'
  452. - grid-template-columns: 1fr auto
  453. - column-gap: 14px
  454. extra_styles: >
  455. #bar { width: 100%; height: 100%; }
  456.  
  457. #mode { align-self: center; }
  458.  
  459.  
  460. /* [ clock ] [ Next Birthday · Next Holiday (centred) ] [ — ] [
  461. mode switch ] */
  462.  
  463. .row { display: grid; grid-template-columns: 1fr auto 1fr;
  464. align-items: center; gap: 24px; height: 100%; }
  465.  
  466.  
  467. /* clock: same style as the sidebar's month title */
  468.  
  469. .clk { justify-self: start; font-size: 1.9rem; font-weight: 700;
  470. letter-spacing: -0.01em; line-height: 1;
  471. font-variant-numeric: tabular-nums; color: var(--c-text); white-space: nowrap; }
  472. .clk .ap { color: #ff453a; font-weight: 600; }
  473.  
  474.  
  475. .items { display: flex; align-items: center; justify-content:
  476. center; gap: 72px; } /* space between Next Birthday and Next
  477. Holiday */
  478.  
  479. .item { display: flex; align-items: center; gap: 6px; flex: none;
  480. white-space: nowrap; }
  481.  
  482. .lbl { font-size: 1.15rem; font-weight: 600; color: var(--c-sub);
  483. }
  484.  
  485.  
  486. .chip { display: flex; align-items: center; gap: 6px; font-size:
  487. 1.15rem; font-weight: 600; white-space: nowrap; color:
  488. var(--c-text); }
  489.  
  490. .chip .cn { max-width: 220px; overflow: hidden; text-overflow:
  491. ellipsis; }
  492.  
  493. .chip em { font-style: normal; font-weight: 500; color:
  494. var(--c-sub); }
  495.  
  496.  
  497. .badge { display: flex; align-items: center; justify-content:
  498. center; flex: none; color: var(--c-icon); }
  499.  
  500. .badge ha-icon { --mdc-icon-size: 26px; width: 26px; height: 26px;
  501. display: flex; margin: 0; }
  502. - type: custom:button-card
  503. template: themed
  504. view_layout:
  505. grid-area: leg
  506. place-self: stretch
  507. entity: sensor.wall_weather_daily
  508. triggers_update:
  509. - weather.pirateweather
  510. - sun.sun
  511. - input_select.wall_display_mode
  512. custom_fields:
  513. strip: |
  514. [[[
  515. const icon = c => `<ha-icon icon="mdi:${variables.wx[c] || 'weather-cloudy'}"></ha-icon>`;
  516. const r = v => v == null ? '–' : Math.round(v);
  517. const all = entity?.attributes?.forecast || [];
  518. const today = all[0] || {};
  519. const w = states['weather.pirateweather'];
  520. const a = w?.attributes || {};
  521.  
  522. // current conditions + a few words about the day
  523. const COND = {
  524. 'sunny': 'Sunny', 'clear-night': 'Clear', 'partlycloudy': 'Partly cloudy', 'cloudy': 'Cloudy',
  525. 'fog': 'Foggy', 'rainy': 'Rain', 'pouring': 'Heavy rain', 'snowy': 'Snow', 'snowy-rainy': 'Sleet',
  526. 'hail': 'Hail', 'lightning': 'Thunderstorms', 'lightning-rainy': 'Thunderstorms & rain',
  527. 'windy': 'Windy', 'windy-variant': 'Windy', 'exceptional': 'Unusual weather',
  528. };
  529. const words = [COND[w?.state]];
  530. const pop = today.precipitation_probability;
  531. if (pop != null) words.push(pop >= 60 ? `rain likely (${r(pop)}%)` : pop >= 25 ? `${r(pop)}% chance of rain` : 'staying dry');
  532. const ws = a.wind_speed;
  533. if (ws != null) words.push(ws < 4 ? 'calm' : ws < 12 ? 'light breeze' : ws < 20 ? `breezy, ${r(ws)} mph` : `windy, ${r(ws)} mph`);
  534.  
  535. const now = w ? `<span class="now">${icon(w.state)}<span class="temp">${r(a.temperature)}°</span>`
  536. + `<span class="hl"><b>H</b> ${r(today.temperature)}°&nbsp;&nbsp;<b>L</b> ${r(today.templow)}°</span>`
  537. + `<span class="sum">${words.filter(Boolean).join(' · ')}</span></span>` : '';
  538.  
  539. const days = all.slice(1, 6).map(f =>
  540. `<span><em>${new Date(f.datetime).toLocaleDateString('en-US', {weekday: 'short'})}</em>${icon(f.condition)}${r(f.temperature)}°<i>/${r(f.templow)}°</i></span>`
  541. ).join('');
  542.  
  543. return `<div class="grp fc">${now}${days}</div>`;
  544. ]]]
  545. styles:
  546. card:
  547. - width: calc(80cqw + 40px)
  548. - border-top: 1px solid var(--c-line)
  549. - padding: 0
  550. grid:
  551. - grid-template-areas: '"strip"'
  552. - grid-template-columns: 100%
  553. - justify-items: stretch
  554. - align-content: center
  555. extra_styles: >
  556. #strip { width: 100%; justify-self: stretch; text-align: left; }
  557.  
  558.  
  559. /* one segmented box (like the "‹ Today ›" buttons): current
  560. conditions fill the left, then 5 forecast days */
  561.  
  562. .grp { display: flex; width: 100%; box-sizing: border-box;
  563. background: var(--c-grp); border: 1px solid var(--c-line);
  564. border-radius: 6px; overflow: hidden; font-size: 0.88rem; font-weight: 600; color: var(--c-text); }
  565. .grp > span { flex: none; display: flex; align-items: center;
  566. justify-content: center; gap: 5px; padding: 0 12px;
  567. height: 28px; box-sizing: border-box; white-space: nowrap; border-right: 1px solid var(--c-line); }
  568. .grp > span:last-child { border-right: none; }
  569.  
  570. .grp ha-icon { --mdc-icon-size: 20px; width: 20px; height: 20px;
  571. flex: none; display: flex; margin: 0; color: var(--c-icon); }
  572.  
  573.  
  574. /* current conditions */
  575.  
  576. .grp > span.now { flex: 1 1 auto; min-width: 0; justify-content:
  577. flex-start; gap: 10px; overflow: hidden; }
  578.  
  579. .now ha-icon { --mdc-icon-size: 24px; width: 24px; height: 24px; }
  580.  
  581. .now > span { flex: none; }
  582.  
  583. .now .temp { font-size: 1.35rem; font-weight: 700; }
  584.  
  585. .now .hl { font-size: 0.92rem; }
  586.  
  587. .now .hl b { color: var(--c-sub); font-weight: 600; }
  588.  
  589. .now .sum { flex: 0 1 auto; min-width: 0; font-size: 0.92rem;
  590. font-weight: 500; color: var(--c-sub); overflow: hidden;
  591. text-overflow: ellipsis; padding-left: 10px; border-left: 1px solid var(--c-line); }
  592.  
  593. /* forecast days: Day [icon] hi/lo */
  594.  
  595. .fc em { font-style: normal; color: var(--c-sub); margin-right:
  596. 2px; }
  597.  
  598. .fc i { font-style: normal; color: var(--c-sub); font-weight: 500;
  599. }
  600. - type: custom:week-planner-card
  601. view_layout:
  602. grid-area: cal
  603. calendars:
  604. - entity: calendar.family_example
  605. name: Family
  606. color: '#1e6f7a'
  607. icon: mdi:account-group
  608. - entity: calendar.child_example
  609. name: Child
  610. color: '#7a3a30'
  611. icon: mdi:account
  612. - entity: calendar.sports_team_example
  613. name: Sports Team
  614. color: '#3b5a80'
  615. icon: mdi:football
  616. - entity: calendar.sports_club_example
  617. name: Sports Club
  618. color: '#b03a3a'
  619. icon: mdi:soccer
  620. - entity: calendar.birthdays
  621. name: Birthdays
  622. color: '#7d3d68'
  623. icon: mdi:cake-variant
  624. - entity: calendar.holidays
  625. name: Holidays
  626. color: '#5a5a72'
  627. icon: mdi:flag
  628. - entity: calendar.holidays_in_united_states
  629. name: US Holidays
  630. color: '#5a5a72'
  631. icon: mdi:flag
  632. days: 35
  633. startingDay: sunday
  634. showWeekDayText: false
  635. maxDayEvents: 5
  636. replaceTitleText:
  637. Example Sports Club
  638. showLegend: false
  639. combineSimilarEvents: true
  640. locale: en-US
  641. texts:
  642. sunday: SUN
  643. monday: MON
  644. tuesday: TUE
  645. wednesday: WED
  646. thursday: THU
  647. friday: FRI
  648. saturday: SAT
  649. moreEvents: more…
  650. noEvents: ''
  651. fullDay: ''
  652. today: ''
  653. tomorrow: ''
  654. yesterday: ''
  655. weather:
  656. entity: weather.pirateweather
  657. showCondition: true
  658. showTemperature: false
  659. columns:
  660. extraLarge: 7
  661. large: 7
  662. medium: 7
  663. small: 7
  664. extraSmall: 7
  665. card_mod:
  666. style: >
  667. {# NIGHT MODE: forced Night, or Auto while the sun is down #}
  668.  
  669. {% set night = is_state('input_select.wall_display_mode',
  670. 'Night')
  671. or (not is_state('input_select.wall_display_mode', 'Day') and is_state('sun.sun', 'below_horizon')) %}
  672.  
  673. ha-card {
  674. --c-bg: {{ '#000000' if night else '#ffffff' }};
  675. --c-text: {{ '#f2f2f7' if night else '#1d1d1f' }};
  676. --c-sub: {{ '#98989d' if night else '#6e6e73' }};
  677. --c-line: {{ '#38383a' if night else '#e5e5ea' }};
  678. --c-line2: {{ '#48484a' if night else '#d1d1d6' }};
  679. --c-weekend: {{ '#0d0d0f' if night else '#f6f6f8' }}; /* WEEKENDS */
  680. --c-outside: {{ '#0c0c0e' if night else '#fafafa' }};
  681. --c-past: {{ '#636366' if night else '#aeaeb2' }};
  682. --c-time: {{ '#98989d' if night else '#8e8e93' }};
  683. --c-pill: transparent;
  684. --c-pillmix: {{ '45%' if night else '28%' }}; /* how strongly event boxes are tinted */
  685. --c-pilltxt: {{ '#ffffff' if night else '#000000' }};
  686. --c-pilltxtmix: {{ '0%' if night else '70%' }}; /* how much calendar colour goes into titles */
  687. background: var(--c-bg) !important;
  688. color: var(--c-text);
  689. border: none !important;
  690. border-radius: 0 !important;
  691. box-shadow: none !important;
  692. padding: 0 !important;
  693. height: calc(100vh - 48px - 40px);
  694. overflow: hidden;
  695. font-family: 'Inter', -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  696. --primary-text-color: var(--c-text);
  697. --secondary-text-color: var(--c-time);
  698. }
  699.  
  700.  
  701. .card-content { padding: 0 !important; height: 100%; }
  702.  
  703.  
  704. /* real month grid: weekday header row + equal-height weeks */
  705.  
  706. .container {
  707. display: grid !important;
  708. grid-template-columns: repeat(7, minmax(0, 1fr));
  709. grid-template-rows: auto;
  710. grid-auto-rows: minmax(0, 1fr);
  711. gap: 0 !important;
  712. height: 100%;
  713. border-top: 1px solid var(--c-line);
  714. }
  715.  
  716. .container .day {
  717. position: relative;
  718. width: auto !important;
  719. min-height: 0;
  720. margin: 0 !important;
  721. padding: 4px 6px;
  722. box-sizing: border-box;
  723. overflow: hidden;
  724. border-right: 1px solid var(--c-line);
  725. border-bottom: 1px solid var(--c-line);
  726. }
  727.  
  728. .container .day:nth-child(7n) { border-right: none; }
  729.  
  730.  
  731. .day.header { padding: 6px 8px 5px; border-bottom: 1px solid
  732. var(--c-line2); }
  733.  
  734. .day.header .date { justify-content: flex-end; }
  735.  
  736. .day.header .date .text { font-size: 0.85rem; font-weight: 600;
  737. color: var(--c-sub); letter-spacing: 0.02em; }
  738.  
  739. .day .date { display: flex; justify-content: flex-end;
  740. align-items: center; min-height: 28px; }
  741.  
  742. .day .date .number { font-size: 1.05rem !important; line-height:
  743. 1 !important; font-weight: 500; color: var(--c-text); }
  744.  
  745. .day:not(.header) .date .text { display: none !important; }
  746.  
  747.  
  748. /* month name on the 1st, like "Nov 1" */
  749.  
  750. {% for mo in
  751. ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
  752. %}
  753.  
  754. .day[data-date="1"][data-month="{{ loop.index }}"] .date
  755. .number::before { content: "{{ mo }} "; }
  756.  
  757. {% endfor %}
  758.  
  759. .day[data-date="1"]:not(.today) .date .number { font-weight:
  760. 700; }
  761.  
  762. .day.today .date .number::before { content: none !important; }
  763.  
  764.  
  765. .day.sunday, .day.saturday { background: var(--c-weekend); }
  766.  
  767. .day.outside-month { background: var(--c-outside); }
  768.  
  769. .day.past .date .number { color: var(--c-past); }
  770.  
  771. .day.today { background: transparent; box-shadow: inset 0 0 0
  772. 2px {{ '#1a8cff' if night else '#ff453a' }}; } /* TODAY
  773. outline */
  774.  
  775. .day.today .date .number {
  776. display: inline-flex; align-items: center; justify-content: center;
  777. width: 1.75em; height: 1.75em; border-radius: 50%;
  778. background: {{ '#1a8cff' if night else '#ff453a' }}; color: #fff; font-weight: 600; /* TODAY circle: blue at night, red by day */
  779. }
  780.  
  781.  
  782. /* WEATHER ICONS: outline icons, black by day, light at night */
  783.  
  784. {% set ic = 'e5e5ea' if night else '000000' %}
  785.  
  786. {% set icons = {
  787. 'sunny': 'M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z',
  788. 'clear-night': 'M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z',
  789. 'partlycloudy': 'M12.74,5.47C15.1,6.5 16.35,9.03 15.92,11.46C17.19,12.56 18,14.19 18,16V16.17C18.31,16.06 18.65,16 19,16A3,3 0 0,1 22,19A3,3 0 0,1 19,22H6A4,4 0 0,1 2,18A4,4 0 0,1 6,14H6.27C5,12.45 4.6,10.24 5.5,8.26C6.72,5.5 9.97,4.24 12.74,5.47M11.93,7.3C10.16,6.5 8.09,7.31 7.31,9.07C6.85,10.09 6.93,11.22 7.41,12.13C8.5,10.83 10.16,10 12,10C12.7,10 13.38,10.12 14,10.34C13.94,9.06 13.18,7.86 11.93,7.3M13.55,3.64C13,3.4 12.45,3.23 11.88,3.12L14.37,1.82L15.27,4.71C14.76,4.29 14.19,3.93 13.55,3.64M6.09,4.44C5.6,4.79 5.17,5.19 4.8,5.63L4.91,2.82L7.87,3.5C7.25,3.71 6.65,4.03 6.09,4.44M18,9.71C17.91,9.12 17.78,8.55 17.59,8L19.97,9.5L17.92,11.73C18.03,11.08 18.05,10.4 18,9.71M3.04,11.3C3.11,11.9 3.24,12.47 3.43,13L1.06,11.5L3.1,9.28C3,9.93 2.97,10.61 3.04,11.3M19,18H16V16A4,4 0 0,0 12,12A4,4 0 0,0 8,16H6A2,2 0 0,0 4,18A2,2 0 0,0 6,20H19A1,1 0 0,0 20,19A1,1 0 0,0 19,18Z',
  790. 'cloudy': 'M6,19A5,5 0 0,1 1,14A5,5 0 0,1 6,9C7,6.65 9.3,5 12,5C15.43,5 18.24,7.66 18.5,11.03L19,11A4,4 0 0,1 23,15A4,4 0 0,1 19,19H6M19,13H17V12A5,5 0 0,0 12,7C9.5,7 7.45,8.82 7.06,11.19C6.73,11.07 6.37,11 6,11A3,3 0 0,0 3,14A3,3 0 0,0 6,17H19A2,2 0 0,0 21,15A2,2 0 0,0 19,13Z',
  791. 'fog': 'M3,15H13A1,1 0 0,1 14,16A1,1 0 0,1 13,17H3A1,1 0 0,1 2,16A1,1 0 0,1 3,15M16,15H21A1,1 0 0,1 22,16A1,1 0 0,1 21,17H16A1,1 0 0,1 15,16A1,1 0 0,1 16,15M1,12A5,5 0 0,1 6,7C7,4.65 9.3,3 12,3C15.43,3 18.24,5.66 18.5,9.03L19,9C21.19,9 22.97,10.76 23,13H21A2,2 0 0,0 19,11H17V10A5,5 0 0,0 12,5C9.5,5 7.45,6.82 7.06,9.19C6.73,9.07 6.37,9 6,9A3,3 0 0,0 3,12C3,12.35 3.06,12.69 3.17,13H1.1L1,12M3,19H5A1,1 0 0,1 6,20A1,1 0 0,1 5,21H3A1,1 0 0,1 2,20A1,1 0 0,1 3,19M8,19H21A1,1 0 0,1 22,20A1,1 0 0,1 21,21H8A1,1 0 0,1 7,20A1,1 0 0,1 8,19Z',
  792. 'rainy': 'M6,14.03A1,1 0 0,1 7,15.03C7,15.58 6.55,16.03 6,16.03C3.24,16.03 1,13.79 1,11.03C1,8.27 3.24,6.03 6,6.03C7,3.68 9.3,2.03 12,2.03C15.43,2.03 18.24,4.69 18.5,8.06L19,8.03A4,4 0 0,1 23,12.03C23,14.23 21.21,16.03 19,16.03H18C17.45,16.03 17,15.58 17,15.03C17,14.47 17.45,14.03 18,14.03H19A2,2 0 0,0 21,12.03A2,2 0 0,0 19,10.03H17V9.03C17,6.27 14.76,4.03 12,4.03C9.5,4.03 7.45,5.84 7.06,8.21C6.73,8.09 6.37,8.03 6,8.03A3,3 0 0,0 3,11.03A3,3 0 0,0 6,14.03M12,14.15C12.18,14.39 12.37,14.66 12.56,14.94C13,15.56 14,17.03 14,18C14,19.11 13.1,20 12,20A2,2 0 0,1 10,18C10,17.03 11,15.56 11.44,14.94C11.63,14.66 11.82,14.4 12,14.15M12,11.03L11.5,11.59C11.5,11.59 10.65,12.55 9.79,13.81C8.93,15.06 8,16.56 8,18A4,4 0 0,0 12,22A4,4 0 0,0 16,18C16,16.56 15.07,15.06 14.21,13.81C13.35,12.55 12.5,11.59 12.5,11.59',
  793. 'pouring': 'M9,12C9.53,12.14 9.85,12.69 9.71,13.22L8.41,18.05C8.27,18.59 7.72,18.9 7.19,18.76C6.65,18.62 6.34,18.07 6.5,17.54L7.78,12.71C7.92,12.17 8.47,11.86 9,12M13,12C13.53,12.14 13.85,12.69 13.71,13.22L11.64,20.95C11.5,21.5 10.95,21.8 10.41,21.66C9.88,21.5 9.56,20.97 9.7,20.43L11.78,12.71C11.92,12.17 12.47,11.86 13,12M17,12C17.53,12.14 17.85,12.69 17.71,13.22L16.41,18.05C16.27,18.59 15.72,18.9 15.19,18.76C14.65,18.62 14.34,18.07 14.5,17.54L15.78,12.71C15.92,12.17 16.47,11.86 17,12M17,10V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11C3,12.11 3.6,13.08 4.5,13.6V13.59C5,13.87 5.14,14.5 4.87,14.96C4.59,15.43 4,15.6 3.5,15.32V15.33C2,14.47 1,12.85 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12C23,13.5 22.2,14.77 21,15.46V15.46C20.5,15.73 19.91,15.57 19.63,15.09C19.36,14.61 19.5,14 20,13.72V13.73C20.6,13.39 21,12.74 21,12A2,2 0 0,0 19,10H17Z',
  794. 'snowy': 'M6,14A1,1 0 0,1 7,15A1,1 0 0,1 6,16A5,5 0 0,1 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12A4,4 0 0,1 19,16H18A1,1 0 0,1 17,15A1,1 0 0,1 18,14H19A2,2 0 0,0 21,12A2,2 0 0,0 19,10H17V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11A3,3 0 0,0 6,14M7.88,18.07L10.07,17.5L8.46,15.88C8.07,15.5 8.07,14.86 8.46,14.46C8.85,14.07 9.5,14.07 9.88,14.46L11.5,16.07L12.07,13.88C12.21,13.34 12.76,13.03 13.29,13.17C13.83,13.31 14.14,13.86 14,14.4L13.41,16.59L15.6,16C16.14,15.86 16.69,16.17 16.83,16.71C16.97,17.24 16.66,17.79 16.12,17.93L13.93,18.5L15.54,20.12C15.93,20.5 15.93,21.15 15.54,21.54C15.15,21.93 14.5,21.93 14.12,21.54L12.5,19.93L11.93,22.12C11.79,22.66 11.24,22.97 10.71,22.83C10.17,22.69 9.86,22.14 10,21.6L10.59,19.41L8.4,20C7.86,20.14 7.31,19.83 7.17,19.29C7.03,18.76 7.34,18.21 7.88,18.07Z',
  795. 'snowy-rainy': 'M18.5,18.67C18.5,19.96 17.5,21 16.25,21C15,21 14,19.96 14,18.67C14,17.12 16.25,14.5 16.25,14.5C16.25,14.5 18.5,17.12 18.5,18.67M4,17.36C3.86,16.82 4.18,16.25 4.73,16.11L7,15.5L5.33,13.86C4.93,13.46 4.93,12.81 5.33,12.4C5.73,12 6.4,12 6.79,12.4L8.45,14.05L9.04,11.8C9.18,11.24 9.75,10.92 10.29,11.07C10.85,11.21 11.17,11.78 11,12.33L10.42,14.58L12.67,14C13.22,13.83 13.79,14.15 13.93,14.71C14.08,15.25 13.76,15.82 13.2,15.96L10.95,16.55L12.6,18.21C13,18.6 13,19.27 12.6,19.67C12.2,20.07 11.54,20.07 11.15,19.67L9.5,18L8.89,20.27C8.75,20.83 8.18,21.14 7.64,21C7.08,20.86 6.77,20.29 6.91,19.74L7.5,17.5L5.26,18.09C4.71,18.23 4.14,17.92 4,17.36M1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12A4,4 0 0,1 19,16A1,1 0 0,1 18,15A1,1 0 0,1 19,14A2,2 0 0,0 21,12A2,2 0 0,0 19,10H17V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11C3,11.85 3.35,12.61 3.91,13.16C4.27,13.55 4.26,14.16 3.88,14.54C3.5,14.93 2.85,14.93 2.47,14.54C1.56,13.63 1,12.38 1,11Z',
  796. 'hail': 'M6,14A1,1 0 0,1 7,15A1,1 0 0,1 6,16A5,5 0 0,1 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12A4,4 0 0,1 19,16H18A1,1 0 0,1 17,15A1,1 0 0,1 18,14H19A2,2 0 0,0 21,12A2,2 0 0,0 19,10H17V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11A3,3 0 0,0 6,14M10,18A2,2 0 0,1 12,20A2,2 0 0,1 10,22A2,2 0 0,1 8,20A2,2 0 0,1 10,18M14.5,16A1.5,1.5 0 0,1 16,17.5A1.5,1.5 0 0,1 14.5,19A1.5,1.5 0 0,1 13,17.5A1.5,1.5 0 0,1 14.5,16M10.5,12A1.5,1.5 0 0,1 12,13.5A1.5,1.5 0 0,1 10.5,15A1.5,1.5 0 0,1 9,13.5A1.5,1.5 0 0,1 10.5,12Z',
  797. 'lightning': 'M6,16A5,5 0 0,1 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12A4,4 0 0,1 19,16H18A1,1 0 0,1 17,15A1,1 0 0,1 18,14H19A2,2 0 0,0 21,12A2,2 0 0,0 19,10H17V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11A3,3 0 0,0 6,14H7A1,1 0 0,1 8,15A1,1 0 0,1 7,16H6M12,11H15L13,15H15L11.25,22L12,17H9.5L12,11Z',
  798. 'lightning-rainy': 'M4.5,13.59C5,13.87 5.14,14.5 4.87,14.96C4.59,15.44 4,15.6 3.5,15.33V15.33C2,14.47 1,12.85 1,11A5,5 0 0,1 6,6C7,3.65 9.3,2 12,2C15.43,2 18.24,4.66 18.5,8.03L19,8A4,4 0 0,1 23,12A4,4 0 0,1 19,16A1,1 0 0,1 18,15A1,1 0 0,1 19,14A2,2 0 0,0 21,12A2,2 0 0,0 19,10H17V9A5,5 0 0,0 12,4C9.5,4 7.45,5.82 7.06,8.19C6.73,8.07 6.37,8 6,8A3,3 0 0,0 3,11C3,12.11 3.6,13.08 4.5,13.6V13.59M9.5,11H12.5L10.5,15H12.5L8.75,22L9.5,17H7L9.5,11M17.5,18.67C17.5,19.96 16.5,21 15.25,21C14,21 13,19.96 13,18.67C13,17.12 15.25,14.5 15.25,14.5C15.25,14.5 17.5,17.12 17.5,18.67Z',
  799. 'windy': 'M4,10A1,1 0 0,1 3,9A1,1 0 0,1 4,8H12A2,2 0 0,0 14,6A2,2 0 0,0 12,4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0 0,1 16,6A4,4 0 0,1 12,10H4M19,12A1,1 0 0,0 20,11A1,1 0 0,0 19,10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14H5A1,1 0 0,1 4,13A1,1 0 0,1 5,12H19M18,18H4A1,1 0 0,1 3,17A1,1 0 0,1 4,16H18A3,3 0 0,1 21,19A3,3 0 0,1 18,22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0 0,0 19,19A1,1 0 0,0 18,18Z',
  800. 'windy-variant': 'M6,6L6.69,6.06C7.32,3.72 9.46,2 12,2A5.5,5.5 0 0,1 17.5,7.5L17.42,8.45C17.88,8.16 18.42,8 19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14H6A4,4 0 0,1 2,10A4,4 0 0,1 6,6M6,8A2,2 0 0,0 4,10A2,2 0 0,0 6,12H19A1,1 0 0,0 20,11A1,1 0 0,0 19,10H15.5V7.5A3.5,3.5 0 0,0 12,4A3.5,3.5 0 0,0 8.5,7.5V8H6M18,18H4A1,1 0 0,1 3,17A1,1 0 0,1 4,16H18A3,3 0 0,1 21,19A3,3 0 0,1 18,22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0 0,0 19,19A1,1 0 0,0 18,18Z',
  801. 'exceptional': 'M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z',
  802. } %}
  803.  
  804. :host {
  805.  
  806. {% for name, d in icons.items() %}
  807. --weather-icon-{{ name }}: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23{{ ic }}' d='{{ d }}'/></svg>");
  808. {% endfor %}
  809.  
  810. }
  811.  
  812.  
  813. /* CALENDAR WEATHER ICON: top-left of each day */
  814.  
  815. .weather { position: absolute; left: 7px; top: 8px; }
  816.  
  817. .weather .icon { width: 17px !important; height: 17px
  818. !important; background-size: contain !important;
  819. background-repeat: no-repeat !important; background-position: center !important; }
  820.  
  821. /* EVENTS: [icon] [time] [title…] in a box tinted with the
  822. calendar colour, solid colour bar on the left */
  823.  
  824. .event {
  825. background: color-mix(in srgb, var(--border-color) var(--c-pillmix), var(--c-pill)) !important;
  826. border: none !important;
  827. border-left: 3px solid var(--border-color) !important;
  828. border-radius: 3px !important;
  829. box-shadow: inset 0 0 0 1px {{ 'rgba(255,255,255,0.06)' if night else 'rgba(0,0,0,0.04)' }};
  830. padding: 2px 6px 2px 3px !important;
  831. margin: 0 0 3px !important;
  832. display: flex !important;
  833. align-items: baseline;
  834. color: var(--c-text);
  835. }
  836.  
  837. .event::after { content: none !important; }
  838.  
  839. .event.past { opacity: 0.45; }
  840.  
  841. .event .time, .event .additionalColor { display: none
  842. !important; }
  843.  
  844. .event .inner { padding: 0 !important; min-width: 0; }
  845.  
  846.  
  847. /* EVENT ICON: white at night, calendar colour by day */
  848.  
  849. .event .icon {
  850. display: flex !important;
  851. order: -2;
  852. flex: none;
  853. align-self: flex-start;
  854. align-items: center;
  855. justify-content: center;
  856. width: 16px; height: 16px;
  857. background: none !important;
  858. color: {{ '#ffffff' if night else 'var(--border-color)' }};
  859. margin: 1px 5px 0 1px !important;
  860. padding: 0 !important;
  861. --mdc-icon-size: 15px;
  862. }
  863.  
  864. .event .icon ha-icon { --mdc-icon-size: 15px; width: 15px;
  865. height: 15px; display: flex; color: inherit; }
  866.  
  867.  
  868. /* EVENT NAMES: Inter, like the sidebar agenda; wrap to 2 lines
  869. then "…" (change the clamp for more lines) */
  870.  
  871. .event .title {
  872. font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  873. font-size: 0.9rem; font-weight: 600; line-height: 1.3;
  874. color: color-mix(in srgb, var(--border-color) var(--c-pilltxtmix), var(--c-pilltxt)) !important;
  875. white-space: normal; overflow-wrap: anywhere;
  876. display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  877. }
  878.  
  879.  
  880. /* EMPTY DAYS: no "No events" box, just blank */
  881.  
  882. .day .none, .day .no-events, .day .noEvents { display: none
  883. !important; }
  884.  
  885.  
  886. .more { background: transparent !important; font-size: 0.8rem;
  887. color: var(--c-time) !important; padding: 0 4px !important; }
  888.  
  889.  
  890. /* START TIMES: compact "7p" / "7:30a" before timed events,
  891. except on the days the
  892. sidebar agenda already shows (today + next 2) and on past days.
  893. Set agenda_days to 0 to show times on every day. */
  894. {% set agenda_days = 3 %}
  895.  
  896. .event::before {
  897. order: -1; flex: none; margin-right: 4px;
  898. font-family: 'Barlow Condensed', 'Roboto Condensed', 'Arial Narrow', sans-serif;
  899. font-stretch: condensed;
  900. font-size: 0.8rem; font-weight: 600; line-height: 1.45;
  901. color: var(--c-sub); white-space: nowrap;
  902. }
  903.  
  904. {% for h in range(24) %}{% set hr = (h % 12) or 12 %}{% set ap =
  905. 'a' if h < 12 else 'p' %}
  906.  
  907. .event[data-start-hour="{{ h }}"]::before { content: "{{ hr }}{{
  908. ap }}"; }
  909.  
  910. .event[data-start-hour="{{ h
  911. }}"]:not([data-start-minute="00"]):not([data-start-minute="0"])::before
  912. { content: "{{ hr }}:" attr(data-start-minute) "{{ ap }}"; }
  913.  
  914. {% endfor %}
  915.  
  916. .event.fullday::before { content: none !important; }
  917.  
  918. .day.past .event::before { content: none !important; }
  919.  
  920. {% for i in range(agenda_days) %}{% set d = now() +
  921. timedelta(days=i) %}
  922.  
  923. .day[data-date="{{ d.day }}"][data-month="{{ d.month }}"]
  924. .event::before { content: none !important; }
  925.  
  926. {% endfor %}
  927.  
Advertisement
Add Comment
Please, Sign In to add comment