forked from github/codespaces-blank
-
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.
Merge pull request github#1 from JoelMinaya114/JoelBranch
index, script, styles
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Slide to Letter</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="slider-container"> | ||
<label for="letterSlider">Slide to Select a Letter:</label> | ||
<input type="range" id="letterSlider" min="0" max="25" value="0"> | ||
<span id="selectedLetter">A</span> | ||
</div> | ||
|
||
<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,20 @@ | ||
// script.js | ||
const slider = document.getElementById('letterSlider'); | ||
const selectedLetter = document.getElementById('selectedLetter'); | ||
|
||
// Array of letters A-Z | ||
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | ||
|
||
// Update the displayed letter and redirect when the slider is moved | ||
slider.addEventListener('input', function() { | ||
const letterIndex = this.value; | ||
selectedLetter.textContent = letters[letterIndex]; | ||
}); | ||
|
||
// Redirect on change | ||
slider.addEventListener('change', function() { | ||
const selectedLetter = letters[this.value]; | ||
// Example: Redirect to a URL based on the letter selected | ||
// In a real application, replace with actual URLs | ||
window.location.href = `https://example.com/page-${selectedLetter}`; | ||
}); |
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,35 @@ | ||
/* styles.css */ | ||
.slider-container { | ||
width: 300px; | ||
margin: 50px auto; | ||
text-align: center; | ||
} | ||
|
||
input[type="range"] { | ||
width: 100%; | ||
margin: 20px 0; | ||
-webkit-appearance: none; | ||
appearance: none; | ||
height: 8px; | ||
background: #ddd; | ||
outline: none; | ||
border-radius: 5px; | ||
} | ||
|
||
input[type="range"]::-webkit-slider-thumb { | ||
-webkit-appearance: none; | ||
appearance: none; | ||
width: 20px; | ||
height: 20px; | ||
background: #007BFF; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
} | ||
|
||
input[type="range"]::-moz-range-thumb { | ||
width: 20px; | ||
height: 20px; | ||
background: #007BFF; | ||
border-radius: 50%; | ||
cursor: pointer; | ||
} |