_Daylight.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. @use "sass:color";
  2. @mixin daylight() {
  3. @-webkit-keyframes pulse {
  4. to {
  5. box-shadow: 0 0 0 12px rgba(232, 76, 61, 0);
  6. }
  7. }
  8. @-moz-keyframes pulse {
  9. to {
  10. box-shadow: 0 0 0 12px rgba(232, 76, 61, 0);
  11. }
  12. }
  13. @-ms-keyframes pulse {
  14. to {
  15. box-shadow: 0 0 0 12px rgba(232, 76, 61, 0);
  16. }
  17. }
  18. @keyframes pulse {
  19. to {
  20. box-shadow: 0 0 0 12px rgba(232, 76, 61, 0);
  21. }
  22. }
  23. $slider-label-offset--dropdown-on: 20px;
  24. $slider-label-offset--drop-down-off: 12px;
  25. .esri-daylight {
  26. padding: var(--esri-widget-padding);
  27. width: 350px;
  28. display: flex;
  29. flex-direction: column;
  30. flex-shrink: 0;
  31. flex-basis: auto;
  32. justify-content: space-between;
  33. gap: $cap-spacing;
  34. &__anchor {
  35. font-size: $font-size--small;
  36. }
  37. &__panel--error {
  38. padding: 0 $side-spacing;
  39. animation: esri-fade-in 250ms ease-in-out;
  40. }
  41. &__container {
  42. display: flex;
  43. flex-direction: row;
  44. justify-content: space-between;
  45. align-items: center;
  46. gap: $side-spacing;
  47. }
  48. .esri-date-picker,
  49. &__season-picker {
  50. flex-grow: 1;
  51. }
  52. .esri-date-picker__calendar-toggle {
  53. height: 32px;
  54. font-size: $font-size--small;
  55. }
  56. &__container,
  57. &__season-picker {
  58. &--disabled {
  59. opacity: $opacity--disabled;
  60. pointer-events: none;
  61. }
  62. }
  63. &__play-pause-button {
  64. flex: 0;
  65. }
  66. @include timeSlider();
  67. .esri-slider.esri-slider--horizontal .esri-slider__thumb {
  68. $thumb-size: 27px;
  69. width: $thumb-size;
  70. height: $thumb-size;
  71. left: -$thumb-size * 0.5;
  72. top: -$thumb-size * 0.5;
  73. background-color: $button-color;
  74. border: 7px solid #0079c14d;
  75. background-clip: padding-box;
  76. background-position: 0 0 !important;
  77. &:hover,
  78. &:active,
  79. &:focus {
  80. background-color: $button-color--hover;
  81. }
  82. }
  83. .esri-slider.esri-slider--horizontal {
  84. .esri-slider-with-dropdown__box {
  85. display: flex;
  86. align-items: center;
  87. font-size: $font-size--tiny-time-slider;
  88. min-width: inherit;
  89. white-space: nowrap;
  90. margin: 0;
  91. margin-top: -$cap-spacing--half;
  92. left: 0;
  93. transform: translateX(-50%); // Center the label. We define it here so we can transition it.
  94. transition: transform 0.15s ease-out;
  95. > .esri-slider__label {
  96. inset-inline-start: auto;
  97. margin: 0;
  98. min-width: auto;
  99. outline: none;
  100. }
  101. }
  102. .esri-slider-with-dropdown__box--drop-down-on,
  103. .esri-slider-with-dropdown__box--drop-down-off {
  104. width: min-content;
  105. }
  106. }
  107. // Aligns the slider label to the left so it doesn't overflow.
  108. .esri-slider--align-left .esri-slider.esri-slider--horizontal .esri-slider-with-dropdown__box {
  109. &--drop-down-off,
  110. &--drop-down-on {
  111. transform: translateX(-$slider-label-offset--drop-down-off);
  112. }
  113. }
  114. // Aligns the slider label to the right so it doesn't overflow.
  115. .esri-slider--align-right .esri-slider.esri-slider--horizontal .esri-slider-with-dropdown__box {
  116. &--drop-down-on {
  117. transform: translateX($slider-label-offset--dropdown-on) translateX(-100%);
  118. }
  119. &--drop-down-off {
  120. transform: translateX($slider-label-offset--drop-down-off) translateX(-100%);
  121. }
  122. }
  123. .esri-slider--ampm-on .esri-slider.esri-slider--horizontal {
  124. padding: 30px 8px 42px 8px;
  125. ~ .esri-daylight__play-pause-button {
  126. margin-bottom: 10px; // Align vertically with the slider
  127. }
  128. }
  129. .esri-slider--shadow-on .esri-slider__thumb {
  130. box-shadow: 2px 2px 5px 0px rgba(148, 148, 148, 0.63);
  131. }
  132. .esri-slider.esri-slider--horizontal .esri-widget__anchor.esri-slider-with-dropdown__anchor {
  133. font-size: $font-size--tiny-time-slider;
  134. color: $interactive-font-color;
  135. &:hover {
  136. color: $interactive-font-color--hover;
  137. }
  138. }
  139. calcite-label {
  140. // Cancel default calcite component margin. See https://github.com/Esri/calcite-components/issues/2138
  141. margin-bottom: -0.6rem;
  142. }
  143. }
  144. [dir="rtl"] .esri-daylight {
  145. .esri-slider--align-left .esri-slider.esri-slider--horizontal .esri-slider-with-dropdown__box {
  146. &--drop-down-on {
  147. transform: translateX(-$slider-label-offset--dropdown-on);
  148. }
  149. &--drop-down-off {
  150. transform: translateX(-$slider-label-offset--drop-down-off);
  151. }
  152. }
  153. .esri-slider--align-right .esri-slider.esri-slider--horizontal .esri-slider-with-dropdown__box {
  154. &--drop-down-on,
  155. &--drop-down-off {
  156. transform: translateX($slider-label-offset--drop-down-off) translateX(-100%);
  157. }
  158. }
  159. }
  160. }
  161. @mixin sliderWithDropdown() {
  162. $timezone-dropdown-z-index: 999; // Just below the `Popover` widget
  163. .esri-slider-with-dropdown__box {
  164. text-align: center;
  165. .esri-slider__label {
  166. display: inline-block;
  167. position: static;
  168. }
  169. .esri-slider__label-input {
  170. display: inline-block;
  171. }
  172. }
  173. .esri-slider__anchor:focus .esri-slider-with-dropdown__box.esri-slider__label {
  174. outline: none !important;
  175. }
  176. .esri-slider-with-dropdown__dropdown-root {
  177. display: inline-block;
  178. margin-inline-start: $side-spacing--half;
  179. }
  180. .esri-slider-with-dropdown__anchor {
  181. background-color: transparent;
  182. border: none;
  183. padding: 0;
  184. margin: 0;
  185. }
  186. .esri-slider-with-dropdown__anchor--closed:after {
  187. content: unicode(\25bf);
  188. visibility: hidden;
  189. }
  190. .esri-slider-with-dropdown__anchor--closed:hover:after {
  191. visibility: visible;
  192. }
  193. .esri-slider-with-dropdown__anchor--open:after {
  194. content: unicode(\25b5);
  195. }
  196. .esri-slider-with-dropdown__list {
  197. @include defaultBoxShadow();
  198. display: block;
  199. position: relative;
  200. padding: 0;
  201. margin: 0;
  202. list-style: none;
  203. background-color: $background-color;
  204. border: 1px solid $border-color--subtle;
  205. height: 350px;
  206. width: 300px;
  207. overflow-y: scroll;
  208. overflow-x: hidden;
  209. text-align: left;
  210. white-space: inherit;
  211. font-size: $font-size--small;
  212. }
  213. .esri-slider-with-dropdown__list-item {
  214. display: flex;
  215. flex-direction: column;
  216. padding: $cap-spacing $side-spacing;
  217. }
  218. .esri-slider-with-dropdown__list-item:hover {
  219. background-color: $background-color--hover;
  220. }
  221. .esri-slider-with-dropdown__list-item--selected {
  222. background-color: $background-color--active;
  223. }
  224. }
  225. @if $include_Daylight == true {
  226. @include daylight();
  227. @include sliderWithDropdown();
  228. }