Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Favicon and Assets Folder #38

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.DS_Store
619 changes: 619 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

Binary file added assets/alert_chirp.mp3
Binary file not shown.
Binary file added assets/alert_image.mp3
Binary file not shown.
Binary file added assets/chirpLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/favicon.ico
Binary file not shown.
15 changes: 5 additions & 10 deletions index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,27 @@
<title>
CHIRP
</title>
<link rel="icon" type="image/ico" href="assets/favicon.ico"/>
</head>
<body>
<div class="grid-container">
<div class="left-col">
<img src="assets/chirpLogo.png" alt="logo" width="200" height="200"/>
<p>
<input type="text" placeholder="Enter chirp" id="textInput">
</p>
<button class="my-button" onclick="addDiv()">Add a chirp</button>
<button class="my-button" onclick="addDiv(); emptyText()">Add a chirp</button>
<p>
<input type="text" placeholder="Image url" id="imgInput">
</p>
<button class="my-button" onclick="addImage()">Add an image</button>
<button class="my-button" onclick="addImage(); emptyImg()">Add an image</button>

</div>

<div class="right-col" id="content-area">
</div>
</div>






<script src="script.js">
</script>

<script src="script.js"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions script.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ let time = hours + ":" + currentDate.getMinutes();
//add the new div to that tag
theContentArea.appendChild(theNewDiv);
theContentArea.appendChild(timeDiv);

//play a sound when a post is made
let audio = new Audio("assets/alert_chirp.mp3");
audio.play();
}

function addImage() {
Expand Down Expand Up @@ -56,6 +60,38 @@ let time = hours + ":" + currentDate.getMinutes();
theContentArea.appendChild(theNewDiv);
theContentArea.appendChild(timeDiv);

//play a sound when a post is made
let audio = new Audio("assets/alert_image.mp3");
audio.play();

var input = document.getElementById("textInput"); //Get the input box
input.addEventListener("keyup", function(event) { //Check keys
if (event.keyCode === 13) { //Check for enter key
event.preventDefault();
// document.getElementById("my-button").click(); //Should activate the button, but doesn't.
addDiv(); //Submit the text
emptyText(); //Clear the input
}
});
var imginput = document.getElementById("imgInput"); //Get the input box
imginput.addEventListener("keyup", function(event) { //Check keys
if (event.keyCode === 13) { //Check for enter key
event.preventDefault();
// document.getElementById("my-button").click(); //Should activate the button, but doesn't.
addImage(); //Submit the image link
emptyImg(); //Clear the input
}
});


function emptyText()
{
document.getElementById("textInput").value = ""; //Clears input box for text
}
function emptyImg()
{
document.getElementById("imgInput").value = ""; //Clears input box for image links
}


}
10 changes: 5 additions & 5 deletions style.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body {

.my-button {
border: 0px;
background-color: #90adc6;
background-color: #fdfcdc;
padding: 10px;
border: 1px solid black;
}
Expand All @@ -38,13 +38,13 @@ body {
.left-col {
/*style left column*/
padding: 15px;
background-color: #fad02c;
background-color: #0081a7;
}

.right-col {
/*style right column*/
padding: 15px;
background-color: coral;
background-color: #00afb9;
}

/*format for each chirp message*/
Expand All @@ -55,8 +55,8 @@ body {

padding: 10px;

background-color: palevioletred;
border: 3px solid peachpuff;
background-color: #f07167;
border: 3px solid #fdfcdc;
}
.right {
margin: -15px 0;
Expand Down