diff --git a/public/icons/link-white.svg b/public/icons/link-white.svg new file mode 100644 index 00000000..5a4bc439 --- /dev/null +++ b/public/icons/link-white.svg @@ -0,0 +1,4 @@ + + + diff --git a/src/components/Feed/Group.scss b/src/components/Feed/Group.scss index c778d559..757ac6ad 100644 --- a/src/components/Feed/Group.scss +++ b/src/components/Feed/Group.scss @@ -33,3 +33,13 @@ transition: filter 0.2s; } } + +.floor--group { + @include media-breakpoint-down(sm) { + .col-lg-6 { + .row { + margin: 0 0 0 divide(-$container-padding-x, 2); + } + } + } +} diff --git a/src/components/Feed/Group.tsx b/src/components/Feed/Group.tsx index 2e2da95f..a33dd0ab 100644 --- a/src/components/Feed/Group.tsx +++ b/src/components/Feed/Group.tsx @@ -11,7 +11,7 @@ interface GroupProps { export default (props: GroupProps) => { if (!props.articles) props.articles = [] return ( -
+
4}>
{props.header}
diff --git a/src/components/Loading.module.scss b/src/components/Loading.module.scss index de09f09b..5783271c 100644 --- a/src/components/Loading.module.scss +++ b/src/components/Loading.module.scss @@ -2,7 +2,7 @@ position: absolute; top: 50%; left: 50%; - transform: translate(-50%, -50%); + transform: translate(-50%, 0); } @keyframes spin { diff --git a/src/components/Nav/Header.module.scss b/src/components/Nav/Header.module.scss index c04308a7..0a34a45e 100644 --- a/src/components/Nav/Header.module.scss +++ b/src/components/Nav/Header.module.scss @@ -20,6 +20,10 @@ } } +.mainHeaderInner { + position: relative; +} + .headerFixed.headerScrolledBottom, .headerFixed.headerScrolledTop { .mainLogo { @@ -31,9 +35,26 @@ } } +.popupShare { + opacity: 1; + transition: opacity 0.3s; + z-index: 1; + + .headerScrolledTop & { + opacity: 0; + transition: opacity 0.3s, z-index 0s 0.3s; + z-index: -1; + } +} + .headerFixed { position: fixed; top: 0; + + .fixed & { + bottom: 0; + margin-bottom: 0; + } } .headerInner { @@ -44,8 +65,7 @@ justify-content: space-between; margin: 0; - &.fixed { - border-bottom: 4px solid #000; + .fixed & { left: 0; position: fixed; right: 0; @@ -62,25 +82,33 @@ .mainLogo { align-items: center; display: inline-flex; - height: 70px; + height: 56px; padding: 0 $container-padding-x 0 0; position: relative; transition: height 0.2s; text-align: center; z-index: 9; + @include media-breakpoint-up(md) { + height: 70px; + } + @include media-breakpoint-up(lg) { height: 80px; } img { - height: 32px; + height: 20px; object-fit: contain; object-position: left; transition: height 0.2s; vertical-align: middle; width: 100px; + @include media-breakpoint-up(md) { + height: 32px; + } + @include media-breakpoint-up(lg) { width: 175px; } @@ -113,6 +141,14 @@ padding-left: 0; position: relative; @include font-size(1.7rem); + + @include media-breakpoint-down(md) { + display: none; + } + + .fixed & { + display: block; + } } .mainNavigation { @@ -145,7 +181,7 @@ padding: divide($container-padding-x, 2); } - &.fixed { + .fixed & { display: inline-flex; @include media-breakpoint-down(lg) { @@ -181,13 +217,9 @@ display: inline-flex; float: right; padding-right: 0; - padding-left: 0; + padding-left: divide($container-padding-x, 2); width: 2.2rem; - @include media-breakpoint-up(sm) { - padding-left: divide($container-padding-x, 2); - } - @include media-breakpoint-up(md) { display: none; } @@ -235,7 +267,7 @@ top: 0; } - &.fixed { + .fixed & { > div { opacity: 0; transition: opacity 0s; @@ -276,6 +308,10 @@ text-overflow: ellipsis; white-space: nowrap; width: 100%; + + @include media-breakpoint-down(md) { + display: none; + } } .headerSearch { @@ -305,6 +341,7 @@ .articleControls { display: flex; + justify-content: flex-end; left: 0; position: absolute; top: 50%; diff --git a/src/components/Nav/Header.tsx b/src/components/Nav/Header.tsx index 802db235..973280df 100644 --- a/src/components/Nav/Header.tsx +++ b/src/components/Nav/Header.tsx @@ -3,12 +3,14 @@ import Private from './Private' import Notifications from './Notifications' import { Icon } from './Icon' import { Modal } from './Modal' +import { Popup } from './Popup' import AuthModal from './AuthModal' import { t } from '../../utils/intl' -import { useModalStore, showModal, useWarningsStore } from '../../stores/ui' +import {useModalStore, showModal, useWarningsStore, toggleModal} from '../../stores/ui' import { useAuthStore } from '../../stores/auth' import { handleClientRouteLinkClick, router, Routes, useRouter } from '../../stores/router' import styles from './Header.module.scss' +import stylesPopup from './Popup.module.scss' import privateStyles from './Private.module.scss' import { getPagePath } from '@nanostores/router' import { getLogger } from '../../utils/logger' @@ -49,11 +51,10 @@ export const Header = (props: Props) => { const toggleFixed = () => setFixed(!fixed()) // effects createEffect(() => { - if (fixed() || getModal()) { - document.body.classList.add('fixed') - } else { - document.body.classList.remove('fixed') - } + const isFixed = fixed() || (getModal() && getModal() !== 'share'); + + document.body.classList.toggle('fixed', isFixed); + document.body.classList.toggle(styles.fixed, isFixed); }, [fixed(), getModal()]) // derived @@ -71,8 +72,6 @@ export const Header = (props: Props) => { onMount(() => { let scrollTop = window.scrollY - // window.console.log(props.title) - const handleScroll = () => { setIsScrollingBottom(window.scrollY > scrollTop) setIsScrolled(window.scrollY > 0) @@ -98,7 +97,43 @@ export const Header = (props: Props) => { -
+ +
+ + + +