Skip to content

Commit e4ef47c

Browse files
committed
updated code
1 parent cb652f7 commit e4ef47c

File tree

1 file changed

+56
-31
lines changed

1 file changed

+56
-31
lines changed

index.html

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -159,32 +159,40 @@
159159
}
160160
/* Styles for images in fullscreen mode */
161161
.slideshow-container:-webkit-full-screen .mySlides img {
162-
width: 100%; /* Image takes full width of the slide */
163-
height: 100%; /* Image takes full height of the slide */
162+
width: auto; /* Changed to auto */
163+
height: auto; /* Changed to auto */
164+
max-width: 100%; /* Ensure max width is 100% of container */
164165
max-height: 100%; /* Ensure max height is 100% of container */
165-
object-fit: cover; /* *** Changed to cover *** */
166+
object-fit: contain; /* Changed to contain */
166167
border-radius: 0; /* No rounded corners in fullscreen */
168+
margin: auto; /* Added margin: auto for centering */
167169
}
168170
.slideshow-container:-moz-full-screen .mySlides img {
169-
width: 100%;
170-
height: 100%;
171+
width: auto; /* Changed to auto */
172+
height: auto; /* Changed to auto */
173+
max-width: 100%;
171174
max-height: 100%;
172-
object-fit: cover; /* *** Changed to cover *** */
175+
object-fit: contain; /* Changed to contain */
173176
border-radius: 0;
177+
margin: auto; /* Added margin: auto for centering */
174178
}
175179
.slideshow-container:-ms-full-screen .mySlides img {
176-
width: 100%;
177-
height: 100%;
180+
width: auto; /* Changed to auto */
181+
height: auto; /* Changed to auto */
182+
max-width: 100%;
178183
max-height: 100%;
179-
object-fit: cover; /* *** Changed to cover *** */
184+
object-fit: contain; /* Changed to contain */
180185
border-radius: 0;
186+
margin: auto; /* Added margin: auto for centering */
181187
}
182188
.slideshow-container:full-screen .mySlides img {
183-
width: 100%;
184-
height: 100%;
189+
width: auto; /* Changed to auto */
190+
height: auto; /* Changed to auto */
191+
max-width: 100%;
185192
max-height: 100%;
186-
object-fit: cover; /* *** Changed to cover *** */
193+
object-fit: contain; /* Changed to contain */
187194
border-radius: 0;
195+
margin: auto; /* Added margin: auto for centering */
188196
}
189197

190198

@@ -326,24 +334,24 @@
326334
left: 10px; /* Position from left */
327335
width: 100px; /* Small width */
328336
height: 20px; /* Small height */
329-
opacity: 0.5; /* Increased opacity for debugging */
330-
border: 1px solid rgba(0, 0, 0, 0.5); /* Darker outline for debugging */
331-
background-color: rgba(255, 255, 255, 0.2); /* Slightly visible background for debugging */
332-
color: black; /* Make text visible for debugging */
333-
caret-color: black; /* Make cursor visible for debugging */
337+
opacity: 0.1; /* Make it lightly visible */
338+
border: 1px solid rgba(0, 0, 0, 0.2); /* Light black outline */
339+
background-color: transparent; /* Transparent background */
340+
color: transparent; /* Hide typed text */
341+
caret-color: rgba(0, 0, 0, 0.5); /* Light cursor color */
334342
z-index: 10000; /* Increased z-index further */
335343
padding: 0; /* Remove padding */
336344
margin: 0; /* Remove margin */
337345
transition: opacity 0.3s ease; /* Smooth transition for opacity */
338346
}
339347
#spamInput:focus {
340348
outline: none; /* Remove default focus outline */
341-
opacity: 1; /* Fully visible when focused */
349+
opacity: 0.3; /* Slightly more visible when focused */
342350
}
343351
/* Add hover effect */
344352
#spamInput:hover {
345-
opacity: 0.8; /* More visible on hover */
346-
border-color: rgba(0, 0, 0, 0.8); /* Darker outline on hover */
353+
opacity: 0.5; /* More visible on hover */
354+
border-color: rgba(0, 0, 0, 0.5); /* Darker outline on hover */
347355
}
348356

349357

@@ -680,20 +688,14 @@
680688
// Add event listener to the hidden spam input
681689
const spamInput = document.getElementById('spamInput');
682690
spamInput.addEventListener('input', function() {
683-
console.log('Spam input value:', this.value); // *** Added console log ***
684691
const inputValue = this.value.toLowerCase();
692+
this.value = ''; // Clear the input immediately
685693

686-
// *** Added console logs to check if conditions are met ***
687694
if (inputValue === 'spam') {
688-
console.log('Input is "spam". Triggering spam.');
689-
this.value = ''; // Clear the input immediately
690695
triggerSpam(); // Trigger the spam function
691696
} else if (inputValue === 'cookie') {
692-
console.log('Input is "cookie". Displaying cookie.');
693-
this.value = ''; // Clear the input immediately
694697
displayCookie(); // Display the cookie string and copy button
695698
} else {
696-
console.log('Input is not "spam" or "cookie". Hiding output.');
697699
// Optionally hide spamOutput if something else is typed
698700
document.getElementById('spamOutput').style.display = 'none';
699701
document.getElementById('spamOutput').innerHTML = '';
@@ -787,6 +789,29 @@
787789
}
788790

789791

792+
// Add keyboard event listener for arrow keys
793+
document.addEventListener('keydown', function(event) {
794+
// Check if the passcode container is visible. If so, don't navigate slides.
795+
const passcodeContainer = document.getElementById('passcodeContainer');
796+
if (passcodeContainer.style.display !== 'none') {
797+
return; // Exit the function if passcode is required
798+
}
799+
800+
// Check if the spamOutput is visible. If so, don't navigate slides.
801+
const spamOutput = document.getElementById('spamOutput');
802+
if (spamOutput.style.display !== 'none') {
803+
return; // Exit the function if spam/cookie output is shown
804+
}
805+
806+
807+
if (event.key === 'ArrowLeft') {
808+
plusSlides(-1); // Go to previous slide
809+
} else if (event.key === 'ArrowRight') {
810+
plusSlides(1); // Go to next slide
811+
}
812+
});
813+
814+
790815
// Initial call to hide the slideshow area until passcode is entered
791816
document.getElementById('slideshowArea').style.display = 'none';
792817

@@ -811,10 +836,10 @@
811836
}
812837
}
813838

814-
// *** Explicitly focus the spam input on page load for testing ***
815-
window.onload = function() {
816-
document.getElementById('spamInput').focus();
817-
};
839+
// *** Explicitly focus the spam input on page load for testing (removed as it interfered with arrow keys) ***
840+
// window.onload = function() {
841+
// document.getElementById('spamInput').focus();
842+
// };
818843

819844

820845
</script>

0 commit comments

Comments
 (0)