_TimeSlider.scss 7.8 KB
Newer Older
1 2 3 4 5 6 7
@mixin timeSlider() {
  $widget-min-width: 375px;
  $primary-color: $border-color--contrast;
  $highlight-color: $button-color;
  $invalid-color: #d83020;

  .esri-time-slider {
杨思琦's avatar
杨思琦 committed
8 9
    @include defaultBoxShadow();

10 11 12 13 14 15 16 17 18 19 20
    cursor: default;
    min-width: $widget-min-width;

    &__layout {
      &--wide {
        .esri-time-slider {
          &__row {
            height: 88px;
            overflow: hidden;
          }

21 22 23
          &__playback-controls {
            display: flex;
            flex: auto;
杨思琦's avatar
杨思琦 committed
24
            direction: ltr;
25 26
          }

27 28 29 30 31 32 33
          &__animation {
            width: 64px;
          }

          &__time-extent {
            display: flex;
            flex-flow: column nowrap;
杨思琦's avatar
杨思琦 committed
34
            align-items: center;
35 36 37 38
            justify-content: center;
            width: 110px;
          }

39
          &__time-extent,
40
          &__min,
41 42 43 44 45
          &__previous,
          &__actions {
            border: {
              left: 1px solid $border-color;
            }
46 47
          }

48
          &__min,
49
          &__max {
50 51
            align-items: center;
            width: 110px;
52 53 54 55 56 57 58 59 60 61 62 63
          }

          &__slider {
            flex: auto;
          }

          &__previous,
          &__next {
            width: 42px;
          }

          &__warning {
64
            margin-bottom: 4px;
杨思琦's avatar
杨思琦 committed
65
            font-size: $font-size__h1;
66 67

            &-text {
68
              margin-inline: 3px;
69 70 71
              text-align: center;
            }
          }
72 73 74 75 76 77

          &__actions {
            &-button {
              height: 88px;
            }
          }
78 79 80 81
        }
      }

      &--compact {
82 83 84 85 86 87 88 89 90 91
        &.esri-time-slider {
          &--has-actions {
            .esri-time-slider {
              &__time-extent {
                padding-inline-start: 48px;
              }
            }
          }
        }

92 93 94 95
        .esri-time-slider {
          &__row {
            &:nth-child(1),
            &:nth-child(3) {
96
              height: 36px;
97
            }
杨思琦's avatar
杨思琦 committed
98

99 100 101 102 103 104 105 106 107 108 109 110 111 112
            &:nth-child(2) {
              height: 88px;
              overflow: hidden;
            }
          }

          &__animation {
            width: 35px;
          }

          &__time-extent {
            display: flex;
            flex: auto;
            flex-flow: row nowrap;
杨思琦's avatar
杨思琦 committed
113
            align-items: center;
114 115 116
            justify-content: center;

            &-separator {
117
              margin-inline: 7px;
118 119 120 121 122 123 124 125 126 127 128
            }
          }

          &__slider {
            flex: auto;
          }

          &__min,
          &__max {
            flex: auto;
          }
杨思琦's avatar
杨思琦 committed
129

130 131
          &__min {
            align-items: flex-start;
132
            margin-inline-start: 35px;
133
          }
杨思琦's avatar
杨思琦 committed
134

135 136
          &__max {
            align-items: flex-end;
137
            margin-inline-end: 35px;
138 139 140 141 142 143 144 145
          }

          &__previous,
          &__next {
            width: 35px;
          }

          &__warning {
146
            margin-inline-end: 4px;
杨思琦's avatar
杨思琦 committed
147
            line-height: $font-size__body;
148 149 150 151
          }

          &__actions {
            align-items: flex-end;
杨思琦's avatar
杨思琦 committed
152

153 154 155
            &-button {
              height: 36px;
            }
156 157 158 159 160
          }
        }
      }
    }

161 162 163 164
    &__row {
      display: flex;
    }

165 166 167 168 169 170 171 172 173 174 175 176 177
    &__mode {
      &--instant {
        .esri-slider {
          &__segment-0,
          &__segment-1 {
            background-color: $primary-color;
          }
        }
      }

      &--time-window {
        .esri-slider {
          &__segment-1 {
杨思琦's avatar
杨思琦 committed
178
            margin-top: -1px;
179 180 181
            background-color: $highlight-color;
            height: 6px;
          }
杨思琦's avatar
杨思琦 committed
182

183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
          &__segment-0,
          &__segment-2 {
            background-color: $primary-color;
          }
        }

        &.esri-time-slider {
          &--out-of-bounds {
            .esri-slider {
              &__segment-1 {
                background-color: $invalid-color;
              }
            }
          }
        }
      }

      &--cumulative-from-start {
        .esri-slider {
          &__segment-0 {
杨思琦's avatar
杨思琦 committed
203
            margin-top: -1px;
204 205 206
            background-color: $highlight-color;
            height: 6px;
          }
杨思琦's avatar
杨思琦 committed
207

208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
          &__segment-1 {
            background-color: $primary-color;
          }
        }

        &.esri-time-slider {
          &--out-of-bounds {
            .esri-slider {
              &__segment-0 {
                background-color: $invalid-color;
              }
            }
          }
        }
      }

      &--cumulative-from-end {
        .esri-slider {
          &__segment-0 {
            background-color: $primary-color;
          }
杨思琦's avatar
杨思琦 committed
229

230
          &__segment-1 {
杨思琦's avatar
杨思琦 committed
231
            margin-top: -1px;
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
            background-color: $highlight-color;
            height: 6px;
          }
        }

        &.esri-time-slider {
          &--out-of-bounds {
            .esri-slider {
              &__segment-1 {
                background-color: $invalid-color;
              }
            }
          }
        }
      }
    }

    &__time-extent {
      line-height: $font-size__body;
      color: $highlight-color;
杨思琦's avatar
杨思琦 committed
252
      font-size: $font-size__body;
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271

      &-group {
        display: flex;
        flex-flow: column nowrap;
        align-items: center;
      }

      &-date,
      &-separator {
        font-weight: $font-weight--bold;
      }
    }

    &__min,
    &__max {
      display: flex;
      flex-flow: column nowrap;
      justify-content: center;
      line-height: $font-size__body;
杨思琦's avatar
杨思琦 committed
272
      font-size: $font-size__body;
273 274 275 276 277 278 279 280

      &-date {
        font-weight: $font-weight--bold;
      }
    }

    &__slider {
      background-color: $background-color--offset;
杨思琦's avatar
杨思琦 committed
281
      padding: 0 40px;
282 283 284 285 286 287 288 289 290 291 292 293

      .esri-slider {
        margin-top: -19px;
        background-color: $background-color--offset;

        // This is a fix specifically for IE11. Without it ticks and tick labels are severely displaced.
        &__content {
          height: 2px;
        }

        &__thumb {
          top: -6px;
杨思琦's avatar
杨思琦 committed
294
          border-width: 3px;
295 296 297 298 299
        }

        &__tick-label {
          margin-top: 23px;
          white-space: nowrap;
杨思琦's avatar
杨思琦 committed
300
          font-size: $font-size__body;
301 302 303 304 305 306 307 308 309
        }

        &__tick {
          background: $primary-color;
          width: 1px;

          &.minorTick {
            height: 4px;
          }
杨思琦's avatar
杨思琦 committed
310

311 312 313 314 315 316
          &.majorTick {
            height: 8px;
          }
        }

        &__ticks {
317
          margin-top: 16px;
318 319 320 321 322 323 324 325
        }

        &__track {
          height: 4px;
        }
      }
    }

326
    &__animation,
327 328 329 330 331
    &__previous,
    &__next {
      &-button {
        border: none;
        width: 100%;
杨思琦's avatar
杨思琦 committed
332
        height: 100%;
333 334 335
      }
    }

336 337 338 339 340 341 342
    .esri-icon-play,
    .esri-icon-pause,
    .esri-icon-reverse,
    .esri-icon-forward {
      font-size: 24px;
    }

343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
    &--out-of-bounds {
      .esri-slider {
        &__thumb {
          border-color: $invalid-color;
        }
      }

      .esri-time-slider {
        &__time-extent {
          color: $invalid-color;
        }
      }
    }
  }

358
  [dir="rtl"] .esri-time-slider {
359
    &__layout {
360
      &--compact {
361 362
        .esri-time-slider {
          &__row {
363 364 365 366
            &:nth-child(3) {
              direction: ltr;
            }
          }
杨思琦's avatar
杨思琦 committed
367

368 369 370 371 372 373
          &__min,
          &__max {
            &-date,
            &-time {
              direction: rtl;
            }
374 375 376
          }
        }
      }
杨思琦's avatar
杨思琦 committed
377

378
      &--wide {
379
        .esri-time-slider {
380 381
          &__playback-controls {
            direction: ltr;
382
          }
杨思琦's avatar
杨思琦 committed
383

384 385 386 387 388 389 390
          &__min,
          &__max,
          &__time-extent {
            &-date,
            &-time {
              direction: rtl;
            }
391
          }
392
        }
杨思琦's avatar
杨思琦 committed
393

394 395 396 397 398 399 400 401
        &.esri-time-slider {
          &--has-actions {
            .esri-time-slider {
              &__actions {
                border: {
                  left: none;
                }
              }
杨思琦's avatar
杨思琦 committed
402

403 404 405 406 407 408
              &__animation {
                border: {
                  left: 1px solid $border-color;
                }
              }
            }
409 410 411 412 413 414 415 416 417 418
          }
        }
      }
    }
  }
}

@if $include_TimeSlider == true {
  @include timeSlider();
}