@@ -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;
-}