Skip to content

Commit

Permalink
feat(scene): No animation for scene in timeline
Browse files Browse the repository at this point in the history
Inform the user with an icon that a scene that is part of the timeline is missing at least 1
animation.
  • Loading branch information
TimPietrusky committed Oct 10, 2019
1 parent 5ce15ca commit e62d021
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 6 deletions.
84 changes: 80 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@apollo-elements/lit-apollo": "^0.0.5",
"@material/layout-grid": "^0.39.0",
"@material/mwc-button": "^0.7.1",
"@material/mwc-icon": "^0.7.1",
"@material/mwc-icon": "^0.9.1",
"@polymer/app-layout": "3.0.1",
"@polymer/iron-icons": "3.0.1",
"@polymer/iron-pages": "3.0.1",
Expand Down
27 changes: 26 additions & 1 deletion src/components/timeline/timeline-scene.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { LitElement, html } from 'lit-element'
import { LitElement, html, css } from 'lit-element'
import { repeat } from 'lit-html/directives/repeat.js'
import { store } from '../../reduxStore.js'
import { connect } from 'pwa-helpers/connect-mixin.js'
import './timeline-animation.js'
import { getAnimation, getAnimations, getLive } from '../../selectors/index.js'
import { SCENE_TYPE_STATIC } from '../../constants/timeline.js'
import { setSceneOnTimeline } from '../../actions/index.js'
import '@material/mwc-icon/mwc-icon.js'


/*
* Handle a scene in a timeline
Expand All @@ -15,6 +17,7 @@ class TimelineScene extends connect(store)(LitElement) {
return {
timelineScene: { type: Object },
progress: { type: Number },
// All animations that exist in luminave, not only the ones assigned to the scene
animations: { type: Array },
live: { type: Boolean }
}
Expand Down Expand Up @@ -42,6 +45,26 @@ class TimelineScene extends connect(store)(LitElement) {
}
}

/*
* This is broken as this.animations are ALL animations from all scenes...
*/
noAnimationInScene(animations) {

if (animations.length === 0) {
return html`<mwc-icon title="No animation is assigned to this Scene">error</mwc-icon>`
}

return html``
}

static get styles() {
return css`
mwc-icon {
color: var(--default-warning-color);
}
`
}

render() {
const { timelineScene, progress, live } = this

Expand All @@ -56,6 +79,8 @@ class TimelineScene extends connect(store)(LitElement) {
<div>
<h3>${timelineScene.scene.name}</h3>
${this.noAnimationInScene(timelineScene.scene.animations)}
${repeat(timelineScene.scene.animations, animationId => html`
Expand Down
3 changes: 3 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<meta property="og:site_name" content="luminave">
<meta property="og:image" content="/assets/icons/icon-192x192.png" />

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">

<style>
body {
margin: 0;
Expand Down

0 comments on commit e62d021

Please sign in to comment.