-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
399 additions
and
30 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
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 @@ | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,38 @@ | ||
// Function to fetch and display subdirectories (models) of the selected directory | ||
async function fetchSubdirectories() { | ||
const params = new URLSearchParams(window.location.search); | ||
const directoryName = params.get('directory'); | ||
const subdirectoriesList = document.getElementById('subdirectories'); | ||
|
||
try { | ||
const response = await fetch(`https://api.github.com/repos/recodehive/machine-learning-repos/contents/${directoryName}`); | ||
if (!response.ok) { | ||
throw new Error(`HTTP error! status: ${response.status}`); | ||
} | ||
const data = await response.json(); | ||
const subdirectories = data.filter(item => item.type === 'dir'); | ||
|
||
subdirectories.forEach(subdirectory => { | ||
const li = document.createElement('li'); | ||
li.classList.add('card'); | ||
|
||
const h3 = document.createElement('h3'); | ||
h3.textContent = subdirectory.name; | ||
|
||
const a = document.createElement('a'); | ||
a.href = subdirectory.html_url; | ||
a.textContent = 'View Repository'; | ||
a.classList.add('btn-view-repo'); | ||
|
||
li.appendChild(h3); | ||
li.appendChild(a); | ||
subdirectoriesList.appendChild(li); | ||
}); | ||
} catch (error) { | ||
console.error('Error fetching subdirectories:', error); | ||
subdirectoriesList.innerHTML = '<li class="card">Failed to load models.</li>'; | ||
} | ||
} | ||
|
||
// Call the function when the page loads | ||
document.addEventListener('DOMContentLoaded', fetchSubdirectories); |
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
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,62 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Models</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
<link rel="icon" href="/assets/recode-hive.png" type="image/png"> <!-- Added favicon --> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> | ||
</head> | ||
<body class="dark-mode"> | ||
<div class="loading-container" id="loading-animation"> | ||
<div class="loader"></div> | ||
</div> | ||
<header> | ||
<nav class="navbar"> | ||
<a class="logo-container" href="/"> | ||
<img src="assets/recode-hive.png" alt="Recode Hive Icon" class="logo-icon"> | ||
<span class="logo-text">Recode Hive</span> | ||
</a> | ||
<ul class="nav-links"> | ||
<li><a href="/">Home</a></li> | ||
<li><a href="/about">About</a></li> | ||
<li><a href="/organization">Organization</a></li> | ||
<li><a href="/faq">FAQ</a></li> | ||
<li><a href="/contact">Contact</a></li> | ||
<div class="nav-icons"> | ||
<li> | ||
<a href="https://github.com/recodehive/machine-learning-repos" target="_blank"> | ||
<img src="assets/images.png" alt="GitHub"> <!-- GitHub Icon --> | ||
</a> | ||
</li> | ||
<li> | ||
<button id="toggle-dark-mode"> | ||
<i class="fas fa-moon"></i> | ||
</button> | ||
</li> | ||
</div> | ||
</ul> | ||
<div class="line" id="line"> | ||
<div class="bar1"></div> | ||
<div class="bar2"></div> | ||
<div class="bar3"></div> | ||
</div> | ||
</nav> | ||
</header> | ||
<section id="model-list"> | ||
<h2>Explore Our Models</h2> | ||
<ul id="subdirectories"></ul> | ||
</section> | ||
<footer class="footer"> | ||
<div>© <span id="year"></span> Machine Learning Repos - <a href="https://github.com/recodehive" id="footer-link">RecodeHive</a>. All rights reserved.</div> | ||
</footer> | ||
|
||
<script> | ||
const year = new Date().getFullYear(); | ||
document.getElementById("year").textContent = year; | ||
</script> | ||
<script src="js/models.js"></script> | ||
<script src="js/script.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.