Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitions #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
}
}
1 change: 1 addition & 0 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class ApplicationController extends Controller {

@tracked speaker;
@tracked slide;
@tracked transitionDirection = 'crossFade';

init() {
super.init(...arguments);
Expand Down
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=this.transitionDirection 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}}
14 changes: 6 additions & 8 deletions app/transitions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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.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