Skip to content

Commit 11162ba

Browse files
committed
[UPDATE] additional work
1 parent 23f2a98 commit 11162ba

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

projects/wml-carousel/src/lib/wml-carousel-one/wml-carousel-one/wml-carousel-one.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
</section>
55
<section
66

7-
[style]="props.slideContainer.style"
8-
[class]="classPrefix('Pod1')">
7+
[ngStyle]="props.slideContainer.style"
8+
[class]="props.slideContainer.class">
99
<div
1010
#slideContainer
1111
[ngStyle]="props.controller.style"
1212
(transitionend)="props.controller.transitionEnd($event)"
13-
[class]="classPrefix('Pod1Item0')">
13+
[class]="props.controller.class">
1414
<wml-carousel-one-slide
1515
[ngStyle]="slide.view.style"
16-
[class]="classPrefix('Pod1Item1') + slide.view.class"
16+
[class]=" slide.view.class"
1717
[props]="slide"
1818
*ngFor="let slide of props.slides"
1919
></wml-carousel-one-slide>

projects/wml-carousel/src/lib/wml-carousel-one/wml-carousel-one/wml-carousel-one.component.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
&0{}
1717
&1{
18+
1819
&Item {
1920
&0 {
2021
border:calc(1/10.6 * 1em) solid red;
@@ -24,6 +25,7 @@
2425
justify-content: center;
2526
align-items: center;
2627
transform-style: preserve-3d;
28+
transform:"rotate3D(60deg)";
2729
}
2830
&1{
2931

projects/wml-carousel/src/lib/wml-carousel-one/wml-carousel-one/wml-carousel-one.component.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)