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

mobile responsive #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>

<html lang="en">

<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">

<!-- fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
10 changes: 6 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ if(minutes < 10){
}
//create a new P tag, save it in a variable
let theNewDiv = document.createElement("div");
let timeDiv = document.createElement("div");
//add a class to our new div element

let darkMode = document.getElementById("mode");
Expand All @@ -43,9 +42,9 @@ if(minutes < 10){
}

timeDiv.classList.add("right");

//set the text inside the div
theNewDiv.innerHTML = document.getElementById("textInput").value;
timeDiv.innerHTML = time;

//find the right tag to add the div to
//we used an id of "content-area" for
Expand All @@ -54,6 +53,7 @@ if(minutes < 10){

//add the new div to that tag
theContentArea.appendChild(theNewDiv);

theContentArea.appendChild(timeDiv);

//play a sound when a post is made
Expand All @@ -74,9 +74,9 @@ if(minutes < 10){
}else{
time = hours + ":" + minutes;
}

//create a new P tag, save it in a variable
let theNewDiv = document.createElement("div");
let timeDiv = document.createElement("div");
//add a class to our new div element

let darkMode = document.getElementById("mode");
Expand All @@ -85,6 +85,7 @@ if(minutes < 10){
theNewDiv.classList.add("darkAuto-div");
} else {
theNewDiv.classList.add("auto-div");

}

timeDiv.classList.add("right");
Expand All @@ -95,7 +96,6 @@ if(minutes < 10){

//set the text inside the div
theNewDiv.innerHTML = theImgTag;
timeDiv.innerHTML = time;

//find the right tag to add the div to
//we used an id of "content-area" for
Expand All @@ -104,6 +104,7 @@ if(minutes < 10){

//add the new div to that tag
theContentArea.appendChild(theNewDiv);

theContentArea.appendChild(timeDiv);

//play a sound when a post is made
Expand All @@ -130,6 +131,7 @@ if(minutes < 10){
});



function emptyText()
{
document.getElementById("textInput").value = ""; //Clears input box for text
Expand Down
34 changes: 30 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body {
color: blue;
}

.my-button {
.button {
border: 0px;
background-color: #CDDEE9;
padding: 10px;
Expand All @@ -35,20 +35,21 @@ body {
.left-col {
/*style left column*/
padding: 15px;

height: 100%;
background-color: #780000;

}

.right-col {
/*style right column*/
padding: 15px;
background-color: #FDF0D5;
height: 100%;
}

#content-area {
height: 100%;
background-color: #FDF0D5;
}

/*format for each chirp message*/
.auto-div {
/*15px on top and botton*/
Expand Down Expand Up @@ -147,3 +148,28 @@ a:hover {
.main {
text-align: center;
}

@media only screen and (max-width: 620px) {
/* For mobile phones: */
.right-col {
/* width: 100%; */
height: 70%;
padding-bottom: 40%;
}
.left-col {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #fad02c;
text-align: center;
height: 30%;
}
.grid-container {
grid-template-columns: 100%;
grid-template-rows: 75% 25%;
}
.auto-div {
width: 75%;
}
}