Skip to content

Commit

Permalink
mobile responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
davenarchives committed Oct 27, 2024
1 parent 8ffe91a commit 0b97c8d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
19 changes: 17 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function uploadFile(file) {
fetch('https://api.remove.bg/v1.0/removebg', {
method: 'POST',
headers: {
'X-Api-Key': 'UartFkyZmYmZfJvykz6e5AAG',
'X-Api-Key': 'PJ6coatQNuA8gZHZHaU7XLex',
},
body: formData
})
Expand Down Expand Up @@ -118,7 +118,7 @@ function uploadFileFromBlob(blob) {
fetch('https://api.remove.bg/v1.0/removebg', {
method: 'POST',
headers: {
'X-Api-Key': 'UartFkyZmYmZfJvykz6e5AAG',
'X-Api-Key': 'PJ6coatQNuA8gZHZHaU7XLex',
},
body: formData
})
Expand Down Expand Up @@ -164,3 +164,18 @@ resetBtn.addEventListener('click', () => {
resetBtn.classList.add('hidden');
output.classList.add('hidden');
});
function showOutput() {
comparisonContainer.style.display = 'flex';
output.classList.remove('hidden');
}
function showOutput() {
comparisonContainer.style.display = 'flex';
output.classList.remove('hidden');

// Smoothly scroll to the output section and ensure it's fully visible
output.scrollIntoView({ behavior: 'smooth', block: 'center' });

// Optionally, set focus to the output container to ensure it's active
output.focus({ preventScroll: true });
}

17 changes: 17 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* General reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

/* Body styling */
body {
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
background-color: #292826;
Expand All @@ -16,6 +18,7 @@ body {
min-height: 100vh; /* Minimum height to cover the viewport */
}

/* Main container styling */
.main-container {
display: flex;
justify-content: space-between;
Expand All @@ -28,6 +31,7 @@ body {
user-select: none;
}

/* Title container styling */
.title-container {
width: 40%;
text-align: left;
Expand Down Expand Up @@ -56,6 +60,7 @@ body {
color: #2C65AE;
}

/* Upload container styling */
.upload-container {
text-align: center; /* Center text inside upload-container */
width: 40%;
Expand All @@ -81,6 +86,7 @@ h2 {
margin-bottom: 20px;
}

/* Drag and drop area styling */
#drop-area {
font-weight: bold;
border: 2px dashed #3ABEF9;
Expand All @@ -105,6 +111,7 @@ h2 {
background-color: #2d2c2c;
}

/* Button styling */
#choose-file-btn {
padding: 12px 24px;
background-color: #3ABEF9;
Expand All @@ -121,6 +128,7 @@ h2 {
background-color: #2C65AE;
}

/* URL container styling */
.url-container {
margin-top: 10px;
margin-bottom: 10px;
Expand Down Expand Up @@ -174,6 +182,7 @@ h2 {
color: #3ABEF9;
}

/* Comparison section styling */
#comparison {
display: flex;
justify-content: space-between;
Expand All @@ -198,6 +207,7 @@ img {
margin-top: 10px;
}

/* Button container styling */
.button-container {
text-align: center;
margin-top: 10px;
Expand Down Expand Up @@ -256,6 +266,13 @@ img {
text-align: center; /* Center text */
}

#drop-area {
width: 90%; /* Adjust the width for smaller screens */
height: auto; /* Let height adjust automatically */
max-width: 350px; /* Set a maximum width */
margin: 20px auto; /* Center the drag-and-drop box */
}

#comparison {
flex-direction: column; /* Stack images vertically */
margin-left: 0; /* Remove left margin */
Expand Down

0 comments on commit 0b97c8d

Please sign in to comment.