]> _ Git - fluidbook-toolbox.git/commitdiff
wip #4628 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Jul 2022 18:19:50 +0000 (20:19 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Jul 2022 18:19:50 +0000 (20:19 +0200)
resources/views/fields/fluidbook_composition.blade.php

index 6e2a5124626e39f7c55bdec448f780d69064234f..fbbbe3050613c1161e83fdb836915715192e7229 100644 (file)
 
                 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