Skip to content

Commit 7f18ac2

Browse files
authored
Merge pull request #567 from totaldebug/v7.0.0-b1
fix: progress bar not functioning with media player
2 parents bb9f585 + ab3848b commit 7f18ac2

File tree

9 files changed

+5370
-120
lines changed

9 files changed

+5370
-120
lines changed

.devcontainer/recommended-Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apt install python3 zsh -y
88

99
RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | zsh || true
1010

11-
RUN npm install --include=dev
11+
RUN yarn install
1212

1313
RUN pip3 install -r ../docs/requirements.txt
1414
RUN pip3 install sphinx

dist/atomic-calendar-revive.js

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

docs/contribute/devcycle.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ From the cloned repository, run the command to install the requirements:
6262

6363
.. code-block:: bash
6464
65-
npm install
65+
yarn install
6666
6767
********************
6868
Make changes & Build
6969
********************
7070

7171
#. Any changes to the card should be made in the folder ``src``
7272
#. Update the version number in ``package.json``
73-
#. Run the command ``npm run build`` to create the latest distribution file
73+
#. Run the command ``yarn run build`` to create the latest distribution file
7474

7575
*******
7676
Testing

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "atomic-calendar-revive",
3-
"version": "7.0.0-b",
3+
"version": "7.0.0-b1",
44
"editor_version": "2.0.0",
55
"description": "Calendar Card for Home Assistant",
66
"main": "atomic-calendar-revive.js",
@@ -59,7 +59,6 @@
5959
"dayjs": "^1.10.7",
6060
"lit": "^2.2.0",
6161
"lit-element": "^3.2.0",
62-
"node-google-calendar": "^1.1.1",
6362
"npm": "^8.5.1",
6463
"typescript": "^4.5.5"
6564
},

src/defaults.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
showProgressBar: true,
7777
showFullDayProgress: false,
7878
progressBarColor: 'var(--primary-color)',
79-
progressBarBufferColor: 'var(--secondary-color)',
79+
progressBarBackgroundColor: '#555',
8080

8181
enableModeChange: false,
8282
defaultMode: 'Event',
@@ -107,4 +107,5 @@ export default {
107107
showMultiDay: false,
108108
showMultiDayEventParts: false,
109109
showWeekNumber: false,
110+
showDescription: false,
110111
};

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import "@material/mwc-linear-progress/mwc-linear-progress";
2-
import { LitElement, html, TemplateResult, CSSResultGroup } from 'lit';
3-
import { property, query } from 'lit/decorators.js';
1+
import { LitElement, html, TemplateResult, CSSResultGroup } from 'lit';
2+
import { property } from 'lit/decorators.js';
43
import { HomeAssistant, LovelaceCardEditor } from 'custom-card-helpers';
54
import { formatTime } from './helpers/format-time'
65
import { groupEventsByDay, getEventMode, getCalendarMode } from './lib/event.func';
@@ -363,10 +362,11 @@ class AtomicCalendarRevive extends LitElement {
363362
const eventDuration = event.endDateTime.diff(event.startDateTime, 'minutes');
364363
const eventProgress = dayjs().diff(event.startDateTime, 'minutes');
365364
const eventPercentProgress = (eventProgress * 100) / eventDuration / 100;
366-
progressBar = html`<mwc-linear-progress
365+
/**progressBar = html`<mwc-linear-progress
367366
class="progress-bar"
368-
style="--mdc-theme-primary: ${this._config.progressBarColor}; --mdc-linear-progress-buffer-color: ${this._config.progressBarBufferColor};"
369-
progress="${eventPercentProgress}"></mwc-linear-progress>`;
367+
368+
progress="${eventPercentProgress}"></mwc-linear-progress>`;*/
369+
progressBar = html`<progress style="--progress-bar: ${this._config.progressBarColor}; --progress-bar-bg: ${this._config.progressBarBackgroundColor};" value="${eventPercentProgress}" max="1"></progress>`;
370370
}
371371

372372
const finishedEventsStyle =

src/style.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,19 @@ export const styles: CSSResultGroup = css`
181181
margin-bottom: 0px;
182182
}
183183
184-
.progress-bar {
185-
--mdc-theme-primary: var(--mdc-theme-primary);
186-
--mdc-linear-progress-buffer-color: var(--mdc-linear-progress-buffer-color);
187-
}
188-
189-
mwc-linear-progress {
184+
progress {
185+
border-radius: 2px;
190186
width: 100%;
191-
margin: auto;
187+
height: 3px;
188+
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
189+
}
190+
progress::-webkit-progress-bar {
191+
background-color: var(--progress-bar-bg);
192+
border-radius: 2px;
193+
}
194+
progress::-webkit-progress-value{
195+
background-color: var(--progress-bar);
196+
border-radius: 2px;
192197
}
193198
194199
ha-button-toggle-group {

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export interface atomicCardConfig extends LovelaceCardConfig {
4242
showHiddenText?: boolean;
4343
hiddenEventText?: string;
4444
refreshInterval: number;
45+
showDescription: boolean;
46+
showEventIcon: boolean;
4547

4648
// color and font settings
4749
nameColor?: string;

0 commit comments

Comments
 (0)