effect-creative.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { CSSSelector } from '../shared';
  2. interface CreativeEffectTransform {
  3. translate?: (string | number)[];
  4. rotate?: number[];
  5. opacity?: number;
  6. scale?: number;
  7. shadow?: boolean;
  8. origin?: string;
  9. }
  10. export interface CreativeEffectMethods {}
  11. export interface CreativeEffectEvents {}
  12. export interface CreativeEffectOptions {
  13. /**
  14. * Previous slide transformations. Accepts object of the following type:
  15. *
  16. * @example
  17. * ```js
  18. * {
  19. * // Array with translate X, Y and Z values
  20. * translate: (string | number)[];
  21. * // Array with rotate X, Y and Z values (in deg)
  22. * rotate?: number[];
  23. * // Slide opacity
  24. * opacity?: number;
  25. * // Slide scale
  26. * scale?: number;
  27. * // Enables slide shadow
  28. * shadow?: boolean;
  29. * // Transform origin, e.g. `left bottom`
  30. * origin?: string;
  31. * }
  32. * ```
  33. *
  34. */
  35. prev?: CreativeEffectTransform;
  36. /**
  37. * Next slide transformations.
  38. *
  39. * @example
  40. * ```js
  41. * {
  42. * // Array with translate X, Y and Z values
  43. * translate: (string | number)[];
  44. * // Array with rotate X, Y and Z values (in deg)
  45. * rotate?: number[];
  46. * // Slide opacity
  47. * opacity?: number;
  48. * // Slide scale
  49. * scale?: number;
  50. * // Enables slide shadow
  51. * shadow?: boolean;
  52. * // Transform origin, e.g. `left bottom`
  53. * origin?: string;
  54. * }
  55. * ```
  56. *
  57. */
  58. next?: CreativeEffectTransform;
  59. /**
  60. * CSS selector of the element inside of the slide to transform instead of the slide itself. Useful to use with cssMode
  61. *
  62. * @default null
  63. */
  64. transformEl?: CSSSelector;
  65. /**
  66. * Limit progress/offset to amount of side slides. If `1`, then slides all slides after prev/next will have same state. If `2`, then all slides after 2nd before/after active will have same state, etc.
  67. *
  68. * @default 1
  69. */
  70. limitProgress?: number;
  71. /**
  72. * Splits shadow "opacity" per slide based on `limitProgress` (only if transformation shadows enabled). E.g. setting `limitProgress: 2` and enabling `shadowPerProgress`, will set shadow opacity to `0.5` and `1` on two slides next to active. With this parameter disabled, all slides beside active will have shadow with `1` opacity
  73. *
  74. * @default false
  75. */
  76. shadowPerProgress?: boolean;
  77. /**
  78. * Allows to multiply slides transformations and opacity.
  79. *
  80. * @default 1
  81. */
  82. progressMultiplier?: number;
  83. /**
  84. * Enable this parameter if your custom transforms require 3D transformations (`translateZ`, `rotateX`, `rotateY` )
  85. *
  86. * @default true
  87. */
  88. perspective?: boolean;
  89. }