diff --git a/assets/icons/compress.svg b/assets/icons/compress.svg new file mode 100644 index 0000000..ec3835d --- /dev/null +++ b/assets/icons/compress.svg @@ -0,0 +1,3 @@ + diff --git a/assets/icons/expand.svg b/assets/icons/expand.svg index 8714568..bb93ea4 100644 --- a/assets/icons/expand.svg +++ b/assets/icons/expand.svg @@ -1,3 +1,3 @@ diff --git a/assets/icons/grip-dots.svg b/assets/icons/grip-dots.svg new file mode 100644 index 0000000..ed61387 --- /dev/null +++ b/assets/icons/grip-dots.svg @@ -0,0 +1,3 @@ + diff --git a/components/comparisons/_style.scss b/components/comparisons/_style.scss index 386cda8..8ecf00f 100644 --- a/components/comparisons/_style.scss +++ b/components/comparisons/_style.scss @@ -2,13 +2,7 @@ @import "@wordpress/base-styles/breakpoints"; .vrts-comparisons { - --vrts-comparisons-slider-control-position: 50%; - --vrts-divider-width: 1px; - --vrts-divider-color: var(--wp-admin-theme-color); - --vrts-divider-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); - --vrts-default-handle-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); - --vrts-default-handle-background-color: #{$white}; - --vrts-default-handle-color: var(--wp-admin-theme-color); + --vrts-comparisons-slider-position: 50%; display: block; box-sizing: border-box; @@ -49,7 +43,7 @@ position: sticky; top: calc(62px + var(--wp-admin--admin-bar--height)); - [data-vrts-fullscreen] & { + [data-vrts-fullscreen="true"] & { top: 62px; } } @@ -60,6 +54,7 @@ -webkit-line-clamp: 1; display: -webkit-box; font-size: 13px; + font-weight: 500; line-height: 1.4; max-block-size: calc(13px * 1.4); white-space: initial; @@ -108,11 +103,6 @@ align-items: center; justify-content: center; - svg { - height: 14px; - width: auto; - } - &::before { position: absolute; top: 5px; @@ -134,58 +124,35 @@ opacity: 1; } } - } - &__panel { - margin: 0 !important; - display: flex; - align-items: flex-start; - flex-wrap: wrap; - gap: 1rem; - padding: 1em; + svg { + height: 14px; + width: auto; - &[hidden] { - display: none; + &:last-child { + display: none; + } } - } - &__tabs { - margin: 0; - padding: 0; - display: inherit; - flex-direction: row; - - [role="tab"] { - --vrts-comparisons-tab-border-height: 3px; - all: unset; - margin-bottom: 0; - list-style: none; - border-bottom: transparent solid var(--vrts-comparisons-tab-border-height); - flex-wrap: wrap; - padding: 1rem calc(1.33rem - var(--vrts-comparisons-tab-border-height)); - color: $gray-text; - cursor: pointer; - text-decoration: none; - transition: border 0.2s, color 0.2s; - - &:hover { - color: var(--wp-admin-theme-color); + [data-vrts-fullscreen="true"] & { + svg:first-child { + display: none; } - &[aria-selected="true"] { - border-bottom-color: var(--wp-admin-theme-color); + svg:last-child { + display: block; } } } - &__images { + &__content { display: grid; - flex-direction: column; - gap: 1rem; + justify-content: center; + gap: 0.5rem; padding: 1em; @media (min-width: $break-medium) { - grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-columns: repeat(3, minmax(0, max-content)); } } @@ -203,6 +170,12 @@ } } + &__highligher { + background: #ddd; + height: 100%; + width: 4px; + } + &__slider { position: relative; display: grid; @@ -220,14 +193,14 @@ } [data-vrts-slot="second"] { - clip-path: inset(0 0 0 var(--vrts-comparisons-slider-control-position)); + clip-path: inset(0 0 0 var(--vrts-comparisons-slider-position)); } } &__slider-handle { position: absolute; top: 0; - left: calc(var(--vrts-comparisons-slider-control-position) - 1px); + left: calc(var(--vrts-comparisons-slider-position) - 1px); width: 2px; height: 100%; display: flex; @@ -239,28 +212,33 @@ display: block; height: 100%; width: 1px; - background: var(--vrts-divider-color); - box-shadow: var(--vrts-divider-shadow); + background: var(--wp-admin-theme-color); + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); } svg { position: absolute; top: 50%; left: 50%; - transform: translate(calc(-50% - 0.5px), -50%); + transform: translate(-50%, -50%); + width: 42px; + height: 42px; + border-radius: 50%; + background: #fff; + border: 1px solid var(--wp-admin-theme-color); + color: var(--wp-admin-theme-color); } } &__slider-handle-clone { position: absolute; top: 0; - left: calc(var(--vrts-comparisons-slider-control-position) - 1px); - width: 1px; + left: calc(var(--vrts-comparisons-slider-position) - 0.5px); + width: 0px; height: 100%; - background: var(--vrts-divider-color); - box-shadow: var(--vrts-divider-shadow); - opacity: .2; - z-index: 1; + border-left: 1px dashed #c3c4c7; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + opacity: .4; } &__slider-control { diff --git a/components/comparisons/index.php b/components/comparisons/index.php index 4b7e7c0..f999243 100644 --- a/components/comparisons/index.php +++ b/components/comparisons/index.php @@ -8,17 +8,18 @@ component( 'alert-actions', $data ); ?> -