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:
WrinklyNinja
2014-08-26 23:22:27 +01:00
parent e1a186b8ac
commit 86b81dcafd
3 changed files with 21 additions and 7 deletions
+13 -4
View File
@@ -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;
}
+1 -1
View File
@@ -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);
+7 -2
View File
@@ -566,8 +566,13 @@ along with LOOT. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<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 &pi;...</h1>
</dialog>
<script src="js/script.js"></script>