-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfile_list.html
129 lines (125 loc) · 10 KB
/
file_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<h1>## File List</h1>
<p># Here is a list of files included in this repository:</p>
<div class="lazyload-placeholder" data-content="file-list-1" style="min-height: 400px;"></div>
<script>
document.addEventListener("DOMContentLoaded", function() {
const lazyLoadElements = document.querySelectorAll('.lazyload-placeholder');
if ("IntersectionObserver" in window) {
let rootMargin = '0px 0px 400px 0px';
let threshold = 0.5;
if (window.innerWidth <= 768) { // Mobile devices
rootMargin = '0px 0px 100px 0px';
threshold = 0.1;
} else if (window.innerWidth <= 1024) { // Tablets
rootMargin = '0px 0px 200px 0px';
threshold = 0.3;
} else if (window.innerWidth <= 1440) { // Small desktops
rootMargin = '0px 0px 300px 0px';
threshold = 0.4;
} else { // Large desktops
rootMargin = '0px 0px 400px 0px';
threshold = 0.5;
}
let observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
let placeholder = entry.target;
let contentId = placeholder.dataset.content;
let file_list_html = '';
switch(contentId) {
case 'file-list-1':
file_list_html = `<ul><h2 style="color: #95d3df;">Repo Root</h2>
<li><a href="https://github.com/author/repo/blob/main/.gitignore" style="color: #c68bdc;">.gitignore</a></li>
<li><a href="https://github.com/author/repo/blob/main/.jsbeautifyrc" style="color: #649667;">.jsbeautifyrc</a></li>
<li><a href="https://github.com/author/repo/blob/main/.pre-commit-config.yaml" style="color: #c6b562;">.pre-commit-config.yaml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.prettierrc" style="color: #2df6be;">.prettierrc</a></li>
<li><a href="https://github.com/author/repo/blob/main/.stylelintrc.json" style="color: #f97cf3;">.stylelintrc.json</a></li>
<li><a href="https://github.com/author/repo/blob/main/.vale.ini" style="color: #e7bfb2;">.vale.ini</a></li>
<li><a href="https://github.com/author/repo/blob/main/.yamllint" style="color: #80b0de;">.yamllint</a></li>
<li><a href="https://github.com/author/repo/blob/main/CNAME" style="color: #2df867;">CNAME</a></li>
<li><a href="https://github.com/author/repo/blob/main/CODE_OF_CONDUCT.md" style="color: #4bb69b;">CODE_OF_CONDUCT.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/CONTRIBUTING.md" style="color: #2e9fa1;">CONTRIBUTING.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/README.md" style="color: #cd828d;">README.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/dockerfile" style="color: #658a6e;">dockerfile</a></li>
<li><a href="https://github.com/author/repo/blob/main/favicon.ico" style="color: #8e7ce4;">favicon.ico</a></li>
<li><a href="https://github.com/author/repo/blob/main/file_list.html" style="color: #3494b7;">file_list.html</a></li>
<li><a href="https://github.com/author/repo/blob/main/file_list.md" style="color: #ac998c;">file_list.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/readme.html" style="color: #b7c7c1;">readme.html</a></li>
<li><a href="https://github.com/author/repo/blob/main/requirements.txt" style="color: #aea265;">requirements.txt</a></li>
<li><a href="https://github.com/author/repo/blob/main/sitemap.xml" style="color: #43c4ad;">sitemap.xml</a></li>
/n<h2 style="color: #be74ad;">JavaScript</h2>
<li><a href="https://github.com/author/repo/blob/main/.eslintrc.js" style="color: #908c3d;">.eslintrc.js</a></li>
/n<h2 style="color: #709bbe;">YAML</h2>
<li><a href="https://github.com/author/repo/blob/main/.github/dependabot.yml" style="color: #31a9ce;">.github/dependabot.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/ActionLint.yml" style="color: #fa8f74;">.github/workflows/ActionLint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/greetings.yml" style="color: #a7a353;">.github/workflows/greetings.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/main.yml" style="color: #64d330;">.github/workflows/main.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/sitemap.yml" style="color: #a67b72;">.github/workflows/sitemap.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/stale.yml" style="color: #26b742;">.github/workflows/stale.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/static.yml" style="color: #4894f4;">.github/workflows/static.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.markdownlint.yml" style="color: #8a9a5c;">.markdownlint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.scss-lint.yml" style="color: #9abb02;">.scss-lint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/_config.yml" style="color: #f39856;">_config.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/action.yml" style="color: #ff884c;">action.yml</a></li>
<br><h2 style="color: #dfb3d7;">src</h2>
<li><a href="https://github.com/author/repo/blob/main/src/generate_file_list.py" style="color: #8497d9;">src/generate_file_list.py</a></li></ul>`;
break;
}
placeholder.innerHTML = file_list_html;
observer.unobserve(placeholder);
console.log(`Loaded content for ${contentId}`);
}
});
}, { rootMargin: rootMargin, threshold: threshold });
lazyLoadElements.forEach(element => {
element.style.marginTop = '-17px';
observer.observe(element);
});
} else {
lazyLoadElements.forEach(placeholder => {
let contentId = placeholder.dataset.content;
let file_list_html = '';
switch(contentId) {
case 'file-list-1':
file_list_html = `<ul><h2 style="color: #95d3df;">Repo Root</h2>
<li><a href="https://github.com/author/repo/blob/main/.gitignore" style="color: #c68bdc;">.gitignore</a></li>
<li><a href="https://github.com/author/repo/blob/main/.jsbeautifyrc" style="color: #649667;">.jsbeautifyrc</a></li>
<li><a href="https://github.com/author/repo/blob/main/.pre-commit-config.yaml" style="color: #c6b562;">.pre-commit-config.yaml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.prettierrc" style="color: #2df6be;">.prettierrc</a></li>
<li><a href="https://github.com/author/repo/blob/main/.stylelintrc.json" style="color: #f97cf3;">.stylelintrc.json</a></li>
<li><a href="https://github.com/author/repo/blob/main/.vale.ini" style="color: #e7bfb2;">.vale.ini</a></li>
<li><a href="https://github.com/author/repo/blob/main/.yamllint" style="color: #80b0de;">.yamllint</a></li>
<li><a href="https://github.com/author/repo/blob/main/CNAME" style="color: #2df867;">CNAME</a></li>
<li><a href="https://github.com/author/repo/blob/main/CODE_OF_CONDUCT.md" style="color: #4bb69b;">CODE_OF_CONDUCT.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/CONTRIBUTING.md" style="color: #2e9fa1;">CONTRIBUTING.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/README.md" style="color: #cd828d;">README.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/dockerfile" style="color: #658a6e;">dockerfile</a></li>
<li><a href="https://github.com/author/repo/blob/main/favicon.ico" style="color: #8e7ce4;">favicon.ico</a></li>
<li><a href="https://github.com/author/repo/blob/main/file_list.html" style="color: #3494b7;">file_list.html</a></li>
<li><a href="https://github.com/author/repo/blob/main/file_list.md" style="color: #ac998c;">file_list.md</a></li>
<li><a href="https://github.com/author/repo/blob/main/readme.html" style="color: #b7c7c1;">readme.html</a></li>
<li><a href="https://github.com/author/repo/blob/main/requirements.txt" style="color: #aea265;">requirements.txt</a></li>
<li><a href="https://github.com/author/repo/blob/main/sitemap.xml" style="color: #43c4ad;">sitemap.xml</a></li>
/n<h2 style="color: #be74ad;">JavaScript</h2>
<li><a href="https://github.com/author/repo/blob/main/.eslintrc.js" style="color: #908c3d;">.eslintrc.js</a></li>
/n<h2 style="color: #709bbe;">YAML</h2>
<li><a href="https://github.com/author/repo/blob/main/.github/dependabot.yml" style="color: #31a9ce;">.github/dependabot.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/ActionLint.yml" style="color: #fa8f74;">.github/workflows/ActionLint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/greetings.yml" style="color: #a7a353;">.github/workflows/greetings.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/main.yml" style="color: #64d330;">.github/workflows/main.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/sitemap.yml" style="color: #a67b72;">.github/workflows/sitemap.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/stale.yml" style="color: #26b742;">.github/workflows/stale.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.github/workflows/static.yml" style="color: #4894f4;">.github/workflows/static.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.markdownlint.yml" style="color: #8a9a5c;">.markdownlint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/.scss-lint.yml" style="color: #9abb02;">.scss-lint.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/_config.yml" style="color: #f39856;">_config.yml</a></li>
<li><a href="https://github.com/author/repo/blob/main/action.yml" style="color: #ff884c;">action.yml</a></li>
<br><h2 style="color: #dfb3d7;">src</h2>
<li><a href="https://github.com/author/repo/blob/main/src/generate_file_list.py" style="color: #8497d9;">src/generate_file_list.py</a></li></ul>`;
break;
}
placeholder.innerHTML = file_list_html;
});
}
});
</script>