restore animation progress. cleanup style
This commit is contained in:
parent
94dfc15768
commit
bc3e738a8d
2 changed files with 17 additions and 14 deletions
|
|
@ -11,7 +11,7 @@ const { CAM } = driver;
|
||||||
|
|
||||||
let meshes = {},
|
let meshes = {},
|
||||||
unitScale = 1,
|
unitScale = 1,
|
||||||
progress, toolPosX, toolPosY, toolPosZ,
|
progress,
|
||||||
speedValues = [ 25, 12, 6, 3 ],
|
speedValues = [ 25, 12, 6, 3 ],
|
||||||
speedNames = [ "1x", "2x", "4x", "8x" ],
|
speedNames = [ "1x", "2x", "4x", "8x" ],
|
||||||
speedMax = speedValues.length - 1,
|
speedMax = speedValues.length - 1,
|
||||||
|
|
@ -58,7 +58,8 @@ kiri.load(() => {
|
||||||
UC.newButton(null,step,{icon:'<i class="fas fa-step-forward"></i>',title:"single step"}),
|
UC.newButton(null,step,{icon:'<i class="fas fa-step-forward"></i>',title:"single step"}),
|
||||||
UC.newButton(null,fast,{icon:'<i class="fas fa-forward"></i>',title:"toggle speed"}),
|
UC.newButton(null,fast,{icon:'<i class="fas fa-forward"></i>',title:"toggle speed"}),
|
||||||
UC.newButton(null,skip,{icon:'<i class="fas fa-fast-forward"></i>',title:"skip forward without animation"}),
|
UC.newButton(null,skip,{icon:'<i class="fas fa-fast-forward"></i>',title:"skip forward without animation"}),
|
||||||
speedLabel = UC.newLabel("speed")
|
speedLabel = UC.newLabel("speed", {class:"speed"}),
|
||||||
|
progress = UC.newLabel('0%', {class:"progress"})
|
||||||
]);
|
]);
|
||||||
updateSpeed();
|
updateSpeed();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
@ -67,10 +68,6 @@ kiri.load(() => {
|
||||||
const toolpos = $('layer-toolpos');
|
const toolpos = $('layer-toolpos');
|
||||||
toolpos.innerHTML = '';
|
toolpos.innerHTML = '';
|
||||||
UC.setGroup(toolpos);
|
UC.setGroup(toolpos);
|
||||||
progress = UC.newInput('%', {disabled: true, size: 5});
|
|
||||||
toolPosX = UC.newInput('x', {disabled: true, size: 7});
|
|
||||||
toolPosY = UC.newInput('y', {disabled: true, size: 7});
|
|
||||||
toolPosZ = UC.newInput('z', {disabled: true, size: 7});
|
|
||||||
playButton.style.display = '';
|
playButton.style.display = '';
|
||||||
pauseButton.style.display = 'none';
|
pauseButton.style.display = 'none';
|
||||||
api.event.emit('animate', 'CAM');
|
api.event.emit('animate', 'CAM');
|
||||||
|
|
@ -173,7 +170,7 @@ kiri.load(() => {
|
||||||
function handleGridUpdate(data) {
|
function handleGridUpdate(data) {
|
||||||
checkMeshCommands(data);
|
checkMeshCommands(data);
|
||||||
if (data && data.progress) {
|
if (data && data.progress) {
|
||||||
progress.value = (data.progress * 100).toFixed(1)
|
progress.innerText = (data.progress * 100).toFixed(1) + '%'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -216,11 +213,6 @@ kiri.load(() => {
|
||||||
mesh.position.y = pos.y;
|
mesh.position.y = pos.y;
|
||||||
mesh.position.z = pos.z;
|
mesh.position.z = pos.z;
|
||||||
space.update();
|
space.update();
|
||||||
if (id !== 0) {
|
|
||||||
toolPosX.value = ((pos.x + posOffset.x) * unitScale).toFixed(2);
|
|
||||||
toolPosY.value = ((pos.y + posOffset.y) * unitScale).toFixed(2);
|
|
||||||
toolPosZ.value = ((pos.z + posOffset.z) * unitScale).toFixed(2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.mesh_update) {
|
if (data.mesh_update) {
|
||||||
|
|
|
||||||
|
|
@ -1432,12 +1432,23 @@ th, tr, td, label {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
#layer-animate .speed {
|
||||||
|
width: 30px;
|
||||||
|
margin-left: 5px !important;
|
||||||
|
}
|
||||||
|
#layer-animate .progress {
|
||||||
|
width: 3.5em;
|
||||||
|
}
|
||||||
|
#layer-animate button {
|
||||||
|
width: 45px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
#layer-animate label {
|
#layer-animate label {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
width: 30px;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
margin: 1px 2px 2px 4px;
|
margin: 1px 2px 2px 1px;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue