- Ionic4 底部弹出框组件 ion-action-sheet-controller
- Ionic4 底部弹出框组件 ion-action-sheet
- Ionic4 弹窗组件 ion-alert-controller
- Ionic4 弹窗组件 ion-alert
- Ionic4 徽章组件 ion-badge
- Ionic4 按钮组件 ion-button
- Ionic4 按钮组件 ion-ripple-effect
- Ionic4 卡片组件 ion-card
- Ionic4 卡片组件 ion-card-content
- Ionic4 卡片组件 ion-card-header
- Ionic4 卡片组件 ion-card-subtitle
- Ionic4 卡片组件 ion-card-title
- Ionic4 多选框组件 ion-checkbox
- Ionic4 组件 ion-chip
- Ionic4 内容组件 ion-app
- Ionic4 内容组件 ion-content
- Ionic4 日期组件 ion-datetime
- Ionic4 日期组件 ion-picker-controller
- Ionic4 日期组件 ion-picker
- Ionic4 浮动按钮组件 ion-fab-button
- Ionic4 浮动按钮组件 ion-fab-list
- Ionic4 浮动按钮组件 ion-fab
- Ionic4 栅格系统组件 ion-col
- Ionic4 栅格系统组件 ion-row
- Ionic4 栅格系统组件 ion-grid
- Ionic4 上拉分页组件 ion-infinite-scroll-content
- Ionic4 上拉分页组件 ion-infinite-scroll
- Ionic4 组件 ion-input
- Ionic4 组件 ion-textarea
- Ionic4 列表项组件 ion-item
- Ionic4 列表项组件 ion-item-divider
- Ionic4 列表项组件 ion-item-group
- Ionic4 列表项组件 ion-item-sliding
- Ionic4 列表项组件 ion-item-options
- Ionic4 列表项组件 ion-item-option
- Ionic4 列表项组件 ion-label
- Ionic4 列表项组件 ion-note
- Ionic4 列表组件 ion-list
- Ionic4 列表组件 ion-list-header
- Ionic4 列表组件 ion-virtual-scroll
- Ionic4 媒体组件 ion-avatar
- Ionic4 媒体组件 ion-img
- Ionic4 媒体组件 ion-thumbnail
- Ionic4 侧边栏组件 ion-menu-button
- Ionic4 侧边栏组件 ion-menu-controller
- Ionic4 侧边栏组件 ion-menu-toggle
- Ionic4 侧边栏组件 ion-menu
- Ionic4 侧边栏组件 ion-split-pane
- Ionic4 模态框组件 ion-modal-controller
- Ionic4 模态框组件 ion-modal
- Ionic4 路由导航组件 ion-nav-pop
- Ionic4 路由导航组件 ion-nav-push
- Ionic4 路由导航组件 ion-nav-set-root
- Ionic4 路由导航组件 ion-nav
- Ionic4 弹出框组件 ion-popover-controller
- Ionic4 弹出框组件 ion-popover
- Ionic4 进度指示组件 ion-loading
- Ionic4 进度指示组件 ion-loading-controller
- Ionic4 进度指示组件 ion-progress-bar
- Ionic4 进度指示组件 ion-skeleton-text
- Ionic4 单选框组件 ion-radio-group
- Ionic4 单选框组件 ion-radio
- Ionic4 滑块组件组件 ion-range
- Ionic4 下拉分页组件 ion-refresher-content
- Ionic4 下拉分页组件 ion-refresher
- Ionic4 排序组件 ion-reorder-group
- Ionic4 排序组件 ion-reorder
- Ionic4 路由组件 ion-route-redirect
- Ionic4 路由组件 ion-route
- Ionic4 路由组件 ion-router-outlet
- Ionic4 路由组件 ion-router
- Ionic4 搜索框组件 ion-searchbar
- Ionic4 Tab切换组件 ion-segment-button
- Ionic4 Tab切换组件 ion-segment
- Ionic4 选择框组件 ion-select-option
- Ionic4 选择框组件 ion-select
- Ionic4 轮播图组件 ion-slide
- Ionic4 轮播图组件 ion-slides
- Ionic4 底部Tabs组件组件 ion-tab-bar
- Ionic4 底部Tabs组件组件 ion-tab-button
- Ionic4 底部Tabs组件组件 ion-tab
- Ionic4 底部Tabs组件组件 ion-tabs
- Ionic4 提示框组件 ion-toast-controller
- Ionic4 提示框组件 ion-toast
- Ionic4 开关组件 ion-toggle
- Ionic4 导航条组件 ion-toolbar
- Ionic4 导航条组件 ion-footer
- Ionic4 导航条组件 ion-header
- Ionic4 导航条组件 ion-title
- Ionic4 导航条组件 ion-buttons
- Ionic4 导航条组件 ion-back-button
- Ionic4 组件 ion-anchor
- Ionic4 组件 ion-text
- Ionic Native插件使用中文文档教程
- Ionic4 多点触控插件-多点触控 3D Touch
- Ionic4 ABBYY Real-Time Recognition插件-ABBYY Real-Time Recognition
- Ionic4 AES256插件-AES256加密
- Ionic4 Action Sheet插件-底部弹出框Action Sheet
- Ionic4 AdMob Free插件-AdMob Free
- Ionic4 AdMob Plus插件-AdMob Plus
- Ionic4 AdMob Pro插件-AdMob Pro
- Ionic4 Admob插件-Admob
- Ionic4 支付宝支付插件-支付宝支付 Alipay
- Ionic4 媒体播放插件插件-媒体播放插件 Analytics Firebase
- Ionic4 媒体播放插件-媒体播放 Android ExoPlayer
- Ionic4 安卓指纹认证插件-安卓指纹认证 Android Fingerprint Auth
- Ionic4 Android全屏插件-全屏 Android Full Screen
- Ionic4 Android权限检测插件-Android权限检测 Android Permissions
- Ionic4 Answers插件-Answers
- Ionic4 判断应用是否安装插件-判断应用是否安装 App Availability
- Ionic4 App Center Analytics插件-App Center Analytics
- Ionic4 App Center Crashes插件-App Center Crashes
- Ionic4 消息推送插件-消息推送插件App Center Push
- Ionic4 最小化应用插件-最小化应用App Minimize
- Ionic4 App Preferences插件-App Preferences
- Ionic4 App Rate插件-App Rate
- Ionic4 检测应用更新插件-应用更新 App Update
- Ionic4 获取应用版本插件-获取应用版本 App Version
- Ionic4 苹果支付插件-苹果支付 Apple Pay
- Ionic4 苹果钱包插件-苹果钱包 Apple Wallet
- Ionic4 Appodeal插件-Appodeal
- Ionic4 Appsflyer插件-Appsflyer
- Ionic4 Autostart插件-Autostart
- Ionic4 蓝牙插件-蓝牙插件BLE
- Ionic4 Background Fetch插件-Background Fetch
- Ionic4 后台定位插件-后台定位Background Geolocation
- Ionic4 防止职为后台插件-防止后台睡觉 Background Mode
- Ionic4 背后照明插件-背后照明Backlight
- Ionic4 徽章插件-徽章Badge
- Ionic4 百度推送插件-百度推送Baidu Push
- Ionic4 二维码扫描插件-二维码扫描Barcode Scanner
- Ionic4 Base64 转化成图片插件-Base64 转化成图片Base64 To Gallery
- Ionic4 文件转换成Base64格式插件-文件转换成Base64
- Ionic4 电量插件-电量Battery Status
- Ionic4 BlinkUp插件-BlinkUp
- Ionic4 蓝牙插件-蓝牙 Bluetooth Serial
- Ionic4 低功耗蓝牙插件-低功耗蓝牙BluetoothLE
- Ionic4 Braintree插件-Braintree
- Ionic4 BranchIo插件-BranchIo
- Ionic4 屏幕亮度插件-屏幕亮度Brightness
- Ionic4 通信插件-通信Broadcaster
- Ionic4 Browser Tab插件-Browser Tab
- Ionic4 日历插件-日历Calendar
- Ionic4 联系人插件-联系人 Call Directory
- Ionic4 历史通话记录插件-历史通话记录 Call Log
- Ionic4 拨打电话插件 - 拨打电话 Call Number
- Ionic4 Camera Preview插件-Camera Preview
- Ionic4 拍照插件-拍照Camera
- Ionic4 Card IO插件-Card IO
- Ionic4 Chooser插件-Chooser
- Ionic4 Class Kit插件-Class Kit
- Ionic4 CleverTap插件-CleverTap
- Ionic4 剪切板插件-剪切板 Clipboard
- Ionic4 Cloud Settings插件-Cloud Settings
- Ionic4 消息推送插件-微软消息推送 Code Push
- Ionic4 联系人插件-联系人Contacts
- Ionic4 Couchbase Lite插件-Couchbase Lite
- Ionic4 Crashlytics插件-Crashlytics
- Ionic4 图片剪切插件-图片剪切Crop
- Ionic4 获取麦克风分贝插件-获取麦克风分贝 DB Meter
- Ionic4 DNS插件-DNS
- Ionic4 日历插件插件-日历Date Picker
- Ionic4 Deeplinks插件-Deeplinks
- Ionic4 Device Accounts插件-Device Accounts
- Ionic4 Device Feedback插件-Device Feedback
- Ionic4 Device Motion插件-Device Motion
- Ionic4 Device Orientation插件-加速度 Device Orientation
- Ionic4 Device插件-设备 Device
- Ionic4 检测硬件 插件-检测硬件 Diagnostic
- Ionic4 弹出框插件-弹出框Dialogs
- Ionic4 文档查看器插件-文档查看器Document Viewer
- Ionic4 下载文件插件-下载文件Downloader
- Ionic4 Email Composer插件-Email Composer
- Ionic4 Estimote Beacons插件-Estimote Beacons
- Ionic4 Extended Device Information插件-Extended Device Information
- Ionic4 FCM插件-FCM
- Ionic4 FTP 插件
- Ionic4 Facebook 插件
- Ionic4 文件选择插件 File Chooser
- Ionic4 文件加密插件 File Encryption
- Ionic4 打开文件插件 File Opener
- Ionic4 File Path 插件
- Ionic4 文件传输插件-文件传输File Transfer
- Ionic4 文件插件-文件File
- Ionic4 Fingerprint AIO插件-Fingerprint AIO
- Ionic4 Firebase Analytics插件-Firebase Analytics
- Ionic4 Firebase Authentication插件-Firebase Authentication
- Ionic4 Firebase Config插件-Firebase Config
- Ionic4 Firebase Dynamic Links插件-Firebase Dynamic Links
- Ionic4 Firebase Messaging插件-Firebase Messaging
- Ionic4 Firebase插件-Firebase
- Ionic4 手电筒插件-手电筒Flashlight
- Ionic4 Flurry Analytics插件-Flurry Analytics
- Ionic4 高德定位插件-高德定位Gao De Location
- Ionic4 Geofence插件-Geofence
- Ionic4 Geolocation插件-定位Geolocation
- Ionic4 Globalization插件-Globalization
- Ionic4 Google Analytics插件-Google Analytics
- Ionic4 Google Nearby插件-Google Nearby
- Ionic4 Google Play Games Services插件-Google Play Games Services
- Ionic4 Google Plus插件-Google Plus
- Ionic4 陀螺仪插件-陀螺仪 Gyroscope
- Ionic4 原生插件-原生HTTP
- Ionic4 任务栏导航颜色插件-任务栏导航颜色Header Color
- Ionic4 Health Kit插件-Health Kit
- Ionic4 Health插件-Health
- Ionic4 热更新插件-热更新Hot Code Push
- Ionic4 热点网络插件-热点网络Hotspot
- Ionic4 服务器插件-服务器Httpd
- Ionic4 HyperTrack插件-HyperTrack
- Ionic4 IBeacon插件-IBeacon
- Ionic4 图片多选插件-图片多选Image Picker
- Ionic4 图片剪切插件-图片剪切Image Resizer
- Ionic4 webview插件-In App Browser
- Ionic4 In App Purchase 2插件-In App Purchase 2
- Ionic4 In App Purchase插件-In App Purchase
- Ionic4 In App Review插件-In App Review
- Ionic4 Index App Content插件-Index App Content
- Ionic4 睡眠插件-睡眠 Insomnia
- Ionic4 Instagram插件-Instagram
- Ionic4 Intel Security插件-Intel Security
- Ionic4 对讲机插件-对讲机 Intercom
- Ionic4 Is Debug插件-Is Debug
- Ionic4 Jins Meme插件-Jins Meme
- Ionic4 键盘插件-键盘 Keyboard
- Ionic4 指纹插件插件-指纹 Keychain Touch Id
- Ionic4 Keychain插件-Keychain
- Ionic4 相机预览插件-相机预览LastCam
- Ionic4 Launch Navigator插件-Launch Navigator
- Ionic4 Launch Review插件-Launch Review
- Ionic4 Line Login插件-Line Login
- Ionic4 LinkedIn 插件
- Ionic4 本地通知插件 Local Notifications
- Ionic4 更改位置 Location Accuracy
- Ionic4 MS ADAL 插件
- Ionic4 Market 插件
- Ionic4 媒体插件 Media Capture
- Ionic4 Media 媒体插件
- Ionic4 Mixpanel 插件
- Ionic4 Mobile Accessibility插件-Mobile Accessibility
- Ionic4 音频控制插件-音频控制Music Controls
- Ionic4 NFC插件-NFC
- Ionic4 Native Audio插件-Native Audio
- Ionic4 Native Geocoder插件-Native Geocoder
- Ionic4 原生键盘插件-原生键盘Native Keyboard
- Ionic4 原生页面切换插件-页面切换Native Page Transitions
- Ionic4 手机铃声插件-手机铃声 Native Ringtones
- Ionic4 本地存储插件-本地存储 Native Storage
- Ionic4 导航栏插件-导航栏 Navigation Bar
- Ionic4 网络接口插件-网络接口 Network Interface
- Ionic4 网络插件-网络 Network
- Ionic4 OneSignal插件-OneSignal
- Ionic4 调用系统设置插件-调用系统设置 Open Native Settings
- Ionic4 检索车牌插件-检索车牌OpenALPR
- Ionic4 PayPal插件-PayPal
- Ionic4 计步插件-计步Pedometer
- Ionic4 Phonegap Local Notification插件-Phonegap Local Notification
- Ionic4 图片库插件-图片库Photo Library
- Ionic4 图片预览插件-图片预览 Photo Viewer
- Ionic4 Pin Check插件-Pin Check
- Ionic4 Pin Dialog插件-Pin Dialog
- Ionic4 Pinterest插件-Pinterest
- Ionic4 电源管理插件-电源管理 Power Management
- Ionic4 打印插件-打印 Printer
- Ionic4 Pro插件-Pro
- Ionic4 消息推送插件-消息推送 Push
- Ionic4 腾讯互联 插件-腾讯互联 QQSDK
- Ionic4 扫码 QR Scanner插件-扫码 QR Scanner
- Ionic4 Regula Document Reader插件-Regula Document Reader
- Ionic4 Rollbar插件-Rollbar
- Ionic4 发送短信 插件-发送短信 SMS
- Ionic4 数据库插件-数据库 SQLite Porter
- Ionic4 SQLite插件-数据库 SQLite
- Ionic4 Safari View Controller插件-Safari View Controller
- Ionic4 锁定屏幕方向插件-锁定屏幕方向 Screen Orientation
- Ionic4 捕捉屏幕截图插件-捕捉屏幕截图 Screenshot
- Ionic4 本地存储 插件-本地存储 Secure Storage
- Ionic4 Sensors插件-Sensors
- Ionic4 Serial插件-Serial
- Ionic4 摇一摇插件-摇一摇 Shake
- Ionic4 获取Sim卡信息 插件-获取Sim卡信息 Sim
- Ionic4 Siri Shortcuts插件-Siri Shortcuts
- Ionic4 本地分享插件-本地分享 Social Sharing
- Ionic4 语音识别插件-语音识别Speech Recognition
- Ionic4 SpeechKit插件-SpeechKit
- Ionic4 Spinner Dialog插件-Spinner Dialog
- Ionic4 启动画面插件-启动画面Splash Screen
- Ionic4 数据库插件-数据库Sqlite Db Copy
- Ionic4 StarPRNT插件-StarPRNT
- Ionic4 状态栏插件-状态栏 Status Bar
- Ionic4 Stepcounter插件-Stepcounter
- Ionic4 Streaming Media插件-Streaming Media
- Ionic4 Stripe插件-Stripe
- Ionic4 Taptic Engine插件-Taptic Engine
- Ionic4 Tealium插件-Tealium
- Ionic4 TealiumAdIdentifier插件-TealiumAdIdentifier
- Ionic4 TealiumInstallReferrer插件-TealiumInstallReferrer
- Ionic4 文本转换语音插件-文本转换语音Text To Speech
- Ionic4 浏览器插件插件-浏览器插件 Themeable Browser
- Ionic4 弹出框插件-弹出框Toast
- Ionic4 Touch ID插件-指纹扫描Touch ID
- Ionic4 Twitter Connect插件-Twitter Connect
- Ionic4 唯一标识插件-唯一标识Uid
- Ionic4 唯一标识插件-唯一标识Unique Device ID
- Ionic4 Uptime插件-Uptime
- Ionic4 User Agent插件-User Agent
- Ionic4 振动插件-振动Vibration
- Ionic4 Video Capture Plus插件-Video Capture Plus
- Ionic4 视频编辑插件-视频编辑 Video Editor
- Ionic4 视频播放 插件-视频播放 Video Player
- Ionic4 Web Intent插件-Web Intent
- Ionic4 Web Server插件-Web Server
- Ionic4 Webengage插件-Webengage
- Ionic4 微信支付插件-微信支付 Wechat
- Ionic4 WheelSelector Plugin插件-WheelSelector Plugin
- Ionic4 Youtube Video Player插件-Youtube Video Player
- Ionic4 扫码插件-扫码ZBar
- Ionic4 Zeroconf插件-Zeroconf
- Ionic4 压缩减压插件-压缩减压Zip
- Ionic4 hce插件-hce
- Ionic4 iOS DocumentPicker插件-iOS DocumentPicker
- Ionic4 iOS File Picker插件-iOS File Picker
- Ionic4 jAnalytics插件-jAnalytics
- Ionic 图标
- 使用 Ionic 图标
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Ionic4 轮播图组件 ion-slides
Ionic4项目中我们可以使用Ionic4轮播图组件ion-slides对项目进行布局。
ion-slides官方文档地址:https://ionicframework.com/docs/api/slides
The Slides component is a multi-section container. Each section can be swiped or dragged between. It contains any number of Slide components.
Adopted from Swiper.js: The most modern mobile touch slider and framework with hardware accelerated transitions.
http://www.idangero.us/swiper/
Copyright 2016, Vladimir Kharlampidi The iDangero.us http://www.idangero.us/
Licensed under MIT
Custom Animations
By default, Ionic slides use the built-in slide
animation effect. Custom animations can be provided via the options
property. Examples of other animations can be found below.
Coverflow
const slidesOpts = {
slidesPerView: 3,
coverflowEffect: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true,
},
on: {
beforeInit() {
const swiper = this;
swiper.classNames.push(`${swiper.params.containerModifierClass}coverflow`);
swiper.classNames.push(`${swiper.params.containerModifierClass}3d`);
swiper.params.watchSlidesProgress = true;
swiper.originalParams.watchSlidesProgress = true;
},
setTranslate() {
const swiper = this;
const {
width: swiperWidth, height: swiperHeight, slides, $wrapperEl, slidesSizesGrid, $
} = swiper;
const params = swiper.params.coverflowEffect;
const isHorizontal = swiper.isHorizontal();
const transform$$1 = swiper.translate;
const center = isHorizontal ? -transform$$1 + (swiperWidth / 2) : -transform$$1 + (swiperHeight / 2);
const rotate = isHorizontal ? params.rotate : -params.rotate;
const translate = params.depth;
// Each slide offset from center
for (let i = 0, length = slides.length; i < length; i += 1) {
const $slideEl = slides.eq(i);
const slideSize = slidesSizesGrid[i];
const slideOffset = $slideEl[0].swiperSlideOffset;
const offsetMultiplier = ((center - slideOffset - (slideSize / 2)) / slideSize) * params.modifier;
let rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;
// var rotateZ = 0
let translateZ = -translate * Math.abs(offsetMultiplier);
let translateY = isHorizontal ? 0 : params.stretch * (offsetMultiplier);
let translateX = isHorizontal ? params.stretch * (offsetMultiplier) : 0;
// Fix for ultra small values
if (Math.abs(translateX) < 0.001) translateX = 0;
if (Math.abs(translateY) < 0.001) translateY = 0;
if (Math.abs(translateZ) < 0.001) translateZ = 0;
if (Math.abs(rotateY) < 0.001) rotateY = 0;
if (Math.abs(rotateX) `);
$slideEl.append($shadowBeforeEl);
}
if ($shadowAfterEl.length === 0) {
$shadowAfterEl = swiper.$(`${isHorizontal ? 'right' : 'bottom'}">`);
$slideEl.append($shadowAfterEl);
}
if ($shadowBeforeEl.length) $shadowBeforeEl[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
if ($shadowAfterEl.length) $shadowAfterEl[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;
}
}
// Set correct perspective for IE10
if (swiper.support.pointerion-slides 事件(Events) || swiper.support.prefixedPointerion-slides 事件(Events)) {
const ws = $wrapperEl[0].style;
ws.perspectiveOrigin = `${center}px 50%`;
}
},
setTransition(duration) {
const swiper = this;
swiper.slides
.transition(duration)
.find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left')
.transition(duration);
}
}
}
Cube
const slidesOpts = {
grabCursor: true,
cubeEffect: {
shadow: true,
slideShadows: true,
shadowOffset: 20,
shadowScale: 0.94,
},
on: {
beforeInit: function() {
const swiper = this;
swiper.classNames.push(`${swiper.params.containerModifierClass}cube`);
swiper.classNames.push(`${swiper.params.containerModifierClass}3d`);
const overwriteParams = {
slidesPerView: 1,
slidesPerColumn: 1,
slidesPerGroup: 1,
watchSlidesProgress: true,
resistanceRatio: 0,
spaceBetween: 0,
centeredSlides: false,
virtualTranslate: true,
};
this.params = Object.assign(this.params, overwriteParams);
this.originalParams = Object.assign(this.originalParams, overwriteParams);
},
setTranslate: function() {
const swiper = this;
const {
$el, $wrapperEl, slides, width: swiperWidth, height: swiperHeight, rtlTranslate: rtl, size: swiperSize,
} = swiper;
const params = swiper.params.cubeEffect;
const isHorizontal = swiper.isHorizontal();
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
let wrapperRotate = 0;
let $cubeShadowEl;
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl = $wrapperEl.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = swiper.$('');
$wrapperEl.append($cubeShadowEl);
}
$cubeShadowEl.css({ height: `${swiperWidth}px` });
} else {
$cubeShadowEl = $el.find('.swiper-cube-shadow');
if ($cubeShadowEl.length === 0) {
$cubeShadowEl = swiper.$('');
$el.append($cubeShadowEl);
}
}
}
for (let i = 0; i < slides.length; i += 1) {
const $slideEl = slides.eq(i);
let slideIndex = i;
if (isVirtual) {
slideIndex = parseInt($slideEl.attr('data-swiper-slide-index'), 10);
}
let slideAngle = slideIndex * 90;
let round = Math.floor(slideAngle / 360);
if (rtl) {
slideAngle = -slideAngle;
round = Math.floor(-slideAngle / 360);
}
const progress = Math.max(Math.min($slideEl[0].progress, 1), -1);
let tx = 0;
let ty = 0;
let tz = 0;
if (slideIndex % 4 === 0) {
tx = -round * 4 * swiperSize;
tz = 0;
} else if ((slideIndex - 1) % 4 === 0) {
tx = 0;
tz = -round * 4 * swiperSize;
} else if ((slideIndex - 2) % 4 === 0) {
tx = swiperSize + (round * 4 * swiperSize);
tz = swiperSize;
} else if ((slideIndex - 3) % 4 === 0) {
tx = -swiperSize;
tz = (3 * swiperSize) + (swiperSize * 4 * round);
}
if (rtl) {
tx = -tx;
}
if (!isHorizontal) {
ty = tx;
tx = 0;
}
const transform$$1 = `rotateX(${isHorizontal ? 0 : -slideAngle}deg) rotateY(${isHorizontal ? slideAngle : 0}deg) translate3d(${tx}px, ${ty}px, ${tz}px)`;
if (progress -1) {
wrapperRotate = (slideIndex * 90) + (progress * 90);
if (rtl) wrapperRotate = (-slideIndex * 90) - (progress * 90);
}
$slideEl.transform(transform$$1);
if (params.slideShadows) {
// Set shadows
let shadowBefore = isHorizontal ? $slideEl.find('.swiper-slide-shadow-left') : $slideEl.find('.swiper-slide-shadow-top');
let shadowAfter = isHorizontal ? $slideEl.find('.swiper-slide-shadow-right') : $slideEl.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = swiper.$(`${isHorizontal ? 'left' : 'top'}">`);
$slideEl.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = swiper.$(`${isHorizontal ? 'right' : 'bottom'}">`);
$slideEl.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
}
}
$wrapperEl.css({
'-webkit-transform-origin': `50% 50% -${swiperSize / 2}px`,
'-moz-transform-origin': `50% 50% -${swiperSize / 2}px`,
'-ms-transform-origin': `50% 50% -${swiperSize / 2}px`,
'transform-origin': `50% 50% -${swiperSize / 2}px`,
});
if (params.shadow) {
if (isHorizontal) {
$cubeShadowEl.transform(`translate3d(0px, ${(swiperWidth / 2) + params.shadowOffset}px, ${-swiperWidth / 2}px) rotateX(90deg) rotateZ(0deg) scale(${params.shadowScale})`);
} else {
const shadowAngle = Math.abs(wrapperRotate) - (Math.floor(Math.abs(wrapperRotate) / 90) * 90);
const multiplier = 1.5 - (
(Math.sin((shadowAngle * 2 * Math.PI) / 360) / 2)
+ (Math.cos((shadowAngle * 2 * Math.PI) / 360) / 2)
);
const scale1 = params.shadowScale;
const scale2 = params.shadowScale / multiplier;
const offset$$1 = params.shadowOffset;
$cubeShadowEl.transform(`scale3d(${scale1}, 1, ${scale2}) translate3d(0px, ${(sw
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论