Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Support for SVG templates #54

Merged
merged 16 commits into from
Aug 2, 2018
Merged

Support for SVG templates #54

merged 16 commits into from
Aug 2, 2018

Conversation

nbedos
Copy link
Owner

@nbedos nbedos commented Jul 29, 2018

See #53 for SVG templates discussion

// Set slider button animation duration
anim_slider_button.setAttribute('dur', style.getPropertyValue('--animation-duration'));

play_button.setAttribute('display', 'none');
Copy link

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')
Copy link

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')
Copy link

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")
Copy link

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);
Copy link

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?

Copy link

@styfle styfle Jul 30, 2018

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);
Copy link

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'))
Copy link

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 =

@nbedos
Copy link
Owner Author

nbedos commented Aug 2, 2018

Thanks!

nbedos added 2 commits August 2, 2018 15:49
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
@nbedos nbedos merged commit f5334d1 into develop Aug 2, 2018
nbedos added a commit that referenced this pull request Aug 3, 2018
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
@nbedos nbedos deleted the feature/animation_UI branch August 4, 2018 21:50
@nbedos nbedos added the merged This pull request was merged label Aug 15, 2018
@nbedos nbedos added the enhancement New feature or request label Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request merged This pull request was merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants