forked from jjchan1/Jukebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Create Playlist.html
111 lines (94 loc) · 3.86 KB
/
Create Playlist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
$( "#sortable-1" ).sortable();
$( "#addNew" ).sortable();
});
</script>
<script>
var songCount = 0;
function addNewSong() {
songCount = songCount + 1;
var currCount = songCount;
var icon = document.createElement('i');
icon.className ="fa fa-reorder";
icon.style = "color:white; font-size: 18px; padding-right:5px";
icon.id = "icon" + currCount;
var box = document.createElement('div');
var listItem = document.createElement('li');
box.className = "regbox";
box.style = "font-size: 16px;";
var node = document.createTextNode("Song Title " + currCount + " - Artist Name");
box.appendChild(node);
listItem.id = "song" + currCount
var close = document.createElement('i');
close.className = "fa fa-close";
close.style="font-size: 15px;float: right;";
close.id = "delete";
close.onclick = function() {removeSong(currCount)};
box.appendChild(close);
listItem.appendChild(icon);
listItem.appendChild(box);
var element = document.getElementById("addNew");
element.appendChild(listItem);
}
function removeSong(songCount) {
var parent = document.getElementById("addNew");
var child = document.getElementById("song"+ songCount);
var iconChild = document.getElementById("icon"+ songCount);
parent.removeChild(child);
parent.removeChild(iconChild);
}
function removePlaylist() {
if (confirm("Are you sure you want to delete this playlist?")) {
window.location.href = "Home.html"
//will remove all instances of playlist
}
}
</script>
</head>
<body>
<h1>JUKEBOX</h1>
<h2>Create Playlist</h2>
<center style="font-family: arial;color: white;font-size=20px;">
<form action="/action_page.php">
<label> Name:</label>
<input type="text" style="width: 98%; line-height: 50px; width:38%; margin-right: 5%;" placeholder="Enter Playlist Name...">
<!--
<a href="#"><i class="fa fa-trash-o" onclick="removePlaylist()" style="font-size: 35px; vertical-align: middle;"></i></a>
-->
</form>
</center>
<center style="font-family: arial;color: white;font-size=20px;">
<div>
<form action="/action_page.php">
<label> URL:</label>
<input type="text" style="line-height: 50px;width:40%;" placeholder="Enter YouTube Link...">
<a href="#"><i class="fa fa-plus-square-o" onclick="addNewSong()" style="font-size: 35px; vertical-align: middle;"></i></a>
</form>
</div>
</center>
<center class="center-container" style="padding-top: 10px; padding-bottom: 10px;">
<ul id="addNew">
</ul>
</center>
<div class="nav">
<center style="background-color: #141f1f; padding-bottom: 10px; padding-top: 10px;">
<a href="Playlists.html"><i class="fa fa-check-circle-o" style="font-size: 40px; "></i></a>
<a href="Playlists.html"><i class="fa fa-times-circle-o" style="font-size: 40px; padding-left:20px"></i></a>
</center>
<center>
<a class="a icon" href="Home.html"><i class="fa fa-home" style="font-size: 50px; padding: 15px;"></i></a>
<a class="a icon" href="Playlists.html"><i class="fa fa-music" style="font-size: 50px; padding: 15px; color: #4656ea"></i></a>
<a class="a icon" href="Currently Playing.html"><i class="fa fa-volume-up" style="font-size: 50px; padding: 15px;"></i></a>
</center>
</div>
</body>
</html>