-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from YKhm20020/ticket-38
close #38 ETロボコンページの作成
- Loading branch information
Showing
28 changed files
with
1,878 additions
and
1,579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("pdfjs-dist/build/pdf.worker.min.js"); | ||
} else { | ||
module.exports = require("pdfjs-dist/build/pdf.worker.js"); | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'use client'; | ||
|
||
import { useEffect, useState } from 'react'; | ||
import type React from 'react'; | ||
import { Document, Page, pdfjs } from 'react-pdf'; | ||
// import pdfjsWorkerSrc from '../../../../pdf-worker'; | ||
|
||
// pdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorkerSrc; | ||
// pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`; | ||
// pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`; | ||
|
||
type PDFViewerProps = { | ||
filePath: string; // 表示するPDFのファイルパス | ||
}; | ||
|
||
export const PDFViewer: React.FC<PDFViewerProps> = ({ filePath }: PDFViewerProps) => { | ||
const [numPages, setNumPages] = useState(1); | ||
const [pageWidth, setPageWidth] = useState(500); // PDFページの初期幅 | ||
const onDocumentLoadSuccess = ({ numPages }: { numPages: number }) => { | ||
setNumPages(numPages); | ||
}; | ||
|
||
useEffect(() => { | ||
// PDFページの大きさを更新する関数 | ||
const updatePageWidth = () => { | ||
const screenWidth = window.innerWidth; | ||
if (screenWidth < 640) { | ||
setPageWidth(screenWidth * 0.9); // スマホサイズ | ||
} else if (screenWidth < 1024) { | ||
setPageWidth(700); // タブレットサイズ | ||
} else { | ||
setPageWidth(950); // デスクトップサイズ | ||
} | ||
}; | ||
|
||
// 初回設定とリサイズイベントリスナー | ||
updatePageWidth(); | ||
window.addEventListener('resize', updatePageWidth); | ||
return () => window.removeEventListener('resize', updatePageWidth); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<div className='flex justify-center'> | ||
<Document file={filePath} onLoadSuccess={onDocumentLoadSuccess}> | ||
<div className='flex flex-col items-center gap-8'> | ||
{Array.from({ length: numPages }, (_, index) => ( | ||
<Page | ||
key={`page_${index + 1}`} | ||
pageNumber={index + 1} | ||
renderAnnotationLayer={false} | ||
renderTextLayer={false} | ||
width={pageWidth} | ||
className='mb-4 shadow-lg' | ||
/> | ||
))} | ||
</div> | ||
</Document> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import Image from 'next/image'; | ||
import type React from 'react'; | ||
// import { PDFViewer } from '../components/atoms/PDFViewer'; | ||
import { MediaObject } from '../components/organisms/MediaObject'; | ||
|
||
const imageInfo = [ | ||
{ id: 0, src: '/images/etrobocon/model/0_abstract.jpg', alt: 'abstract' }, | ||
{ id: 1, src: '/images/etrobocon/model/1_requirements.jpg', alt: 'requirements' }, | ||
{ id: 2, src: '/images/etrobocon/model/2_analysis.jpg', alt: 'analysis' }, | ||
{ id: 3, src: '/images/etrobocon/model/3_design1.jpg', alt: 'design1' }, | ||
{ id: 4, src: '/images/etrobocon/model/3_design2.jpg', alt: 'design2' }, | ||
{ id: 5, src: '/images/etrobocon/model/4_control.jpg', alt: 'control' }, | ||
]; | ||
|
||
const ETRobocon: React.FC = () => { | ||
return ( | ||
<div className='bg-white flex-grow container mx-auto px-4 sm:px-6 lg:px-8 py-12'> | ||
<div className='flex flex-col items-center py-4'> | ||
<h1 className='text-4xl font-bold text-center'>ETロボコン</h1> | ||
<p className='text-lg pt-4'> | ||
学生時代に最も力を入れて取り組んだ、ETロボコンについてのページ | ||
</p> | ||
</div> | ||
<MediaObject | ||
src='/images/etrobocon/etrobocon2024.png' | ||
alt='ETロボコン' | ||
heading='ETロボコンとは' | ||
texts={[ | ||
'ETロボコンは、高専や大学生などの学生から、企業までが参加する組み込み系の大会です。', | ||
'リアルコース上を機械に走らせて点数を競う走行部門と、設計書の出来を評価するモデル部門でチームの得点を決定します。', | ||
'2023年は九州地区大会で総合優勝、全国大会で総合6位の成績を収めました。', | ||
'2024年はチームリーダーを務め、九州地区大会で総合準優勝、モデル優勝の成績を収めました。', | ||
]} | ||
/> | ||
<MediaObject | ||
src='/images/etrobocon/driving.png' | ||
alt='走行部門' | ||
heading='走行部門' | ||
texts={[ | ||
'走行部門では、走行体にリアルな布製のコースを走らせた結果が評価されます。', | ||
'指定箇所の走行までが速いほど得点が高いエリアと、攻略することでボーナスの得点が入る難所のエリアがあります。', | ||
]} | ||
/> | ||
<MediaObject | ||
src='/images/etrobocon/model/2_analysis.jpg' | ||
alt='モデル部門' | ||
heading='モデル部門' | ||
texts={[ | ||
'モデル部門では、設計書の出来が評価されます。', | ||
'開発の目標と、それに必要な機能や品質、制約をまとめた要求モデル、要求や制約からシステム全体の構造をまとめた分析モデル、要求を実現する各システムの構造と振る舞いをまとめた設計モデル、要求で定義した品質を満たす制御戦略とそれに用いる要素技術をまとめた制御モデルで構成します。', | ||
]} | ||
/> | ||
<div className='flex flex-col items-center'> | ||
<h1 className='py-4 self-start text-3xl font-bold sm:text-4xl md:text-2xl lg:text-3xl'> | ||
KatLab 2024年モデル | ||
</h1> | ||
{/* <PDFViewer filePath='/ADV_093_KatLab.pdf' /> */} | ||
{imageInfo.map((image) => ( | ||
<Image | ||
key={image.id} | ||
src={image.src} | ||
alt={image.alt} | ||
layout='responsive' | ||
width={700} | ||
height={700} | ||
className='shadow-lg' | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ETRobocon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.