Skip to content

Commit

Permalink
animation: show play button when scene has been loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Jan 12, 2024
1 parent 338efaa commit daf2924
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions js/Qgis2threejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,15 @@ Q3D.E = function (id) {
}
app.render();

if (conf.animation.startOnLoad) {
app.animation.keyframes.start();
if (conf.animation.enabled) {
var btn = E("animbtn");
if (btn) {
btn.className = "playbtn";
}

if (conf.animation.startOnLoad) {
app.animation.keyframes.start();
}
}
}, true);

Expand Down Expand Up @@ -1520,8 +1527,6 @@ Q3D.E = function (id) {
if (conf.animation.enabled && btn) {
var anim = app.animation.keyframes;

btn.classList.remove("hidden");

var playButton = function () {
btn.className = "playbtn";
};
Expand All @@ -1530,8 +1535,6 @@ Q3D.E = function (id) {
btn.className = "pausebtn";
};

playButton();

btn.onclick = function () {
if (anim.isActive) {
anim.pause();
Expand Down

0 comments on commit daf2924

Please sign in to comment.