Skip to content

Commit

Permalink
Assign ld2studio category for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
LD2Studio committed Sep 20, 2024
1 parent 037a15e commit 5777e5a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
"physics_ammo_volume",
"physics_jolt_instancing",
"physics_rapier_instancing",
"physics_rapier_instanced_bodies"
"ld2studio_rapier_instanced_bodies"
],
"misc": [
"misc_animation_groups",
Expand Down
7 changes: 6 additions & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ <h1><a href="https://threejs.org">three.js</a></h1>

// Reveal "View source" button and set attributes to this example
viewSrcButton.style.display = '';
viewSrcButton.href = 'https://github.com/mrdoob/three.js/blob/master/examples/' + selected + '.html';
if ( selected.includes("ld2studio") ) {
viewSrcButton.href = 'https://github.com/LD2Studio/LD2Studio-Editor/blob/three-editor/examples/' + selected + '.html';
}
else {
viewSrcButton.href = 'https://github.com/mrdoob/three.js/blob/master/examples/' + selected + '.html';
}
viewSrcButton.title = 'View source code for ' + getName( selected ) + ' on GitHub';

}
Expand Down
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<div id="header">
<h1><span translate="no">three.js (LD2Studio)</span> <a id="version" href="http://github.com/mrdoob/three.js/releases">r168</a></h1>

<div id="expandButton"></div>
</div>

<div id="contentWrapper">
Expand Down Expand Up @@ -57,6 +59,27 @@ <h2>Merch</h2>

</div>

<script>
var panel = document.getElementById( 'panel' );
var expandButton = document.getElementById( 'expandButton' );
var panelScrim = document.getElementById( 'panelScrim' );

expandButton.addEventListener( 'click', function ( event ) {

panel.classList.toggle( 'open' );
event.preventDefault();

} );

panelScrim.onclick = function ( event ) {

event.preventDefault();
panel.classList.toggle( 'open' );

};

</script>

<div id="viewer">


Expand Down

0 comments on commit 5777e5a

Please sign in to comment.