motoe moto commited on
Commit
bb384bf
1 Parent(s): 3566b47

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +108 -13
index.html CHANGED
@@ -5,37 +5,132 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>File List</title>
7
  <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  body {
9
- background-color: #333;
10
  color: #fff;
 
 
 
 
 
 
 
 
11
  }
12
  a {
13
- color: #9ecfff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  </style>
16
  </head>
17
  <body>
18
- <h1>Files in Directory</h1>
19
- <ul id="fileList"></ul>
 
 
 
 
 
 
 
20
 
21
  <script>
 
 
 
22
  fetch('list.yml')
23
  .then(response => response.text())
24
  .then(data => {
25
  const files = data.split('\n')
26
  .filter(line => line.trim() !== '')
27
  .map(line => line.replace(/^- /, '').trim());
28
- const listElement = document.getElementById('fileList');
29
- files.forEach(file => {
30
- const listItem = document.createElement('li');
31
- const link = document.createElement('a');
32
- link.href = file;
33
- link.textContent = file;
34
- listItem.appendChild(link);
35
- listElement.appendChild(listItem);
36
- });
 
 
 
 
 
37
  })
38
  .catch(error => console.error('Error loading the file list:', error));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </script>
40
  </body>
41
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>File List</title>
7
  <style>
8
+ @keyframes fadeIn {
9
+ from { opacity: 0; }
10
+ to { opacity: 1; }
11
+ }
12
+
13
+ body, html {
14
+ height: 100%;
15
+ margin: 0;
16
+ }
17
+
18
+ .bg {
19
+ /* The video background */
20
+ position: fixed;
21
+ right: 0;
22
+ bottom: 0;
23
+ min-width: 100%;
24
+ min-height: 100%;
25
+ }
26
+
27
  body {
28
+ /* Styling for content */
29
  color: #fff;
30
+ display: flex;
31
+ justify-content: center;
32
+ align-items: flex-start; /* Align items to the top */
33
+ height: 100vh;
34
+ padding-top: 20px; /* Add padding to top to move content down slightly */
35
+ overflow: hidden; /* Lock scrolling */
36
+ animation: fadeIn 1s ease-out;
37
+ position: relative;
38
  }
39
  a {
40
+ color: #FF0000; /* Brighter red for better visibility */
41
+ font-size: 24px; /* Increased font size for file names */
42
+ text-decoration: none; /* No underline */
43
+ transition: transform 0.3s ease-in-out, color 0.3s ease-in-out; /* Added transform transition */
44
+ }
45
+ a:hover {
46
+ color: #FFFFFF; /* White color on hover */
47
+ transform: scale(1.2); /* Scale up on hover */
48
+ }
49
+ ul {
50
+ list-style: none;
51
+ padding: 0;
52
+ text-align: center; /* Center align the list items */
53
+ }
54
+ div {
55
+ text-align: center; /* Center align the div content */
56
+ animation: fadeIn 2s ease-in;
57
+ }
58
+ h1 {
59
+ color: #FF0000; /* Brighter red consistent with link color */
60
+ text-shadow: 2px 2px 4px #000000; /* Text shadow for better readability */
61
+ }
62
+ #pagination {
63
+ margin-top: 20px;
64
+ display: flex;
65
+ justify-content: center; /* Center pagination */
66
+ }
67
+ .page-link {
68
+ color: #FFB6C1; /* Light pink */
69
+ font-size: 24px; /* Made page number bigger */
70
+ cursor: pointer;
71
+ margin: 0 10px; /* Increase spacing */
72
+ transition: transform 0.2s ease-in-out;
73
+ }
74
+ .page-link:hover {
75
+ transform: scale(1.2); /* Scale up on hover */
76
+ color: #FF69B4; /* Hot pink on hover */
77
  }
78
  </style>
79
  </head>
80
  <body>
81
+ <video autoplay muted loop class="bg">
82
+ <source src="1.mp4" type="video/mp4">
83
+ Your browser does not support HTML5 video.
84
+ </video>
85
+ <div>
86
+ <h1>Files in Directory</h1>
87
+ <ul id="fileList"></ul>
88
+ <div id="pagination"></div>
89
+ </div>
90
 
91
  <script>
92
+ const itemsPerPage = 5; // Number of files to display per page
93
+ let currentPage = 1;
94
+
95
  fetch('list.yml')
96
  .then(response => response.text())
97
  .then(data => {
98
  const files = data.split('\n')
99
  .filter(line => line.trim() !== '')
100
  .map(line => line.replace(/^- /, '').trim());
101
+ const totalPages = Math.ceil(files.length / itemsPerPage);
102
+ displayFiles(files, currentPage);
103
+
104
+ const paginationElement = document.getElementById('pagination');
105
+ for (let i = 1; i <= totalPages; i++) {
106
+ const pageLink = document.createElement('span');
107
+ pageLink.textContent = i;
108
+ pageLink.className = 'page-link';
109
+ pageLink.onclick = () => {
110
+ currentPage = i;
111
+ displayFiles(files, currentPage);
112
+ };
113
+ paginationElement.appendChild(pageLink);
114
+ }
115
  })
116
  .catch(error => console.error('Error loading the file list:', error));
117
+
118
+ function displayFiles(files, page) {
119
+ const start = (page - 1) * itemsPerPage;
120
+ const end = start + itemsPerPage;
121
+ const paginatedFiles = files.slice(start, end);
122
+
123
+ const listElement = document.getElementById('fileList');
124
+ listElement.innerHTML = ''; // Clear previous entries
125
+ paginatedFiles.forEach(file => {
126
+ const listItem = document.createElement('li');
127
+ const link = document.createElement('a');
128
+ link.href = file;
129
+ link.textContent = file.replace(/^files\//, ''); // Remove 'files/' from display text
130
+ listItem.appendChild(link);
131
+ listElement.appendChild(listItem);
132
+ });
133
+ }
134
  </script>
135
  </body>
136
  </html>