Files

155 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UFC Calendar</title>
<link rel="icon" type="image/x-icon" href="./src/assets/favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter&display=swap"
rel="stylesheet"
/>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
background-color: rgb(243, 243, 243);
font-family: "Inter", sans-serif;
}
.calendar-type-selector {
margin: 20px 0;
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
}
.calendar-type-selector label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
font-size: 16px;
line-height: 1;
}
.calendar-type-selector input[type="radio"] {
cursor: pointer;
width: 18px;
height: 18px;
margin: 0;
}
.links {
margin: 40px 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 16px;
}
.sub-link {
display: flex;
flex-direction: column;
align-items: center;
row-gap: 16px;
background-color: white;
border-radius: 8px;
box-shadow: 0px 4px 12px -3px rgba(0, 0, 0, 0.2);
padding: 16px 32px;
text-decoration: none;
color: inherit;
transition: 0.3s;
}
.sub-link:hover {
box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.2);
}
.sub-link img {
width: 80px;
height: 80px;
}
.sub-manual {
margin-bottom: 40px;
max-width: 100%;
}
.code-wrapper {
background-color: white;
padding: 2px 6px;
border: 1px solid lightgray;
border-radius: 4px;
}
code {
overflow-wrap: break-word;
max-width: 100%;
}
</style>
</head>
<body>
<h1>Subscribe to this calendar to keep track of UFC events</h1>
<div class="calendar-type-selector">
<label>
<input
type="radio"
name="calendar-type"
value="all"
checked
onchange="updateCalendarLinks('all')"
/>
<span>All UFC Events</span>
</label>
<label>
<input
type="radio"
name="calendar-type"
value="ppv"
onchange="updateCalendarLinks('ppv')"
/>
<span>PPV Events Only</span>
</label>
</div>
<div class="links">
<a
class="sub-link"
id="apple-link"
href="webcal://raw.githubusercontent.com/clarencechaan/ufc-cal/ics/UFC.ics"
><img src="./src/assets/apple.svg" alt="apple" />
<div>Apple</div>
</a>
<a
class="sub-link"
id="google-link"
href="https://calendar.google.com/calendar/u/0/r?cid=webcal://raw.githubusercontent.com/clarencechaan/ufc-cal/ics/UFC.ics"
><img src="./src/assets/google.svg" alt="google" />
<div>Google</div>
</a>
</div>
<div class="sub-manual">
<p>Or subscribe manually from your calendar app using this URL:</p>
<div class="code-wrapper">
<code id="manual-url"
>webcal://raw.githubusercontent.com/clarencechaan/ufc-cal/ics/UFC.ics</code
>
</div>
</div>
<p>Maintained by Clarence Chan</p>
<p>
<a href="https://github.com/clarencechaan/ufc-cal"
>Source code on GitHub</a
>
</p>
<script>
function updateCalendarLinks(type) {
const filename = type === "ppv" ? "UFC-PPV.ics" : "UFC.ics";
const baseUrl =
"webcal://raw.githubusercontent.com/clarencechaan/ufc-cal/ics/";
const fullUrl = baseUrl + filename;
document.getElementById("apple-link").href = fullUrl;
document.getElementById("google-link").href =
"https://calendar.google.com/calendar/u/0/r?cid=" + fullUrl;
document.getElementById("manual-url").textContent = fullUrl;
}
</script>
</body>
</html>