Skip to content

Commit

Permalink
Merge pull request #88 from ux3d/feature/xmpUpdateUIAndExtension
Browse files Browse the repository at this point in the history
Feature/xmp update UI and extension
  • Loading branch information
UX3D-becher authored Jan 25, 2021
2 parents 3cb5bfe + f4c5bae commit 05d2a8a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 19 deletions.
28 changes: 20 additions & 8 deletions app_web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,25 @@
<script id="jsonToUITemplate" type="text/x-template">
<div>
<div v-for="(value, name) in data">
<div class="greyOverlay" style="word-break: break-word;">
<section>
<label class="smallerLabel">{{ name }}</label>
</section>
<b-collapse :class="(isinner === false) ? 'cardGrayMain' : 'cardGrayMainInner'" animation="slide" style="word-break: break-word;">
<!-- header -->
<template #trigger="props">
<div class="cardHeader" role="button">
<p class="smallerLabel">
{{ name }}
</p>
<!-- a element needed for buefy. can be removed if hover effects are made custom -->
<a>
<b-icon :icon="props.open ? 'menu-down' : 'menu-up'">
</b-icon>
</a>
</div>
</template>

<!-- content -->
<!-- if value is object -->
<div v-if="value !== null && value !== undefined && value.constructor.name === 'Object'">
<json-to-ui-template v-bind:data="value"></json-to-ui-template>
<json-to-ui-template v-bind:data="value" v-bind:isinner="!isinner"></json-to-ui-template>
</div>
<!-- if value is array -->
<div v-else-if="Array.isArray(value)">
Expand All @@ -93,7 +105,7 @@
<div v-else>
<label class="smallestLabel">{{ value }}</label>
</div>
</div>
</b-collapse>
</div>
</div>
</script>
Expand Down Expand Up @@ -234,9 +246,9 @@ <h2>Animation</h2>
<span>XMP</span>
</template>

<div class="tabContent">
<div class="tabContent xmpWrapper">
<h2>XMP</h2>
<json-to-ui-template v-bind:data="xmp.xmp"></json-to-ui-template>
<json-to-ui-template v-bind:data="xmp" v-bind:isinner="false" ref="xmpUI"></json-to-ui-template>
</div>
</b-tab-item>
<!--<b-tab-item label="Capture" icon="video">
Expand Down
8 changes: 4 additions & 4 deletions app_web/src/logic/uimodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ class UIModel

const xmpData = gltfLoadedAndInit.pipe(
map( (gltf) => {
if(gltf.extensions !== undefined && gltf.extensions.KHR_xmp !== undefined)
if(gltf.extensions !== undefined && gltf.extensions.KHR_xmp_json_ld !== undefined)
{
if(gltf.asset.extensions !== undefined && gltf.asset.extensions.KHR_xmp !== undefined)
if(gltf.asset.extensions !== undefined && gltf.asset.extensions.KHR_xmp_json_ld !== undefined)
{
let xmpPacket = gltf.extensions.KHR_xmp.packets[gltf.asset.extensions.KHR_xmp.packet];
return {xmp: xmpPacket};
let xmpPacket = gltf.extensions.KHR_xmp_json_ld.packets[gltf.asset.extensions.KHR_xmp_json_ld.packet];
return xmpPacket;
}
}
return [];
Expand Down
2 changes: 1 addition & 1 deletion app_web/src/ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Vue.component('dual-label-element', {
template:'#dualLabelTemplate'
});
Vue.component('json-to-ui-template', {
props: ['data'],
props: ['data', 'isinner'],
template:'#jsonToUITemplate'
});

Expand Down
33 changes: 27 additions & 6 deletions app_web/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ nav.tabs ul

section.tab-content
{
background-color: #333333;
background-color: #363636;
width: 300px;
}

Expand Down Expand Up @@ -166,14 +166,35 @@ canvas
opacity: 0.8;
}

.greyOverlay
.xmpWrapper
{
margin-right: 5px;
}

.cardGrayMain
{
background-color: #424242;
margin-bottom: 5px;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 8px;
padding: 8px;
padding-right: 0px;
padding-bottom: 5px;
margin-bottom: 8px;
}
.cardGrayMainInner
{
background-color: #4d4d4d;
padding: 8px;
padding-right: 0px;
padding-bottom: 5px;
margin-bottom: 8px;
}

.cardHeader
{
display: flex;
justify-content: space-between
}



.select, .select select
{
Expand Down

0 comments on commit 05d2a8a

Please sign in to comment.