mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Implemented custom progress bar.
CEF won't animate the `<progress>` value pseudo-element, though it works fine in Chrome, so I had to roll my own. Part of #246.
This commit is contained in:
@@ -419,12 +419,16 @@ input:valid {
|
||||
box-shadow:0 0 3px 0px rgba(0,0,0,0.5);
|
||||
padding: 2px 5px;
|
||||
}
|
||||
progress {
|
||||
progress, .progress {
|
||||
/* Reset the default appearance */
|
||||
-webkit-appearance: none;
|
||||
width: 250px;
|
||||
height: 20px;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#progressDialog > h1 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
@-webkit-keyframes indeterminate {
|
||||
@@ -432,11 +436,16 @@ progress {
|
||||
100% { width: 100% }
|
||||
}
|
||||
|
||||
progress::-webkit-progress-bar {
|
||||
progress::-webkit-progress-bar, .progress.bar {
|
||||
background-color: #eee;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
|
||||
}
|
||||
progress::-webkit-progress-value {
|
||||
-webkit-animation: indeterminate 5s linear 0 infinite alternate;
|
||||
progress::-webkit-progress-value, .progress .value {
|
||||
height: 100%;
|
||||
background-color: green;
|
||||
-webkit-animation: indeterminate 2s linear 0 infinite alternate paused;
|
||||
}
|
||||
#progressDialog[open] > .progress > .value {
|
||||
-webkit-animation-play-state: running;
|
||||
}
|
||||
@@ -759,7 +759,7 @@ function updateProgressDialog(message) {
|
||||
progressDialog.getElementsByTagName('h1')[0].textContent = message;
|
||||
}
|
||||
function sortPlugins(evt) {
|
||||
updateProgressDialog('LOOT Working...');
|
||||
updateProgressDialog('Sorting plugins...');
|
||||
toggleProgressDialog();
|
||||
if (loot.settings.updateMasterlist) {
|
||||
updateMasterlist(evt);
|
||||
|
||||
@@ -566,8 +566,13 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
<div id="hoverText" class="hidden"></div>
|
||||
<dialog id="progressDialog">
|
||||
<progress></progress>
|
||||
<h1></h1>
|
||||
<!-- CEF doesn't seem to want to play any animation set through CSS
|
||||
for <progress>'s internal value pseudo-element, so use this
|
||||
instead. -->
|
||||
<div class="progress bar">
|
||||
<div class="value"></div>
|
||||
</div>
|
||||
<h1>Calculating the last digit of π...</h1>
|
||||
</dialog>
|
||||
|
||||
<script src="js/script.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user