Removed compiled JS from repo; added jake to about page; Fixed Grunt.js config to actually compile SASS

This commit is contained in:
Gregory Ballantine 2023-05-13 00:00:00 -04:00
parent e34ec3b947
commit 114b256d97
13 changed files with 18 additions and 1004 deletions

View File

@ -11,7 +11,7 @@ module.exports = function(grunt) {
},
files: [{
expand: true,
cwd: 'assets/styles',
cwd: 'assets/sass',
src: ['**/*.sass'],
dest: 'public/css',
ext: '.css'
@ -36,7 +36,7 @@ module.exports = function(grunt) {
watch: {
css: {
files: ['assets/styles/**/*.sass'],
files: ['assets/sass/**/*.sass'],
tasks: ['sass'],
options: {
atBegin: true,

View File

@ -6,6 +6,7 @@
img
+position(absolute, 0 null null 0)
+size(100% 480px)
background: #212121
/*+filter(blur(2px))
.about-band

729
public/css/main.css Executable file → Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
public/img/about/jake.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -1,13 +0,0 @@
(function() {
$(function() {
$.get('https://api.bandsintown.com/artists/Skrillex/events.json?', {
'api_version': '2.0',
'app_id': 'shows_halftoneband.com'
}, function(data) {
alert(data);
});
});
}).call(this);
//# sourceMappingURL=bit.js.map

View File

@ -1,8 +0,0 @@
(function() {
$(document).ready(function() {
return console.log('Hey there, lad!');
});
}).call(this);
//# sourceMappingURL=main.js.map

View File

@ -1,18 +0,0 @@
(function() {
(function($) {
$.fn.alert = function() {
return this.each(function() {
var self;
self = $(this);
self.on('click', '.close-button', function(e) {
e.preventDefault();
self.addClass('close');
});
self.on('transitionEnd webkitTransitionEnd oTransitionEnd', function() {
self.remove();
});
});
};
})(jQuery);
}).call(this);

View File

@ -1,22 +0,0 @@
(function() {
$(function() {
var awesomeInput, checkInput;
awesomeInput = '.awesome-form .input-group input';
checkInput = function(elem) {
var text_val;
text_val = $(elem).val();
if (text_val === '') {
$(elem).removeClass('has-value');
} else {
$(elem).addClass('has-value');
}
};
$(awesomeInput).focusout(function() {
checkInput(this);
});
$(awesomeInput).on('change', function() {
checkInput(this);
});
});
}).call(this);

View File

@ -1,53 +0,0 @@
(function($){
$.fn.musicPlayer = function(opt) {
var settings, player, getVolume, setVolume, isPlaying, play, pause, getTime, setTime;
settings = $.extend({
'audio': '#music-player',
'volume': .5,
'startTime': 0
}, opt);
player = $(settings.player);
getVolume = function() {
return player.prop('volume');
}
setVolume = function(volume) {
player.prop('volume', volume);
};
isPlaying = function() {
return !player.prop('paused');
};
play = function() {
if (!isPlaying()) {
player.trigger('play');
}
};
pause = function() {
if (isPlaying()) {
player.trigger('pause');
}
};
getTime = function() {
return player.prop('currentTime');
};
setTime = function(time) {
player.prop('currentTime', time);
};
// Default actions
setVolume(settings.volume);
setTime(setTime.startTime);
};
})(jQuery);

View File

@ -1,158 +0,0 @@
var player = '';
$(document).ready(function() {
player = $('#music-player').get(0);
// set the player's volume to 0.5 by default
player.volume = 0.5;
// on music track click
$('.now-playing-list').on('click', '.music-track', function() {
// change selected track
changeSelectedTrack(this);
});
// on album art click
$('.music-album').on('click', '.thumbnail', function() {
// change selected album
changeSelectedAlbum(this);
});
// on track end
$(player).on('ended', function() {
// find selected track
changeSelectedTrack($('.music-track.selected').next().get(0));
});
});
function changeSelectedAlbum(albumElem) {
var oldSelected = $('.music-album.selected');
var newSelected = $(albumElem).parent();
if (oldSelected.data('albumid') != newSelected.data('albumid')) {
// remove selected class from the old element and add it to the new one
oldSelected.removeClass('selected');
newSelected.addClass('selected');
// change album info
getAlbumInfo(albumElem);
// change available songs
getAlbumSongs(albumElem);
}
}
function getAlbumInfo(albumElem) {
albumElem = $(albumElem).parent();
$.get('/apiv1/music/album-info/' + albumElem.data('albumid'), function(data) {
var json = $.parseJSON(data);
// change album artwork
$('#album-artwork').attr('src', json.album_art);
// change album title
$('#album-title').text(json.title);
// change album release date
$('#album-release span').text(formatReleaseDate(json.release_date));
// change album description
$('#album-description').text(json.description);
});
}
function formatReleaseDate(d) {
var monthNames = [
"January", "February", "March",
"April", "May", "June", "July",
"August", "September", "October",
"November", "December"
];
var date = new Date(d);
var day = date.getDate();
var monthIndex = date.getMonth();
var year = date.getFullYear();
return monthNames[monthIndex] + ' ' + day + ', ' + year;
}
function getAlbumSongs(albumElem) {
albumElem = $(albumElem).parent();
$.get('/apiv1/music/album-songs/' + albumElem.data('albumid'), function(data) {
var json = $.parseJSON(data);
var playlist = $('.now-playing-list');
playlist.empty();
for (var i = 0; i < json.songs.length; i++) {
var song = json.songs[i];
var songElem = $('<li></li>')
.addClass('music-track')
.attr('data-trackid', song.id)
.attr('data-title', song.title)
.attr('data-album', song.album_id)
.attr('data-order', song.track_order)
.attr('data-path', song.audio_file);
if (i === 0) {
songElem.addClass('selected');
}
songElem.html('<span>' + song.track_order + '. ' + song.title + '</span>');
playlist.append(songElem);
}
changeAudioSources(playlist.find('.selected'), false);
});
}
function changeSelectedTrack(trackElem) {
var oldSelected = $('.now-playing-list .music-track.selected');
var newSelected = $(trackElem);
if (oldSelected.data('trackid') != newSelected.data('trackid')) {
// remove selected class from the old element and add it to the new one
oldSelected.removeClass('selected');
newSelected.addClass('selected');
// now change the audio sources
changeAudioSources(trackElem, true);
}
}
function changeAudioSources(trackElem, autoplay) {
trackElem = $(trackElem);
var playerSources = $('#music-player source');
if (autoplay === null) {
autoplay = false;
}
// retrieve audio file path from selected element
var audioFilePath = trackElem.data('path');
// loop through the audio player source elements
playerSources.each(function() {
// jQuery-ize the element
source = $(this);
if (source.attr('type') == 'audio/ogg') {
// OGG source file
source.attr('src', audioFilePath + '.ogg');
} else if (source.attr('type') == 'audio/mpeg') {
// MP3 source file
source.attr('src', audioFilePath + '.mp3');
}
});
// change track title
$('#track-title').text(trackElem.data('title'));
// reload music player
player.load();
if (autoplay) {
// start playing new song
player.play();
}
}

View File

@ -5,7 +5,7 @@
{% block content %}
<header id="about-header" class="row shadow-1">
<div class="col-xs-12">
<img class="img-responsive" src="/img/about/halftone.jpg" alt="halftone">
<img id="about-header-image" class="img-responsive" src="/img/logo-white.png" alt="halftone">
</div>
<div class="about-band col-xs-12">
<h2>About the Band</h2><br/>
@ -43,7 +43,7 @@
<div class="caption">
<h3>Wyatt Hamilton</h3>
<hr />
<h4>Lead vocals/Guitar</h4>
<h4>Lead Vocals/Guitar</h4>
<p>World's "okay-est" guitarist... and we're using "okay" loosely.</p>
</div>
<a href="#"></a>
@ -61,5 +61,17 @@
<a href="#"></a>
</div>
</section>
<section class="col-md-6 col-md-offset-3 col-xs-12">
<div class="thumbnail shadow-1">
<img src="img/about/jake.jpg" alt="Jake the Snake!">
<div class="caption">
<h3>Jake Lahoff</h3>
<hr />
<h4>Bass Guitar/Backing Vocals</h4>
<p>Taking the bass to the mainstream!</p>
</div>
<a href="#"></a>
</div>
</section>
</div>
{% endblock %}