generated from gravity-ui/package-example
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Gallery): add Gallery component
- Loading branch information
kseniyakuzina
committed
Jan 29, 2025
1 parent
52ef20f
commit 070ce7f
Showing
43 changed files
with
1,450 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
@use '../variables'; | ||
|
||
$block: '.#{variables.$ns}gallery'; | ||
$filePreviewBlock: '.#{variables.$ns}file-preview'; | ||
|
||
#{$block} { | ||
--g-modal-margin: 0; | ||
|
||
&__content { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
width: calc(100vw - 264px); | ||
height: calc(100vh - 56px); | ||
} | ||
|
||
&__header { | ||
display: flex; | ||
align-items: start; | ||
|
||
padding: var(--g-spacing-2) var(--g-spacing-3) var(--g-spacing-2) var(--g-spacing-5); | ||
|
||
> * { | ||
flex: 1; | ||
min-width: 0; | ||
} | ||
} | ||
|
||
&__navigation { | ||
display: flex; | ||
gap: var(--g-spacing-2); | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
gap: var(--g-spacing-1); | ||
align-items: stretch; | ||
justify-content: flex-end; | ||
} | ||
|
||
&__active-item-info { | ||
align-self: stretch; | ||
align-items: center; | ||
display: flex; | ||
} | ||
|
||
&__body { | ||
position: relative; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
flex: 1; | ||
min-height: 0; | ||
|
||
padding: 0 var(--g-spacing-2); | ||
} | ||
|
||
&__body-navigation-button { | ||
position: absolute; | ||
inset-block: 0 60px; | ||
z-index: 2; | ||
|
||
width: 200px; | ||
max-width: 20%; | ||
padding: 0; | ||
margin: 0; | ||
|
||
appearance: none; | ||
cursor: pointer; | ||
|
||
background-color: transparent; | ||
border: none; | ||
outline: none; | ||
|
||
&_direction_left { | ||
inset-inline-start: 0; | ||
|
||
cursor: | ||
url('./assets/arrow-left.svg') 2 2, | ||
default; | ||
} | ||
|
||
&_direction_right { | ||
inset-inline-end: var(--g-spacing-5); | ||
|
||
cursor: | ||
url('./assets/arrow-right.svg') 2 2, | ||
default; | ||
} | ||
} | ||
|
||
&__footer { | ||
padding: var(--g-spacing-2) var(--g-spacing-5) var(--g-spacing-4) var(--g-spacing-5); | ||
} | ||
|
||
&__preview-list { | ||
display: flex; | ||
gap: var(--g-spacing-2); | ||
align-items: stretch; | ||
overflow: auto hidden; | ||
-ms-overflow-style: none; | ||
scrollbar-width: none; | ||
|
||
&::-webkit-scrollbar { | ||
display: none; | ||
} | ||
} | ||
|
||
&__preview-list-item { | ||
width: 48px; | ||
min-width: 48px; | ||
height: 48px; | ||
border: 2px solid transparent; | ||
border-radius: var(--g-border-radius-l); | ||
padding: 0; | ||
margin: 0; | ||
|
||
appearance: none; | ||
cursor: pointer; | ||
|
||
background-color: transparent; | ||
outline: none; | ||
overflow: hidden; | ||
|
||
&_selected { | ||
border-color: var(--g-color-line-brand); | ||
} | ||
} | ||
|
||
&_mode_full-screen { | ||
overflow: hidden; | ||
|
||
--g-modal-border-radius: 0; | ||
|
||
#{$block} { | ||
&__content { | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
|
||
&__body { | ||
padding: 0; | ||
} | ||
|
||
&__header { | ||
position: absolute; | ||
inset-block-start: 0; | ||
inset-inline: 0; | ||
z-index: 3; | ||
|
||
opacity: 0; | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
&__footer { | ||
position: absolute; | ||
inset-inline: 0; | ||
inset-block-end: 0; | ||
z-index: 1; | ||
|
||
opacity: 0; | ||
background-color: rgba(0, 0, 0, 0.45); | ||
|
||
&:hover { | ||
opacity: 1; | ||
} | ||
} | ||
} | ||
|
||
.g-root_theme_light, | ||
.g-root_theme_light-hc { | ||
#{$block}__header { | ||
background-color: var(--g-color-private-white-450); | ||
} | ||
} | ||
|
||
.g-root_theme_dark, | ||
.g-root_theme_dark-hc { | ||
#{$block}__header { | ||
background-color: var(--g-color-private-black-450); | ||
} | ||
} | ||
} | ||
|
||
#{$filePreviewBlock}[class] { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#{$filePreviewBlock}__card { | ||
width: 100%; | ||
min-width: 100%; | ||
height: 100%; | ||
padding: 0; | ||
} | ||
|
||
#{$filePreviewBlock}__image, | ||
#{$filePreviewBlock}__icon { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} |
Oops, something went wrong.