function showProgressBar(message, progress) {
console.log(message, progress);
- if(progress===3){
+ if ($("#compositionProgress").length === 0) {
+ $('body').append('<div id="compositionProgress"><div><span></span><progress max="100"></progress></div></div>');
+ }
+ var p = Math.round((progress % 1) * 100);
+
+ var step = Math.floor(progress);
+
+ $("#compositionProgress progress").attr('data-step', step).attr('value', p).text(p + '%');
+ $("#compositionProgress span").text(message);
+
+
+ if (progress === 3) {
hideProgressBar();
}
}
- function hideProgressBar(){
+ function hideProgressBar() {
clearInterval(progressInterval);
console.log('End conversion');
+ $("#compositionProgress").remove();
}
function updateComposition() {
top: -10px;
left: 12px;
}
+
+ #compositionProgress {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.25);
+ }
+
+ #compositionProgress div {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 20%;
+ padding: 20px;
+ background-color: #fff;
+ }
</style>
@endpush