-
Notifications
You must be signed in to change notification settings - Fork 436
Conversation
// Set slider button animation duration | ||
anim_slider_button.setAttribute('dur', style.getPropertyValue('--animation-duration')); | ||
|
||
play_button.setAttribute('display', 'none'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
play_button.style.display = 'none';
pause_button.style.display = 'inline';
terminal.unpauseAnimations() | ||
screen.unpauseAnimations() | ||
play_button.setAttribute('display', 'none') | ||
pause_button.setAttribute('display', 'inline') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use style
here like above
} else { | ||
terminal.pauseAnimations() | ||
screen.pauseAnimations() | ||
play_button.setAttribute('display', 'inline') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use style
here like above
timer.textContent = timer_from_ms(current_time) + "/" + timer_from_ms(animation_duration) | ||
} | ||
|
||
setInterval(update_timer, "100ms") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change 100ms
to 100
var screen = terminal.getElementById('screen'); | ||
var slider_1 = terminal.getElementById('slider_1'); | ||
var anim_slider_button = document.getElementById('anim_slider_button'); | ||
var style = getComputedStyle(terminal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use window.getComputedStyle
here for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you don't need to create the style
variable here. Instead you can do this:
var dur = window.getComputedStyle(terminal).getPropertyValue('--animation-duration');
var animation_duration = parseInt(dur) / 1000;
// ...then later below...
anim_slider_button.setAttribute('dur', dur);
var timer = terminal.getElementById('timer') | ||
|
||
function timer_from_ms(t) { | ||
minutes = Math.floor(t / 60); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be var minutes
and var seconds
.
return parseInt(matrix.m41) | ||
} | ||
|
||
track_begin = getTranslateX(terminal.getElementById('track')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be var track_begin =
Thanks! |
Color theme and font used in the animation can now be set by modifying one of the CSS style elements of the template. --font and --theme CLI options have been removed in favor of --template
Add support for SVG templates: templates make it possible to add a terminal window frame to the animation, as well as custom Javascript code Remove static configuration file: animation styling (color theme and font) is now done by modifying the template Replace --font and --theme CLI options by --template
See #53 for SVG templates discussion