music / index.html
motoe moto
Update index.html
105d29f verified
raw
history blame
No virus
5.26 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File List</title>
<style>
body, html {
height: 100%;
margin: 0;
}
.bg {
/* The video background */
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
z-index: -1; /* Ensure video stays in the background */
}
body {
/* Styling for content */
color: #fff;
display: flex;
justify-content: center;
align-items: center; /* Align items to the center */
height: 100vh;
overflow: hidden; /* Lock scrolling */
position: relative;
}
a {
color: #FF0000; /* Brighter red for better visibility */
font-size: 24px; /* Increased font size for file names */
text-decoration: none; /* No underline */
transition: transform 0.3s ease-in-out, color 0.3s ease-in-out; /* Added transform transition */
}
a:hover {
color: #FFFFFF; /* White color on hover */
transform: scale(1.2); /* Scale up on hover */
}
ul {
list-style: none;
padding: 0;
text-align: center; /* Center align the list items */
}
div {
text-align: center; /* Center align the div content */
}
h1 {
color: #FF0000; /* Brighter red consistent with link color */
text-shadow: 2px 2px 4px #000000; /* Text shadow for better readability */
}
#pagination {
margin-top: 20px;
display: flex;
justify-content: center; /* Center pagination */
}
.page-link {
color: #FFB6C1; /* Light pink */
font-size: 24px; /* Made page number bigger */
cursor: pointer;
margin: 0 10px; /* Increase spacing */
transition: transform 0.2s ease-in-out;
}
.page-link:hover {
transform: scale(1.2); /* Scale up on hover */
color: #FF69B4; /* Hot pink on hover */
}
/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
body {
flex-direction: column;
justify-content: space-around;
}
h1 {
font-size: 20px; /* Smaller font size for smaller screens */
}
a {
font-size: 18px; /* Smaller font size for links on smaller screens */
}
.page-link {
font-size: 18px; /* Smaller font size for pagination on smaller screens */
}
}
</style>
</head>
<body>
<div>
<h1>Files in Directory</h1>
<ul id="fileList"></ul>
<div id="pagination"></div>
</div>
<video autoplay muted loop class="bg">
<source src="1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
<script>
const itemsPerPage = 5; // Number of files to display per page
let currentPage = 1;
fetch('list.yml')
.then(response => response.text())
.then(data => {
const files = data.split('\n')
.filter(line => line.trim() !== '')
.map(line => line.replace(/^- /, '').trim());
const totalPages = Math.ceil(files.length / itemsPerPage);
displayFiles(files, currentPage);
const paginationElement = document.getElementById('pagination');
paginationElement.innerHTML = ''; // Clear previous pagination links
for (let i = 1; i <= totalPages; i++) {
const pageLink = document.createElement('span');
pageLink.textContent = i;
pageLink.className = 'page-link';
pageLink.onclick = () => {
currentPage = i;
displayFiles(files, currentPage);
};
paginationElement.appendChild(pageLink);
}
})
.catch(error => console.error('Error loading the file list:', error));
function displayFiles(files, page) {
const start = (page - 1) * itemsPerPage;
const end = start + itemsPerPage;
const paginatedFiles = files.slice(start, end);
const listElement = document.getElementById('fileList');
listElement.innerHTML = ''; // Clear previous entries
paginatedFiles.forEach(file => {
const listItem = document.createElement('li');
const link = document.createElement('a');
link.href = file;
link.textContent = file.replace(/^files\//, ''); // Remove 'files/' from display text
listItem.appendChild(link);
listElement.appendChild(listItem);
});
}
</script>
</body>
</html>