Skip to content

Commit

Permalink
Merge pull request #11 from kohta9521/develop
Browse files Browse the repository at this point in the history
add subpage subehro tempalte
  • Loading branch information
kohta9521 authored Nov 18, 2023
2 parents 6e5d571 + 3895a1a commit ea156ae
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 0 deletions.
Empty file added src/app/about/About.module.scss
Empty file.
29 changes: 29 additions & 0 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react'


// scss import
import styles from './About.module.scss'
import SubPageHero from '@/components/templates/SubPageHero'


// components import



const About = () => {
return(
<div className={styles.about}>
<SubPageHero
id={1}
backgroundImg='/'
title='ここごはんについて'
subTitle='このサービスを作るに至った経緯について、また、このサービスをどのように使用して欲しいのか。サービスを詳しく説明させていただきます。'
pageName='ABOUT'
>
<h1>this space is children space</h1>
</SubPageHero>
</div>
)
}

export default About
67 changes: 67 additions & 0 deletions src/components/templates/SubPageHero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react'
import Image from 'next/image'

// scss import
import styles from './styles/SubPageHero.module.scss'

// components import
import Header from '../organisms/Header'
import Link from 'next/link'


// type
export type SubPageHeroProps = {
id: number
backgroundImg: string,
title: string,
subTitle: string,
pageName: string,
children?: React.ReactNode
}


const SubPageHero = ({
id,
backgroundImg,
title,
subTitle,
pageName,
children
}: SubPageHeroProps ) => {
return (
<>
<Header />
<div className={styles.hero} key={id}>
<div className={styles.titleBox}>
{/* TODO: HERO内に画像を背景画像として差し込みたかった */}
{/* <Image
className={styles.bgImg}
width={1000}
height={350}
src={backgroundImg}
alt='background image'
/> */}
<h1 className={styles.title}>
{title}
</h1>
<p className={styles.desc}>
{subTitle}
</p>
</div>
<div className={styles.pageLinkBox}>
<Link className={styles.pageLinkHome} href={"/"}>
HOME
</Link>
<span className={styles.pageLinkRod}></span>
<p className={styles.pageLinkNow}>
{pageName}
</p>
</div>
{children}
</div>
</>

)
}

export default SubPageHero
74 changes: 74 additions & 0 deletions src/components/templates/styles/SubPageHero.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.hero {
width: 100%;
height: 500px;
padding: 20px 0px;
box-sizing: border-box;
// background-color: antiquewhite;
.titleBox {
width: 95%;
height: 400px;
border-radius: 40px;
padding: 0px 40px;
box-sizing: border-box;
margin: 0 auto;
background-color: var(--main-red-color);
overflow: hidden;
.title {
display: block;
font-size: 40px;
font-weight: bold;
line-height: 50px;
margin-top: 250px;
color: var(--main-white-color);
}
.desc {
display: block;
font-size: 20px;
line-height: 25px;
color: var(--main-white-color);
}
}
.pageLinkBox {
width: 90%;
height: 100px;
margin: 0 auto;
display: flex;
align-items: center;
.pageLinkHome {
display: block;
font-size: 15px;
margin-right: 30px;
color: var(--main-red-color);
text-decoration: none;
&:hover {
opacity: 0.5;
transition: all .3s ease-in-out;
}
}
.pageLinkRod {
display: block;
content: ' ';
width: 50px;
height: 2px;
background-color: var(--main-black-color);
margin-right: 30px;
}
.pageLinkNow {
display: block;
margin-right: 30px;
font-size: 15px;
margin-right: 30px;
color: var(--main-black-color);
text-decoration: none;
}
}
}



@media screen and (max-width: 1280px) {

}
@media screen and (max-width: 768px) {

}

0 comments on commit ea156ae

Please sign in to comment.