Last active
October 4, 2024 21:33
-
-
Save rsegecin/cc3e0257209a0613ba3f539acce6a360 to your computer and use it in GitHub Desktop.
Progress indicator for flutter web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<base href="$FLUTTER_BASE_HREF"> | |
<meta charset="UTF-8"> | |
<meta content="IE=Edge" http-equiv="X-UA-Compatible"> | |
<meta name="description" | |
content="ChampionsGoal is a dynamic social network dedicated to sports enthusiasts, where users can connect with fellow players, form teams, organize and join games, and find and reserve sports fields."> | |
<meta name="computer-engineer" content="https://github.com/rsegecin" /> | |
<meta name="google-signin-client_id" | |
content="[your_client_id]"> | |
<!-- iOS meta tags & icons --> | |
<meta name="mobile-web-app-capable" content="yes"> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | |
<meta name="apple-mobile-web-app-title" content="ChampionsField"> | |
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png"> | |
<!-- Favicon --> | |
<link rel="icon" type="image/png" href="icons/favicon.ico" /> | |
<title>ChampionsField</title> | |
<link rel="manifest" href="manifest.json"> | |
<script> | |
// The value below is injected by flutter build, do not touch. | |
var serviceWorkerVersion = '{{flutter_service_worker_version}}'; | |
</script> | |
<script src="assets/packages/libphonenumber_plugin/js/stringbuffer.js"></script> | |
<style> | |
.loading { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
margin: 0; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
-ms-transform: translate(-50%, -50%); | |
transform: translate(-50%, -50%); | |
color: black | |
} | |
.progress-bar__container { | |
width: 100%; | |
height: 1.5rem; | |
border-radius: .35rem; | |
position: relative; | |
overflow: hidden; | |
transition: all 0.5s; | |
will-change: transform; | |
box-shadow: 0 0 5px #fbcc34; | |
} | |
.progress-bar { | |
position: absolute; | |
height: 100%; | |
width: 100%; | |
content: ""; | |
background-color: #fbcc34; | |
top: 0; | |
bottom: 0; | |
left: -100%; | |
border-radius: inherit; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
color: white; | |
font-family: sans-serif; | |
} | |
.progress-bar__text { | |
display: none; | |
} | |
</style> | |
</head> | |
<body style="background-color: #1E1E1E;"> | |
<script src="flutter_bootstrap.js" async></script> | |
<div class="loading"> | |
<div> | |
<img src="img/chosen.png" style="width: 250px;" /><br /> | |
<div style="height: 15px;"></div> | |
<div class="container"> | |
<div class="progress-bar__container"> | |
<div class="progress-bar"> | |
<span class="progress-bar__text"> | |
<div id="loading"></div> | |
</span> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script> | |
var scriptLoaded = false; | |
function initMap() { | |
console.log("Maps ready to load"); | |
} | |
function getRelease() { | |
var release = document.querySelector('meta[name="RELEASE_NAME"]'); | |
return (release != null) ? release.content : ""; | |
} | |
function getVersion() { | |
var appversion = document.querySelector('meta[name="APP_VERSION"]'); | |
return (appversion != null) ? appversion.content : ""; | |
} | |
function updateProgress(num) { | |
const progressBar = document.querySelector('.progress-bar'); | |
progressBar.style.transformOrigin = 'center'; | |
progressBar.style.transition = 'transform 5s'; | |
setTimeout(() => { | |
progressBar.style.transform = 'translateX(250px)'; | |
}, 10); | |
} | |
updateProgress(100); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment