diff --git a/package.json b/package.json index c03f0c1..b5bcb52 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "next dev --turbopack", "build": "next build", - "start": "next start", + "start": "next start -p 3001", "lint": "next lint" }, "dependencies": { diff --git a/src/app/(core)/layout.module.scss b/src/app/(core)/layout.module.scss index 8f7786a..948bbf3 100644 --- a/src/app/(core)/layout.module.scss +++ b/src/app/(core)/layout.module.scss @@ -1,4 +1,11 @@ .main { padding: 16px; padding-bottom: 64px; +} + +.navBar { + position: sticky; + top: 0; + z-index: 7777; + background: var(--background); } \ No newline at end of file diff --git a/src/app/(core)/layout.tsx b/src/app/(core)/layout.tsx index 63f1329..f54c0cc 100644 --- a/src/app/(core)/layout.tsx +++ b/src/app/(core)/layout.tsx @@ -7,7 +7,7 @@ export default function CoreLayout({ children: React.ReactNode; }>) { return <> - +
{children}
diff --git a/src/app/layout.module.scss b/src/app/layout.module.scss index 3f1d55e..92be521 100644 --- a/src/app/layout.module.scss +++ b/src/app/layout.module.scss @@ -1,4 +1,5 @@ .body { max-width: 560px; margin: 0 auto; + position: relative; } \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index cb10b5c..0e4fca4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,8 +1,8 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; -import "./globals.css"; import clsx from "clsx"; import styles from "./layout.module.scss" +import "@/styles/globals.css"; const inter = Inter({ subsets: ["latin", "cyrillic"], diff --git a/src/components/AdviserCard/AdviserCard.module.scss b/src/components/AdviserCard/AdviserCard.module.scss index 6466970..638be48 100644 --- a/src/components/AdviserCard/AdviserCard.module.scss +++ b/src/components/AdviserCard/AdviserCard.module.scss @@ -1,4 +1,4 @@ -.card { +.card.adviserCard { padding: 0; min-width: 160px; height: 235px; @@ -7,6 +7,7 @@ justify-content: flex-end; position: relative; overflow: hidden; + background-repeat: no-repeat; } .content { diff --git a/src/components/AdviserCard/AdviserCard.tsx b/src/components/AdviserCard/AdviserCard.tsx index d8f3017..0aa3ae1 100644 --- a/src/components/AdviserCard/AdviserCard.tsx +++ b/src/components/AdviserCard/AdviserCard.tsx @@ -1,3 +1,4 @@ +import clsx from "clsx" import Button from "../ui/Button/Button" import Card from "../ui/Card/Card" import Typography from "../ui/Typography/Typography" @@ -5,7 +6,7 @@ import styles from "./AdviserCard.module.scss" export default function AdviserCard() { return ( - +
diff --git a/src/components/AdvisersSection/AdvisersSection.module.scss b/src/components/AdvisersSection/AdvisersSection.module.scss index 940d36a..17d1509 100644 --- a/src/components/AdvisersSection/AdvisersSection.module.scss +++ b/src/components/AdvisersSection/AdvisersSection.module.scss @@ -1,4 +1,12 @@ .sectionContent { overflow-x: scroll; - width: calc(100% + 16px); + width: calc(100% + 32px); + padding: 16px; + padding-right: 0; + margin: -16px; + margin-right: 0; +} + +.grid { + padding-right: 16px; } \ No newline at end of file diff --git a/src/components/AdvisersSection/AdvisersSection.tsx b/src/components/AdvisersSection/AdvisersSection.tsx index 9659f94..321778c 100644 --- a/src/components/AdvisersSection/AdvisersSection.tsx +++ b/src/components/AdvisersSection/AdvisersSection.tsx @@ -19,7 +19,7 @@ const advisers = [ export default function AdvisersSection() { return (
- + {advisers.map((adviser, index) => ( ))} diff --git a/src/components/CompatibilitySection/CompatibilitySection.module.scss b/src/components/CompatibilitySection/CompatibilitySection.module.scss index 940d36a..15f758e 100644 --- a/src/components/CompatibilitySection/CompatibilitySection.module.scss +++ b/src/components/CompatibilitySection/CompatibilitySection.module.scss @@ -1,4 +1,10 @@ .sectionContent { overflow-x: scroll; - width: calc(100% + 16px); + width: calc(100% + 32px); + padding: 16px; + margin: -16px; +} + +.grid { + padding-right: 16px; } \ No newline at end of file diff --git a/src/components/CompatibilitySection/CompatibilitySection.tsx b/src/components/CompatibilitySection/CompatibilitySection.tsx index ff5cbb4..64b57fa 100644 --- a/src/components/CompatibilitySection/CompatibilitySection.tsx +++ b/src/components/CompatibilitySection/CompatibilitySection.tsx @@ -19,7 +19,7 @@ const compatibilities = [ export default function CompatibilitySection() { return (
- + {compatibilities.map((compatibility, index) => ( ))} diff --git a/src/components/Horoscope/Horoscope.module.scss b/src/components/Horoscope/Horoscope.module.scss index 59128c0..8b1dc2a 100644 --- a/src/components/Horoscope/Horoscope.module.scss +++ b/src/components/Horoscope/Horoscope.module.scss @@ -24,8 +24,13 @@ flex-direction: column; padding-inline: 8px; gap: 20px; + transition: height 2s ease; } -.seeAll { - text-align: right; +.seeAllButton { + padding: 0 !important; + background: none !important; + border-radius: 0 !important; + width: fit-content !important; + margin-left: auto; } \ No newline at end of file diff --git a/src/components/Horoscope/Horoscope.tsx b/src/components/Horoscope/Horoscope.tsx index b485f44..6353501 100644 --- a/src/components/Horoscope/Horoscope.tsx +++ b/src/components/Horoscope/Horoscope.tsx @@ -1,10 +1,11 @@ "use client"; -import { useState } from "react"; +import { useMemo, useState } from "react"; import TabBar, { Tab } from "../ui/TabBar/TabBar"; import Text from "../ui/Typography/Typography"; import styles from "./Horoscope.module.scss"; import Card from "../ui/Card/Card"; +import Button from "../ui/Button/Button"; type Period = "today" | "week" | "month" | "year"; @@ -16,7 +17,7 @@ const TABS: Tab[] = [ ]; const HOROSCOPE_TEXT = { - today: "Today, Cancer men should trust their intuition — it will guide them through a tricky moment. A pleasant surprise from a loved one is likely. Spend the evening in comfort and calm.", + today: "Today, Cancer men should trust their intuition — it will guide them through a tricky moment. A pleasant surprise from a loved one is likely. Spend the evening in comfort and calm. Today, Cancer men should trust their intuition — it will guide them through a tricky moment. A pleasant surprise from a loved one is likely. Spend the evening in comfort and calm.", week: "Weekly horoscope text...", month: "Monthly horoscope text...", year: "Yearly horoscope text...", @@ -24,6 +25,16 @@ const HOROSCOPE_TEXT = { export default function Horoscope() { const [active, setActive] = useState("today"); + const [isCollapsed, setIscollapsed] = useState(true) + + const enableCollapse = useMemo(() => { + return HOROSCOPE_TEXT[active]?.split(" ")?.length > 30 + }, [active]) + + const text = useMemo(() => { + if (!isCollapsed || !enableCollapse) return HOROSCOPE_TEXT[active]; + return HOROSCOPE_TEXT[active]?.split(" ").slice(0, 31).join(" ") + " ..." + }, [isCollapsed, active, enableCollapse]) return ( @@ -33,11 +44,13 @@ export default function Horoscope() { — Your Horoscope today — - {HOROSCOPE_TEXT[active]} - - - See All + {text} + {enableCollapse && }
); diff --git a/src/components/MeditationSection/MeditationSection.module.scss b/src/components/MeditationSection/MeditationSection.module.scss index 940d36a..15f758e 100644 --- a/src/components/MeditationSection/MeditationSection.module.scss +++ b/src/components/MeditationSection/MeditationSection.module.scss @@ -1,4 +1,10 @@ .sectionContent { overflow-x: scroll; - width: calc(100% + 16px); + width: calc(100% + 32px); + padding: 16px; + margin: -16px; +} + +.grid { + padding-right: 16px; } \ No newline at end of file diff --git a/src/components/MeditationSection/MeditationSection.tsx b/src/components/MeditationSection/MeditationSection.tsx index c30fafc..82a32ef 100644 --- a/src/components/MeditationSection/MeditationSection.tsx +++ b/src/components/MeditationSection/MeditationSection.tsx @@ -14,7 +14,7 @@ const meditations = [ export default function MeditationSection() { return (
- + {meditations.map((meditation, index) => ( ))} diff --git a/src/components/NavigationBar/NavigationBar.tsx b/src/components/NavigationBar/NavigationBar.tsx index 2dd3905..0790483 100644 --- a/src/components/NavigationBar/NavigationBar.tsx +++ b/src/components/NavigationBar/NavigationBar.tsx @@ -1,10 +1,17 @@ import Logo from "../Logo/Logo" import Icon, { IconName } from "../ui/Icon/Icon" import styles from "./NavigationBar.module.scss" +import clsx from "clsx"; -export default function NavigationBar() { +interface NavigationBarProps { + className?: string; +} + +export default function NavigationBar({ + className +}: NavigationBarProps) { return ( -
+
diff --git a/src/components/PalmSection/PalmSection.module.scss b/src/components/PalmSection/PalmSection.module.scss index 940d36a..15f758e 100644 --- a/src/components/PalmSection/PalmSection.module.scss +++ b/src/components/PalmSection/PalmSection.module.scss @@ -1,4 +1,10 @@ .sectionContent { overflow-x: scroll; - width: calc(100% + 16px); + width: calc(100% + 32px); + padding: 16px; + margin: -16px; +} + +.grid { + padding-right: 16px; } \ No newline at end of file diff --git a/src/components/PalmSection/PalmSection.tsx b/src/components/PalmSection/PalmSection.tsx index ec5a6b1..56c7651 100644 --- a/src/components/PalmSection/PalmSection.tsx +++ b/src/components/PalmSection/PalmSection.tsx @@ -14,7 +14,7 @@ const palms = [ export default function PalmSection() { return (
- + {palms.map((palm, index) => ( ))} diff --git a/src/components/ui/Button/Button.module.scss b/src/components/ui/Button/Button.module.scss index 5b3bb09..d10044b 100644 --- a/src/components/ui/Button/Button.module.scss +++ b/src/components/ui/Button/Button.module.scss @@ -1,4 +1,5 @@ .button { + font: inherit; display: inline-flex; align-items: center; justify-content: center; diff --git a/src/components/ui/Grid/Grid.module.scss b/src/components/ui/Grid/Grid.module.scss index 744e517..45aa0ab 100644 --- a/src/components/ui/Grid/Grid.module.scss +++ b/src/components/ui/Grid/Grid.module.scss @@ -1,4 +1,5 @@ .grid { display: grid; width: 100%; + min-width: fit-content; } \ No newline at end of file diff --git a/src/components/ui/Section/Section.module.scss b/src/components/ui/Section/Section.module.scss index 3e71cc7..ab31559 100644 --- a/src/components/ui/Section/Section.module.scss +++ b/src/components/ui/Section/Section.module.scss @@ -7,4 +7,8 @@ .content { width: 100%; + + &::-webkit-scrollbar { + display: none; + } } \ No newline at end of file diff --git a/src/components/ui/Section/Section.tsx b/src/components/ui/Section/Section.tsx index b44547b..2af641d 100644 --- a/src/components/ui/Section/Section.tsx +++ b/src/components/ui/Section/Section.tsx @@ -12,6 +12,7 @@ interface SectionProps { } export default function Section({ title, children, className, titleClassName, contentClassName }: SectionProps) { + return (
{title && diff --git a/src/app/globals.css b/src/styles/globals.css similarity index 96% rename from src/app/globals.css rename to src/styles/globals.css index a6a757f..d5ca90f 100644 --- a/src/app/globals.css +++ b/src/styles/globals.css @@ -13,7 +13,7 @@ html, body { max-width: 100vw; - overflow-x: hidden; + /* overflow-x: hidden; */ font-family: var(--font-inter), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; }