_Swipe.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. @mixin swipe() {
  2. $divider-color: $background-color !default;
  3. $divider-size: 4px !default;
  4. .esri-swipe {
  5. width: 100%;
  6. height: 100%;
  7. position: absolute;
  8. overflow: hidden;
  9. margin: 0;
  10. padding: 0;
  11. background: transparent;
  12. user-select: none;
  13. }
  14. .esri-swipe,
  15. .esri-ui .esri-swipe {
  16. pointer-events: none;
  17. }
  18. .esri-swipe__container {
  19. position: absolute;
  20. margin: 0;
  21. padding: 0;
  22. border: 0;
  23. z-index: 1;
  24. touch-action: none; // needed for touch actions to work correctly
  25. pointer-events: auto;
  26. overflow: hidden; // needed to hide tracers in iOS
  27. }
  28. .esri-swipe--horizontal .esri-swipe__container {
  29. margin-left: -$button-width--half;
  30. height: 100%;
  31. cursor: col-resize;
  32. }
  33. .esri-swipe--vertical .esri-swipe__container {
  34. margin-top: -$button-height--half;
  35. width: 100%;
  36. cursor: row-resize;
  37. }
  38. .esri-swipe--disabled .esri-swipe__container {
  39. pointer-events: none;
  40. cursor: default;
  41. }
  42. .esri-swipe__divider {
  43. position: absolute;
  44. background-color: $divider-color;
  45. }
  46. .esri-swipe--horizontal .esri-swipe__divider {
  47. border-left: 1px solid rgba($interactive-font-color, 0.5);
  48. border-right: 1px solid rgba($interactive-font-color, 0.5);
  49. width: $divider-size;
  50. height: 100%;
  51. margin-left: -#{$divider-size * 0.5};
  52. top: 0;
  53. left: $button-width--half;
  54. }
  55. .esri-swipe--vertical .esri-swipe__divider {
  56. border-top: 1px solid rgba($interactive-font-color, 0.5);
  57. border-bottom: 1px solid rgba($interactive-font-color, 0.5);
  58. width: 100%;
  59. height: $divider-size;
  60. margin-top: -#{$divider-size * 0.5};
  61. left: 0;
  62. top: $button-height--half;
  63. }
  64. .esri-swipe__handle {
  65. width: $button-width;
  66. height: $button-height;
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. position: relative;
  71. border: 1px solid rgba($interactive-font-color, 0.5);
  72. border-radius: $border-radius;
  73. background-color: $divider-color;
  74. &--hidden {
  75. visibility: hidden;
  76. }
  77. }
  78. .esri-swipe__handle-icon {
  79. position: relative;
  80. z-index: 2;
  81. }
  82. .esri-swipe--horizontal .esri-swipe__handle {
  83. top: calc(50% - #{$button-height--half});
  84. }
  85. .esri-swipe--vertical .esri-swipe__handle {
  86. left: calc(50% - #{$button-height--half});
  87. }
  88. }
  89. @if $include_Swipe == true {
  90. @include swipe();
  91. }