mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
22. Nutmeg is a hallucinogen.
This commit is contained in:
parent
bc51a5cfa9
commit
6fa0520c7b
8 changed files with 64 additions and 64 deletions
|
@ -2,5 +2,6 @@
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"semi": false,
|
"semi": false,
|
||||||
"singleQuote": true
|
"singleQuote": true,
|
||||||
|
"jsxSingleQuote": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Source } from '@/components/Source'
|
|
||||||
import { ThemeSwitcher } from '@/components/ThemeSwitcher'
|
import { ThemeSwitcher } from '@/components/ThemeSwitcher'
|
||||||
|
import { Source } from '@/components/Source'
|
||||||
|
|
||||||
export const Footer = () => {
|
export const Footer = () => {
|
||||||
return (
|
return (
|
||||||
<div className="fixed bottom-0 py-5 left-0 right-0 text-center space-x-5">
|
<div className='fixed bottom-0 py-5 left-0 right-0 text-center space-x-5'>
|
||||||
<Source />
|
<Source />
|
||||||
<ThemeSwitcher />
|
<ThemeSwitcher />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import { RiOpenSourceFill } from 'react-icons/ri'
|
import { VscGithubInverted } from 'react-icons/vsc'
|
||||||
import { Button } from '@nextui-org/button'
|
import { Button } from '@nextui-org/button'
|
||||||
|
|
||||||
export const Source = () => {
|
export const Source = () => {
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
aria-label="Source Code"
|
aria-label='Source Code'
|
||||||
size="sm"
|
size='sm'
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
window.open('https://github.com/skidoodle/erettsegi-browser')
|
window.open('https://github.com/skidoodle/erettsegi-browser')
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<RiOpenSourceFill size={20} />
|
<VscGithubInverted size={20} />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,29 @@
|
||||||
import { BsSunFill, BsMoonFill } from 'react-icons/bs'
|
import { VscColorMode } from 'react-icons/vsc'
|
||||||
import { useEffect, useState } from 'react'
|
|
||||||
import { useTheme } from 'next-themes'
|
|
||||||
import { Button } from '@nextui-org/button'
|
import { Button } from '@nextui-org/button'
|
||||||
|
import { useTheme } from 'next-themes'
|
||||||
|
|
||||||
export const ThemeSwitcher = () => {
|
export const ThemeSwitcher = () => {
|
||||||
const [mounted, setMounted] = useState(false)
|
|
||||||
const { theme, setTheme } = useTheme()
|
const { theme, setTheme } = useTheme()
|
||||||
|
|
||||||
const toggle = () => {
|
const toggle = () => {
|
||||||
if (theme === 'dark') {
|
switch (theme) {
|
||||||
setTheme('light')
|
case 'dark':
|
||||||
} else {
|
setTheme('light')
|
||||||
setTheme('dark')
|
break
|
||||||
|
case 'light':
|
||||||
|
setTheme('dark')
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => setMounted(true), [])
|
|
||||||
|
|
||||||
if (!mounted) return null
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button aria-label="Switch Theme" size="sm" onClick={() => toggle()}>
|
<Button aria-label='Switch Theme' size='sm' onClick={() => toggle()}>
|
||||||
{theme === 'light' ? (
|
{theme === 'light' ? (
|
||||||
<BsMoonFill style={{ fill: 'black' }} size={20} />
|
<VscColorMode style={{ fill: 'black' }} size={20} />
|
||||||
) : (
|
) : (
|
||||||
<BsSunFill size={20} />
|
<VscColorMode size={20} key={'dark'} />
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
||||||
|
import { Analytics } from '@vercel/analytics/react'
|
||||||
|
import { NextUIProvider } from '@nextui-org/react'
|
||||||
import { Inter } from 'next/font/google'
|
import { Inter } from 'next/font/google'
|
||||||
import { AppProps } from 'next/app'
|
import { AppProps } from 'next/app'
|
||||||
import { NextUIProvider } from '@nextui-org/react'
|
|
||||||
import { Analytics } from '@vercel/analytics/react'
|
|
||||||
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import '@/styles/globals.css'
|
import '@/styles/globals.css'
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ export default function App({ Component, pageProps }: AppProps) {
|
||||||
</Head>
|
</Head>
|
||||||
<NextUIProvider className={`${inter.variable} font-sans`}>
|
<NextUIProvider className={`${inter.variable} font-sans`}>
|
||||||
<NextThemesProvider
|
<NextThemesProvider
|
||||||
attribute="class"
|
attribute='class'
|
||||||
defaultTheme="dark"
|
defaultTheme='dark'
|
||||||
enableSystem={true}
|
enableSystem={true}
|
||||||
>
|
>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
|
|
@ -2,11 +2,11 @@ import { Html, Head, Main, NextScript } from 'next/document'
|
||||||
|
|
||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
<Html lang="hu">
|
<Html lang='hu'>
|
||||||
<Head>
|
<Head>
|
||||||
<meta name="theme-color" content="#121212" />
|
<meta name='theme-color' content='#121212' />
|
||||||
<meta name="title" content="Érettségi kereső" />
|
<meta name='title' content='Érettségi kereső' />
|
||||||
<meta name="author" content="albert" />
|
<meta name='author' content='albert' />
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { useAvailableYears } from '@/utils/years'
|
import { Footer } from '@/components/Footer'
|
||||||
import { subjects } from '@/utils/subjects'
|
import { subjects } from '@/utils/subjects'
|
||||||
|
import { useYears } from '@/utils/years'
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
|
@ -8,7 +9,6 @@ import {
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Divider,
|
Divider,
|
||||||
} from '@nextui-org/react'
|
} from '@nextui-org/react'
|
||||||
import { Footer } from '@/components/Footer'
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const [flPdfLink, setflPdfLink] = useState<string>('')
|
const [flPdfLink, setflPdfLink] = useState<string>('')
|
||||||
|
@ -21,7 +21,7 @@ export default function Home() {
|
||||||
const [selectedLevel, setSelectedLevel] = useState<string>('')
|
const [selectedLevel, setSelectedLevel] = useState<string>('')
|
||||||
const [years, setYears] = useState<string[]>([])
|
const [years, setYears] = useState<string[]>([])
|
||||||
|
|
||||||
useAvailableYears(setYears)
|
useYears(setYears)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
|
@ -66,20 +66,20 @@ export default function Home() {
|
||||||
])
|
])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="dark:bg-[#121212] text-foreground bg-background py-5">
|
<main className='dark:bg-[#121212] text-foreground bg-background py-5'>
|
||||||
<h1 className="text-4xl font-bold text-blue-400 text-center mt-16">
|
<h1 className='text-4xl font-bold text-blue-400 text-center mt-16'>
|
||||||
Érettségi kereső
|
Érettségi kereső
|
||||||
</h1>
|
</h1>
|
||||||
<div className="flex min-h-screen flex-col items-center justify-between">
|
<div className='flex min-h-screen flex-col items-center justify-between'>
|
||||||
<div className="container mx-auto">
|
<div className='container mx-auto'>
|
||||||
<div className="flex flex-col items-center justify-center">
|
<div className='flex flex-col items-center justify-center'>
|
||||||
<div className="mt-5 mb-3">
|
<div className='mt-5 mb-3'>
|
||||||
<Select
|
<Select
|
||||||
selectionMode="single"
|
selectionMode='single'
|
||||||
label="Tárgy"
|
label='Tárgy'
|
||||||
value={selectedSubject}
|
value={selectedSubject}
|
||||||
onChange={(e) => setSelectedSubject(e.target.value)}
|
onChange={(e) => setSelectedSubject(e.target.value)}
|
||||||
className="w-56"
|
className='w-56'
|
||||||
>
|
>
|
||||||
{subjects.map((subject) => (
|
{subjects.map((subject) => (
|
||||||
<SelectItem key={subject.value} value={subject.value}>
|
<SelectItem key={subject.value} value={subject.value}>
|
||||||
|
@ -88,13 +88,13 @@ export default function Home() {
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3">
|
<div className='mb-3'>
|
||||||
<Select
|
<Select
|
||||||
selectionMode="single"
|
selectionMode='single'
|
||||||
label="Év"
|
label='Év'
|
||||||
value={selectedYear}
|
value={selectedYear}
|
||||||
onChange={(e) => setSelectedYear(e.target.value)}
|
onChange={(e) => setSelectedYear(e.target.value)}
|
||||||
className="w-56"
|
className='w-56'
|
||||||
>
|
>
|
||||||
{years.map((year) => (
|
{years.map((year) => (
|
||||||
<SelectItem key={year} value={year}>
|
<SelectItem key={year} value={year}>
|
||||||
|
@ -103,13 +103,13 @@ export default function Home() {
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3">
|
<div className='mb-3'>
|
||||||
<Select
|
<Select
|
||||||
selectionMode="single"
|
selectionMode='single'
|
||||||
label="Időszak"
|
label='Időszak'
|
||||||
value={selectedPeriod}
|
value={selectedPeriod}
|
||||||
onChange={(e) => setSelectedPeriod(e.target.value)}
|
onChange={(e) => setSelectedPeriod(e.target.value)}
|
||||||
className="w-56"
|
className='w-56'
|
||||||
>
|
>
|
||||||
<SelectItem key={'tavasz'} value={'tavasz'}>
|
<SelectItem key={'tavasz'} value={'tavasz'}>
|
||||||
Tavasz
|
Tavasz
|
||||||
|
@ -119,13 +119,13 @@ export default function Home() {
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3">
|
<div className='mb-3'>
|
||||||
<Select
|
<Select
|
||||||
selectionMode="single"
|
selectionMode='single'
|
||||||
label="Szint"
|
label='Szint'
|
||||||
value={selectedLevel}
|
value={selectedLevel}
|
||||||
onChange={(e) => setSelectedLevel(e.target.value)}
|
onChange={(e) => setSelectedLevel(e.target.value)}
|
||||||
className="w-56"
|
className='w-56'
|
||||||
>
|
>
|
||||||
<SelectItem key={'kozep'} value={'kozep'}>
|
<SelectItem key={'kozep'} value={'kozep'}>
|
||||||
Közép
|
Közép
|
||||||
|
@ -136,33 +136,33 @@ export default function Home() {
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-x-3">
|
<div className='space-x-3'>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
isDisabled={!flPdfLink}
|
isDisabled={!flPdfLink}
|
||||||
className="w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2"
|
className='w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2'
|
||||||
onClick={flPdfLink ? () => window.open(flPdfLink) : () => {}}
|
onClick={flPdfLink ? () => window.open(flPdfLink) : () => {}}
|
||||||
>
|
>
|
||||||
Feladatlap
|
Feladatlap
|
||||||
</Button>
|
</Button>
|
||||||
<Divider orientation="vertical" />
|
<Divider orientation='vertical' />
|
||||||
<Button
|
<Button
|
||||||
isDisabled={!utPdfLink}
|
isDisabled={!utPdfLink}
|
||||||
className="w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2"
|
className='w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2'
|
||||||
onClick={utPdfLink ? () => window.open(utPdfLink) : () => {}}
|
onClick={utPdfLink ? () => window.open(utPdfLink) : () => {}}
|
||||||
>
|
>
|
||||||
Útmutató
|
Útmutató
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-x-3">
|
<div className='space-x-3'>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
{selectedSubject === 'inf' ||
|
{selectedSubject === 'inf' ||
|
||||||
selectedSubject === 'infoism' ||
|
selectedSubject === 'infoism' ||
|
||||||
selectedSubject === 'digkult' ? (
|
selectedSubject === 'digkult' ? (
|
||||||
<Button
|
<Button
|
||||||
isDisabled={!flZipLink}
|
isDisabled={!flZipLink}
|
||||||
className="w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2"
|
className='w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2'
|
||||||
onClick={
|
onClick={
|
||||||
flZipLink ? () => window.open(flZipLink) : () => {}
|
flZipLink ? () => window.open(flZipLink) : () => {}
|
||||||
}
|
}
|
||||||
|
@ -170,13 +170,13 @@ export default function Home() {
|
||||||
Forrás
|
Forrás
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
<Divider orientation="vertical" />
|
<Divider orientation='vertical' />
|
||||||
{selectedSubject === 'inf' ||
|
{selectedSubject === 'inf' ||
|
||||||
selectedSubject === 'infoism' ||
|
selectedSubject === 'infoism' ||
|
||||||
selectedSubject === 'digkult' ? (
|
selectedSubject === 'digkult' ? (
|
||||||
<Button
|
<Button
|
||||||
isDisabled={!utZipLink}
|
isDisabled={!utZipLink}
|
||||||
className="w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2"
|
className='w-24 mt-3 text-sm bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2'
|
||||||
onClick={
|
onClick={
|
||||||
utZipLink ? () => window.open(utZipLink) : () => {}
|
utZipLink ? () => window.open(utZipLink) : () => {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
export function useAvailableYears(
|
export function useYears(
|
||||||
setYears: React.Dispatch<React.SetStateAction<string[]>>
|
setYears: React.Dispatch<React.SetStateAction<string[]>>
|
||||||
) {
|
) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue