Skip to content

Commit

Permalink
add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Linyi Jin committed Mar 10, 2024
1 parent 9caab01 commit 2efea8c
Show file tree
Hide file tree
Showing 54 changed files with 2,014 additions and 39 deletions.
Binary file added html_src/.DS_Store
Binary file not shown.
Binary file added html_src/0004-5view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0004-5view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0004-5view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0004-5view/rgb_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0004-5view/rgb_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0068-3view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0068-3view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0068-3view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0101-5view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0101-5view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0101-5view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0101-5view/rgb_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0101-5view/rgb_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0194-5view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0194-5view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0194-5view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0194-5view/rgb_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0194-5view/rgb_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0330-3view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0330-3view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0330-3view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0369-5view/rgb_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0369-5view/rgb_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0369-5view/rgb_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0369-5view/rgb_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html_src/0369-5view/rgb_4.jpg
Binary file added html_src/0370-5view/rgb_0.jpg
Binary file added html_src/0370-5view/rgb_1.jpg
Binary file added html_src/0370-5view/rgb_2.jpg
Binary file added html_src/0370-5view/rgb_3.jpg
Binary file added html_src/0370-5view/rgb_4.jpg
Binary file added html_src/0415-5view/rgb_0.jpg
Binary file added html_src/0415-5view/rgb_1.jpg
Binary file added html_src/0415-5view/rgb_2.jpg
Binary file added html_src/0415-5view/rgb_3.jpg
Binary file added html_src/0415-5view/rgb_4.jpg
Binary file added html_src/0481-3view/rgb_0.jpg
Binary file added html_src/0481-3view/rgb_1.jpg
Binary file added html_src/0481-3view/rgb_2.jpg
Binary file added html_src/0516-3view/rgb_0.jpg
Binary file added html_src/0516-3view/rgb_1.jpg
Binary file added html_src/0516-3view/rgb_2.jpg
Binary file added html_src/0664-3view/rgb_0.jpg
Binary file added html_src/0664-3view/rgb_1.jpg
Binary file added html_src/0664-3view/rgb_2.jpg
Binary file added html_src/0758-3view/rgb_0.jpg
Binary file added html_src/0758-3view/rgb_1.jpg
Binary file added html_src/0758-3view/rgb_2.jpg
54 changes: 54 additions & 0 deletions html_src/bind.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// https://newbedev.com/javascript-how-to-pass-parameter-to-event-listener-javascript-code-example


function enableInteractionTieControls() {
var obj = document.getElementById('tie_controls')

if (obj.hasAttribute('tie-interactions')){
obj.removeAttribute('tie-interactions')
// obj.textContent = "Tie Controls"
}
else{
var att = document.createAttribute("tie-interactions");
obj.setAttributeNode(att);
console.log('Setting attribute')
// obj.textContent = "UnTie Controls"
}

}

var modelViewerClick = function(obj, evt) {
var tie_controls = true;

if (evt.detail.source == 'user-interaction') {
var orbit = obj.getCameraOrbit();
var text = obj.id;

// Extract r_id from the ID of the clicked viewer
var r_id = text.split("_")[1].substring(1);

if (tie_controls) {
// Get all model viewers in the same row
var matchingElems = document.querySelectorAll(`[id^="glb_r${r_id}_"]`);

matchingElems.forEach(elem => {
if (elem.id !== text) { // Exclude the clicked viewer itself
elem.cameraOrbit = orbit.toString();
elem.interactionPrompt = 'none';
elem.jumpCameraToGoal();
}
});
}
}
}

function modelEventListeners(){
console.log('enabled interactions')
var x = document.getElementsByTagName('model-viewer');
Array.from(x).forEach((el) => {
var mvid = el.getAttribute("mv-id")
var id = el.getAttribute("id")
el.addEventListener('camera-change', modelViewerClick.bind(event, el), 'false')
});

}
162 changes: 162 additions & 0 deletions html_src/demo-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
.container {
width: 100%;
margin-left: auto;
margin-right: auto;
}

.attribution {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 1em;
}

.attribution h1 {
margin: 0 0 0.25em;
}

.attribution img {
opacity: 0.5;
height: 2em;
}

.attribution .cc {
flex-shrink: 0;
text-decoration: none;
}

footer {
display: flex;
flex-direction: column;
max-width: 600px;
margin: auto;
text-align: center;
font-style: italic;
line-height: 1.5em;
}


/* .row {
display: flex;
flex-direction: row;
margin-bottom: 0.5vh;
}
*/
.column-demo-fig {
flex: 1; /* This ensures each column takes equal space */
text-align: center;
padding: 0 5px; /* Adjust the left and right padding to reduce the gap */
}

.row {
display: flex;
align-items: center; /* This ensures vertical alignment in the center */
}

.input-img {
display: block; /* Ensures there is no extra space under the image */
max-width: 100%; /* Ensures the image is not wider than its container */
height: auto; /* Maintains the aspect ratio */
}

/* For the text, you might want to create a specific class or target it differently */
/* .column > div {
text-align: center;
} */

.column-demo {
text-align: center; /* Centers the text */
font-weight: 500;
margin: 0;
}

/* Clear floats after the columns */
/* .row:after {
content: "";
display: table;
} */

.block {
display: block;
width: 25%;
border: none;
background-color: #4CAF50;
color: white;
padding: 14px 28px;
font-size: 24px;
cursor: pointer;
text-align: center;
}

.block:hover {
background-color: #ddd;
color: black;
}

.header {
font-size: 2vw;
text-align: center;
}

.header-input {
/* width: 280px; */
width: 100%;
}

.header-result {
/* width: 280px; */
width: 100%;
}

/* .input-img {
width: 100%;
} */


span.blueText {
color: #6196C9;
font-weight: bold;
}

span.redText {
color: #e6729a;
font-weight: bold;
}

/* for interactive results */
#card {
display: flex;
flex-direction: column;
overflow: hidden;
border: 2px rgb(0, 0, 0) solid;
width: 100%;
height: 100%;
}

model-viewer {
width: 100%;
height: calc(15vw);;
overflow: hidden;
background-color: #8b8b8b;
}
.view0 {
border:4px solid #0071bc;
}


.view1 {
border:4px solid #d85218;
}

.view2 {
border:4px solid #ecb01f;
}


.view3 {
border:4px solid #7d2e8d;
}

.view4 {
border:4px solid #76ab2f;
}
Binary file added html_src/pure_grey.png
124 changes: 124 additions & 0 deletions html_src/website.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 18px;
margin-left: auto;
margin-right: auto;
width: 80%;
}

h1 {
font-weight: 300;
}

button.external-link.button.is-normal.is-rounded.is-dark {
padding: 5px 10px; /* Adjust padding to make buttons smaller */
margin: 10px; /* Add more margin to create space between buttons */
font-size: 0.8em; /* Optional: Adjust font size if needed */
}

#exampleList {
text-align: center; /* Keep the buttons centered in the div */
}

#exampleList button {
margin: 5px; /* This creates a gap between buttons */
}


.disclaimerbox {
background-color: #eee;
border: 1px solid #eeeeee;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
padding: 20px;
}

video.header-vid {
height: 140px;
border: 1px solid black;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}

img.header-img {
height: 140px;
border: 1px solid black;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}

img.rounded {
border: 1px solid #eeeeee;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}

a:link,
a:visited {
color: #1367a7;
text-decoration: none;
}

a:hover {
color: #208799;
}

td.dl-link {
height: 160px;
text-align: center;
font-size: 22px;
}

.layered-paper-big {
/* modified from: http://css-tricks.com/snippets/css/layered-paper/ */
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.35), /* The top layer shadow */
5px 5px 0 0px #fff, /* The second layer */
5px 5px 1px 1px rgba(0, 0, 0, 0.35), /* The second layer shadow */
10px 10px 0 0px #fff, /* The third layer */
10px 10px 1px 1px rgba(0, 0, 0, 0.35), /* The third layer shadow */
15px 15px 0 0px #fff, /* The fourth layer */
15px 15px 1px 1px rgba(0, 0, 0, 0.35), /* The fourth layer shadow */
20px 20px 0 0px #fff, /* The fifth layer */
20px 20px 1px 1px rgba(0, 0, 0, 0.35), /* The fifth layer shadow */
25px 25px 0 0px #fff, /* The fifth layer */
25px 25px 1px 1px rgba(0, 0, 0, 0.35);
/* The fifth layer shadow */
margin-left: 10px;
margin-right: 45px;
}

.layered-paper {
/* modified from: http://css-tricks.com/snippets/css/layered-paper/ */
box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.35), /* The top layer shadow */
5px 5px 0 0px #fff, /* The second layer */
5px 5px 1px 1px rgba(0, 0, 0, 0.35), /* The second layer shadow */
10px 10px 0 0px #fff, /* The third layer */
10px 10px 1px 1px rgba(0, 0, 0, 0.35);
/* The third layer shadow */
margin-top: 5px;
margin-left: 10px;
margin-right: 30px;
margin-bottom: 5px;
}

.vert-cent {
position: relative;
top: 50%;
transform: translateY(-50%);
}

hr {
border: 0;
height: 1.5px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

p.abstract {
text-align: left;
width: 80%;
}
Loading

0 comments on commit 2efea8c

Please sign in to comment.