-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit a21e684
Showing
1 changed file
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Speckle 3D Model Viewer</title> | ||
<style> | ||
body, html { | ||
margin: 0; | ||
height: 100%; | ||
overflow: hidden; | ||
} | ||
#viewer { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="viewer"></div> | ||
<script src="https://unpkg.com/@speckle/viewer@latest"></script> | ||
<script> | ||
const viewerContainer = document.getElementById('viewer'); | ||
const speckleStreamId = 'a8adb1ab64'; | ||
const accessToken = '0d8ce4b49d198fafa15a51018a3870fd53862c5479'; | ||
|
||
const viewer = new Speckle.Viewer({ | ||
container: viewerContainer, | ||
showStats: false, | ||
}); | ||
|
||
const url = `https://speckle.xyz/streams/${speckleStreamId}/commits/latest?access_token=${accessToken}`; | ||
viewer.load(url) | ||
.catch(err => console.error('Error loading model:', err)); | ||
|
||
viewer.on('load-complete', () => { | ||
console.log('Model loaded successfully!'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |