Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taro中Swiper组件卡片3D化 #14

Open
imondo opened this issue Jul 22, 2019 · 0 comments
Open

Taro中Swiper组件卡片3D化 #14

imondo opened this issue Jul 22, 2019 · 0 comments
Labels

Comments

@imondo
Copy link
Owner

imondo commented Jul 22, 2019

DOM格式

        <View className="college-container">
          <Swiper
            className="swiper-block"
            circular
            autoplay
            current={this.state.current}
            previous-margin="32rpx"
            next-margin="32rpx"
            onChange={this.handleChange.bind(this)}
          >
            {list.slice(0, 1).map(item => {
              return (
                <SwiperItem className="swiper-item">
                  <FallbackImage src={item.content.posterPath} directory={false}/>
                </SwiperItem>
              );
            })}
          </Swiper>
        </View>

样式

.index-wrapper {
  .college-container {
    display: flex;
    flex-direction: column;
  }

  .swiper-block {
    height: 258px;
    width: 100%;
  }

  swiper-item {
    width: 620px !important;
    height: 258px !important;
  }

  .swiper-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    overflow: unset;
  }

  .swiper-image {
    height: 258px;
    width: 620px;
    border-radius: 9px;
    box-shadow: 0 2px 14px 0 rgba(0, 0, 0, 0.10);
    margin: 0px 32px;
    z-index: 1;
    transform: scale(0.9);
  }

  .active {
    transform: scale(1);
    transition: all 0.2s ease-in 0s;
    z-index: 20;
  }
}
@imondo imondo added the 项目 label Jul 22, 2019
@imondo imondo changed the title Taro Swper卡片3D化 Taro中Swiper组件卡片3D化 Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant