From 47c45bd0b6f324ef77219f6211d03359a00cdd98 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Fri, 19 Jul 2019 17:21:47 +0300 Subject: [PATCH] SE skeleton loader --- .../main/app/controller/Main.js | 2 + apps/spreadsheeteditor/main/index.html | 247 +++++++----------- .../main/resources/less/app.less | 33 ++- 3 files changed, 131 insertions(+), 151 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 7ee72540f..5eb974c52 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -143,6 +143,8 @@ define([ // viewport.applicationUI.setVisible(true); } + $('#editor_sdk').append('
' + '
'.repeat(2) + '
'); + var value = Common.localStorage.getItem("sse-settings-fontrender"); if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3'; Common.Utils.InternalSettings.set("sse-settings-fontrender", value); diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html index 158ad8d9c..9a565c43f 100644 --- a/apps/spreadsheeteditor/main/index.html +++ b/apps/spreadsheeteditor/main/index.html @@ -20,157 +20,116 @@ z-index: 10000; } - .loader-page { + .loadmask { width: 100%; - height: 170px; - bottom: 42%; - position: absolute; - text-align: center; - line-height: 10px; + height: 100%; } - .loader-logo { - max-height: 160px; - margin-bottom: 10px; + .loadmask > .brendpanel { + width: 100%; + height: 56px; + background: #40865c; } - .loader-page-romb { - width: 40px; + .loadmask > .brendpanel > div { + display: flex; + align-items: center; + } + + .loadmask > .brendpanel .loading-logo { + padding: 0 24px 0 12px; + max-width: 200px; + height: 20px; + } + + .loadmask > .brendpanel .loading-logo > i { display: inline-block; + width: 86px; + height: 20px; + background-image: url(http://192.168.3.191:8080/web-apps-pro/apps/common/main/resources/img/header/header-logo.png); + background-repeat: no-repeat; } - .loader-page-text { + .loadmask > .brendpanel .spacer { + margin-left: auto; + } + + .loadmask > .brendpanel .circle { + vertical-align: middle; + width: 20px; + height: 20px; + border-radius: 12px; + margin: 4px 10px; + background: rgba(255, 255, 255, 0.2); + + -webkit-animation: flickerAnimation 2s infinite ease-in-out; + -moz-animation: flickerAnimation 2s infinite ease-in-out; + -o-animation: flickerAnimation 2s infinite ease-in-out; + animation: flickerAnimation 2s infinite ease-in-out; + } + + .loadmask > .brendpanel .rect { + vertical-align: middle; + width: 50px; + height: 12px; + border-radius: 3px; + margin: 0 10px; + background: rgba(255, 255, 255, 0.2); + + -webkit-animation: flickerAnimation 2s infinite ease-in-out; + -moz-animation: flickerAnimation 2s infinite ease-in-out; + -o-animation: flickerAnimation 2s infinite ease-in-out; + animation: flickerAnimation 2s infinite ease-in-out; + } + + .loadmask > .placeholder { + background: #fbfbfb; width: 100%; - bottom: 42%; - position: absolute; - text-align: center; - color: #888; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 20px; + height: 100%; + border: 1px solid #dfdfdf; + white-space: nowrap; + + -webkit-animation: flickerAnimation 2s infinite ease-in-out; + -moz-animation: flickerAnimation 2s infinite ease-in-out; + -o-animation: flickerAnimation 2s infinite ease-in-out; + animation: flickerAnimation 2s infinite ease-in-out; } - .loader-page-text-loading { - font-size: 14px; + .loadmask > .placeholder > .columns { + width: 100%; + height: 100%; + display: inline-block; + background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0, + linear-gradient(rgba(0,255,0,0) 19px, #d5d5d5 20px) 0 0, + linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x; + background-size: 80px 20px; } - .loader-page-text-customer { - font-size: 16px; - margin-bottom: 5px; + .loadmask > .placeholder > .columns:first-child { + background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0; + background-size: 20px 20px; + width: 35px; } - .romb { - width: 40px; - height: 40px; - -webkit-transform: rotate(135deg) skew(20deg, 20deg); - -moz-transform: rotate(135deg) skew(20deg, 20deg); - -ms-transform: rotate(135deg) skew(20deg, 20deg); - -o-transform: rotate(135deg) skew(20deg, 20deg); - position: absolute; - background: red; - border-radius: 6px; - -webkit-animation: movedown 3s infinite ease; - -moz-animation: movedown 3s infinite ease; - -ms-animation: movedown 3s infinite ease; - -o-animation: movedown 3s infinite ease; - animation: movedown 3s infinite ease; + @keyframes flickerAnimation { + 0% { opacity:1; } + 50% { opacity:0.3; } + 100% { opacity:1; } } - - #blue { - z-index: 3; - background: #55bce6; - -webkit-animation-name: blue; - -moz-animation-name: blue; - -ms-animation-name: blue; - -o-animation-name: blue; - animation-name: blue; + @-o-keyframes flickerAnimation{ + 0% { opacity:1; } + 50% { opacity:0.3; } + 100% { opacity:1; } } - - #red { - z-index:1; - background: #de7a59; - -webkit-animation-name: red; - -moz-animation-name: red; - -ms-animation-name: red; - -o-animation-name: red; - animation-name: red; + @-moz-keyframes flickerAnimation{ + 0% { opacity:1; } + 50% { opacity:0.3; } + 100% { opacity:1; } } - - #green { - z-index: 2; - background: #a1cb5c; - -webkit-animation-name: green; - -moz-animation-name: green; - -ms-animation-name: green; - -o-animation-name: green; - animation-name: green; - } - - @-webkit-keyframes red { - 0% { top:120px; background: #de7a59; } - 10% { top:120px; background: #F2CBBF; } - 14% { background: #f4f4f4; top:120px; } - 15% { background: #f4f4f4; top:0;} - 20% { background: #E6E4E4; } - 30% { background: #D2D2D2; } - 40% { top:120px; } - 100% { top:120px; background: #de7a59; } - } - - @keyframes red { - 0% { top:120px; background: #de7a59; } - 10% { top:120px; background: #F2CBBF; } - 14% { background: #f4f4f4; top:120px; } - 15% { background: #f4f4f4; top:0; } - 20% { background: #E6E4E4; } - 30% { background: #D2D2D2; } - 40% { top:120px; } - 100% { top:120px; background: #de7a59; } - } - - @-webkit-keyframes green { - 0% { top:110px; background: #a1cb5c; opacity:1; } - 10% { top:110px; background: #CBE0AC; opacity:1; } - 14% { background: #f4f4f4; top:110px; opacity:1; } - 15% { background: #f4f4f4; top:0; opacity:1; } - 20% { background: #f4f4f4; top:0; opacity:0; } - 25% { background: #EFEFEF; top:0; opacity:1; } - 30% { background:#E6E4E4; } - 70% { top:110px; } - 100% { top:110px; background: #a1cb5c; } - } - - @keyframes green { - 0% { top:110px; background: #a1cb5c; opacity:1; } - 10% { top:110px; background: #CBE0AC; opacity:1; } - 14% { background: #f4f4f4; top:110px; opacity:1; } - 15% { background: #f4f4f4; top:0; opacity:1; } - 20% { background: #f4f4f4; top:0; opacity:0; } - 25% { background: #EFEFEF; top:0; opacity:1; } - 30% { background:#E6E4E4; } - 70% { top:110px; } - 100% { top:110px; background: #a1cb5c; } - } - - @-webkit-keyframes blue { - 0% { top:100px; background: #55bce6; opacity:1; } - 10% { top:100px; background: #BFE8F8; opacity:1; } - 14% { background: #f4f4f4; top:100px; opacity:1; } - 15% { background: #f4f4f4; top:0; opacity:1; } - 20% { background: #f4f4f4; top:0; opacity:0; } - 25% { background: #f4f4f4; top:0; opacity:0; } - 45% { background: #EFEFEF; top:0; opacity:0.2; } - 100% { top:100px; background: #55bce6; } - } - - @keyframes blue { - 0% { top:100px; background: #55bce6; opacity:1; } - 10% { top:100px; background: #BFE8F8; opacity:1; } - 14% { background: #f4f4f4; top:100px; opacity:1; } - 15% { background: #f4f4f4; top:0; opacity:1; } - 20% { background: #f4f4f4; top:0; opacity:0; } - 25% { background: #f4f4f4; top:0; opacity:0; } - 45% { background: #EFEFEF; top:0; opacity:0.2; } - 100% { top:100px; background: #55bce6; } + @-webkit-keyframes flickerAnimation{ + 0% { opacity:1; } + 50% { opacity:0.3; } + 100% { opacity:1; } } @@ -246,21 +205,9 @@ else if ( lang == 'vi') loading = 'Đang tải...'; else if ( lang == 'zh') loading = '加载中...'; - if (!stopLoading) - document.write( - '
' + - '
' + - ((logo!==null) ? logo : - '
' + - '
' + - '
' + - '
' + - '
') + - '
' + - '
' + customer + - '
' + loading + '
' + - '
' + - '
'); + if (stopLoading) { + document.getElementById('loading-mask').remove(); + } @@ -270,7 +217,7 @@ - +
@@ -294,7 +241,7 @@ - + diff --git a/apps/spreadsheeteditor/main/resources/less/app.less b/apps/spreadsheeteditor/main/resources/less/app.less index a5d13d177..7b7d265b2 100644 --- a/apps/spreadsheeteditor/main/resources/less/app.less +++ b/apps/spreadsheeteditor/main/resources/less/app.less @@ -142,4 +142,35 @@ } @huge-icon-size: 37px; -@x-huge-icon-size: 45px; \ No newline at end of file +@x-huge-icon-size: 45px; + +// Skeleton of workbook + +.doc-placeholder { + background: #fbfbfb; + width: 100%; + height: 100%; + border: 1px solid #dfdfdf; + white-space: nowrap; + + -webkit-animation: flickerAnimation 2s infinite ease-in-out; + -moz-animation: flickerAnimation 2s infinite ease-in-out; + -o-animation: flickerAnimation 2s infinite ease-in-out; + animation: flickerAnimation 2s infinite ease-in-out; + + > .columns { + width: 100%; + height: 100%; + display: inline-block; + background: linear-gradient(90deg, #d5d5d5 0px, rgba(0,0,0,0) 1px) 0 0, + linear-gradient(rgba(0,255,0,0) 19px, #d5d5d5 20px) 0 0, + linear-gradient( #f1f1f1 0px, #f1f1f1 20px) 0 0 repeat-x; + background-size: 80px 20px; + + &:first-child { + background: linear-gradient(#f1f1f1 19px, #d5d5d5 20px) 0 0; + background-size: 20px 20px; + width: 35px; + } + } +} \ No newline at end of file