Skip to content

Commit

Permalink
Mobile Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
hackrfstuff committed Dec 8, 2024
1 parent 8837f6b commit c62fb9b
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 60 deletions.
38 changes: 20 additions & 18 deletions docs/batteryandcharging.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,25 @@ <h3 class="card-title">Charging</h3>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script>
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
</script>
if (window.innerWidth >= 768) {
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
}
</script>
</body>
</html>
38 changes: 20 additions & 18 deletions docs/disassembly.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,25 @@ <h3 class="card-title">Disassembly Guide</h3>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script>
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
</script>
if (window.innerWidth >= 768) {
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
}
</script>
</body>
</html>
38 changes: 20 additions & 18 deletions docs/microsdcardsetup.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,25 @@ <h3 class="card-title">MicroSD Card Setup (MacOS Guide Using Disk Utility)</h3>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script>
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
</script>
if (window.innerWidth >= 768) {
fetch('../index.html')
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(data, 'text/html');
const sidebar = htmlDoc.querySelector('.sidebar');
document.getElementById('sidebar-container').innerHTML = sidebar.innerHTML;

const links = document.querySelectorAll('#sidebar-container a');
links.forEach(link => {
const href = link.getAttribute('href');
if (href && href.startsWith('./')) {
link.setAttribute('href', href.replace('./', '../'));
}
});
})
.catch(error => console.error('Error loading sidebar:', error));
}
</script>
</body>
</html>
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HackRF Docs</title>
<title>HackRF Documentation</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
Expand All @@ -19,11 +19,11 @@ <h5 class="sidebar-title">
<div class="accordion" id="sidebarAccordion">
<div class="accordion-item border-0">
<h2 class="accordion-header" id="headingSetup">
<button class="accordion-button collapsed no-hover" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSetup" aria-expanded="false" aria-controls="collapseSetup">
<button class="accordion-button no-hover" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSetup" aria-expanded="true" aria-controls="collapseSetup">
Set Up
</button>
</h2>
<div id="collapseSetup" class="accordion-collapse collapse" aria-labelledby="headingSetup" data-bs-parent="#sidebarAccordion">
<div id="collapseSetup" class="accordion-collapse collapse show" aria-labelledby="headingSetup" data-bs-parent="#sidebarAccordion">
<div class="accordion-body">
<ul class="list-unstyled">
<li><a href="./docs/microsdcardsetup.html" class="text-decoration-none d-block">MicroSD Card Setup</a></li>
Expand All @@ -34,11 +34,11 @@ <h2 class="accordion-header" id="headingSetup">
</div>
<div class="accordion-item border-0">
<h2 class="accordion-header" id="headingRepair">
<button class="accordion-button collapsed no-hover" type="button" data-bs-toggle="collapse" data-bs-target="#collapseRepair" aria-expanded="false" aria-controls="collapseRepair">
<button class="accordion-button no-hover" type="button" data-bs-toggle="collapse" data-bs-target="#collapseRepair" aria-expanded="true" aria-controls="collapseRepair">
Repair Guides
</button>
</h2>
<div id="collapseRepair" class="accordion-collapse collapse" aria-labelledby="headingRepair" data-bs-parent="#sidebarAccordion">
<div id="collapseRepair" class="accordion-collapse collapse show" aria-labelledby="headingRepair" data-bs-parent="#sidebarAccordion">
<div class="accordion-body">
<ul class="list-unstyled">
<li><a href="./docs/disassembly.html" class="text-decoration-none d-block">Disassembly</a></li>
Expand All @@ -51,7 +51,7 @@ <h2 class="accordion-header" id="headingRepair">

<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<h1 class="mt-4">HackRF (PortaPack) Documentation</h1>
<div class="row row-cols-1 g-3">
<div class="row row-cols-1 g-3 d-none d-md-flex">
<div class="col">
<a href="/docs/microsdcardsetup.html" class="text-decoration-none" style="color: black;">
<div class="card h-100">
Expand Down

0 comments on commit c62fb9b

Please sign in to comment.