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
73 changes: 73 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
$(document).ready(function() {
$.ajax({
url: "https://lit-fortress-6467.herokuapp.com/object", success: function(result){
var arr = [];
while(arr.length < 3){
var randomnumber = Math.ceil(Math.random()*4);
if(arr.indexOf(randomnumber) > -1) continue;
arr[arr.length] = randomnumber;
}
var album = result.results[arr[0]].cover_art;
$('.album1').css({'background': `url(images/${album}) no-repeat`, "background-size": "100%"});
var album = result.results[arr[1]].cover_art;
$('.album2').css({'background': `url(images/${album}) no-repeat`, "background-size": "100%"});
var album = result.results[arr[2]].cover_art;
$('.album3').css({'background': `url(images/${album}) no-repeat`, "background-size": "100%"});

for (var i = 0; i < 5; i++) {
$('.album-scroll').append('<div class="sample" id="'+ i +'" />')
}

for (var i = 0; i < 5; i++) {
var pic = result.results[i].cover_art;
$('#'+ i).css({'background': `url(images/${pic}) no-repeat`, "background-size": "100%"});
}
var artInfo;
$(".sample").click(function() {
newId = $(this).attr('id');
artInfo = result.results[newId].artist + ": " + result.results[newId].title + ",<br>";
$('.info').append(artInfo)
})

$("button[name='button2']").click(function() {
$('.info').empty()
})


$("button[name='button3']").click(function() {
var obj = {};
var infoText = $('.info').text()
var arr1 = infoText.split(/[,:]+/)
for (var i = 0; i < arr1.length-1; i+= 2) {
obj[arr1[i]] = arr1[i+1].substring(1)
}

$.ajax({
type: "POST",
url: 'https://lit-fortress-6467.herokuapp.com/post',
data: {"obj" : JSON.stringify(obj)},
cache: false,
success: function(result){
alert(result);
}
});
})
}});

















});
File renamed without changes
130 changes: 130 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
* {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
box-sizing: border-box;
}

.main {
width: 100%;
height: 84vh;
position:relative;
top: 0;
}

.text1 {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.background1 {
background: url("resources/track.fw.png")no-repeat right;
filter: alpha(opacity=60);
/* IE */
-moz-opacity: 0.6;
/* Mozilla */
opacity: 0.6;
/* CSS3 */
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: 50%;
}


.header {
height: 8vh;
background-color: #9B9B8C;
width: 100%;
border-bottom: 1px solid black;
}

.footer{
height: 8vh;
background-color: #686859;
width: 100%;
position: absolute;
margin: 0 auto;
}

.footer-text {
margin-top: 14px;
margin-left: 150px;
font-family: avenir;
font-size: 28px;
color: white;
font-weight: 100;
}

.left {
height: 100%;
width: 50%;
position: fixed;
display: inline-block;
float: left;
}

.track-bin {
position: relative;
text-align: center;
margin-top: 28vh;
font-size: 80px;
color: #4C0066;
font-family: avenir;
font-weight: 100;
}

.button1 {
text-align: center;
}
button {
position: relative;
text-align: center;
margin-top: 2vh;
font-size: 36px;
background: #353526;
border-radius: 10px ;
font-family: avenir;
font-weight: 100;
color: white;
padding: 4px 40px 4px 40px;

}

.albums {
height: 100%;
width: 50%;
display: inline-block;
float: right;
}


.album1 {
height: 26vh;
width: 35%;
margin: 0 auto;
margin-top: 12px;
}

.album2 {
height: 26vh;
width: 35%;
margin: 0 auto;
margin-top: 10px;
}

.album3 {
height: 26vh;
width: 35%;
margin: 0 auto;
margin-top: 10px;
}
31 changes: 29 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,37 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<title>Splash</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="index.css">
<script type="text/javascript" src="app.js"></script>
</head>
<body>

<div class="header"></div>
<div class="main">
<div class="background1">

</div>
<div class="text1">
<div class="left">
<div class="track-bin">
<p>track bin</p>
</div>
<div class="button1">
<a href="secondpage.html"><button type="button" name="button">choose tracks</button></a>
</div>
</div>
<div class="albums">
<div class="album1"></div>
<div class="album2"></div>
<div class="album3"></div>
</div>
</div>
</div>
<div class="footer">
<div class="footer-text">
<p>© 2017 Stephan Holly</p>
</div>
</div>
</body>
</html>
110 changes: 110 additions & 0 deletions secondpage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
* {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
box-sizing: border-box;
}

.main {
width: 100%;
height: 73vh;
position:relative;
top: 0;
}

.header {
height: 18vh;
background-color: #9B9B8C;
width: 100%;

}

.footer{
height: 8vh;
background-color: #686859;
width: 100%;
position: absolute;
margin: 0 auto;
}

.footer-text {
margin-top: 14px;
margin-left: 150px;
font-family: avenir;
font-size: 28px;
color: white;
font-weight: 100;
}

.header-text {
padding-top: 95px;
margin-left: 150px;
font-family: avenir;
font-size: 36px;
color: white;
font-weight: 100;
}



.album-scroll {
width:100%;
height:18vh;
margin-top: 10px;
margin-bottom: 10px;
left:0;right:0;
top:0;bottom:0;
overflow-y:hidden;
overflow-x: scroll;
white-space: nowrap;
text-align: center;
}


.sample {
height: 16vh;
width: 8%;
margin-left: 36px;
margin-right: 36px;
margin-top: 10px;
background-color: blue;
display: inline-block;

}

.info {
height: 28vh;
width: 79%;
margin: 0 auto;
border: 5px solid black;
background-color: #EEEEEE;
font-family: avenir;
font-size: 24px;
overflow-y: scroll;
}

button {
position: relative;
text-align: center;
margin-top: 2vh;
font-size: 36px;
background: #353526;
border-radius: 10px ;
font-family: avenir;
font-weight: 100;
color: white;
padding: 4px 40px 4px 40px;
}

button[name="button2"] {
margin-right: 30px;
}

.btns {
display: inline-block;
margin-left: 150px;
}
30 changes: 30 additions & 0 deletions secondpage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Playlist</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="secondpage.css">
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<div class="header">
<div class="header-text">
<p>click an album to add its tracks to the bin</p>
</div>
</div>
<div class="main">
<div class="album-scroll"></div>
<div class="info"></div>
<div class="btns">
<button type="button" name="button2">clear tracks</button>
<button type="button" name="button3">submit bin</button>
</div>
</div>
<div class="footer">
<div class="footer-text">
<p>© 2017 Stephan Holly</p>
</div>
</div>
</body>
</html>