123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717 |
- $.fn.waypoint.defaults = {
- context: window,
- continuous: true,
- enabled: true,
- horizontal: false,
- offset: '70%',
- triggerOnce: true
- }
- $('.timeline').waypoint(function() {
- $(function() {
- options = {
- responsive: true,
- maintainAspectRatio: true,
- animationSteps: 100,
- animationEasing: "easeInQuart",
- legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
- };
- var data = {
- labels: ["January", "February", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"],
- datasets: [
- {
- label: "Ambient",
- fillColor: "rgba(254, 254, 51,0.2)",
- strokeColor: "rgba(254, 254, 51,1)",
- pointColor: "rgba(254, 254, 51,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(220,220,220,1)",
- data: [115, 91, 47, 31, 26, 55, 60, 70, 85, 94, 100, 63]
- },
- {
- label: "Blues",
- fillColor: "rgba(250, 188, 2,0.2)",
- strokeColor: "rgba(250, 188, 2,1)",
- pointColor: "rgba(250, 188, 2,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [83, 91, 104, 79, 56, 27, 52, 35, 33, 25, 22, 86]
- },
- {
- label: "Classical",
- fillColor: "RGBA(251, 153, 2, .3)",
- strokeColor: "rgba(251, 153, 2,1)",
- pointColor: "rgba(251, 153, 2,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [118, 78, 30, 9, 16, 37, 50, 41, 34, 50, 99, 200]
- },
- {
- label: "Country",
- fillColor: "RGBA(253, 83, 8, .3)",
- strokeColor: "rgba(253, 83, 8,1)",
- pointColor: "rgba(253, 83, 8,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [46, 85, 91, 79, 26, 37, 50, 41, 34, 50, 49, 81]
- },
- {
- label: "Electronic",
- fillColor: "RGBA(254, 39, 18, .3)",
- strokeColor: "rgba(254, 39, 18,1)",
- pointColor: "rgba(254, 39, 18,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [28, 42, 34, 59, 86, 77, 50, 41, 34, 67, 70, 81]
- },
- {
- label: "Folk",
- fillColor: "RGBA(167, 25, 75, .3)",
- strokeColor: "rgba(167, 25, 75,1)",
- pointColor: "rgba(167, 25, 75,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [38, 31, 70, 39, 56, 117, 50, 41, 34, 50, 90, 121]
- },
- {
- label: "Hip Hop",
- fillColor: "RGBA(134, 1, 175, .3)",
- strokeColor: "rgba(134, 1, 175,1)",
- pointColor: "rgba(134, 1, 175,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [21, 17, 31, 89, 86, 77, 50, 41, 34, 50, 90, 81]
- },
- {
- label: "Jazz",
- fillColor: "RGBA(61, 1, 164, .3)",
- strokeColor: "rgba(61, 1, 164,1)",
- pointColor: "rgba(61, 1, 164,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [51, 38, 33, 19, 26, 57, 50, 81, 170, 200, 195, 172]
- },
- {
- label: "Pop",
- fillColor: "RGBA(2, 71, 254, .3)",
- strokeColor: "rgba(2, 71, 254,1)",
- pointColor: "rgba(2, 71, 254,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [48, 53, 63, 107, 191, 177, 118, 91, 74, 60, 51, 123]
- },
- {
- label: "R&B",
- fillColor: "RGBA(3, 146, 206, .3)",
- strokeColor: "rgba(3, 146, 206,1)",
- pointColor: "rgba(3, 146, 206,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [73, 43, 52, 29, 56, 73, 24, 33, 37, 14, 26, 41]
- },
- {
- label: "Rock",
- fillColor: "RGBA(102, 176, 50, .3)",
- strokeColor: "rgba(102, 176, 50,1)",
- pointColor: "rgba(102, 176, 50,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [28, 37, 30, 59, 146, 157, 200, 105, 94, 40, 36, 89]
- },
- {
- label: "World",
- fillColor: "RGBA(208, 234, 43, .3)",
- strokeColor: "rgba(208, 234, 43,1)",
- pointColor: "rgba(208, 234, 43,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(151,187,205,1)",
- data: [36, 41, 23, 34, 94, 85, 87, 71, 44, 39, 30, 11]
- }
- ]
- };
- ctx = $("#timechart").get(0).getContext("2d");
- LineChart = new Chart(ctx).Line(data, options);
- });
- });
- $('.music-types').waypoint(function() {
- $(function() {
- options = {
- responsive: true,
- scaleShowLabelBackdrop: true,
- scaleBackdropColor: "rgba(255,255,255,0.75)",
- scaleBeginAtZero: true,
- scaleBackdropPaddingY: 2,
- scaleBackdropPaddingX: 2,
- scaleShowLine: true,
- segmentShowStroke: true,
- segmentStrokeColor: "#fff",
- segmentStrokeWidth: 2,
- animationSteps: 100,
- animationEasing: "easeInCirc",
- animateRotate: true,
- animateScale: false,
- legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
- };
- data = [
- {
- value: 440,
- color: "RGBA(254, 254, 51, .7)",
- highlight: "RGBA(254, 254, 51, .3)",
- label: "Ambient"
- },
- {
- value: 510,
- color: "RGBA(250, 188, 2, .7)",
- highlight: "RGBA(250, 188, 2, .3)",
- label: "Blues"
- },
- {
- value: 410,
- color: "RGBA(251, 153, 2, .7)",
- highlight: "RGBA(251, 153, 2, .3)",
- label: "Classical"
- },
- {
- value: 510,
- color: "RGBA(253, 83, 8, .7)",
- highlight: "RGBA(253, 83, 8, .3)",
- label: "Country"
- },
- {
- value: 548,
- color: "RGBA(254, 39, 18, .7)",
- highlight: "RGBA(254, 39, 18, .3)",
- label: "Electronic"
- },
- {
- value: 460,
- color: "RGBA(167, 25, 75, .7)",
- highlight: "RGBA(167, 25, 75, .3)",
- label: "Folk"
- },
- {
- value: 261,
- color: "RGBA(134, 1, 175, .7)",
- highlight: "RGBA(134, 1, 175, .3)",
- label: "Hip Hop"
- },
- {
- value: 1038,
- color: "RGBA(61, 1, 164, .7)",
- highlight: "RGBA(61, 1, 164, .3)",
- label: "Jazz"
- },
- {
- value: 970,
- color: "RGBA(2, 71, 254, .7)",
- highlight: "RGBA(2, 71, 254, .3)",
- label: "Pop"
- },
- {
- value: 777,
- color: "RGBA(3, 146, 206, .7)",
- highlight: "RGBA(3, 146, 206, .3)",
- label: "R&B"
- },
- {
- value: 712,
- color: "RGBA(102, 176, 50, .7)",
- highlight: "RGBA(102, 176, 50, .3)",
- label: "Rock"
- },
- {
- value: 625,
- color: "RGBA(208, 234, 43, .7)",
- highlight: "RGBA(208, 234, 43, .3)",
- label: "World"
- }
- ];
- ctx = $("#typechart").get(0).getContext("2d");
- styles = new Chart(ctx).Doughnut(data, options);
- document.getElementById('key').innerHTML = styles.generateLegend();
- });
- });
- $('.music-typed').waypoint(function() {
- $(function() {
- options = {
- responsive: true,
- scaleShowLabelBackdrop: true,
- scaleBackdropColor: "rgba(255,255,255,0.75)",
- scaleBeginAtZero: true,
- scaleBackdropPaddingY: 2,
- scaleBackdropPaddingX: 2,
- scaleShowLine: true,
- segmentShowStroke: true,
- segmentStrokeColor: "#fff",
- segmentStrokeWidth: 2,
- animationSteps: 100,
- animationEasing: "easeOutQuart",
- animateRotate: true,
- animateScale: false,
- legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
- };
- data = [
- {
- value: 440,
- color: "RGBA(254, 254, 51, .7)",
- highlight: "RGBA(254, 254, 51, .3)",
- label: "Ambient"
- },
- {
- value: 510,
- color: "RGBA(250, 188, 2, .7)",
- highlight: "RGBA(250, 188, 2, .3)",
- label: "Blues"
- },
- {
- value: 410,
- color: "RGBA(251, 153, 2, .7)",
- highlight: "RGBA(251, 153, 2, .3)",
- label: "Classical"
- },
- {
- value: 510,
- color: "RGBA(253, 83, 8, .7)",
- highlight: "RGBA(253, 83, 8, .3)",
- label: "Country"
- },
- {
- value: 548,
- color: "RGBA(254, 39, 18, .7)",
- highlight: "RGBA(254, 39, 18, .3)",
- label: "Electronic"
- },
- {
- value: 460,
- color: "RGBA(167, 25, 75, .7)",
- highlight: "RGBA(167, 25, 75, .3)",
- label: "Folk"
- },
- {
- value: 261,
- color: "RGBA(134, 1, 175, .7)",
- highlight: "RGBA(134, 1, 175, .3)",
- label: "Hip Hop"
- },
- {
- value: 1000,
- color: "RGBA(61, 1, 164, .7)",
- highlight: "RGBA(61, 1, 164, .3)",
- label: "Jazz"
- },
- {
- value: 970,
- color: "RGBA(2, 71, 254, .7)",
- highlight: "RGBA(2, 71, 254, .3)",
- label: "Pop"
- },
- {
- value: 777,
- color: "RGBA(3, 146, 206, .7)",
- highlight: "RGBA(3, 146, 206, .3)",
- label: "R&B"
- },
- {
- value: 712,
- color: "RGBA(102, 176, 50, .7)",
- highlight: "RGBA(102, 176, 50, .3)",
- label: "Rock"
- },
- {
- value: 625,
- color: "RGBA(208, 234, 43, .7)",
- highlight: "RGBA(208, 234, 43, .3)",
- label: "World"
- }
- ];
- ctx = $("#artchart").get(0).getContext("2d");
- myNewChart = new Chart(ctx).PolarArea(data, options);
- });
- });
- (function( $ ) {
- $.fn.lfmr = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&format=json&limit=50";
- var tracks = [];
- function isLoadedr (recentElement) {
- for (var i = 0; i < tracks.length; i++){
- var markup = $("<li class='list-group-item'>" + tracks[i].artist + " - <span class='artist'>" + tracks[i].title + " : " + tracks[i].album + "</li>");
- recentElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.recenttracks.track).each(function(){
- tracks.push ({
- artist: this.artist["#text"],
- title: this.name,
- album: this.album["#text"]
- });
- });
- isLoadedr($this);
- });
- });
- };
-
- $('.recent').lfmr();
-
- $.fn.lfmtw = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=7day&format=json&limit=25";
- var tracks = [];
- function isLoadedt (tracksElement) {
- for (var i = 0; i < tracks.length; i++){
- var markup = $("<li class='list-group-item'>" + tracks[i].artist + " - <span class='artist'>" + tracks[i].title + "</span><span class='badge'>" + tracks[i].played + "</span></li>");
- tracksElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.toptracks.track).each(function(){
- tracks.push ({
- title: this.name,
- artist: this.artist.name,
- played: this.playcount,
- });
- });
- isLoadedt($this);
- });
- });
- };
-
- $.fn.lfmaw = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=7day&format=json&limit=25";
- var artists = [];
- function isLoadeda (artistElement) {
- for (var i = 0; i < artists.length; i++){
- var markup = $("<li class='list-group-item'>" + artists[i].aname + "<span class='badge'>" + artists[i].played + "</span></li>");
- artistElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.topartists.artist).each(function(){
- artists.push ({
- aname: this.name,
- played: this.playcount
- });
- });
- isLoadeda($this);
- });
- });
- };
-
- $('.wtracks').lfmtw();
- $('.wartists').lfmaw();
-
- $.fn.lfmtm = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=1month&format=json&limit=45";
- var tracks = [];
- function isLoadedt (tracksElement) {
- for (var i = 0; i < tracks.length; i++){
- var markup = $("<li class='list-group-item'>" + tracks[i].artist + " - <span class='artist'>" + tracks[i].title + "</span><span class='badge'>" + tracks[i].played + "</span></li>");
- tracksElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.toptracks.track).each(function(){
- tracks.push ({
- title: this.name,
- artist: this.artist.name,
- played: this.playcount,
- });
- });
- isLoadedt($this);
- });
- });
- };
-
- $.fn.lfmam = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=1month&format=json&limit=45";
- var artists = [];
- function isLoadeda (artistElement) {
- for (var i = 0; i < artists.length; i++){
- var markup = $("<li class='list-group-item'>" + artists[i].aname + "<span class='badge'>" + artists[i].played + "</span></li>");
- artistElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.topartists.artist).each(function(){
- artists.push ({
- aname: this.name,
- played: this.playcount
- });
- });
- isLoadeda($this);
- });
- });
- };
-
- $('.mtracks').lfmtm();
- $('.martists').lfmam();
-
- $.fn.lfma = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=6month&format=json&limit=50";
- var artists = [];
- function isLoadeda (artistElement) {
- for (var i = 0; i < artists.length; i++){
- var markup = $("<li class='list-group-item'>" + artists[i].aname + "<span class='badge'>" + artists[i].played + "</span></li>");
- artistElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.topartists.artist).each(function(){
- artists.push ({
- aname: this.name,
- played: this.playcount
- });
- });
- isLoadeda($this);
- });
- });
- };
-
- $.fn.lfmt = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=6month&format=json&limit=50";
- var tracks = [];
- function isLoadedt (tracksElement) {
- for (var i = 0; i < tracks.length; i++){
- var markup = $("<li class='list-group-item'>" + tracks[i].artist + " - <span class='artist'>" + tracks[i].title + "</span><span class='badge'>" + tracks[i].played + "</span></li>");
- tracksElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.toptracks.track).each(function(){
- tracks.push ({
- title: this.name,
- artist: this.artist.name,
- played: this.playcount,
- });
- });
- isLoadedt($this);
- });
- });
- };
-
- $('.artists').lfma();
- $('.tracks').lfmt();
-
- $.fn.lfya = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=12month&format=json&limit=50";
- var artists = [];
- function isLoadeda (artistElement) {
- for (var i = 0; i < artists.length; i++){
- var markup = $("<li class='list-group-item'>" + artists[i].aname + "<span class='badge'>" + artists[i].played + "</span></li>");
- artistElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.topartists.artist).each(function(){
- artists.push ({
- aname: this.name,
- played: this.playcount
- });
- });
- isLoadeda($this);
- });
- });
- };
-
- $.fn.lfyt = function(options){
- var urla = "https://ws.audioscrobbler.com/2.0/?method=user.gettoptracks&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=12month&format=json&limit=50";
- var tracks = [];
- function isLoadedt (tracksElement) {
- for (var i = 0; i < tracks.length; i++){
- var markup = $("<li class='list-group-item'>" + tracks[i].artist + " - <span class='artist'>" + tracks[i].title + "</span><span class='badge'>" + tracks[i].played + "</span></li>");
- tracksElement.append(markup);
- }
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( urla, function(data){
- $(data.toptracks.track).each(function(){
- tracks.push ({
- title: this.name,
- artist: this.artist.name,
- played: this.playcount,
- });
- });
- isLoadedt($this);
- });
- });
- };
-
- $('.artists').lfya();
- $('.tracks').lfyt();
- $.fn.lfm = function(options){
- var url = "https://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=windhamdavid&api_key=e12ea1d0253898ee9a93edfe42ffdeab&period=12month&format=json&limit=200";
- var albums = [];
- function isLoaded (albumElement) {
- for (var i = 0; i < albums.length; i++){
- var markup = $("<div class='album'><div class='front'><img src='" + albums[i].art + "'><div class='alpha'></div></div><div class='back'><h2>" + albums[i].artist + "</h2><h1>" + albums[i].name + "</h1><h3><span class='badge'>" + albums[i].played + "</span> tracks played</h3></div></div>");
- albumElement.append(markup);
- }
- albumElement.find('.album').hover(function(){
- $(this).addClass('flip');
- },function(){
- $(this).removeClass('flip');
- });
- }
- return this.each(function(){
- var $this = $(this);
- $.getJSON( url, function(data){
- $(data.topalbums.album).each(function(){
- albums.push ({
- name: this.name,
- artist: this.artist.name,
- played: this.playcount,
- art: this.image[this.image.length-1]["#text"]
- });
- });
- isLoaded($this);
- });
- });
- };
-
- $('.albums').lfm();
-
- })( 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": [
- {
- "url": "https://stream.davidawindham.com/stream",
- "live": true
- }
- ],
- "amplitude_volume": 90
- }
- function get_radio_tower() {
- return '../../wp-content/themes/dw/img/radio.gif';
- }
- function get_radio_none() {
- return '../../wp-content/themes/dw/img/none.svg';
- }
- function get_radio_eq() {
- return '../../wp-content/themes/dw/img/eq.gif';
- }
- function get_radio_eq_none() {
- return '../../wp-content/themes/dw/img/1.png';
- }
- function radioTitle() {
- $('#radio').attr('src', get_radio_none()).fadeIn(300);
- $('#eq').attr('src', get_radio_eq_none()).fadeIn(300);
- var url = 'https://stream.davidawindham.com/status2.xsl';
- var mountpoint = '/stream';
- $.ajax({ type: 'GET',
- url: url,
- async: true,
- jsonpCallback: 'parseMusic',
- contentType: "application/json",
- dataType: 'jsonp',
- success: function (json) {
- $('#track').text(json[mountpoint].title);
- $('#listeners').text(json[mountpoint].listeners);
- $('#peak-listeners').text(json[mountpoint].peak_listeners);
- $('#bitrate').text(json[mountpoint].bitrate);
- $('#radio').attr('src', get_radio_tower()).fadeIn(300);
- $('#eq').attr('src', get_radio_eq()).fadeIn(300);
- },
- error: function (e) { console.log(e.message);
- $('#radio').attr('src', get_radio_none()).fadeIn(300);
- $('#eq').attr('src', get_radio_eq_none()).fadeIn(300);
- }
- });
- }
- $(document).ready(function () {
- setTimeout(function () {radioTitle();}, 2000);
- setInterval(function () {radioTitle();}, 30000); // update every 30 seconds
- });
- $('.nav-toggle').on('touchstart click', function(e) {
- e.preventDefault();
- $( this ).toggleClass( 'active' );
- });
- $(function dw_hidenav() {
- var headerHeight = $('.navbar').height();
- $(window).on('scroll', { previousTop: 0 },
- function() {
- var currentTop = $(window).scrollTop();
- if (currentTop < this.previousTop) {
- if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
- $('.navbar').addClass('visible');
- } else {
- $('.navbar').removeClass('visible fixed');
- }
- }
- else {
- $('.navbar').removeClass('visible');
- if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
- }
- this.previousTop = currentTop;
- }
- );
- });
|