Files
awesome-piracy/index.html

73 lines
2.2 KiB
HTML
Raw Normal View History

2024-08-22 06:36:12 +06:00
<!doctype html>
2022-10-16 22:14:15 +06:00
<html lang="en">
<head>
2024-08-22 06:36:12 +06:00
<meta charset="utf-8">
2022-10-16 22:14:15 +06:00
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Awesome Piracy</title>
<link rel="stylesheet" href="">
2024-08-22 07:05:47 +06:00
<link rel="icon" href="rocket-takeoff.svg" type="image/svg+xml">
2022-10-16 22:14:15 +06:00
<style>
main
{
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
font-size: 16px;
line-height: 1.5;
width: 960px;
margin: auto;
}
select
{
position: fixed;
bottom: 0;
right: 0;
}
</style>
</head>
<body>
<select onchange="changeCSS( this.value )">
<option value="darkly">Darkly</option>
<option value="united">United</option>
<option value="flatly">Flatly</option>
<option value="quartz">Quartz</option>
</select>
<main></main>
<!-- JavaScript Library to Convert Markdown into HTML -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
2024-03-07 03:36:38 -05:00
2024-03-07 14:53:24 +06:00
<!-- Marked plugin to add heading ID's -->
2024-03-07 03:36:38 -05:00
<script src="https://cdn.jsdelivr.net/npm/marked-gfm-heading-id/lib/index.umd.js"></script>
2024-08-22 06:41:13 +06:00
2024-03-07 14:53:24 +06:00
<script>
2022-10-16 22:14:15 +06:00
// Basic Settings
const defaultTheme = 'darkly';
2025-12-29 17:36:39 +06:00
const bootswatchVersion = '5.3.8'; // Last updated: 29 December, 2025
2022-10-16 22:14:15 +06:00
// Update last one only when https://www.jsdelivr.com/package/npm/bootswatch is updated.
2025-12-29 17:37:46 +06:00
// Configure marked.js to use GitHub heading IDs to allow the contents list to function
2024-03-07 14:53:24 +06:00
marked.use( markedGfmHeadingId.gfmHeadingId() );
2024-03-07 03:36:38 -05:00
2024-03-07 14:53:24 +06:00
// Get the markdown file, convert it to HTML & put it inside the main tag
2022-10-16 22:14:15 +06:00
fetch( 'https://raw.githubusercontent.com/Shakil-Shahadat/awesome-piracy/main/Readme.md' )
.then( response => response.text() )
.then( data => {
data = data.replaceAll( ':star2:', '<img src="https://github.githubassets.com/images/icons/emoji/unicode/1f31f.png?v8" width="20">' );
document.querySelector( 'main' ).innerHTML = marked.parse( data );
})
.catch( error => console.error( 'Error:', error ) );
// Change the theme
function changeCSS( theme )
{
document.querySelector( 'link' ).href
= `https://cdn.jsdelivr.net/npm/bootswatch@${bootswatchVersion}/dist/${theme}/bootstrap.min.css`;
}
// Set the default theme
changeCSS( defaultTheme );
</script>
</body>
2024-03-07 14:53:24 +06:00
</html>