main
AW-474, AW-475, AW-476, AW-477, AW-478, AW-479
This commit is contained in:
parent
f83f3aae2e
commit
cf18cf897d
@ -5,7 +5,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev --turbopack",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start -p 3001",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,4 +1,11 @@
|
|||||||
.main {
|
.main {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
padding-bottom: 64px;
|
padding-bottom: 64px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navBar {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 7777;
|
||||||
|
background: var(--background);
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@ export default function CoreLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return <>
|
return <>
|
||||||
<NavigationBar />
|
<NavigationBar className={styles.navBar} />
|
||||||
<main className={styles.main}>
|
<main className={styles.main}>
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
.body {
|
.body {
|
||||||
max-width: 560px;
|
max-width: 560px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Inter } from "next/font/google";
|
import { Inter } from "next/font/google";
|
||||||
import "./globals.css";
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import styles from "./layout.module.scss"
|
import styles from "./layout.module.scss"
|
||||||
|
import "@/styles/globals.css";
|
||||||
|
|
||||||
const inter = Inter({
|
const inter = Inter({
|
||||||
subsets: ["latin", "cyrillic"],
|
subsets: ["latin", "cyrillic"],
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.card {
|
.card.adviserCard {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
height: 235px;
|
height: 235px;
|
||||||
@ -7,6 +7,7 @@
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import clsx from "clsx"
|
||||||
import Button from "../ui/Button/Button"
|
import Button from "../ui/Button/Button"
|
||||||
import Card from "../ui/Card/Card"
|
import Card from "../ui/Card/Card"
|
||||||
import Typography from "../ui/Typography/Typography"
|
import Typography from "../ui/Typography/Typography"
|
||||||
@ -5,7 +6,7 @@ import styles from "./AdviserCard.module.scss"
|
|||||||
|
|
||||||
export default function AdviserCard() {
|
export default function AdviserCard() {
|
||||||
return (
|
return (
|
||||||
<Card className={styles.card} style={{ backgroundImage: `url(/adviser-card.png)` }}>
|
<Card className={clsx(styles.card, styles.adviserCard)} style={{ backgroundImage: `url(/adviser-card.png)` }}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.info}>
|
<div className={styles.info}>
|
||||||
<div className={styles.name}>
|
<div className={styles.name}>
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
.sectionContent {
|
.sectionContent {
|
||||||
overflow-x: scroll;
|
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;
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ const advisers = [
|
|||||||
export default function AdvisersSection() {
|
export default function AdvisersSection() {
|
||||||
return (
|
return (
|
||||||
<Section title="Advisers" contentClassName={styles.sectionContent}>
|
<Section title="Advisers" contentClassName={styles.sectionContent}>
|
||||||
<Grid columns={5}>
|
<Grid columns={5} className={styles.grid}>
|
||||||
{advisers.map((adviser, index) => (
|
{advisers.map((adviser, index) => (
|
||||||
<AdviserCard key={index} {...adviser} />
|
<AdviserCard key={index} {...adviser} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
.sectionContent {
|
.sectionContent {
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
width: calc(100% + 16px);
|
width: calc(100% + 32px);
|
||||||
|
padding: 16px;
|
||||||
|
margin: -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
padding-right: 16px;
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ const compatibilities = [
|
|||||||
export default function CompatibilitySection() {
|
export default function CompatibilitySection() {
|
||||||
return (
|
return (
|
||||||
<Section title="Compatibility" contentClassName={styles.sectionContent}>
|
<Section title="Compatibility" contentClassName={styles.sectionContent}>
|
||||||
<Grid columns={5}>
|
<Grid columns={5} className={styles.grid}>
|
||||||
{compatibilities.map((compatibility, index) => (
|
{compatibilities.map((compatibility, index) => (
|
||||||
<CompatibilityCard key={index} {...compatibility} />
|
<CompatibilityCard key={index} {...compatibility} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -24,8 +24,13 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-inline: 8px;
|
padding-inline: 8px;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
|
transition: height 2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.seeAll {
|
.seeAllButton {
|
||||||
text-align: right;
|
padding: 0 !important;
|
||||||
|
background: none !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
width: fit-content !important;
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
@ -1,10 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import TabBar, { Tab } from "../ui/TabBar/TabBar";
|
import TabBar, { Tab } from "../ui/TabBar/TabBar";
|
||||||
import Text from "../ui/Typography/Typography";
|
import Text from "../ui/Typography/Typography";
|
||||||
import styles from "./Horoscope.module.scss";
|
import styles from "./Horoscope.module.scss";
|
||||||
import Card from "../ui/Card/Card";
|
import Card from "../ui/Card/Card";
|
||||||
|
import Button from "../ui/Button/Button";
|
||||||
|
|
||||||
type Period = "today" | "week" | "month" | "year";
|
type Period = "today" | "week" | "month" | "year";
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ const TABS: Tab<Period>[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const HOROSCOPE_TEXT = {
|
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...",
|
week: "Weekly horoscope text...",
|
||||||
month: "Monthly horoscope text...",
|
month: "Monthly horoscope text...",
|
||||||
year: "Yearly horoscope text...",
|
year: "Yearly horoscope text...",
|
||||||
@ -24,6 +25,16 @@ const HOROSCOPE_TEXT = {
|
|||||||
|
|
||||||
export default function Horoscope() {
|
export default function Horoscope() {
|
||||||
const [active, setActive] = useState<Period>("today");
|
const [active, setActive] = useState<Period>("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 (
|
return (
|
||||||
<Card className={styles.card}>
|
<Card className={styles.card}>
|
||||||
@ -33,11 +44,13 @@ export default function Horoscope() {
|
|||||||
— Your Horoscope today —
|
— Your Horoscope today —
|
||||||
</Text>
|
</Text>
|
||||||
<Text as="p" weight="medium" className={styles.text}>
|
<Text as="p" weight="medium" className={styles.text}>
|
||||||
{HOROSCOPE_TEXT[active]}
|
{text}
|
||||||
</Text>
|
|
||||||
<Text as="span" size="sm" weight="medium" color="secondary" className={styles.seeAll}>
|
|
||||||
See All
|
|
||||||
</Text>
|
</Text>
|
||||||
|
{enableCollapse && <Button className={styles.seeAllButton} onClick={() => setIscollapsed((prev) => !prev)}>
|
||||||
|
<Text as="span" size="sm" weight="medium" color="secondary" align="right">
|
||||||
|
{isCollapsed ? "See All" : "Hide"}
|
||||||
|
</Text>
|
||||||
|
</Button>}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
.sectionContent {
|
.sectionContent {
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
width: calc(100% + 16px);
|
width: calc(100% + 32px);
|
||||||
|
padding: 16px;
|
||||||
|
margin: -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
padding-right: 16px;
|
||||||
}
|
}
|
||||||
@ -14,7 +14,7 @@ const meditations = [
|
|||||||
export default function MeditationSection() {
|
export default function MeditationSection() {
|
||||||
return (
|
return (
|
||||||
<Section title="Meditations" contentClassName={styles.sectionContent}>
|
<Section title="Meditations" contentClassName={styles.sectionContent}>
|
||||||
<Grid columns={5}>
|
<Grid columns={5} className={styles.grid}>
|
||||||
{meditations.map((meditation, index) => (
|
{meditations.map((meditation, index) => (
|
||||||
<MeditationCard key={index} {...meditation} />
|
<MeditationCard key={index} {...meditation} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -1,10 +1,17 @@
|
|||||||
import Logo from "../Logo/Logo"
|
import Logo from "../Logo/Logo"
|
||||||
import Icon, { IconName } from "../ui/Icon/Icon"
|
import Icon, { IconName } from "../ui/Icon/Icon"
|
||||||
import styles from "./NavigationBar.module.scss"
|
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 (
|
return (
|
||||||
<header className={styles.header}>
|
<header className={clsx(styles.header, className)}>
|
||||||
<Icon name={IconName.Menu} />
|
<Icon name={IconName.Menu} />
|
||||||
<Logo />
|
<Logo />
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
.sectionContent {
|
.sectionContent {
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
width: calc(100% + 16px);
|
width: calc(100% + 32px);
|
||||||
|
padding: 16px;
|
||||||
|
margin: -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
padding-right: 16px;
|
||||||
}
|
}
|
||||||
@ -14,7 +14,7 @@ const palms = [
|
|||||||
export default function PalmSection() {
|
export default function PalmSection() {
|
||||||
return (
|
return (
|
||||||
<Section title="Palm" contentClassName={styles.sectionContent}>
|
<Section title="Palm" contentClassName={styles.sectionContent}>
|
||||||
<Grid columns={5}>
|
<Grid columns={5} className={styles.grid}>
|
||||||
{palms.map((palm, index) => (
|
{palms.map((palm, index) => (
|
||||||
<PalmCard key={index} {...palm} />
|
<PalmCard key={index} {...palm} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
.button {
|
.button {
|
||||||
|
font: inherit;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
.grid {
|
.grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
min-width: fit-content;
|
||||||
}
|
}
|
||||||
@ -7,4 +7,8 @@
|
|||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -12,6 +12,7 @@ interface SectionProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Section({ title, children, className, titleClassName, contentClassName }: SectionProps) {
|
export default function Section({ title, children, className, titleClassName, contentClassName }: SectionProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={clsx(styles.section, className)}>
|
<section className={clsx(styles.section, className)}>
|
||||||
{title &&
|
{title &&
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
overflow-x: hidden;
|
/* overflow-x: hidden; */
|
||||||
font-family: var(--font-inter), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
font-family: var(--font-inter), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
||||||
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user