SideBar.vue
614 lines
| 1 | <template> |
| 2 | <div :style="cssVars" role="complementary"> |
| 3 | <slot name="step-list"></slot> |
| 4 | <slot name="support-info"></slot> |
| 5 | </div> |
| 6 | </template> |
| 7 | |
| 8 | <script setup> |
| 9 | // * Color Vars |
| 10 | import { ref, computed, inject } from 'vue' |
| 11 | import { useColorTransparency } from '../../../../assets/js/common/colorManipulation' |
| 12 | |
| 13 | let amColors = inject( |
| 14 | 'amColors', |
| 15 | ref({ |
| 16 | colorPrimary: '#1246D6', |
| 17 | colorSuccess: '#019719', |
| 18 | colorError: '#B4190F', |
| 19 | colorWarning: '#CCA20C', |
| 20 | colorMainBgr: '#FFFFFF', |
| 21 | colorMainHeadingText: '#33434C', |
| 22 | colorMainText: '#1A2C37', |
| 23 | colorSbBgr: '#17295A', |
| 24 | colorSbText: '#FFFFFF', |
| 25 | colorInpBgr: '#FFFFFF', |
| 26 | colorInpBorder: '#D1D5D7', |
| 27 | colorInpText: '#1A2C37', |
| 28 | colorInpPlaceHolder: '#1A2C37', |
| 29 | colorDropBgr: '#FFFFFF', |
| 30 | colorDropBorder: '#D1D5D7', |
| 31 | colorDropText: '#0E1920', |
| 32 | colorBtnPrim: '#265CF2', |
| 33 | colorBtnPrimText: '#FFFFFF', |
| 34 | colorBtnSec: '#1A2C37', |
| 35 | colorBtnSecText: '#FFFFFF', |
| 36 | }), |
| 37 | ) |
| 38 | |
| 39 | // * Css Variables |
| 40 | let cssVars = computed(() => { |
| 41 | return { |
| 42 | '--am-c-sb-text-op5': useColorTransparency(amColors.value.colorSbText, 0.05), |
| 43 | '--am-c-sb-text-op10': useColorTransparency(amColors.value.colorSbText, 0.1), |
| 44 | '--am-c-sb-text-op60': useColorTransparency(amColors.value.colorSbText, 0.6), |
| 45 | '--am-c-scroll-op30': useColorTransparency(amColors.value.colorSbText, 0.3), |
| 46 | '--am-c-scroll-op10': useColorTransparency(amColors.value.colorSbText, 0.1), |
| 47 | } |
| 48 | }) |
| 49 | </script> |
| 50 | |
| 51 | <script> |
| 52 | export default { |
| 53 | name: 'SideBar', |
| 54 | } |
| 55 | </script> |
| 56 | |
| 57 | <style lang="scss"> |
| 58 | //@import "../../../../../src/assets/scss/common/variables/variables-colors"; |
| 59 | @mixin step-sidebar-container { |
| 60 | // am -- amelia |
| 61 | // fs -- form steps |
| 62 | // sb -- sidebar |
| 63 | // Amelia Form Steps |
| 64 | .am-fs { |
| 65 | // Sidebar |
| 66 | &-sb { |
| 67 | flex: 0 0 auto; |
| 68 | position: relative; |
| 69 | max-width: 240px; |
| 70 | width: 240px; |
| 71 | display: flex; |
| 72 | flex-direction: column; |
| 73 | justify-content: space-between; |
| 74 | font-size: 16px; |
| 75 | color: var(--am-c-sb-text); |
| 76 | border-radius: 0.5rem 0 0 0.5rem; |
| 77 | background-color: var(--am-c-sb-bgr); |
| 78 | padding: 16px 8px 16px; |
| 79 | transition: width 0.3s ease-in-out; |
| 80 | |
| 81 | &.am-rtl { |
| 82 | border-radius: 0 0.5rem 0.5rem 0; |
| 83 | } |
| 84 | |
| 85 | &.am-collapsed { |
| 86 | transition-delay: 1s; |
| 87 | } |
| 88 | |
| 89 | * { |
| 90 | font-family: var(--am-font-family); |
| 91 | } |
| 92 | |
| 93 | // Sidebar Step |
| 94 | &__step { |
| 95 | background-color: var(--am-c-sb-text-op5); |
| 96 | border-radius: 4px; |
| 97 | padding: 8px; |
| 98 | margin-bottom: 8px; |
| 99 | |
| 100 | $count: 100; |
| 101 | @for $i from 0 through $count { |
| 102 | &:nth-child(#{$i + 1}) { |
| 103 | animation: 400ms cubic-bezier(0.45, 1, 0.4, 1.2) #{$i * 70}ms am-animation-slide-right; |
| 104 | animation-fill-mode: both; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // Sidebar Step Wrapper |
| 109 | &-wrapper { |
| 110 | padding: 0 8px 0; |
| 111 | overflow-x: hidden; |
| 112 | |
| 113 | &:focus-visible { |
| 114 | box-shadow: 0 0 0 1px var(--am-c-sb-text-op60); |
| 115 | border-radius: 4px; |
| 116 | } |
| 117 | |
| 118 | // Main Scroll styles |
| 119 | &::-webkit-scrollbar { |
| 120 | width: 6px; |
| 121 | } |
| 122 | |
| 123 | &::-webkit-scrollbar-thumb { |
| 124 | border-radius: 6px; |
| 125 | background: var(--am-c-scroll-op30); |
| 126 | } |
| 127 | |
| 128 | &::-webkit-scrollbar-track { |
| 129 | border-radius: 6px; |
| 130 | background: var(--am-c-scroll-op10); |
| 131 | } |
| 132 | |
| 133 | .el-skeleton { |
| 134 | .el-skeleton__text { |
| 135 | --el-skeleton-color: var(--am-c-skeleton-sb-op20); |
| 136 | --el-skeleton-to-color: var(--am-c-skeleton-sb-op60); |
| 137 | } |
| 138 | padding: 0; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Sidebar Step Inner |
| 143 | &-inner { |
| 144 | display: flex; |
| 145 | align-items: center; |
| 146 | justify-content: space-between; |
| 147 | } |
| 148 | |
| 149 | // Sidebar Step Icon |
| 150 | &-icon { |
| 151 | position: relative; |
| 152 | width: 24px; |
| 153 | height: 20px; |
| 154 | font-size: 24px; |
| 155 | |
| 156 | span { |
| 157 | display: block; |
| 158 | position: absolute; |
| 159 | top: 50%; |
| 160 | left: 50%; |
| 161 | transform: translate(-50%, -50%); |
| 162 | } |
| 163 | |
| 164 | .am-fs-sb__step-icon__number { |
| 165 | top: -14px; |
| 166 | left: -16px; |
| 167 | transform: translate(0, 0); |
| 168 | font-size: 12px; |
| 169 | width: 18px; |
| 170 | height: 18px; |
| 171 | line-height: 1; |
| 172 | display: flex; |
| 173 | align-items: center; |
| 174 | justify-content: center; |
| 175 | border-radius: 50%; |
| 176 | background-color: var(--am-c-error); |
| 177 | color: var(--am-c-sb-text); |
| 178 | |
| 179 | &.am-collapsed { |
| 180 | width: 16px; |
| 181 | height: 16px; |
| 182 | font-size: 10px; |
| 183 | } |
| 184 | |
| 185 | &.am-rtl { |
| 186 | left: auto; |
| 187 | right: -16px; |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // Sidebar Step Heading |
| 193 | &-heading { |
| 194 | font-family: var(--am-font-family); |
| 195 | font-size: 14px; |
| 196 | font-weight: 500; |
| 197 | line-height: 1.43; |
| 198 | margin: 0 0 0 6px; |
| 199 | |
| 200 | &.fade-enter-active { |
| 201 | animation: sidebar-step-selection 1s; |
| 202 | } |
| 203 | |
| 204 | &.fade-leave-active { |
| 205 | animation: sidebar-step-selection 1s reverse; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // Sidebar Step Check State |
| 210 | // Default |
| 211 | &-checker { |
| 212 | --am-c-sb-checker-border: var(--am-c-sb-text-op10, #{fade-out($am-white, 0.9)}); |
| 213 | display: flex; |
| 214 | align-items: center; |
| 215 | justify-content: center; |
| 216 | width: 24px; |
| 217 | height: 24px; |
| 218 | background-color: var(--am-c-sb-bgr); |
| 219 | border-radius: 50%; |
| 220 | border: 1px solid var(--am-c-sb-checker-border); |
| 221 | transition: border 0.3s ease-in-out; |
| 222 | margin-left: auto; |
| 223 | |
| 224 | &.am-rtl { |
| 225 | margin-right: auto; |
| 226 | margin-left: 0; |
| 227 | } |
| 228 | |
| 229 | // Selected |
| 230 | &-selected { |
| 231 | --am-c-sb-checker-border: var(--am-c-primary); |
| 232 | border-width: 4px; |
| 233 | |
| 234 | // Sidebar Collapsed |
| 235 | &.am-collapsed { |
| 236 | border-width: 2px; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | .am-icon-check { |
| 241 | position: absolute; |
| 242 | width: 18px; |
| 243 | height: 18px; |
| 244 | font-size: 18px; |
| 245 | line-height: 0; |
| 246 | padding: 4px; |
| 247 | border-radius: 50%; |
| 248 | background-color: var(--am-c-success); |
| 249 | color: var(--am-c-sb-bgr); |
| 250 | |
| 251 | &:before { |
| 252 | position: absolute; |
| 253 | top: 50%; |
| 254 | left: 50%; |
| 255 | transform: translate(-50%, -50%); |
| 256 | } |
| 257 | |
| 258 | &.fade-enter-active { |
| 259 | animation: sidebar-step-check-state 1s; |
| 260 | } |
| 261 | |
| 262 | &.fade-leave-active { |
| 263 | animation: sidebar-step-check-state 1s reverse; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | // Sidebar Collapsed |
| 268 | &.am-collapsed { |
| 269 | width: 16px; |
| 270 | height: 16px; |
| 271 | position: absolute; |
| 272 | bottom: -4px; |
| 273 | right: -4px; |
| 274 | |
| 275 | .am-icon-check { |
| 276 | position: absolute; |
| 277 | width: 14px; |
| 278 | height: 14px; |
| 279 | font-size: 16px; |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | &-selection { |
| 285 | font-family: var(--am-font-family); |
| 286 | font-size: 12px; |
| 287 | font-weight: 400; |
| 288 | line-height: 1.5; |
| 289 | padding: 4px 0; |
| 290 | margin: 0; |
| 291 | border-bottom: 1px dashed var(--am-c-sb-text-op10); |
| 292 | white-space: pre; |
| 293 | |
| 294 | &.fade-enter-active { |
| 295 | animation: sidebar-step-selection 1s; |
| 296 | } |
| 297 | |
| 298 | &.fade-leave-active { |
| 299 | animation: sidebar-step-selection 1s reverse; |
| 300 | } |
| 301 | |
| 302 | &:last-child { |
| 303 | border-bottom: none; |
| 304 | padding-bottom: 0; |
| 305 | } |
| 306 | |
| 307 | &__wrapper { |
| 308 | display: block; |
| 309 | overflow: hidden; |
| 310 | } |
| 311 | |
| 312 | &-packages { |
| 313 | max-height: 100px; |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | // Sidebar Step |
| 319 | &__page { |
| 320 | display: flex; |
| 321 | align-items: center; |
| 322 | min-height: 40px; |
| 323 | background-color: transparent; |
| 324 | border-radius: 4px; |
| 325 | padding: 10px 8px; |
| 326 | margin-bottom: 8px; |
| 327 | cursor: pointer; |
| 328 | |
| 329 | &:hover { |
| 330 | background-color: var(--am-c-sb-text-op10); |
| 331 | |
| 332 | .am-fs-sb__page-indicator { |
| 333 | display: flex; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | &.selected { |
| 338 | background-color: var(--am-c-sb-text-op10); |
| 339 | |
| 340 | .am-fs-sb__page-indicator { |
| 341 | display: flex; |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | $count: 100; |
| 346 | @for $i from 0 through $count { |
| 347 | &:nth-child(#{$i + 1}) { |
| 348 | animation: 400ms cubic-bezier(0.45, 1, 0.4, 1.2) #{$i * 70}ms am-animation-slide-right; |
| 349 | animation-fill-mode: both; |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | // Sidebar Step Wrapper |
| 354 | &-wrapper { |
| 355 | padding: 0 8px; |
| 356 | overflow-x: hidden; |
| 357 | |
| 358 | // Main Scroll styles |
| 359 | &::-webkit-scrollbar { |
| 360 | width: 6px; |
| 361 | } |
| 362 | |
| 363 | &::-webkit-scrollbar-thumb { |
| 364 | border-radius: 6px; |
| 365 | background: var(--am-c-scroll-op30); |
| 366 | } |
| 367 | |
| 368 | &::-webkit-scrollbar-track { |
| 369 | border-radius: 6px; |
| 370 | background: var(--am-c-scroll-op10); |
| 371 | } |
| 372 | |
| 373 | .el-skeleton { |
| 374 | .el-skeleton__text { |
| 375 | --el-skeleton-color: var(--am-c-skeleton-sb-op20); |
| 376 | --el-skeleton-to-color: var(--am-c-skeleton-sb-op60); |
| 377 | } |
| 378 | padding: 0; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | // Sidebar Step Inner |
| 383 | &-inner { |
| 384 | width: 100%; |
| 385 | display: flex; |
| 386 | align-items: center; |
| 387 | justify-content: space-between; |
| 388 | gap: 0 4px; |
| 389 | line-height: 20px; |
| 390 | height: 20px; |
| 391 | |
| 392 | &.am-collapsed { |
| 393 | justify-content: center; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | // Sidebar Step Icon |
| 398 | &-icon { |
| 399 | position: relative; |
| 400 | width: 24px; |
| 401 | height: 20px; |
| 402 | font-size: 24px; |
| 403 | flex: 0 0 auto; |
| 404 | |
| 405 | span { |
| 406 | display: block; |
| 407 | position: absolute; |
| 408 | top: 50%; |
| 409 | left: 50%; |
| 410 | transform: translate(-50%, -50%); |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | // Sidebar Step Heading |
| 415 | &-heading { |
| 416 | font-family: var(--am-font-family); |
| 417 | font-size: 14px; |
| 418 | font-weight: 500; |
| 419 | line-height: 1.43; |
| 420 | white-space: nowrap; |
| 421 | overflow: hidden; |
| 422 | text-overflow: ellipsis; |
| 423 | margin: 0 auto 0 0; |
| 424 | |
| 425 | &.am-rtl { |
| 426 | margin: 0 0 0 auto; |
| 427 | } |
| 428 | |
| 429 | &.fade-enter-active { |
| 430 | animation: sidebar-step-selection 1s; |
| 431 | } |
| 432 | |
| 433 | &.fade-leave-active { |
| 434 | animation: sidebar-step-selection 1s reverse; |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | &-indicator { |
| 439 | display: none; |
| 440 | align-items: center; |
| 441 | justify-content: center; |
| 442 | font-size: 24px; |
| 443 | line-height: 20px; |
| 444 | margin-left: auto; |
| 445 | |
| 446 | &.am-rtl { |
| 447 | margin-right: auto; |
| 448 | margin-left: 0; |
| 449 | } |
| 450 | |
| 451 | &.fade-enter-active { |
| 452 | animation: sidebar-step-selection 1s; |
| 453 | } |
| 454 | |
| 455 | &.fade-leave-active { |
| 456 | animation: sidebar-step-selection 1s reverse; |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | &-divider { |
| 461 | border-top: 1px solid var(--am-c-sb-text-op60); |
| 462 | margin: 16px 0; |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | &__footer { |
| 467 | position: absolute; |
| 468 | bottom: 16px; |
| 469 | left: 16px; |
| 470 | width: calc(100% - 32px); |
| 471 | |
| 472 | .am-fs-sb__page { |
| 473 | &-heading { |
| 474 | margin-right: auto; |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | &__support { |
| 480 | border-top: 1px solid var(--am-c-sb-text-op10); |
| 481 | padding: 12px 0; |
| 482 | display: flex; |
| 483 | flex-direction: column; |
| 484 | |
| 485 | &-heading { |
| 486 | font-family: var(--am-font-family); |
| 487 | font-size: 14px; |
| 488 | font-weight: 500; |
| 489 | font-style: normal; |
| 490 | line-height: 1.43; |
| 491 | text-align: center; |
| 492 | color: var(--am-c-sb-text-op60); |
| 493 | |
| 494 | &.fade-enter-active { |
| 495 | animation: sidebar-step-selection 1s; |
| 496 | } |
| 497 | |
| 498 | &.fade-leave-active { |
| 499 | animation: sidebar-step-selection 1s reverse; |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | &-email { |
| 504 | font-family: var(--am-font-family); |
| 505 | font-size: 14px; |
| 506 | font-weight: 400; |
| 507 | font-style: normal; |
| 508 | line-height: 1.43; |
| 509 | text-align: center; |
| 510 | color: var(--am-c-sb-text); |
| 511 | text-decoration: none; |
| 512 | margin: 4px 0 0; |
| 513 | |
| 514 | &:focus-visible { |
| 515 | box-shadow: 0 0 0 1px var(--am-c-sb-text-op60); |
| 516 | border-radius: 4px; |
| 517 | } |
| 518 | |
| 519 | [class^='am-icon-']^='am-icon-'] { |
| 520 | font-size: 24px; |
| 521 | color: var(--am-c-sb-text); |
| 522 | justify-self: flex-end; |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | &__menu { |
| 528 | display: flex; |
| 529 | flex-direction: row; |
| 530 | align-items: center; |
| 531 | justify-content: space-between; |
| 532 | border-top: 1px solid var(--am-c-sb-text-op10); |
| 533 | padding: 12px 0 0; |
| 534 | cursor: pointer; |
| 535 | |
| 536 | &:focus-visible { |
| 537 | outline: none; |
| 538 | & [class^='am-icon-']^='am-icon-'], |
| 539 | & [class*=' am-icon-']*=' am-icon-'] { |
| 540 | box-shadow: 0 0 0 1px var(--am-c-sb-text-op60); |
| 541 | border-radius: 4px; |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | &-text { |
| 546 | font-size: 15px; |
| 547 | font-weight: 500; |
| 548 | line-height: 1.4; |
| 549 | color: var(--am-c-sb-text); |
| 550 | |
| 551 | &.fade-enter-active { |
| 552 | animation: sidebar-step-selection 1s; |
| 553 | } |
| 554 | |
| 555 | &.fade-leave-active { |
| 556 | animation: sidebar-step-selection 1s reverse; |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | & [class^='am-icon-']^='am-icon-'], |
| 561 | & [class*=' am-icon-']*=' am-icon-'] { |
| 562 | font-size: 24px; |
| 563 | color: var(--am-c-sb-text); |
| 564 | justify-self: flex-end; |
| 565 | } |
| 566 | |
| 567 | &.am-collapsed { |
| 568 | & [class^='am-icon-']^='am-icon-'], |
| 569 | & [class*=' am-icon-']*=' am-icon-'] { |
| 570 | margin: auto; |
| 571 | } |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | @keyframes sidebar-step-check-state { |
| 579 | 0% { |
| 580 | transform: scale(0); |
| 581 | } |
| 582 | 50% { |
| 583 | transform: scale(1.2); |
| 584 | } |
| 585 | 100% { |
| 586 | transform: scale(1); |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | @keyframes sidebar-step-selection { |
| 591 | 0% { |
| 592 | opacity: 0; |
| 593 | transform: translateX(-100%); |
| 594 | } |
| 595 | 50% { |
| 596 | transform: translateX(10%); |
| 597 | } |
| 598 | 100% { |
| 599 | opacity: 1; |
| 600 | transform: translateX(0); |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | // Public |
| 605 | .amelia-v2-booking #amelia-container { |
| 606 | @include step-sidebar-container; |
| 607 | } |
| 608 | |
| 609 | // Admin |
| 610 | #amelia-app-backend-new { |
| 611 | @include step-sidebar-container; |
| 612 | } |
| 613 | </style> |
| 614 |