$transition: .2s ease-in-out; .preloader { &-circular { //animation: rotate 2s linear infinite; animation: rotate 1s linear infinite; height: 100%; transform-origin: center center; /* width: 100%; */ position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; } &-path { //stroke-dasharray: 1, 200; stroke-dasharray: 93.6375, 124.85; // 75% stroke-dashoffset: 0; //animation: dash 1.5s ease-in-out infinite/* , color 6s ease-in-out infinite */; stroke-linecap: round; stroke: white; stroke-width: 3; } &-container { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; width: 54px; height: 54px; display: flex; cursor: pointer; opacity: 0; transform: scale(0); body:not(.animation-level-0) & { transition: opacity $transition, transform $transition; } &.is-visible { &:not(.backwards) { opacity: 1; transform: scale(1); } } } } .preloader-container { .you-spin-me-round { width: 100%; height: 100%; animation: rotate 2s linear infinite; } .preloader-circular { animation: none; background-color: rgba(0, 0, 0, .7); border-radius: 50%; width: 100%; height: 100%; } .preloader-path-new { stroke-dasharray: 5, 149.82; //stroke-dasharray: 112.36, 149.82; stroke-dashoffset: 0; transition: stroke-dasharray $transition, stroke-width $transition; stroke-linecap: round; stroke: white; stroke-width: 2; } &.preloader-swing { cursor: default; .you-spin-me-round { animation: rotate 1s linear infinite; } .preloader-path-new { //animation: dashNew 1.5s ease-in-out infinite; stroke-dasharray: 112.36, 149.82; } } .preloader-close, .preloader-download { position: absolute; top: 0; left: 0; bottom: 0; right: 0; margin: auto; color: #fff; width: 56%; height: 56%; transition: opacity .2s ease-in-out/* , transform .2s ease-in-out */; //transform: scale(1); opacity: 1; path { fill: #fff; } html.no-touch &:hover { background: none; } } &:not(.manual) .preloader-download, &.manual .preloader-close { opacity: 0; //transform: scale(.5); } &.manual .preloader-path-new { stroke-width: 0; } .preloader-download { width: 1.5rem; height: 1.5rem; } &.preloader-streamable { &, svg { cursor: pointer !important; } circle { stroke-width: 2.5 !important; //animation: dashNewStreamable 1.5s ease-in-out infinite !important; } &:after { content: ""; position: absolute; width: .8125rem; height: .8125rem; border-radius: .125rem; background-color: #fff; left: 50%; top: 50%; transform: translate3d(-50%, -50%, 0); } } &.preloader-transparent { .preloader-circular { background-color: transparent; } } &.preloader-bold { .preloader-path-new { stroke-width: 3.5; } } } @keyframes rotate { 100% { transform: rotate(360deg); } } @keyframes dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } } @keyframes dashNew { 0% { stroke-dasharray: 1, 149.82; // 149.82 = getTotalLength stroke-dashoffset: 0; } 50% { stroke-dasharray: 112.36, 149.82; // 112.36 = 149.82 * .75 stroke-dashoffset: -38; // bruted } 100% { stroke-dasharray: 112.36, 149.82; stroke-dashoffset: -149.82; // totalLength } } @keyframes dashNewStreamable { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -237%; } }