mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 10:39:57 +00:00
Fetch releases from GitHub API
This commit is contained in:
@@ -103,6 +103,11 @@ body {
|
|||||||
color: var(--text-color-secondary);
|
color: var(--text-color-secondary);
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
.discription__prerelease {
|
||||||
|
color: var(--red-50);
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
.description p {
|
.description p {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
@@ -140,6 +145,14 @@ body {
|
|||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-list__app-label {
|
||||||
|
color: var(--blue-40);
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-variant: small-caps;
|
||||||
|
margin-left: 5px;
|
||||||
|
vertical-align: super;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.preview {
|
.preview {
|
||||||
grid-area: preview;
|
grid-area: preview;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
<link rel="stylesheet" href="photon-colors.css">
|
<link rel="stylesheet" href="photon-colors.css">
|
||||||
<link rel="stylesheet" href="photon.css">
|
<link rel="stylesheet" href="photon.css">
|
||||||
<link rel="stylesheet" href="index.css">
|
<link rel="stylesheet" href="index.css">
|
||||||
|
|
||||||
|
<script src="index.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -18,30 +20,36 @@
|
|||||||
<main class="main-content">
|
<main class="main-content">
|
||||||
<section class="description">
|
<section class="description">
|
||||||
<p>
|
<p>
|
||||||
Enables Chromecast support for casting web apps (like Netflix, YouTube or BBC iPlayer), HTML5 video and screen/tab sharing.
|
Enables Chromecast support for casting web apps (like Netflix, <s>YouTube</s> or BBC iPlayer), HTML5 video and screen/tab sharing.
|
||||||
</p>
|
</p>
|
||||||
<p class="discription__disclaimer">
|
<p class="discription__disclaimer">
|
||||||
Requires a native bridge app to connect with receiver devices. Currently supported on Windows, macOS and Linux.
|
Requires a native bridge app to connect with receiver devices. Currently supported on Windows, macOS and Linux.
|
||||||
<br><br>
|
</p>
|
||||||
<strong>No public full release yet!</strong>
|
<p class="discription__prerelease">
|
||||||
|
No full public release yet! Pre-release beta version is incomplete and likely buggy.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section class="download">
|
<section class="download">
|
||||||
<a class="download__ext btn btn--puffy btn--primary" href="#" disabled>
|
<a class="download__ext btn btn--puffy btn--primary" disabled title="No available download found">
|
||||||
<img class="btn__icon" src="icons/extension_light.svg" alt="">
|
<img class="btn__icon" src="icons/extension_light.svg" alt="">
|
||||||
Firefox Extension
|
Firefox Extension
|
||||||
</a>
|
</a>
|
||||||
<div class="download__app">
|
<div class="download__app">
|
||||||
<div class="app-list">
|
<div class="app-list">
|
||||||
<div class="app-list__label">Bridge:</div>
|
<div class="app-list__label">Bridge:</div>
|
||||||
<a class="app-list__app btn btn--puffy" href="#" disabled>
|
<a class="app-list__app app-list__win btn btn--puffy" disabled title="No available download found">
|
||||||
|
Windows
|
||||||
|
</a>
|
||||||
|
<a class="app-list__app app-list__mac btn btn--puffy" disabled title="No available download found">
|
||||||
macOS
|
macOS
|
||||||
</a>
|
</a>
|
||||||
<a class="app-list__app btn btn--puffy" href="#" disabled>
|
<a class="app-list__app app-list__deb btn btn--puffy" disabled title="No available download found">
|
||||||
Linux
|
Linux
|
||||||
|
<span class="app-list__app-label">deb</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="app-list__app btn btn--puffy" href="#" disabled>
|
<a class="app-list__app app-list__rpm btn btn--puffy" disabled title="No available download found">
|
||||||
Windows
|
Linux
|
||||||
|
<span class="app-list__app-label">rpm</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
56
docs/index.js
Normal file
56
docs/index.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
const ENDPOINT_URL = "https://api.github.com/repos/hensm/fx_cast/releases/14720978";
|
||||||
|
|
||||||
|
fetch(ENDPOINT_URL)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(onResponse)
|
||||||
|
.catch(onError);
|
||||||
|
|
||||||
|
function onResponse (res) {
|
||||||
|
for (const asset of res.assets) {
|
||||||
|
const { browser_download_url } = asset;
|
||||||
|
|
||||||
|
// Ext download button
|
||||||
|
const downloadExtBtn = document.querySelector(".download__ext");
|
||||||
|
|
||||||
|
// App download buttons
|
||||||
|
const appListMacBtn = document.querySelector(".app-list__mac");
|
||||||
|
const appListDebBtn = document.querySelector(".app-list__deb");
|
||||||
|
const appListRpmBtn = document.querySelector(".app-list__rpm");
|
||||||
|
|
||||||
|
|
||||||
|
switch (asset.name.match(/.*\.(.*)$/).pop()) {
|
||||||
|
case "xpi":
|
||||||
|
downloadExtBtn.href = browser_download_url;
|
||||||
|
downloadExtBtn.removeAttribute("disabled");
|
||||||
|
downloadExtBtn.removeAttribute("title");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "exe":
|
||||||
|
appListWinBtn.href = browser_download_url;
|
||||||
|
appListWinBtn.removeAttribute("disabled");
|
||||||
|
appListWinBtn.removeAttribute("title");
|
||||||
|
break;
|
||||||
|
case "pkg":
|
||||||
|
appListMacBtn.href = browser_download_url;
|
||||||
|
appListMacBtn.removeAttribute("disabled");
|
||||||
|
appListMacBtn.removeAttribute("title");
|
||||||
|
break;
|
||||||
|
case "deb":
|
||||||
|
appListDebBtn.href = browser_download_url;
|
||||||
|
appListDebBtn.removeAttribute("disabled");
|
||||||
|
appListDebBtn.removeAttribute("title");
|
||||||
|
break;
|
||||||
|
case "rpm":
|
||||||
|
appListRpmBtn.href = browser_download_url;
|
||||||
|
appListRpmBtn.removeAttribute("disabled");
|
||||||
|
appListRpmBtn.removeAttribute("title");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onError (err) {
|
||||||
|
console.error("Failed to fetch download links");
|
||||||
|
}
|
||||||
@@ -71,6 +71,7 @@ select.btn:-moz-focusring {
|
|||||||
.btn[disabled] {
|
.btn[disabled] {
|
||||||
background-color: var(--btn-bg) !important;
|
background-color: var(--btn-bg) !important;
|
||||||
box-shadow: initial;
|
box-shadow: initial;
|
||||||
|
cursor: default;
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user