Skip to content

Commit

Permalink
Update to download stl-files
Browse files Browse the repository at this point in the history
  • Loading branch information
haasithp committed Feb 2, 2025
1 parent fc42e47 commit 50866aa
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
30 changes: 24 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,31 @@
<h3>STL Files</h3>
<p>Download the 3D printable files for the throwing end-effector:</p>
<ul style="list-style-type: none; padding: 0;">
<li><a href="#" onclick="downloadSTLFile('throwing_ee_base_v2.stl')">Base Mount Assembly</a></li>
<li><a href="#" onclick="downloadSTLFile('throwing_ee_gripper_v2.stl')">Gripper Mechanism</a></li>
<li><a href="#" onclick="downloadSTLFile('throwing_ee_spring_housing_v2.stl')">Spring Housing</a></li>
<li><a href="#" onclick="downloadSTLFile('throwing_ee_release_v2.stl')">Release Mechanism</a></li>
<li><a href="#" onclick="downloadSTLFile('throwing_ee_xarm_mount_v2.stl')">xArm Robot Mount Adapter</a></li>
<li><a href="#" onclick="downloadSTLFile('throwing_ee_full_assembly_v2.stl')">Complete Assembly</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('base_mount.stl')">Base Mount Assembly</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('gripper_assembly.stl')">Gripper Assembly</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('spring_housing.stl')">Spring Housing</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('release_mechanism.stl')">Release Mechanism</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('xarm_mount.stl')">xArm Robot Mount</a></li>
<li><a class="download-link" href="javascript:void(0)" onclick="downloadSTLFile('complete_assembly.stl')">Complete Assembly</a></li>
</ul>

<hr style="margin: 20px 0;">

<div style="text-align: center;">
<a class="download-link" href="javascript:void(0)" onclick="downloadAllSTL()" style="font-size: 1.2em; padding: 15px 30px;">
Download All STL Files (ZIP)
</a>
</div>

<hr style="margin: 20px 0;">

<h3>CAD Files</h3>
<p>Download the Fusion 360 CAD files:</p>
<div style="text-align: center;">
<a class="download-link" href="javascript:void(0)" onclick="downloadCADFiles()" style="font-size: 1.2em; padding: 15px 30px;">
Download CAD Files (ZIP)
</a>
</div>
</div>
</center>
</td>
Expand Down
5 changes: 4 additions & 1 deletion project-structure
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ project-root/
│ └── throwing_ee_full_assembly_v2.stl # Complete assembly for reference
├── scripts/
│ └── download.js
└── index.html
└── index.html
└── downloads/
├── throwing_ee_stl_files.zip # Contains all STL files
└── throwing_ee_cad_files.zip # Contains Fusion 360 files
12 changes: 10 additions & 2 deletions scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const downloadSTLFile = (fileName) => {
function downloadSTLFile(fileName) {
const fileUrl = `assets/stl-files/${fileName}`;

fetch(fileUrl)
Expand All @@ -25,4 +25,12 @@ export const downloadSTLFile = (fileName) => {
console.error('Error downloading file:', error);
alert('Error downloading file. Please try again later.');
});
};
}

function downloadAllSTL() {
window.location.href = 'assets/downloads/throwing_ee_stl_files.zip';
}

function downloadCADFiles() {
window.location.href = 'assets/downloads/throwing_ee_cad_files.zip';
}

0 comments on commit 50866aa

Please sign in to comment.