wulkanowy.github.io/index.html
Mikołaj Pich 8673aea296 Fix id
2018-05-02 19:48:23 +02:00

140 lines
5.1 KiB
HTML

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico?v=1">
<title>Wulkanowy</title>
<style>
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
html, body, .wrapper {
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}
body {
background: url(wallpaper.jpg) no-repeat center / cover fixed;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.wrapper {
align-items: center;
background: -moz-radial-gradient(center center, circle cover, transparent, #000);
background: -ms-radial-gradient(center center, circle cover, transparent, #000);
background: -webkit-radial-gradient(center center, circle cover, transparent, #000);
background: radial-gradient(center center, circle cover, transparent, #000);
display: flex;
flex-direction: column;
justify-content: center;
}
.header__title {
color: #fff;
font-size: 60px;
font-size: calc(50px + 16 * (100vw - 320px) / (960 - 320));
font-weight: normal;
text-align: center;
text-shadow: #000 5px 5px 5px;
}
.main {
margin: 0 0 50px;
text-align: center;
}
.button {
width: 100%;
max-width: 300px;
margin: 10px 0;
background: rgb(112, 50, 50);
border-radius: 3px;
color: #eee;
display: inline-block;
font-size: 25px;
padding: 15px 25px;
text-decoration: none;
transition: background 0.3s;
}
.button--nightly {
background: #333;
}
.button:hover, .button:focus, .button:active {
background: rgb(90, 45, 45);
}
.github {
transition: opacity 0.3s;
}
.github:hover, .github:focus, .github:active {
opacity: 0.7;
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-99646499-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-99646499-3');
</script>
</head>
<body>
<section class="wrapper">
<header id="header" class="header">
<h1 class="header__title">Wulkanowy</h1>
</header>
<main id="main" class="main">
<a
id="beta-button"
title="Pobierz wersję beta"
href="https://github.com/wulkanowy/wulkanowy/releases"
class="button button--beta"
>Pobierz wersję beta<br>
<span id="beta-version">0.0.0</span>
</a>
<a
id="alfa-button"
title="Pobierz wersję nightly"
href="https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk"
class="button button--nightly"
>Pobierz wersję nightly<br>
<span id="alfa-version">000</span>
</a>
</main>
<footer id="footer" class="footer">
<a
title="Zobacz repozytorium na Githubie"
href="https://github.com/wulkanowy/wulkanowy"
class="github">
<img src="./github.svg" alt="Zobacz repozytorium na Githubie">
</a>
</footer>
</section>
<script>
const disableClick = e => e.preventDefault();
const betaButton = document.querySelector("#beta-button");
betaButton.addEventListener("click", disableClick);
fetch("https://api.github.com/repos/wulkanowy/wulkanowy/releases/latest")
.then(res => { return res.json() })
.then(json => {
betaButton.removeEventListener("click", disableClick);
betaButton.href = json.assets[0].browser_download_url;
document.querySelector("#beta-version").innerHTML = json.name;
});
const alfaButton = document.querySelector("#alfa-button")
alfaButton.addEventListener("click", disableClick);
fetch("https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk/info")
.then(res => { return res.json() })
.then(json => {
alfaButton.removeEventListener("click", disableClick);
alfaButton.href = json.url;
document.querySelector("#alfa-version").innerHTML = json.latestVersionCode;
});
</script>
</body>
</html>