generated from nhcarrigan/template
feat: convert to an astro application (!9)
Reviewed-on: https://codeberg.org/nhcarrigan/docs/pulls/9 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
67
src/pages/index.astro
Normal file
67
src/pages/index.astro
Normal file
@ -0,0 +1,67 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
We used to use Docsify, so rather than breaking links we borrowed this from freeCodeCamp
|
||||
to make our things work.
|
||||
-->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const { hash } = window.location;
|
||||
if (!hash || hash === '#/' || hash === '#') {
|
||||
window.location.replace('/intro');
|
||||
return;
|
||||
}
|
||||
if (hash === "#/coc") {
|
||||
window.location.replace('/community/coc');
|
||||
return;
|
||||
}
|
||||
if (hash === "#/coc") {
|
||||
window.location.replace('/community/coc');
|
||||
return;
|
||||
}
|
||||
if (hash === "#/coc") {
|
||||
window.location.replace('/community/coc');
|
||||
return;
|
||||
}
|
||||
if (hash === "#/coc") {
|
||||
window.location.replace('/community/coc');
|
||||
return;
|
||||
}
|
||||
if (hash.startsWith('#/')) {
|
||||
const [newPath, newHash] = hash.slice(2).split('?id=');
|
||||
window.location.replace(
|
||||
newHash ? `/${newPath}/#${newHash}` : `/${newPath}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
window.location.replace('/intro');
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.loader {
|
||||
border: 8px solid #0a0a23;
|
||||
border-top: 8px solid #f3f3f3;
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
animation: spin 2s linear infinite;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class='loader'></div>
|
Reference in New Issue
Block a user