-
redirect(redirectUrlWithPlaceholder.replace('${tag}', 'all'))}>
- All
-
- {tags.map((tag, index) => {
- return (
-
redirect(redirectUrlWithPlaceholder.replace('${tag}', tag))}>
- {tag}
-
- );
- })}
+
{
+ const nextFocusedElement = event.relatedTarget as Node | null;
+
+ if (!event.currentTarget.contains(nextFocusedElement)) {
+ setIsOpen(false);
+ }
+ }}
+ onKeyDown={(event) => {
+ if (event.key === 'Escape' && isOpen) {
+ event.preventDefault();
+ closeDropdown();
+ }
+ }}
+ >
+
+
+ {isOpen && (
+
+ {options.map((tag) => {
+ const isActive = tag === activeTag;
+ const label = tag === 'all' ? 'All images' : tag;
+
+ return (
+
+ );
+ })}
+
+ )}
);
-}
+}
\ No newline at end of file
diff --git a/src/styles/Paginator.module.scss b/src/styles/Paginator.module.scss
index 7e99b95..6ab4f42 100644
--- a/src/styles/Paginator.module.scss
+++ b/src/styles/Paginator.module.scss
@@ -25,8 +25,8 @@
}
&:disabled {
- background-color: #0f0f0f;
cursor: not-allowed;
+ color: rgb(138, 137, 137);
&:hover {
border-bottom-color: transparent;
diff --git a/src/styles/Tags.module.scss b/src/styles/Tags.module.scss
index bb5a161..601ded7 100644
--- a/src/styles/Tags.module.scss
+++ b/src/styles/Tags.module.scss
@@ -1,25 +1,174 @@
-.tags {
- display: flex;
- justify-content: start;
- align-items: start;
- gap: 5px 20px;
- flex-wrap: wrap;
- flex: 1;
+.tagFilter {
+ position: relative;
+ width: min(220px, 100%);
+ font-size: 0.9rem;
+ z-index: 20;
}
-.tag {
+.trigger {
+ width: 100%;
+ min-height: 38px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ padding: 8px 11px 8px 13px;
+
+ color: rgba(255, 255, 255, 0.88);
+ background: rgba(35, 38, 42, 0.9);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 9px;
+
+ font: inherit;
+ text-align: left;
cursor: pointer;
- padding: 0 5px;
- transition: all 30ms ease-in-out;
- border-bottom: 2px solid transparent;
- font-size: 12pt;
+
+ box-shadow:
+ 0 4px 14px rgba(0, 0, 0, 0.12),
+ inset 0 1px rgba(255, 255, 255, 0.025);
+
+ transition:
+ border-color 70ms ease,
+ background-color 100ms ease,
+ box-shadow 100ms ease;
&:hover {
- border-bottom-color: var(--color-accent);
+ background: rgba(41, 44, 49, 0.96);
+ border-color: rgba(255, 255, 255, 0.16);
}
- &Active {
- border-bottom-color: var(--color-accent);
- font-weight: bold;
+ &:focus-visible {
+ outline: none;
+ border-color: color-mix(in srgb, var(--color-accent) 75%, transparent);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent);
+ }
+}
+
+.triggerOpen {
+ border-color: color-mix(in srgb, var(--color-accent) 55%, transparent);
+
+ .chevron {
+ transform: rotate(180deg);
+ }
+}
+
+.triggerLabel {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.chevron {
+ width: 17px;
+ height: 17px;
+ flex-shrink: 0;
+
+ fill: none;
+ stroke: rgba(255, 255, 255, 0.55);
+ stroke-width: 1.7;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+
+ transition: transform 100ms ease;
+}
+
+.options {
+ position: absolute;
+ top: calc(100% + 7px);
+ left: 0;
+ right: 0;
+
+ max-height: 260px;
+ overflow-y: auto;
+
+ padding: 5px;
+
+ background: rgba(29, 31, 35, 0.98);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 10px;
+
+ box-shadow:
+ 0 16px 38px rgba(0, 0, 0, 0.35),
+ inset 0 1px rgba(255, 255, 255, 0.035);
+
+ backdrop-filter: blur(14px);
+ animation: openOptions 130ms ease-out;
+
+ scrollbar-width: thin;
+ scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
+}
+
+.option {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 30px;
+ padding: 8px 10px;
+ color: rgba(255, 255, 255, 0.72);
+ background: transparent;
+ border: 0;
+ border-radius: 6px;
+
+ font: inherit;
+ text-align: left;
+ cursor: pointer;
+
+ transition:
+ color 70ms ease,
+ background-color 70ms ease;
+
+ &:hover,
+ &:focus-visible {
+ color: rgba(255, 255, 255, 0.96);
+ background: rgba(255, 255, 255, 0.065);
+ outline: none;
+ }
+}
+
+.optionActive {
+ color: var(--color-accent);
+ background: color-mix(in srgb, var(--color-accent) 9%, transparent);
+
+ &:hover,
+ &:focus-visible {
+ color: var(--color-accent);
+ background: color-mix(in srgb, var(--color-accent) 13%, transparent);
+ }
+}
+
+.check {
+ width: 16px;
+ height: 16px;
+ flex-shrink: 0;
+
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.8;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+@keyframes openOptions {
+ from {
+ opacity: 0;
+ transform: translateY(-4px) scale(0.98);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .options {
+ animation: none;
+ }
+
+ .trigger,
+ .chevron,
+ .option {
+ transition: none;
}
}