Skip to content

Commit

Permalink
Merge pull request github#1 from JoelMinaya114/JoelBranch
Browse files Browse the repository at this point in the history
index, script, styles
  • Loading branch information
JoelMinaya114 authored Oct 19, 2024
2 parents ed442db + b8e113a commit c7968fa
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.html
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>
20 changes: 20 additions & 0 deletions script.js
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}`;
});
35 changes: 35 additions & 0 deletions styles.css
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;
}

0 comments on commit c7968fa

Please sign in to comment.