Skip to content

Commit

Permalink
Update ember-source to alpha version to get liquid-fire working
Browse files Browse the repository at this point in the history
  • Loading branch information
astronomersiva committed Oct 26, 2019
1 parent 977d8a7 commit c6481ac
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 597 deletions.
6 changes: 5 additions & 1 deletion app/components/clock.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
flex-1
">

<p class="opacity-70">{{this.formattedTime}}</p>
<p class="opacity-70">
<div id="liquid-timer" class="inline-flex">
{{liquid-bind this.formattedMinutes}}:{{liquid-bind this.formattedSeconds}}
</div>
</p>
</div>
9 changes: 6 additions & 3 deletions app/components/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { inject as service } from '@ember/service';
export default class ClockComponent extends Component {
@service presentation;

get formattedTime() {
get formattedMinutes() {
let minutes = Math.floor(this.presentation.elapsedTime / 60000).toString() || '0';
let seconds = ((this.presentation.elapsedTime % 60000) / 1000).toFixed(0).toString() || '0';
return minutes.padStart(2, '0');
}

return `${minutes.padStart(2, '0')}:${seconds.padStart(2, '0')}`;
get formattedSeconds() {
let seconds = ((this.presentation.elapsedTime % 60000) / 1000).toFixed(0).toString() || '0';
return seconds.padStart(2, '0');
}
}
11 changes: 10 additions & 1 deletion app/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@
flex-1
flex-col
items-center
justify-center;
justify-center
min-h-screen;
}

.transitions-container {
@apply w-full min-h-full;
}

.transitions-container > .liquid-child {
display: flex;
}

.pagination {
Expand Down
38 changes: 20 additions & 18 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{{#let (concat "slides/slide-" this.slide) as |Slide|}}
<Slide
@speaker={{this.speaker}}
class="
{{concat "slide-" this.slide}}
{{if this.speaker "hidden md:flex w-3/4" "flex"}}
" as |slide|
>
{{#if this.speaker}}
{{#unless this.presentation.hasStarted}}
<div class="timer-overlay w-full md:w-3/4 md:h-full bottom-26 md:top-0">
<button class="underline" {{on "click" this.startTicking}}>Start Presentation</button>
</div>
{{/unless}}
{{#liquid-bind Slide use="toLeft" class="transitions-container" as |Slide|}}
<Slide
@speaker={{this.speaker}}
class="
{{concat "slide-" this.slide}}
{{if this.speaker "hidden md:flex w-3/4" "flex"}}
" as |slide|
>
{{#if this.speaker}}
{{#unless this.presentation.hasStarted}}
<div class="timer-overlay w-full md:w-3/4 md:h-full bottom-26 md:top-0">
<button class="underline" {{on "click" this.startTicking}}>Start Presentation</button>
</div>
{{/unless}}

<AdjacentSlides />
<SpeakerControls @notes={{slide.notes}} />
{{/if}}
</Slide>
<AdjacentSlides />
<SpeakerControls @notes={{slide.notes}} />
{{/if}}
</Slide>
{{/liquid-bind}}
{{/let}}

{{#unless this.speaker}}
<FullScreen />
{{/unless}}

{{outlet}}
{{liquid-outlet}}
18 changes: 11 additions & 7 deletions app/transitions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// doesn't work in octane even with jquery enabled
// export default function(){
// this.transition(
// this.toRoute(function(routeName){ return true }),
// this.use('toLeft'),
// this.reverse('toRight')
// );
// }
export default function(){
this.transition(
this.withinRoute(function(routeName){ return true }),
this.use('toLeft')
);

this.transition(
this.childOf('#liquid-timer'),
this.use('toUp')
);
}
2 changes: 1 addition & 1 deletion config/optional-features.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"application-template-wrapper": false,
"jquery-integration": false,
"jquery-integration": true,
"template-only-glimmer-components": true
}
Loading

0 comments on commit c6481ac

Please sign in to comment.