diff --git a/beats.css b/beats.css index f6dabd5..98386f8 100644 --- a/beats.css +++ b/beats.css @@ -25,6 +25,9 @@ html, body { animation: spin 1s infinite linear; -webkit-animation: spin 1s infinite linear; } +.cursor-pointer { + cursor: pointer; } + .dialog-container { align-items: flex-start; justify-content: space-around; @@ -55,7 +58,7 @@ html, body { display: inline; float: right; padding: 8px; - text-shadow: 0 0 1px black; } + text-shadow: 1px 1px 1px black; } .dialog-area .confirm { background-color: #448aa6; } .dialog-area .cancel { @@ -141,37 +144,36 @@ html, body { z-index: 2; } .albumgrid-area { + align-items: flex-start; background-color: #444; box-shadow: 0 0 17px 3px black; - display: flex; - flex-direction: row; - flex-wrap: wrap; - flex-flow: row wrap; - justify-content: flex-start; - align-items: flex-start; + color: white; + cursor: default; flex: 5; + list-style-type: none; overflow-x: hidden; overflow-y: auto; position: relative; - z-index: 2; - font-family: 'Open Sans'; - color: white; } - .albumgrid-area .album-artist { - width: 100%; - height: 50px; - font-size: 16px; } - .albumgrid-area .album-art { - width: 150px; - height: 235px; - padding: 20px; - justify-content: center; } - .albumgrid-area .album-art .art { - max-width: 150px; - max-height: 150px; } - .albumgrid-area .album-art .album-name { - width: 150px; + z-index: 2; } + .albumgrid-area li { + display: block; + float: left; + height: 220px; + margin: 10px; + padding: 10px; + width: 150px; } + .albumgrid-area li .art { + box-shadow: 0 0 10px 0 black; + max-height: 150px; + max-width: 150px; } + .albumgrid-area li .album-name { + font-size: 15px; height: 50px; - font-size: 15px; } + width: 150px; + text-shadow: 1px 1px 1px black; } + .albumgrid-area li:hover { + background: #448aa6; + box-shadow: 0 0 10px 0 black; } table.playlist { border-collapse: collapse; @@ -195,8 +197,12 @@ table.playlist { text-overflow: ellipsis; white-space: nowrap; padding: 4px; } - table.playlist td:first-child { - cursor: pointer; } + table.playlist .dragover td { + box-shadow: inset 0 8px 4px -4px rgba(255, 255, 255, 0.4), inset 0 -8px 4px -4px rgba(255, 255, 255, 0.4); } + table.playlist .dragover td:first-child { + box-shadow: inset 8px 0 4px -4px rgba(255, 255, 255, 0.4), inset 0 8px 4px -4px rgba(255, 255, 255, 0.4), inset 0 -8px 4px -4px rgba(255, 255, 255, 0.4); } + table.playlist .dragover td:last-child { + box-shadow: inset -8px 0 4px -4px rgba(255, 255, 255, 0.4), inset 0 8px 4px -4px rgba(255, 255, 255, 0.4), inset 0 -8px 4px -4px rgba(255, 255, 255, 0.4); } .queue-area { background-color: #222; @@ -325,6 +331,3 @@ table.playlist { .control.current-time-label { margin-left: 16px; margin-right: 16px; } - -#search { - width: 350px; } diff --git a/beats.html b/beats.html index b70365f..bff2cb3 100644 --- a/beats.html +++ b/beats.html @@ -43,7 +43,7 @@
-
+
@@ -79,24 +79,22 @@ VoteTrackTitleArtistAlbumLength - - + + {{ song.tracknumber }} {{ song.title }} - {{ song.artist }} - {{ song.album }} + {{ song.artist }} + {{ song.album }} {{ song.length|momentFormat }}
@@ -105,9 +103,9 @@
  • {{ song.title }} - {{ song.album }} - {{ song.artist }} - + {{ song.album }} + {{ song.artist }} +
diff --git a/beats.js b/beats.js index e5c32a9..041fd6d 100644 --- a/beats.js +++ b/beats.js @@ -107,6 +107,52 @@ angular.module('BeatsApp', ['Beats.filters', 'ngCookies']) } }; }) +.directive('dragSong', function() +{ + // Directive for having bar slider based input controls + return { + link: function(scope, element, attrs) + { + var dragging = false; + + var handleDragStart = function(event) + { + dragging = true; + element[0].style.opacity = 0.4; + event.dataTransfer.effectAllowed = 'all'; + event.dataTransfer.setData('text/plain', null); + event.dataTransfer.setDragImage(element[0], 0, 0); + } + + var handleDragOver = function(event) + { + if (!dragging) + { + element[0].classList.add('dragover'); + } + } + + var handleDragLeave = function(event) + { + if (!dragging) + { + element[0].classList.remove('dragover'); + } + } + + var handleDragFinish = function(event) + { + dragging = false; + element[0].style.opacity = 1.0; + } + + element[0].addEventListener('dragstart', handleDragStart); + element[0].addEventListener('dragover', handleDragOver); + element[0].addEventListener('dragleave', handleDragLeave); + element[0].addEventListener('dragend', handleDragFinish); + } + }; +}) .controller('BeatsController', ['$scope', '$http', '$interval', '$cookies', function($scope, $http, $interval, $cookies) { @@ -329,6 +375,14 @@ function($scope, $http, $interval, $cookies) }); }; + $scope.searchAlbum = function(album) + { + if (album) + { + $scope.searchSongs('album:' + album); + } + } + $scope.searchSongs = function(query) { if (!query) { @@ -342,7 +396,7 @@ function($scope, $http, $interval, $cookies) .success(function(data) { // album search - if (query.substring(0,7) == "artist:") + if (query.substring(0,7) == 'artist:') { var albums = []; for (var resultIndex = 0; resultIndex < data.results.length; resultIndex++) @@ -353,7 +407,7 @@ function($scope, $http, $interval, $cookies) $scope.albumlist = albums; $scope.layout = 'albumgrid'; $scope.searchText = query; - } + } else { var songs = []; diff --git a/beats.scss b/beats.scss index 14a7b19..0a596ce 100644 --- a/beats.scss +++ b/beats.scss @@ -1,4 +1,6 @@ $area-shadow: 0 0 17px 3px black; +$item-shadow: 0 0 10px 0 black; +$text-highlight-shadow: 1px 1px 1px black; $hover-blur: 0 0 4px #D0D9E5; $blue: #448AA6; @@ -41,6 +43,10 @@ html, body { -webkit-animation: spin 1s infinite linear; } +.cursor-pointer { + cursor: pointer; +} + .dialog-container { align-items: flex-start; justify-content: space-around; @@ -79,7 +85,7 @@ html, body { display: inline; float: right; padding: 8px; - text-shadow: 0 0 1px black; + text-shadow: $text-highlight-shadow; } .confirm { @@ -182,41 +188,42 @@ html, body { } .albumgrid-area { + align-items: flex-start; background-color: #444; box-shadow: $area-shadow; - display: flex; - flex-direction: row; - flex-wrap: wrap; - flex-flow: row wrap; - justify-content: flex-start; - align-items: flex-start; + color: white; + cursor: default; flex: 5; + list-style-type: none; overflow-x: hidden; overflow-y: auto; position: relative; z-index: 2; - font-family: 'Open Sans'; - color: white; - .album-artist{ - width: 100%; - height: 50px; - font-size: 16px; - } - .album-art{ + li { + display: block; + float: left; + height: 220px; + margin: 10px; + padding: 10px; width: 150px; - height: 235px; - padding: 20px; - justify-content:center; - .art{ - max-width: 150px; + .art { + box-shadow: $item-shadow; max-height: 150px; + max-width: 150px; } - .album-name{ - width: 150px; - height: 50px; + + .album-name { font-size: 15px; + height: 50px; + width: 150px; + text-shadow: $text-highlight-shadow; + } + + &:hover { + background: $blue; + box-shadow: $item-shadow; } } } @@ -253,8 +260,26 @@ table.playlist { padding: 4px; } - td:first-child { - cursor: pointer; + .dragover { + $shadow-size: 4px; + $shadow-offset: $shadow-size * 2; + $shadow-color: rgba(255, 255, 255, 0.4); + td { + box-shadow: inset 0 $shadow-offset $shadow-size -1*$shadow-size $shadow-color, + inset 0 -1 * $shadow-offset $shadow-size -1*$shadow-size $shadow-color; + } + + td:first-child { + box-shadow: inset $shadow-offset 0 $shadow-size -1*$shadow-size $shadow-color, + inset 0 $shadow-offset $shadow-size -1*$shadow-size $shadow-color, + inset 0 -1 * $shadow-offset $shadow-size -1*$shadow-size $shadow-color; + } + + td:last-child { + box-shadow: inset -1 * $shadow-offset 0 $shadow-size -1*$shadow-size $shadow-color, + inset 0 $shadow-offset $shadow-size -1*$shadow-size $shadow-color, + inset 0 -1 * $shadow-offset $shadow-size -1*$shadow-size $shadow-color; + } } } @@ -439,7 +464,3 @@ table.playlist { margin-right: 16px; } } - -#search { - width: 350px; -}