-
Notifications
You must be signed in to change notification settings - Fork 3
/
Create Playlist.php
133 lines (120 loc) · 4.46 KB
/
Create Playlist.php
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!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">
<link href='https://fonts.googleapis.com/css?family=Codystar' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Lobster Two' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=Marvel' rel='stylesheet'>
<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 songs = ["BTS (防弾少年団) 'MIC Drop -Japanese ver.-' Official MV",
"BTS (방탄소년단) 'DNA' Official MV",
"BTS (방탄소년단) 'Not Today' Official MV",
"BTS (방탄소년단) '피 땀 눈물 (Blood Sweat & Tears)' Official MV",
"[MV] BTS(방탄소년단) _ FIRE (불타오르네)"
];
var songCount = -1;
function addNewSong() {
songCount = songCount + 1;
var currCount = songCount;
var icon = document.createElement('i');
icon.className ="fa fa-reorder";
icon.style = "color:black; font-size: 20px; padding-right:5px";
icon.id = "icon" + currCount;
var box = document.createElement('div');
var listItem = document.createElement('li');
box.className = "list-item-container";
// var node = document.createTextNode("Song" + currCount);
var node = document.createTextNode(songs[currCount])
box.appendChild(node);
listItem.id = "song" + currCount
var close = document.createElement('i');
close.className = "fa fa-close";
close.id = "delete";
close.style = "position: absolute; right: 20px; line-height: 50px";
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.php"
//will remove all instances of playlist
}
}
</script>
</head>
<body>
<section class="container topnav">
<center>
<a class="icon" style="position: fixed; left: 0;"><i class="fa fa-user-circle-o" style="color: black;">
<section class="container topnavtext">
Username
</section>
</i></a>
<a class="icon" href="Login.php" style="position: fixed; right: 0;"><i class="fa fa-sign-out">
<section class="container topnavtext">
Logout
</section>
</i></a>
</center>
</section>
<section class="container header">
<h1>JUKEBOX</h1>
<h2>Create Playlist</h2>
</section>
<section class="container list form-list">
<ul>
<form>
<li>
<label>Name:</label>
<input type="text" placeholder="Enter Playlist Name">
</li>
</form>
<form>
<li>
<label>Song Name/URL:</label>
<input type="text" placeholder="Enter Song Name or URL">
<a class="icon-button" onclick="addNewSong()">
<i class="fa fa-plus-square-o"></i>
</a>
</li>
</form>
</ul>
</section>
<section class="container list item-list">
<ul id="addNew">
</ul>
</section>
<section class="container nav">
<center style="background-color: #D0EAFF; padding-bottom: 10px; padding-top: 10px;">
<a href="Manage Playlists.php"><i class="fa fa-check-circle-o" style="font-size: 40px; "></i></a>
<a href="Manage Playlists.php"><i class="fa fa-times-circle-o" style="font-size: 40px; padding-left:20px"></i></a>
</center>
<center>
<a class="icon" href="Home.php"><i class="fa fa-home"></i></a>
<a class="icon" href="Manage Playlists.php"><i class="fa fa-list"></i></a>
<a class="icon" href="Currently Playing.php"><i class="fa fa-play"></i></a>
</center>
</section>
</body>
</html>