@@ -49,7 +49,7 @@ export class WMLCarouselOneComponent {
4949 }
5050 this . props . slideContainerVCF = this . slideContainer
5151 this . props . ngUnsub = this . ngUnsub
52- this . cdref = this . cdref
52+ this . props . cdref = this . cdref
5353 this . listenForUpdate ( ) . subscribe ( )
5454 this . props . init ( )
5555 }
@@ -80,15 +80,18 @@ export class WMLCarouselOneProps {
8080 slideWidth = "23%"
8181 slideHeight = "33%"
8282 distanceFromCenter = "300px"
83+ classPrefix = generateClassPrefix ( 'WMLCarouselOne' )
8384
8485 slideContainer = new WMLUIProperty ( {
8586 style :{
86- perspective :"1000px" ,
87- perspectiveOrigin :"50% -95%"
88- }
87+ // perspective:"1000px",
88+ // perspectiveOrigin:"50% -95%"
89+ } ,
90+ class :this . classPrefix ( 'Pod1' )
8991 } )
9092 controller = new WMLAngularMotionUIProperty ( {
9193 type :"transition" ,
94+ class :this . classPrefix ( 'Pod1Item0' ) ,
9295 style :{
9396 height :"300px" ,
9497 border :"calc(1/10.6 * 1em) solid red"
@@ -109,7 +112,7 @@ export class WMLCarouselOneProps {
109112 . map ( ( nullVal , index0 ) => {
110113 return new WMLCarouselOneSlideProps ( {
111114 view :new WMLUIProperty ( {
112-
115+ class : this . classPrefix ( 'Pod1Item1' ) ,
113116 } )
114117 } )
115118 } )
@@ -132,13 +135,13 @@ export class WMLCarouselOneProps {
132135
133136 console . log ( parentWidth )
134137 console . log ( parentHeight )
135- // this.slideWidth = `${Math.min(parentWidth * 0.2, parentHeight * 0.2)}px`;
136- // this.slideHeight = `${Math.min(parentWidth * 0.3, parentHeight * 0.3)}px`;
137- // this.distanceFromCenter = `${parentWidth / 3}px`;
138-
139- // this.slideContainer.style.perspective = `${parentWidth}px`;
140- // this.slideContainer.style.perspectiveOrigin = `50% ${-90}px`;
138+ this . slideWidth = `${ ( parentWidth * 0.3 ) } px` ;
139+ this . slideHeight = `${ ( parentHeight * 0.3 ) } px` ;
140+ this . distanceFromCenter = `${ parentWidth * .42 } px` ;
141141
142+ this . slideContainer . style . perspective = `${ parentWidth } px` ;
143+ this . slideContainer . style . perspectiveOrigin = `50% ${ - 25 } %` ;
144+ console . log ( this . slideContainer . style )
142145 this . updateSlides ( ) ;
143146 } ) ,
144147 tap ( ( ) => {
@@ -155,7 +158,7 @@ export class WMLCarouselOneProps {
155158 updateSlides = ( ) => {
156159 this . slides = this . slides . map ( ( slide , index0 ) => {
157160 let angle = this . getAngle ( ) ;
158- slide . view . style . transform = `rotateY(${ index0 * angle } deg) translateZ(${ this . distanceFromCenter } )` ;
161+ slide . view . style . transform = `rotateY(${ index0 * angle } deg) translateZ(${ this . distanceFromCenter } ) translateY(-75px )` ;
159162 slide . view . style . height = this . slideHeight ;
160163 slide . view . style . width = this . slideWidth ;
161164 return slide ;
0 commit comments