view music.html @ 45:e44fb9a05998

why does this work? committer: GitHub <noreply@github.com>
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Thu, 28 Jul 2022 20:09:49 -0400
parents 24b2d0a480d3
children 44b4ca6897f4
line wrap: on
line source

<!DOCTYPE html>
<head>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico?">
    <!-- <script src="https://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap/js/bootstrap.min.js"></script> -->
	<script>
		window['libopenmpt'] = {};

		libopenmpt.locateFile = function(filename) {
			return "./js/" + filename;
		};

		libopenmpt.onRuntimeInitialized = function() {
			var player;

			function init() {
				if (player == undefined) {
					player = new ChiptuneJsPlayer(new ChiptuneJsConfig(-1, 100, 1));
				} else {
					player.stop();
				}
			}

			function afterLoad(path, buffer) {
				player.play(buffer);
				setMetadata(path);
			}

			function loadURL(path) {
				init();
				player.load(path, afterLoad.bind(this, path));
			}

			function setMetadata(filename) {
				var metadata = player.metadata();
				if (metadata['title'] != '') {
					document.getElementById('title').innerHTML = metadata['title'];
				} else {
					document.getElementById('title').innerHTML = filename;
				}
			}

			function pauseButton() {
				player.togglePause();
			}

			document.querySelector('#playpause').addEventListener('click', pauseButton, false);
			document.querySelectorAll('.song').forEach(function(e) {
				e.addEventListener('click', function(evt) {
					loadURL(evt.target.getAttribute("data-modurl"));
				}, false);
			});
		};
	</script>
	<script type="application/javascript" src="//cdn.jsdelivr.net/gh/deskjet/chiptune2.js@a97e04cc7e98924f6ad17980d6eeca3f764378b5/chiptune2.js"></script>
	<script type="application/javascript" src="./js/libopenmpt.js"></script>
	<title>Music - Paper's website</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<style>
		@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300&display=swap');
		.navbar {
			background: linear-gradient(to bottom, rgba(255,255,255,0.1) 25%, rgba(0,0,0,0) 100%);
			text-align: left; /* Override body text align */
		}
		body {
			background-size: cover;
			background: url("forest.png") no-repeat center center fixed;
			color: white;
			font-family: 'Source Sans 3', sans-serif;
			text-align: center;
			text-shadow: 5px 0 10px rgba(0, 0, 0, 0.5);
		}
		div.box {
			background-color: rgba(0, 0, 0, 0.7);
			box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5) inset;
			color: white;
			left: 0;
			margin: 1% auto;
			max-width: 500px;
			padding: 10px;
			right: 0;
			text-align: center;
			top: 50%;
		}
		a:link, a:visited, a:hover, a:active {
			color: #ff6600;
		}
	</style>
</head>
<body>
    <div class="navbar-wrapper">
		<div class="container" style="width: 100%-2%;margin-top:1%;">
			<div class="navbar navbar-inverse" style="box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5)">
				<div class="navbar-inner">
					<a class="brand" href="#">Paper's website</a>
					<ul class="nav">
						<li><a href="./">Home</a></li>
						<li class="active"><a href="#">Music</a></li>
						<li><a href="projects.html">Projects</a></li>
						<li><a href="blog/">Blog</a></li>
					</ul>
				</div>
			</div>
		</div>
    </div>
	<h1>Music</h1>
	<div class="box">
		<p>Now playing:</p>
		<p id="title">nothing loaded</p>
		<button type="button" class="btn btn-primary" id="playpause">Play/Pause</button>
	</div>
	<div class="box">
		<h2>Originals</h2>
			<p><a href="#" class="song" data-modurl="music/paper_-_old_desk_tribute.xm">Old Desk Tribute [.XM]</a>&nbsp;<a href="music/paper_-_old_desk_tribute.xm">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_chippygolucky.xm">Chippy-Go-Lucky [.XM]</a>&nbsp;<a href="music/paper_-_chippygolucky.xm">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_whistling_meadows.it">Whistling Meadows [.IT]</a>&nbsp;<a href="music/paper_-_whistling_meadows.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_shartlover.s3m">xX ShartLover1337 Xx [.S3M]</a>&nbsp;<a href="music/paper_-_shartlover.s3m">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_reaching_the_world_border.it">Reaching the World Border [.IT]</a>&nbsp;<a href="music/paper_-_reaching_the_world_border.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_sarta.mptm">THIS IS SARTA [.MPTM]</a>&nbsp;<a href="music/paper_-_sarta.mptm">(Download)</a></p>
	</div>
	<div class="box">
		<h2>Covers</h2>
			<p><a href="#" class="song" data-modurl="music/paper_-_tintin_on_the_moon.mod">TinTin on the Moon [.MOD]</a>&nbsp;<a href="music/paper_-_tintin_on_the_moon.mod">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_dance_in_the_universe_cover.mod">Dance in the universe cover [.MOD]</a>&nbsp;<a href="music/paper_-_dance_in_the_universe_cover.mod">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_bob-omb_battlefield_remix.it">Super Mario 64 - Bob-omb Battlefield Remix [.IT]</a>&nbsp;<a href="music/paper_-_bob-omb_battlefield_remix.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_point_of_no_hi-score.it">(mashup) Drax - Tiger Mission Hi-score + ESCHATOS OST - Point of No Return [.IT]</a>&nbsp;<a href="music/paper_-_point_of_no_hi-score.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_vrc6n001_remake.it">(remake) Naruto - VRC6N001 [.IT]</a>&nbsp;<a href="music/paper_-_vrc6n001_remake.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_hip_shop.it">Deltarune - Hip Shop [.IT]</a>&nbsp;<a href="music/paper_-_hip_shop.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_nerou.it">ziner - Flatwoods Monster [.IT]</a>&nbsp;<a href="music/paper_-_nerou.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_drip.xm">Leonz - Among Us Drip Theme [.XM]</a>&nbsp;<a href="music/paper_-_drip.xm">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_3005.it">Childish Gambino - 3005 [.IT]</a>&nbsp;<a href="music/paper_-_3005.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_infinity.it">Cho Ren Sha 68k - Infinity [.IT]</a>&nbsp;<a href="music/paper_-_infinity.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_bestending.it">Aphex Twin - Avril 14th [.IT]</a>&nbsp;<a href="music/paper_-_bestending.it">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_visitors.xm">KOTO - Visitors [.XM]</a>&nbsp;<a href="music/paper_-_visitors.xm">(Download)</a></p>
			<p><a href="#" class="song" data-modurl="music/paper_-_vrc6n001.it">Naruto - VRC6N001 [.IT]</a>&nbsp;<a href="music/paper_-_vrc6n001.it">(Download)</a></p>
	</div>
</body>