-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
263 additions
and
37 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,8 @@ body { | |
justify-content: center; | ||
|
||
align-items: center; | ||
} | ||
|
||
#pacman { | ||
font-family: 'Bungee Inline'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<!-- What user will use for input --> | ||
<input placeholder='Name' type='text' id='name'> | ||
<input placeholder='Message' type='text' id='message'> | ||
<!-- button for sending message to message board --> | ||
<button onclick='sendMessage()' id='js'>Use Plain JS</button> | ||
<!-- Empty div where the messages will show up --> | ||
<div id='messageBoard'></div> | ||
<script src="https://www.gstatic.com/firebasejs/3.2.1/firebase.js"></script> | ||
<script> | ||
// Initialize Firebase | ||
var config = { | ||
apiKey: "AIzaSyAxEcWqSxZ5B0TnfwrEwYWpNEKD0MEuoeE", | ||
authDomain: "all-star-code.firebaseapp.com", | ||
databaseURL: "https://all-star-code.firebaseio.com", | ||
storageBucket: "", | ||
}; | ||
firebase.initializeApp(config); | ||
</script> | ||
|
||
<!-- adding jQuery --> | ||
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> | ||
<!-- script we'll make dynamic changes with. You'll have to create this file --> | ||
<script src='script.js'></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var database = firebase.database().ref(); | ||
|
||
function sendMessage(){ | ||
var name = $('#name').val(); | ||
var message = $('#message').val(); | ||
//Sending messages | ||
database.push({ | ||
'name':name, | ||
'message':message | ||
}); | ||
} | ||
|
||
database.on('child_added',function(dataRow){ | ||
var row = dataRow.val(); | ||
$("#messageBoard").append("<p>"+row.name+": "+row.message+"</p>"); | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
html, body{ | ||
background-color: cornsilk; | ||
} | ||
|
||
#name{ | ||
height:50px; | ||
font-family: 'Bungee Inline'; | ||
width:300px; | ||
font-size:16pt; | ||
text-align: center; | ||
} | ||
|
||
#submit{ | ||
font-family: 'Bungee Inline'; | ||
border:none; | ||
font-size:14pt; | ||
color:white; | ||
margin-top:10px; | ||
background-color: cornflowerblue; | ||
text-align: center; | ||
padding: 8px 32px; | ||
} | ||
|
||
#submit:hover{ | ||
background-color: deepskyblue; | ||
cursor: pointer; | ||
} | ||
|
||
#img{ | ||
margin-top: 50px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<center> | ||
<input id='name' placeholder="Movie Name"> | ||
<br> | ||
<button id='submit'>Submit</button> | ||
<div id='poster'></div> | ||
<div id='content'></div> | ||
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> | ||
<script src='apiPract.js'></script> | ||
<link rel="stylesheet" type="text/css" href="apiPract.css"> | ||
</center> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$("#submit").click(function(){ | ||
grabData(); | ||
}) | ||
|
||
function grabData(){ | ||
var name = $("#name").val(); | ||
$.ajax({ | ||
url:"http://www.omdbapi.com/?t="+name, | ||
success:function(result){ | ||
console.log(result); | ||
} | ||
}) | ||
} | ||
|
||
function print(obj){ | ||
$('#content').text(''); | ||
$('#poster').text(''); | ||
for(var prop in obj){ | ||
if (prop!="Poster"){ | ||
$('#content').append('<p>'+prop+': '+obj[prop]+'</p>'); | ||
} | ||
if (prop=="Poster"){ | ||
$('#poster').append('<img src="'+obj[prop]+'">'); | ||
} | ||
} | ||
} | ||
|
||
$('#submit').click(function(){ | ||
grabData(); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<center> | ||
<button id='submit'>Random Word</button> | ||
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> | ||
<script src='script.js'></script> | ||
</center> | ||
</body> | ||
</html> |
Oops, something went wrong.