<link rel="icon" href="dist/logo.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <script>
+ var VERSION=2.1;
+ </script>
<style>
.loader {
position: absolute;
100% { transform: rotate(360deg); }
}
</style>
-
+
</head>
<body>
<div class="loader"></div>
<div class="container" style="display:none">
+ <div id="notify" style="position:fixed;margin:10px;z-index:2;display:none">
+ <div id="notify-alert" class="alert alert-info alert-dismissible">
+ <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
+ <h4><span id="notify-text"></span> <a id="notify-link" href="#" class="btn btn-success btn-lg">Download</a></h4>
+ </div>
+ </div>
<div class="text-primary">
<div class="jumbotron">
<h1>ObsCalc</h1>
}, 1000);
}
});
+
+ //Notifications
+ $(window).resize(function(){
+ $("#notify").width($(".container").width()-20);
+ });
+ $(window).scroll(function(){
+ $("#notify").width($(".container").width()-20);
+ });
+ $.get("https://code.agnibho.com/obscalc/info.json", function(data){
+ if(data.latest > VERSION){
+ $("#notify").slideDown();
+ $("#notify").width($(".container").width()-20);
+ $("#notify-text").text("A new version of ObsCalc is available.");
+ if(document.URL.indexOf("http://")==-1 && document.URL.indexOf("https://")==-1){
+ if(/(android)/i.test(navigator.userAgent)){
+ $("#notify-link").attr("href", data.apk);
+ $("#notify-link").text("Download");
+ }
+ else{
+ $("#notify-link").attr("href", data.url);
+ $("#notify-link").text("Load");
+ }
+ }
+ else{
+ $("#notify-link").attr("href", data.url);
+ $("#notify-link").text("Load");
+ }
+ }
+ else if(document.URL.indexOf("http://")!=-1 || document.URL.indexOf("https://")!=-1){
+ if(/(android)/i.test(navigator.userAgent)){
+ $("#notify").slideDown();
+ $("#notify").width($(".container").width()-20);
+ $("#notify-text").text("");
+ $("#notify-link").attr("href", data.apk);
+ $("#notify-link").text("Download for Android");
+ }
+ }
+ });
});