aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionCarousel3DView.tsx
diff options
context:
space:
mode:
authorMelissa Zhang <mzhang19096@gmail.com>2020-05-22 17:08:16 -0700
committerMelissa Zhang <mzhang19096@gmail.com>2020-05-22 17:08:16 -0700
commitda705df20b9b2d44c6aa76050bb59a0bb669f0db (patch)
treec3aad057750f4a5119b11c3307c5b5234ad7e0f4 /src/client/views/collections/CollectionCarousel3DView.tsx
parent905176166a4b33dfbf3c7ac1640381cea53485b6 (diff)
styling changes
Diffstat (limited to 'src/client/views/collections/CollectionCarousel3DView.tsx')
-rw-r--r--src/client/views/collections/CollectionCarousel3DView.tsx43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/client/views/collections/CollectionCarousel3DView.tsx b/src/client/views/collections/CollectionCarousel3DView.tsx
index 649ca4eba..0e704a1a0 100644
--- a/src/client/views/collections/CollectionCarousel3DView.tsx
+++ b/src/client/views/collections/CollectionCarousel3DView.tsx
@@ -38,8 +38,9 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
);
}
- mainPanelWidth = () => this.props.PanelWidth() * 0.6;
- sidePanelWidth = () => this.props.PanelWidth() * 0.3;
+ mainPanelWidth = () => this.props.PanelWidth() * 0.5;
+ mainPanelHeight = () => this.props.PanelHeight() * 0.8;
+ sidePanelWidth = () => this.props.PanelWidth() * 0.25;
sidePanelHeight = () => this.props.PanelHeight() * 0.5;
@computed get content() {
const index = NumCast(this.layoutDoc._itemIndex);
@@ -47,31 +48,35 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
const nextIndex = (index + 1 + this.childLayoutPairs.length) % this.childLayoutPairs.length;
return !(this.childLayoutPairs?.[index]?.layout instanceof Doc) ? (null) :
<>
- <div className="collectionCarouselView-prev">
+ <div className="collectionCarouselView-center">
<ContentFittingDocumentView {...this.props}
onDoubleClick={ScriptCast(this.layoutDoc.onChildDoubleClick)}
- onClick={this.changeIndexScript}
+ onClick={ScriptField.MakeScript(
+ "child._showCaption = 'caption'",
+ { child: Doc.name },
+ { child: this.childLayoutPairs[index].layout }
+ )}
renderDepth={this.props.renderDepth + 1}
LayoutTemplate={this.props.ChildLayoutTemplate}
LayoutTemplateString={this.props.ChildLayoutString}
- Document={this.childLayoutPairs[prevIndex].layout}
- DataDoc={this.childLayoutPairs[prevIndex].data}
- PanelWidth={this.sidePanelWidth}
- PanelHeight={this.sidePanelHeight}
+ Document={this.childLayoutPairs[index].layout}
+ DataDoc={this.childLayoutPairs[index].data}
+ PanelWidth={this.mainPanelWidth}
+ PanelHeight={this.mainPanelHeight}
ScreenToLocalTransform={this.props.ScreenToLocalTransform}
bringToFront={returnFalse}
parentActive={this.props.active}
/>
</div>
- <div className="collectionCarouselView-next">
+ <div className="collectionCarouselView-prev">
<ContentFittingDocumentView {...this.props}
onDoubleClick={ScriptCast(this.layoutDoc.onChildDoubleClick)}
onClick={this.changeIndexScript}
renderDepth={this.props.renderDepth + 1}
LayoutTemplate={this.props.ChildLayoutTemplate}
LayoutTemplateString={this.props.ChildLayoutString}
- Document={this.childLayoutPairs[nextIndex].layout}
- DataDoc={this.childLayoutPairs[nextIndex].data}
+ Document={this.childLayoutPairs[prevIndex].layout}
+ DataDoc={this.childLayoutPairs[prevIndex].data}
PanelWidth={this.sidePanelWidth}
PanelHeight={this.sidePanelHeight}
ScreenToLocalTransform={this.props.ScreenToLocalTransform}
@@ -79,21 +84,17 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
parentActive={this.props.active}
/>
</div>
- <div className="collectionCarouselView-image" key="image">
+ <div className="collectionCarouselView-next">
<ContentFittingDocumentView {...this.props}
onDoubleClick={ScriptCast(this.layoutDoc.onChildDoubleClick)}
- onClick={ScriptField.MakeScript(
- "child._showCaption = 'caption'",
- { child: Doc.name },
- { child: this.childLayoutPairs[index].layout }
- )}
+ onClick={this.changeIndexScript}
renderDepth={this.props.renderDepth + 1}
LayoutTemplate={this.props.ChildLayoutTemplate}
LayoutTemplateString={this.props.ChildLayoutString}
- Document={this.childLayoutPairs[index].layout}
- DataDoc={this.childLayoutPairs[index].data}
- PanelWidth={this.mainPanelWidth}
- PanelHeight={this.props.PanelHeight}
+ Document={this.childLayoutPairs[nextIndex].layout}
+ DataDoc={this.childLayoutPairs[nextIndex].data}
+ PanelWidth={this.sidePanelWidth}
+ PanelHeight={this.sidePanelHeight}
ScreenToLocalTransform={this.props.ScreenToLocalTransform}
bringToFront={returnFalse}
parentActive={this.props.active}