diff --git a/src/pages/articles/_article.css b/src/pages/articles/_article.css index 783a5946..1cfd084b 100644 --- a/src/pages/articles/_article.css +++ b/src/pages/articles/_article.css @@ -23,7 +23,7 @@ } @media (width <= 960px) { - gap: 2rem 0; + gap: 0; padding-inline: 1rem; } } diff --git a/src/pages/index.astro b/src/pages/index.astro index c355d542..6c16f754 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,12 +1,10 @@ --- -import { Picture } from "astro:assets"; import BaseLayout from "@modules/core/components/baseLayout/BaseLayout.astro"; import LatestArticles from "@modules/core/components/latestArticles/LatestArticles.astro"; import MyWork from "@modules/home/components/myWork/MyWork.astro"; import Testimonials from "@modules/home/components/testimonials/Testimonials.astro"; import Welcome from "@modules/home/components/welcome/Welcome.astro"; -// table of contents (details on mobile) // check responsive // todo: add signature email // todo: add small transitions & animations diff --git a/src/ui/assets/images/svg-components/cookie/Cookie.tsx b/src/ui/assets/images/svg-components/cookie/Cookie.tsx index ca3184ab..80df66aa 100644 --- a/src/ui/assets/images/svg-components/cookie/Cookie.tsx +++ b/src/ui/assets/images/svg-components/cookie/Cookie.tsx @@ -18,6 +18,7 @@ export const Cookie = ({ fill = "currentColor", title = "Cookie", classNames, .. y="0px" viewBox="0 0 120.23 122.88" xmlSpace="preserve" + role="img" fill={fill} {...props} > diff --git a/src/ui/assets/images/svg-components/infinite/Infinite.tsx b/src/ui/assets/images/svg-components/infinite/Infinite.tsx index 71ddafe0..de1b0210 100644 --- a/src/ui/assets/images/svg-components/infinite/Infinite.tsx +++ b/src/ui/assets/images/svg-components/infinite/Infinite.tsx @@ -16,6 +16,7 @@ export const Infinite = ({ fill = "currentColor", title = "Loading...", classNam height="23.1" width="55" preserveAspectRatio="xMidYMid meet" + role="img" fill={fill} {...props} > diff --git a/src/ui/assets/images/svg-components/leftArrow/LeftArrow.tsx b/src/ui/assets/images/svg-components/leftArrow/LeftArrow.tsx index 4fd9d7e3..9a44764d 100644 --- a/src/ui/assets/images/svg-components/leftArrow/LeftArrow.tsx +++ b/src/ui/assets/images/svg-components/leftArrow/LeftArrow.tsx @@ -8,7 +8,7 @@ interface LeftArrowProps extends SVGProps { export const LeftArrow = ({ fill = "currentColor", title = "Arrow", classNames, ...props }: LeftArrowProps) => { return ( - + {title} { export const Pin = ({ fill, title = "Pin", classNames, ...props }: PinProps) => { return ( - + {title} + Chevron + + \ No newline at end of file diff --git a/src/ui/assets/images/svg/double-quote.svg b/src/ui/assets/images/svg/double-quote.svg index 241fe636..0039ade3 100644 --- a/src/ui/assets/images/svg/double-quote.svg +++ b/src/ui/assets/images/svg/double-quote.svg @@ -1,5 +1,4 @@ - + Double Quote + Arrow
Table of Contents
- +
+ +
Table of Contents
+ +
diff --git a/src/ui/modules/article/components/tableOfContents/table-of-contents.css b/src/ui/modules/article/components/tableOfContents/table-of-contents.css index b7c22319..473347a1 100644 --- a/src/ui/modules/article/components/tableOfContents/table-of-contents.css +++ b/src/ui/modules/article/components/tableOfContents/table-of-contents.css @@ -1,4 +1,5 @@ .article__table-of-contents__nav { + --animation-range: entry 70cqh; animation: fade-in linear forwards; animation-range: var(--animation-range); animation-timeline: view(); @@ -8,22 +9,82 @@ opacity: 0; padding: 0.25rem 1rem; position: absolute; - --animation-range: entry 70cqh; translate: calc(-50% + 1rem) 0; width: max-content; &.--is-visible .article__table-of-contents__item { translate: 0 0; } + + @media (width <= 960px) { + position: relative; + translate: 0; + left: auto; + opacity: 1; + width: 100%; + } } .article__table-of-contents__wrapper { position: sticky; top: calc(var(--header-height) + 2rem); + + @media (width <= 960px) { + position: relative; + top: 0; + width: 100%; + margin-block: 1rem; + } +} + +.article__table-of-contents__summary { + margin-block-end: 0.5rem; + position: relative; + transition: background-position .2s; + + &::before { + content: ""; + background: url("/src/ui/assets/images/svg/chevron-down.svg") no-repeat right center / 1rem; + position: absolute; + right: 0; + top: 50%; + translate: 0 -50%; + transition: transform .2s; + width: 1rem; + height: 1rem; + visibility: hidden; + } + + @media (width <= 960px) { + &::before { + visibility: visible; + } + } +} + +.article__table-of-contents__details { + height: 1.5rem; + transition: height 0.2s; + + &[open] { + height: auto; + + @media (width <= 960px) { + overflow: clip; + } + } +} + +.article__table-of-contents__details[open] .article__table-of-contents__summary::before { + transform: translateY(-50%) rotate(0.5turn); } .article__table-of-contents__list { gap: 0.25rem 0; + + @media (width <= 960px) { + justify-content: flex-start; + } } .article__table-of-contents__item { @@ -32,6 +93,11 @@ transition: translate calc(0.25s * var(--inline-level)); translate: 100px 0; width: fit-content; + + @media (width <= 960px) { + transition: none; + translate: 0; + } } .article__table-of-contents__item__link { diff --git a/src/ui/styles/base/base.css b/src/ui/styles/base/base.css index 74fa6da5..0e2f5ca9 100644 --- a/src/ui/styles/base/base.css +++ b/src/ui/styles/base/base.css @@ -49,8 +49,12 @@ min-height: 100dvh; width: 100%; - &:not(.--is-projects) { + &:not(.--is-projects, .--is-article) { margin: calc(var(--header-height)) auto 0; + + @media (width <= 960px) { + margin: 0 auto; + } } } @@ -74,6 +78,13 @@ summary { -webkit-tap-highlight-color: transparent; + list-style: none; + pointer-events: none; + + @media (width <= 960px) { + cursor: pointer; + pointer-events: auto; + } } mark {