styles: format code

This commit is contained in:
unknown
2021-09-07 12:20:06 +07:00
parent 2584e6c5d7
commit 510593d500
9 changed files with 35 additions and 29 deletions

View File

@@ -11,7 +11,8 @@ const CONTENT_DATA = [
"When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.", "When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.",
"Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", "Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
] ],
link: "/title"
}, },
{ {
title: "This is a subtitle", title: "This is a subtitle",
@@ -19,7 +20,8 @@ const CONTENT_DATA = [
"When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.", "When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.",
"Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", "Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
] ],
link: "/title"
}, },
{ {
title: "This is a subtitle", title: "This is a subtitle",
@@ -27,7 +29,8 @@ const CONTENT_DATA = [
"When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.", "When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.",
"Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", "Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
] ],
link: "/title"
}, },
{ {
title: "This is a subtitle", title: "This is a subtitle",
@@ -35,7 +38,8 @@ const CONTENT_DATA = [
"When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.", "When youre trying to eat healthier but want something more substantial than a leafy green salad, broccoli salad is there for you. I love the crunch and heft of broccoli, especially when its cut up into bite size spoonable pieces.",
"Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.", "Some people arent into raw broccoli, but I love it! I always go for the raw broccoli on those vegetable platters that seem to be at every potluck/party you go to.",
"This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.", "This is a simple broccoli salad: you have the bulk of it, raw broccoli; crunchy red onions for a bit of acidity and raw crunch, craisins for sweetness, almonds for a nutty counter point; and a sweet and tangy soy-rice vinegar-sesame dressing.",
] ],
link: "/title"
}, },
] ]
export default function Home() { export default function Home() {

View File

@@ -1,10 +1,10 @@
@import "../../../styles/utilities"; @import "../../../styles/utilities";
.cardBlogWarpper{ .cardBlogWarpper {
@apply inline-flex flex-col justify-start;
max-width: 39.2rem; max-width: 39.2rem;
min-height: 34.4rem; min-height: 34.4rem;
@apply inline-flex flex-col justify-start; .image {
.image{
width: 100%; width: 100%;
max-height: 22rem; max-height: 22rem;
border-radius: 2.4rem; border-radius: 2.4rem;
@@ -12,7 +12,7 @@
cursor: pointer; cursor: pointer;
} }
} }
.title{ .title {
padding: 1.6rem 0.8rem 0.4rem 0.8rem; padding: 1.6rem 0.8rem 0.4rem 0.8rem;
@apply font-bold; @apply font-bold;
font-size: 2rem; font-size: 2rem;
@@ -23,7 +23,7 @@
cursor: pointer; cursor: pointer;
} }
} }
.description{ .description {
padding: 0 0.8rem; padding: 0 0.8rem;
@apply overflow-hidden overflow-ellipsis ; @apply overflow-hidden overflow-ellipsis ;
color: var(--text-label); color: var(--text-label);

View File

@@ -1,18 +1,18 @@
@import "../../../../styles/utilities"; @import "../../../../styles/utilities";
.collapseWrapper{ .collapseWrapper {
@apply border-t border-b; @apply border-t border-b;
border-color: var(--border-line); border-color: var(--border-line);
max-width: 80.4rem; max-width: 80.4rem;
min-height: 4rem; min-height: 4rem;
&.isActive{ &.isActive {
.title{ .title {
@apply pb-0; @apply pb-0;
} }
.contentContainer{ .contentContainer {
@apply block; @apply block;
} }
.toggle{ .toggle {
&:before { &:before {
transform: rotate(180deg); transform: rotate(180deg);
} }
@@ -21,21 +21,21 @@
} }
} }
} }
&:hover{ &:hover {
cursor: pointer; cursor: pointer;
} }
} }
.title{ .title {
@apply outline-none flex justify-between font-heading items-center pt-16 pb-16; @apply outline-none flex justify-between font-heading items-center pt-16 pb-16;
font-size: 3.2rem; font-size: 3.2rem;
line-height: 4rem; line-height: 4rem;
letter-spacing: -0.01em; letter-spacing: -0.01em;
.toggle{ .toggle {
height: 2.2rem; height: 2.2rem;
width: 2.2rem; width: 2.2rem;
position: relative; position: relative;
&:before, &:before,
&:after{ &:after {
@apply absolute h-2; @apply absolute h-2;
content: ""; content: "";
border-radius: 0.8rem; border-radius: 0.8rem;
@@ -44,12 +44,12 @@
width: 2.2rem; width: 2.2rem;
transition: transform 500ms ease; transition: transform 500ms ease;
} }
&:before{ &:before {
transform-origin: center; transform-origin: center;
transform: rotate(90deg); transform: rotate(90deg);
} }
} }
} }
.contentContainer{ .contentContainer {
@apply hidden pb-16; @apply hidden pb-16;
} }

View File

@@ -2,13 +2,15 @@ import s from './CollapseChild.module.scss'
import { useState } from 'react' import { useState } from 'react'
import classNames from 'classnames' import classNames from 'classnames'
import CollapseContent from './CollapseContent/CollapseContent' import CollapseContent from './CollapseContent/CollapseContent'
import Link from 'next/link'
interface CollapseProps{ interface CollapseProps{
title?: string, title?: string,
content: Array<string>, content: Array<string>,
isToggle?: boolean, isToggle?: boolean,
link?: string,
} }
const CollapseChild = ({title, content, isToggle=false}: CollapseProps) => { const CollapseChild = ({title, content, isToggle=false, link="/"}: CollapseProps) => {
const [isActive, changeActive] = useState(isToggle) const [isActive, changeActive] = useState(isToggle)
const handleToggle = () => { const handleToggle = () => {
@@ -22,7 +24,9 @@ const CollapseChild = ({title, content, isToggle=false}: CollapseProps) => {
onClick = { handleToggle } onClick = { handleToggle }
> >
<div className={s.title}> <div className={s.title}>
<a>{title}</a> <Link href={link}>
<a>{title}</a>
</Link>
<div className={s.toggle}></div> <div className={s.toggle}></div>
</div> </div>
<div className={s.contentContainer}> <div className={s.contentContainer}>

View File

@@ -1,3 +1,3 @@
.content{ .content {
margin-top: 1.6rem; margin-top: 1.6rem;
} }

View File

@@ -1,4 +1,3 @@
import classNames from 'classnames'
import s from './CollapseContent.module.scss' import s from './CollapseContent.module.scss'
interface CollapseContentProps{ interface CollapseContentProps{

View File

@@ -1,16 +1,15 @@
import s from './CollapseCommon.module.scss'
import CollapseChild from './CollapseChild/CollapseChild' import CollapseChild from './CollapseChild/CollapseChild'
interface CollapseCommonProps{ interface CollapseCommonProps{
data: {title: string, content: Array<string>}[], data: {title: string, content: Array<string>, link: string}[],
} }
const CollapseCommon = ({data}:CollapseCommonProps) => { const CollapseCommon = ({data}: CollapseCommonProps) => {
return ( return (
<section> <section>
{ {
data.map(item => data.map(item =>
<CollapseChild key={item.title} title={item.title} content={item.content} /> <CollapseChild key={item.title} title={item.title} content={item.content} link={item.link} />
) )
} }
</section> </section>

View File

@@ -9,7 +9,7 @@ export const ROUTE = {
HOME: '/', HOME: '/',
PRODUCTS: '/products', PRODUCTS: '/products',
ABOUT: '/about', ABOUT: '/about',
BLOG_DETAIL: '/blogdetail', BLOG_DETAIL: '/blog',
ACCOUNT: '/account', ACCOUNT: '/account',
BUSSINESS: '/bussiness', BUSSINESS: '/bussiness',
CONTACT: '/contact', CONTACT: '/contact',