Skip to content

Commit 359a97f

Browse files
added a lot of updates.
fixed bugs, added new features.
1 parent 4c47ecb commit 359a97f

11 files changed

+290
-5
lines changed

.goutputstream-8OVPZZ

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<?php
2+
3+
session_start();
4+
5+
if($_COOKIE["logged"] != 1)
6+
{
7+
$_SESSION["signin_errors"] = "Sign in to continue<br>";
8+
header("Location: signin.php");
9+
}
10+
11+
?>
12+
13+
<!DOCTYPE html>
14+
<html>
15+
<head>
16+
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/add-on/jplayer.playlist.min.js" type="text/javascript" ></script>
17+
<script src="libraries/requireJS/require.js" type="text/javascript" ></script>
18+
<script src="libraries/id3/src/id3.js" type="text/javascript" ></script> !-->
19+
<link href="stylesheets/player.css" type="text/CSS" rel="stylesheet" />
20+
</head>
21+
<body>
22+
<div id="grey_mask" ></div>
23+
<nav class="topbar_container" >
24+
<nav class="topbar" >
25+
<a href="logout.php" ><div id="logout" class="left_button" >logout</div></a>
26+
<button id="sense" class="button" style="position: relative" >Sense Emotion</button>
27+
<button id="random" class="button" >Random Song</button>
28+
</nav>
29+
</nav>
30+
<div id="sense_window" >
31+
<div class="title" >Choose Method</div>
32+
<div class="left_container" >
33+
<div class="label" >Select Mood</div>
34+
<div class="emoji_list" >
35+
<input type="image" name="happy" id="happy" src="images/happy.png" class="button" value="happy" >
36+
<input type="image" name="sad" id="sad" src="images/sad.png" class="button" >
37+
<input type="image" name="angry" id="angry" src="images/angry.png" class="button" >
38+
<input type="image" name="bored" id="bored" src="images/bored.png" class="button" >
39+
</div>
40+
</div>
41+
<div class="right_container">
42+
<div class="label" >Scan From Camera</div>
43+
<div class="button" >Scan</div>
44+
</div>
45+
</div>
46+
<div class="maincontainer" >
47+
<div class="leftcontainer" >
48+
<div class="player" >
49+
<marquee class="song_title" scrolldelay="40" truespeed=true >
50+
<?php
51+
52+
if(isset($_SESSION["song_title"]))
53+
{
54+
$song_title = $_SESSION["song_title"];
55+
echo "Now Playing: " . $song_title;
56+
}
57+
58+
?>
59+
</marquee>
60+
<img id="visualizer" class="visualizer" src="images/scene3.jpg" >
61+
<audio id="music" controls autoplay src=
62+
<?php
63+
64+
if(isset($_SESSION["song_ref"]))
65+
{
66+
$song_ref = $_SESSION["song_ref"];
67+
echo '"' . $song_ref . '"';
68+
}
69+
70+
?>
71+
class="controls" >Your browser doesn't allow this feature</audio>
72+
</div>
73+
</div>
74+
<div class="rightcontainer" >
75+
<div class="mostplayed" >
76+
<div class="title" >Most Played Songs</div>
77+
<p class="warning" >This feature is coming soon.</p>
78+
</div>
79+
</div>
80+
</div>
81+
82+
<script type="text/javascript" >
83+
84+
var sense_button = document.getElementById("sense");
85+
var random_button = document.getElementById("random");
86+
var grey_mask = document.getElementById("grey_mask");
87+
var happy_btn = document.getElementById("happy");
88+
var sad_btn = document.getElementById("sad");
89+
var angry_btn = document.getElementById("angry");
90+
var bored_btn = document.getElementById("bored");
91+
var music = document.getElementById("music");
92+
93+
var visualizer = document.getElementById("visualizer");
94+
var scene_path = "images/scene";
95+
96+
/*for(;;)
97+
{
98+
setInterval(function()
99+
{
100+
101+
}, 5000);
102+
}*/
103+
104+
function getRandomInt(max) {
105+
return Math.floor(Math.random() * Math.floor(max));
106+
}
107+
108+
109+
function displayWindow(element_id)
110+
{
111+
var element = document.getElementById(element_id);
112+
if(element.style.display == "block")
113+
{
114+
element.style.display = "none";
115+
}
116+
else
117+
{
118+
element.style.display = "block";
119+
}
120+
}
121+
122+
function closeWindow(element_id)
123+
{
124+
var element = document.getElementById(element_id);
125+
if(element.style.display == "block")
126+
{
127+
element.style.display = "none";
128+
}
129+
}
130+
131+
sense_button.onclick = function()
132+
{
133+
displayWindow("grey_mask");
134+
displayWindow("sense_window");
135+
}
136+
137+
grey_mask.onclick = function()
138+
{
139+
closeWindow("sense_window");
140+
closeWindow("grey_mask");
141+
}
142+
143+
happy_btn.onclick = function()
144+
{
145+
window.location = "getsong.php?emotion=happy";
146+
}
147+
148+
sad_btn.onclick = function()
149+
{
150+
window.location = "getsong.php?emotion=sad";
151+
}
152+
153+
angry_btn.onclick = function()
154+
{
155+
window.location = "getsong.php?emotion=angry";
156+
}
157+
158+
bored_btn.onclick = function()
159+
{
160+
window.location = "getsong.php?emotion=bored";
161+
}
162+
163+
random_button.onclick = function()
164+
{
165+
var emos = ["happy", "sad", "angry", "bored"];
166+
window.location = "getsong.php?emotion=" + emos[getRandomInt(3)];
167+
}
168+
169+
</script>
170+
171+
</body>
172+
</html>

createacc.php

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
{
6161
echo "Successfully created an account!<br>";
6262
unset($_SESSION["signup_errors"]);
63+
header("Location: regsuccess.php");
6364
}
6465
else
6566
{

faces/chatbot6.png

388 KB
Loading

faces/hydra.jpg

91.4 KB
Loading

imageprocess.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
if(!isset($_SESSION["logged"]) || $_SESSION["logged"] == 0)
4+
{
5+
//header("Location: signin.php");
6+
}
7+
8+
$image_name = $_FILES["userimage"]["tmp_name"];
9+
$actual_name = basename($_FILES["userimage"]["name"]);
10+
echo "image name: " . $image_name . "<br>";
11+
echo "actual name: " . $actual_name . "<br>";
12+
move_uploaded_file($image_name, "faces/$actual_name");
13+
14+
?>
15+
16+
<html>
17+
<head>
18+
<link href="process.css" type="text/CSS" rel="stylesheet" >
19+
<title>Processing Facial Features</title>
20+
</head>
21+
<body>
22+
<h1>Processing...</h1>
23+
<img id="processarea" class="face" src=
24+
<?php
25+
26+
echo '"' . "faces/$actual_name" . '"';
27+
28+
?>
29+
>
30+
31+
<script>
32+
33+
34+
var processarea = document.getElementById("processarea");
35+
processarea.width = processarea.width / 2;
36+
processarea.height = processarea.height / 2;
37+
38+
</script>
39+
40+
</body>
41+
</html>

loginauth.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function AuthorizeLogin()
6363
unset($_SESSION["signin_errors"]);
6464
echo "successfully logged in<br>";
6565
echo "cookie value: " . $_COOKIE["logged"];
66-
header("Location: meganote.php");
66+
header("Location: logsuccess.php");
6767
}
6868

6969
?>

meganote.php renamed to logsuccess.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!DOCTYPE html>
1313
<html>
1414
<head>
15-
<title>Let\'s leave this empty for now</title>
15+
<title>Successfully Logged In</title>
1616
<link href="stylesheets/meganote.css" rel="stylesheet" type="text/CSS" />
1717
</head>
1818
<body>

player.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<div class="right_container">
4242
<div class="label" >Scan From Camera</div>
4343
<div class="button" >Scan</div>
44+
<form action="imageprocess.php" method="post" enctype="multipart/form-data" >
45+
<input type="file" name="userimage" class="file_button" accept="image/*" value="Scan">
46+
<input type="submit" value="upload" style="float: right; margin-right: 25px;">
47+
</form>
4448
</div>
4549
</div>
4650
<div class="maincontainer" >
@@ -57,7 +61,7 @@
5761

5862
?>
5963
</marquee>
60-
<img class="visualizer" src="images/scene3.jpg" >
64+
<img id="visualizer" class="visualizer" src="images/scene3.jpg" >
6165
<audio id="music" controls autoplay src=
6266
<?php
6367

@@ -90,6 +94,17 @@ class="controls" >Your browser doesn't allow this feature</audio>
9094
var bored_btn = document.getElementById("bored");
9195
var music = document.getElementById("music");
9296

97+
var visualizer = document.getElementById("visualizer");
98+
var scene_path = "images/scene";
99+
100+
/*for(;;)
101+
{
102+
setInterval(function()
103+
{
104+
105+
}, 5000);
106+
}*/
107+
93108
function getRandomInt(max) {
94109
return Math.floor(Math.random() * Math.floor(max));
95110
}

regsuccess.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
include "utility.php";
4+
5+
?>
6+
7+
<!DOCTYPE html>
8+
<html>
9+
<head>
10+
<title>Account Successfully Created</title>
11+
<link href="stylesheets/meganote.css" rel="stylesheet" type="text/CSS" />
12+
</head>
13+
<body>
14+
<div id="note" >
15+
Account Successfully Created!<br>
16+
Redirecting in 3 seconds...
17+
</div>
18+
<script type="text/javascript" >
19+
20+
setInterval(function(){
21+
window.location = "signin.php";
22+
}, 3000);
23+
24+
</script>
25+
</body>
26+
</html>

stylesheets/player.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ body{
182182
background-color: var(--primary-color);
183183
color: white;
184184
width: 500px;
185-
height: 250px;
185+
height: 325px;
186186
margin-left: auto;
187187
margin-right: auto;
188188
border: 1px solid black;
189189
position: fixed;
190-
top: 175px;
190+
top: 150px;
191191
left: calc(50% - 250px);
192192
z-index: 50;
193193
display: none;
@@ -265,3 +265,11 @@ body{
265265
margin-left: 25px;
266266
display: block;
267267
}
268+
269+
.file_button{
270+
display: block;
271+
float: right;
272+
margin-right: -100px;
273+
margin-top: 15px;
274+
height: 40px;
275+
}

stylesheets/process.css

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@import url('https://fonts.googleapis.com/css?family=Fira+Sans|Fira+Sans+Condensed|Nanum+Gothic|Open+Sans|Slabo+27px|Open+Sans+Condensed');
2+
3+
.face{
4+
display: block;
5+
margin-left: auto;
6+
margin-right: auto;
7+
margin-top: 25px;
8+
}
9+
10+
11+
h1{
12+
font-family: 'Fira Sans', sans-serif;
13+
font-weight: 600;
14+
font-size: 18px;
15+
text-align: center;
16+
width: 200px;
17+
height: 35px;
18+
line-height: 35px;
19+
margin-top: 25px;
20+
margin-left: auto;
21+
margin-right: auto;
22+
}

0 commit comments

Comments
 (0)