windhamdavid 5 years ago
parent
commit
6453b50e27
4 changed files with 54 additions and 50 deletions
  1. 8 13
      css/player.css
  2. 0 1
      functions.php
  3. 27 1
      js/last.fm.js
  4. 19 35
      page-music.php

+ 8 - 13
css/player.css

@@ -1,5 +1,3 @@
-/* @override http://macs.local/david/wp-content/themes/dw/css/jplayer.css */
-
 div.jp-audio-stream {
 	background: #eee;
 	padding: 2px;
@@ -44,15 +42,14 @@ div.jp-current-time {
 }
 
 div#player-container{
-	width: 350px;
+	width: 100%;
 }
 
 div#player{
 	padding: 20px;
 	height: 50px;
-	width: 220px;
+	width: 250px;
 	background-color: white;
-	float: left;
 	color: #555555;
 }
 #song-information{
@@ -61,9 +58,8 @@ div#player{
 	text-align: left;
 }
 #controls{
-	width: 50%;
 	float: left;
-	text-align: right;
+	text-align: left;
 }
 div#amplitude-album-art{
 	height: 90px;
@@ -71,13 +67,11 @@ div#amplitude-album-art{
 	background-color: black;
 	float: left;
 }
-div#amplitude-album-art img{
-	height: 90px;
-	width: 90px;
-}
+
 #amplitude-play-pause{
     width: 15px;
     height: 17px;
+    margin: 0 5px 0 0;
     cursor: pointer;
     float: right;
 }
@@ -90,7 +84,8 @@ div#amplitude-album-art img{
     background-repeat: no-repeat;
 }
 #amplitude-volume-slider{
-	width: 100%;
+	width: 80%;
+	float: right;
 }
 #amplitude-now-playing-name{
 	font-family: 'PT Sans', sans-serif;
@@ -104,6 +99,6 @@ div#amplitude-album-art img{
 }
 #amplitude-current-time{
 	font-family: 'PT Sans', sans-serif;
-	font-size: 10px;
+	font-size: 14px;
 	font-weight: 400;
 }

+ 0 - 1
functions.php

@@ -68,7 +68,6 @@ function dw_scripts() {
 		//wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/script-o.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'init-o', get_template_directory_uri() . '/js/init-o.js', 'jquery', '', true );
 		//wp_enqueue_script( 'init', get_template_directory_uri() . '/js/init-o.min.js', 'jquery', '', true );
-		//wp_enqueue_script( 'jplayer', get_template_directory_uri() . '/js/jplayer.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'jplayer', get_template_directory_uri() . '/js/amp.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'chart', get_template_directory_uri() . '/js/chart.min.js', 'jquery', '', true );
 		wp_enqueue_script( 'last-fm', get_template_directory_uri() . '/js/last.fm.js', 'jquery', '', true );

+ 27 - 1
js/last.fm.js

@@ -558,6 +558,32 @@ $('.music-typed').waypoint(function() {
 	
 })( jQuery );
 
+/* =======  SAVE FOR LATER Icecast 2.4 upgrade to fix CORs headers @ http://64.207.154.37:8008/status2.xsl ========
+(function($){
+	$.fn.icecast = function(options){
+		$.ajaxSetup({
+			cache:true,
+			scriptCharset:"utf-8",
+			contentType:"text/json;charset=utf-8"
+		});
+		var defaults = {
+			server:"",
+			stationlogo:""
+		};
+		var options = $.extend(defaults,options);
+		return this.each(function(){var icecast = $(this);
+			$.getJSON('http://'+options.server+'/status2.xsl',
+			function(data){$.each(data.mounts,function(i,mount){
+				$(icecast).append('<li class="mount"><div class="track">'+mount.title+'</div><div class="listeners">Listeners: '+mount.listeners+' at '+mount.bitrate+'kbps</div></li>');
+			});
+		});
+	});	
+};})(jQuery);
+
+$(function(){
+	$('.mounts').icecast({server:"64.207.154.37:8008"});
+});
+*/
 
 amplitude_config = {
 	"amplitude_songs": [
@@ -567,4 +593,4 @@ amplitude_config = {
 		}
 	],
 	"amplitude_volume": 100
-}
+}	

+ 19 - 35
page-music.php

@@ -81,7 +81,6 @@ get_header(); ?>
 						<div class="col-sm-12">
 							<div id="music-notes">
 								<p>&nbsp;</p>
-								<p><small><sup>*</sup>Note: 12 categories are limiting. Bluegrass is country, Rhythm and Blues includes Fats Domino and Mary J. Blige. Peter Tosh is World music. Brian Eno is somtimes ambient and sometimes electronic. I tagged alot of pop music as electronic when I hear very few real instruments. On the monthly chart, I've capped the play count at 200. </small></p>
 							</div>
 						</div>
 					</div>
@@ -99,33 +98,7 @@ get_header(); ?>
 					</div>
 					<div class="row">
 						<div class="col-sm-12">
-							<div id="player-container">
-								<div id="amplitude-album-art">
-									<img src="images/wtmj620.png"/>
-								</div>
-								<div id="player">
-									<div id="song-information">
-										<span id="amplitude-now-playing-name"></span><br>
-										<span id="amplitude-now-playing-album"></span>
-									</div>
-								<div id="controls">
-									<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
-										<span id="amplitude-current-time">0:00</span>
-									</div>
-									<input class="bar" type="range" id="amplitude-volume-slider" value="0"/>
-								</div>
-							</div>
-										
-							<div id="jplayer" class="jp-jplayer"></div>
-							<div id="jp_container_1" class="jp-audio-stream">
-								<div class="jp-gui jp-interface">
-									<ul class="jp-controls">
-										<li><a href="javascript:;" title="play" class="jp-play" tabindex="1">play</a></li>
-										<li><a href="javascript:;" title="pause" class="jp-pause" tabindex="1">pause</a></li>
-									</ul>
-									<div class="jp-current-time"></div>
-								</div>
-							</div>
+
 						</div>
 					</div>
 					
@@ -147,7 +120,8 @@ get_header(); ?>
 							            $artist = $track->artist;
 							            $songname = $track->name;
 										$albumname = $track->album;
-							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . $artist . ' - ' . $songname  . ' : ' . $albumname;
+										$albumart = $track->album->image[2];
+							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . $artist . ' - ' . $songname;
 							        }
 							        else{
 							            return $this->noTrackPlayingMessage;
@@ -160,13 +134,23 @@ get_header(); ?>
 							$nowPlaying = new NowPlaying('windhamdavid', 'e12ea1d0253898ee9a93edfe42ffdeab');
 							?>
 							<h5 class="cm-type"><em>Now Playing</em></h5>
-							<ul class="list-group">
-								<li class="list-group-item">
-	
+							
+							<div class="panel panel-default">
+								<div class="panel-body">
+									<div id="player">
+										<input class="bar" type="range" id="amplitude-volume-slider" value="0"/>
+									<div id="controls">
+										<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
+											<span id="amplitude-current-time">0:00</span>
+										</div>
+										
+									</div>
+								</div>
+								<div class="panel-footer">
 									<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
-								</li>
-								
-							</ul>
+								</div>
+								<ul class="mounts"></ul>
+							</div>
 						</div>
 					</div>
 					<div class="row">