Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//getting the object data through API call
$.get("https://lit-fortress-6467.herokuapp.com/object").done(function(data) {
var music = data.results;
//to shuffle the object .sort(function(){return 0.5 - Math.random()});
var sorter = music.sort(function() {
return 0.5 - Math.random();
});
//creating an array of album cover images and an array of artist and album names from the shuffled object
var covers = [];
var artistAlbum = [];
for (var i = 0; i < music.length; i++) {
covers.push("images/" + music[i].cover_art);
artistAlbum.push(music[i].title + " by " + music[i].artist);
}
console.log(artistAlbum);
//on the splash page, adding shuffled images over railroad track
$('.first_album').append("<img src=" + covers[0] + ">");
$('.second_album').append("<img src=" + covers[1] + ">");
$('.third_album').append("<img src=" + covers[3] + ">");
//allows the select track button to take you to the playlist page
$('.track_button').click(function() {
window.location.href = 'playlist.html';
});
//add album covers to the playlist page
$('.album_1').append("<img src=" + covers[0] + ">");
$('.album_2').append("<img src=" + covers[1] + ">");
$('.album_3').append("<img src=" + covers[2] + ">");
$('.album_4').append("<img src=" + covers[3] + ">");
$('.album_5').append("<img src=" + covers[4] + ">");
//all of these click functions allow the album cover to be clicked and add the album and artist info to the text area.
$('.album_1').click(function() {
$('.track_list').append(artistAlbum[0] + "<br>");
});
$('.album_2').click(function() {
$('.track_list').append(artistAlbum[1] + "<br>");
});
$('.album_3').click(function() {
$('.track_list').append(artistAlbum[2] + "<br>");
});
$('.album_4').click(function() {
$('.track_list').append(artistAlbum[3] + "<br>");
});
$('.album_5').click(function() {
$('.track_list').append(artistAlbum[4] + "<br>");
});
//this button clears the tracks from the track list
$('.clear_tracks').click(function() {
$('.track_list').empty();
})
//this button submits the info and then emptys the track list
$('.submit_button').click(function() {
var tracksubmission = $('.track_list').val();
$.post("https://lit-fortress-6467.herokuapp.com/post", tracksubmission, function(data) {
alert("you did it. you actually did it.");
$('.track_list').empty();
})
});
})
File renamed without changes
60 changes: 54 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,62 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<title>SPLASH</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="app.js" defer>
</script>
</head>

<body>
<select name="my_select" style="height: 40px; line-height: 100px;">
<option name="reggae"> Select your genre </option>
<option name="reggae"> Reggae </option>
<option name="blues"> Blues </option>
</select>
<div class="container-fluid">
<header>
</header>
<main>
<section id="left_section">
<div class="box">
<div class="track_box">
<div class="track_text">track bin</div>
<button type="button" class="track_button">select tracks</button>
</div>
</div>
</section>
<section id="right_section">
<div class="album_box"></div>
<div class="row">
<div class="first_album album">
</div>
</div>
<div class="row">
<div class="second_album album">
</div>
</div>
<div class="row">
<div class="third_album album">
</div>
</div>
</section>
</main>
<footer>
<div class="footy">
&copy; 2017 Race Carpenter
</div>
</footer>
</div>




</body>
</html>
53 changes: 53 additions & 0 deletions playlist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SPLASH</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="app.js" defer>
</script>
</head>
<body>
<div class="container-fluid">
<header id="playlist">
<div class="heady">
click an album to add its tracks to the bin
</div>
</header>
<main>
<section id="album_choice">
<div class="playlist_row">
<div class="album_1 album_playlist"></div>
<div class="album_2 album_playlist"></div>
<div class="album_3 album_playlist"></div>
<div class="album_4 album_playlist"></div>
<div class="album_5 album_playlist"></div>
</div>
</section>
<div class="track_list">

</div>
<button type="button" class="clear_tracks">Clear Tracks</button>
<button type="button" class="submit_button">Submit Bin</button>
</main>

<footer>
<div class="footy">
&copy; 2017 Race Carpenter
</div>
</footer>
</div>
</body>
</html>
172 changes: 172 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
body{
margin: 0px auto;
}

.container-fluid{
padding: 0px;
width: 100vw;
height: 100vh;
}
.row{
float: right;
position: relative;
height: 200px;
width: 100%;
margin:0px auto;
text-align: center;
}

.album_playlist{
margin-top: 20px;
float: left;
height: 100%;
width: 200px;
margin-left: 30px;
margin-right: 20px;
}
.album_playlist img{
padding-left: 20px;
height: 150px;
}
.playlist_row{
height: 150px;
width: 100%;
}

.album{
position: relative;
float: right;
height: 100%;
width: 100%;
margin: 0px auto;
padding: 20px;
}

.album img{
height: 230px;
padding: 20px;
}


header{
height: 50px;
background-color: #9B9B8D;
width: 100%;
color: #ffffff;
}

#playlist{
height: 100px;
}

.heady{
padding-top: 60px;
padding-left: 20px;
font-family: AR;
font-size: 32px;
}



main{
height: 100%;
width: 100%;
}


.track_list{
font-size: 20px;
background-color: #EEEEEE;
margin: 60px auto;
height: 200px;
width: 1000px;
border: 2px solid black;
}

footer {
padding: 5px;
width: 100%;
background-color: #9B9B8D;
color: white;
position: fixed;
bottom: 0px;
height: 50px;
}

.footy{
margin-left: 10px;
}

#left_section{
height: 100%;
width: 40%;
float: left;
background-color: #EEEEEE;
overflow: scroll;
}

.album_box{
opacity: .4;
position: absolute;
height: 100%;
width: 100%;
background-size: 757px 685px;
overflow: scroll;
background-image: url("/Users/racecarpenter/Projects/Week04/playlist/resources/track.jpg");
}

#right_section{
float: right;
height: 100%;
width: 60%;
}


.track_box{
padding-top: 250px;
margin: 0px auto;
width: 100%;
background-color: #EEEEEE;
height: 80%;
text-align: center;
overflow: scroll;
}
@fontface{
font-family: AR;
src: url(/Users/racecarpenter/Projects/Week04/playlist/fonts/AvenirNextLTPro-Regular.otf);
}
.track_text{
width: 300px;
margin: 0px auto;
font-family: AR;
color: purple;
font-size: 60px;
}
.track_button{
width: 220px;
height: 50px;
background-color: #353527;
font-family: AR;
color: #B7B7B2;
border-radius: 20px;
}
.clear_tracks{
margin-left: 150px;
margin-bottom: 100px;
width: 220px;
height: 50px;
background-color: #353527;
font-family: AR;
color: #B7B7B2;
border-radius: 20px;
}

.submit_button{
margin-bottom: 100px;
width: 220px;
height: 50px;
background-color: #353527;
font-family: AR;
color: #B7B7B2;
border-radius: 20px;
}