Rework of page "allQuestions", minor style and layout fixes and modifications for other pages

This commit is contained in:
ndaniel1102 2021-04-12 01:02:40 +02:00
parent 47a2227f87
commit 23865a68cd
14 changed files with 147 additions and 94 deletions

View file

@ -45,16 +45,14 @@ export default function QuestionSearchResult({ data, searchTerm }) {
const renderCount = () => { const renderCount = () => {
return ( return (
<div> <div className="resultContainer">
<div>
{searchTerm ? '' : 'Kezdj el írni kereséshez! '}
{`${results} találat, ${subjs.length || data.length} tárgyból`}
</div>
{results === 0 && ( {results === 0 && (
<div> <div>
{'Pontos egyezést keres a kereső, próbálj kisebb részletre keresni'} {`${results} találat. Az általad keresett kifejezés nem található,
próbáld bővíteni a keresési feltételt!`}
</div> </div>
)} )}
{results > 0 && <div>{`${results} találat.`}</div>}
</div> </div>
) )
} }
@ -62,10 +60,12 @@ export default function QuestionSearchResult({ data, searchTerm }) {
if (results > constants.maxQuestionsToRender) { if (results > constants.maxQuestionsToRender) {
return ( return (
<div> <div>
{renderCount()}
{searchTerm ? ( {searchTerm ? (
<div>Szűkítsd a keresést találatok megjelenítéséhez!</div> <div className="resultContainer">
Szűkítsd a keresési feltételeket a találatok megjelenítéséhez!
</div>
) : null} ) : null}
<hr />
</div> </div>
) )
} else { } else {

View file

@ -10,9 +10,10 @@ class Questions extends PureComponent {
return ( return (
<div> <div>
<hr />
{subjs.map((subj, i) => { {subjs.map((subj, i) => {
return ( return (
<div key={i}> <div className={styles.questionBg} key={i}>
<div className={styles.subjName}>{subj.Name}</div> <div className={styles.subjName}>{subj.Name}</div>
{subj.Questions.map((question, i) => { {subj.Questions.map((question, i) => {
return <Question key={i} question={question} /> return <Question key={i} question={question} />

View file

@ -1,7 +1,14 @@
.subjName { .subjName {
font-size: 24px; font-size: 24px;
background-color: #9999ff; font-weight: 600;
background-color: var(--text-color);
color: black; color: black;
margin-top: 25px;
padding: 10px; padding: 10px;
word-wrap: break-word; word-wrap: break-word;
} }
.questionBg {
background-color: #1b1b1c;
padding-bottom: 5px;
}

View file

@ -27,14 +27,16 @@ export default function Composer({ onSubmit }) {
return ( return (
<> <>
<div <center>
onClick={() => { <div
setEditorShowing(true) onClick={() => {
}} setEditorShowing(true)
className={styles.new} }}
> className={styles.new}
Bejegyzés írása... >
</div> Bejegyzés írása...
</div>
</center>
{editorShowing && ( {editorShowing && (
<Modal <Modal
closeClick={() => { closeClick={() => {

View file

@ -39,16 +39,31 @@
} }
.new { .new {
text-align: center; display: flex;
background-color: #191919; justify-content: center;
border-radius: 3px; margin: 10px 0px;
cursor: pointer; height: 19px;
width: 30%;
display: flex;
background-color: var(--hoover-color);
border: none;
color: var(--text-color);
padding: 10px;
font-size: 15px;
margin: 8px; margin: 8px;
padding: 8px; cursor: pointer;
text-shadow: 1px 1px 8px black;
transition: width 0.5s, height 0.5s, ease-in 0.5s;
text-align: center;
text-decoration: none;
} }
.new:hover { .new:hover {
background-color: var(--hoover-color); text-shadow: 2px 2px 8px black;
transition: width 0.5s, height 0.5s, ease-out 0.5s;
background-color: var(--text-color);
font-weight: bold;
color: black;
} }
.composerAction { .composerAction {

View file

@ -23,10 +23,6 @@
cursor: pointer; cursor: pointer;
} }
.sidebarLinks a:hover {
transition: width 0.5s, height 0.5s, ease-out 0.5s;
}
.sidebarLinks a.active { .sidebarLinks a.active {
border: 0.5px solid var(--text-color); border: 0.5px solid var(--text-color);
color: white; color: white;

View file

@ -12,7 +12,7 @@ body {
font-family: 'Kameron', serif; font-family: 'Kameron', serif;
font-family: 'Overpass Mono', monospace; font-family: 'Overpass Mono', monospace;
color: #999999; color: #999999;
/* cursor: default; */ cursor: default;
} }
li { li {
@ -40,12 +40,10 @@ textarea {
input { input {
color: var(--text-color); color: var(--text-color);
background-color: var(--background-color); background-color: var(--background-color);
border: 0px solid #444; border: 1px solid #666;
width: 100%; border-radius: 5px;
} width: 80%;
font-family: inherit;
input:focus {
border: 0px solid #444;
} }
.link { .link {
@ -175,18 +173,20 @@ input:focus {
} }
.questionContainer { .questionContainer {
margin: 10px; margin: 6px;
padding: 10px;
} }
.questionContainer:hover { .questionContainer:hover {
background-color: var(--hoover-color); background-color: #141414;
color: var(--text-color);
} }
.question { .question {
word-wrap: break-word; word-wrap: break-word;
font-weight: bold; font-weight: bold;
font-size: 17px; font-size: 17px;
color: #ffffff; color: gainsboro;
} }
.answer { .answer {
@ -212,16 +212,22 @@ input:focus {
} }
.subjectSelector { .subjectSelector {
overflow: scroll; overflow: auto;
height: 350px; height: auto;
max-height: 250px;
margin: 10px; margin: 10px;
padding: 5px;
padding-right: 10px;
padding-left: 8px;
background-color: #141414;
} }
.subjItem { .subjItem {
font-size: 18px; font-size: 18px;
padding: 3px; padding: 3px;
padding-top: 5px;
margin-top: 4px;
cursor: pointer; cursor: pointer;
float: 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
@ -376,10 +382,6 @@ input:focus {
text-decoration: none; text-decoration: none;
} }
.buttonContainer > *:active {
transform: translateY(2.5px);
}
.buttonContainer > *:hover { .buttonContainer > *:hover {
text-shadow: 2px 2px 8px black; text-shadow: 2px 2px 8px black;
transition: width 0.5s, height 0.5s, ease-out 0.5s; transition: width 0.5s, height 0.5s, ease-out 0.5s;
@ -410,7 +412,7 @@ select:hover {
} }
.selectContainer > select { .selectContainer > select {
width: 21%; width: 20%;
border-radius: 5px; border-radius: 5px;
border: 1.5px solid white; border: 1.5px solid white;
background-color: #9c9c98; background-color: #9c9c98;
@ -428,3 +430,21 @@ select:hover {
padding: 0px 5px; padding: 0px 5px;
margin-right: 8px; margin-right: 8px;
} }
.description {
padding-top: 1px;
padding-bottom: 10px;
font-size: inherit;
color: inherit;
text-align: center;
margin: 10px;
}
.resultContainer {
color: gainsboro;
font-size: 18px;
display: flex;
justify-content: center;
margin-top: 8px;
}

View file

@ -103,8 +103,16 @@ export default function AllQuestions({ router }) {
<div className={'pageHeader'}> <div className={'pageHeader'}>
<h1>Kérdések és tárgyak</h1> <h1>Kérdések és tárgyak</h1>
</div> </div>
<br /> <Sleep />
<div className={`selectContainer ${styles.content}`}> <div className={'description'}>
<p>
Ezen az oldalon tudsz manuálisan keresni a kérdések és a tárgyak
között, vagy ellenőrizni, hogy egy adott tárgy szerepel-e a
kérdés- és tárgyadatbázisban. Ezen kívül a kérdéseket le is
töltheted offline használatra. (txt formátumban)
</p>
</div>
<div className={'selectContainer'}>
<select <select
defaultValue={-1} defaultValue={-1}
onChange={(event) => { onChange={(event) => {
@ -127,7 +135,7 @@ export default function AllQuestions({ router }) {
}} }}
> >
<option disabled value={-1}> <option disabled value={-1}>
{' - Válassz egy adatbázist! - '} {' Válassz egy adatbázist!'}
</option> </option>
{dbs.map((db, i) => { {dbs.map((db, i) => {
return ( return (
@ -137,7 +145,7 @@ export default function AllQuestions({ router }) {
) )
})} })}
<option value={'all'} key={'all'}> <option value={'all'} key={'all'}>
{'All'} {'Összes kérdés'}
</option> </option>
</select> </select>
</div> </div>
@ -159,25 +167,26 @@ export default function AllQuestions({ router }) {
<div> <div>
{data ? ( {data ? (
<> <>
<div className={styles.searchContainer}> <center>
<input <div className={styles.searchContainer}>
autoFocus <input
placeholder="Keresés..." placeholder="Kezdj el írni a kereséshez..."
type="text" type="text"
value={searchTerm} value={searchTerm}
onChange={(event) => { onChange={(event) => {
setSearchTerm(event.target.value) setSearchTerm(event.target.value)
}} }}
/> />
<button <button
onClick={() => { onClick={() => {
setSearchTerm('') setSearchTerm('')
}} }}
className={styles.clearButton} className={styles.clearButton}
> >
X X
</button> </button>
</div> </div>
</center>
<hr /> <hr />
<SubjectSelector <SubjectSelector
data={data} data={data}
@ -187,10 +196,9 @@ export default function AllQuestions({ router }) {
setActiveSubjName(subjName) setActiveSubjName(subjName)
}} }}
/> />
<hr />
<div>{/*{qCount} kérdés, {sCount} tárgy */}</div>
<Sleep />
<div> <div>
<hr />
<Subject subj={currSubj} /> <Subject subj={currSubj} />
</div> </div>
</> </>
@ -206,8 +214,7 @@ export default function AllQuestions({ router }) {
<> <>
<div className={styles.searchContainer}> <div className={styles.searchContainer}>
<input <input
autoFocus placeholder="Kezdj el írni a kereséshez..."
placeholder="Keresés..."
type="text" type="text"
value={searchTerm} value={searchTerm}
onChange={(event) => { onChange={(event) => {
@ -229,7 +236,6 @@ export default function AllQuestions({ router }) {
X X
</button> </button>
</div> </div>
<hr />
<div> <div>
<QuestionSearchResult data={data} searchTerm={searchTerm} /> <QuestionSearchResult data={data} searchTerm={searchTerm} />
</div> </div>
@ -247,7 +253,9 @@ export default function AllQuestions({ router }) {
{dbs ? <>{renderDbSelector()}</> : <LoadingIndicator />} {dbs ? <>{renderDbSelector()}</> : <LoadingIndicator />}
{dbs && data ? ( {dbs && data ? (
<> <>
{`${questionCount} kérdés, ${subjectCount} tárgy`} <div className={styles.info}>
{`Összesen ${questionCount} kérdés, ${subjectCount} tárgyból`}
</div>
<div className={'buttonContainer'}> <div className={'buttonContainer'}>
<div <div
className={!subjectsShowing ? 'activeButton' : ''} className={!subjectsShowing ? 'activeButton' : ''}

View file

@ -1,17 +1,24 @@
.content {
padding-top: 50px;
}
.searchContainer { .searchContainer {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center;
margin-left: 10px;
padding-top: 10px;
padding-bottom: 2px;
} }
.clearButton { .clearButton {
width: 80px; width: 50px;
background-color: var(--background-color); background-color: var(--background-color);
color: white; color: white;
font-size: 23px; font-size: 18px;
cursor: pointer; cursor: pointer;
border: none; border: none;
margin-left: 10px;
}
.info {
text-align: center;
font-style: italic;
padding-top: 25px;
} }

View file

@ -5,6 +5,8 @@ import FeedbackArea from '../components/feedbackArea'
import constants from '../constants.json' import constants from '../constants.json'
import LoadingIndicator from '../components/LoadingIndicator' import LoadingIndicator from '../components/LoadingIndicator'
import Sleep from '../components/sleep'
import styles from './contact.module.css' import styles from './contact.module.css'
export default function Contact() { export default function Contact() {
@ -36,6 +38,7 @@ export default function Contact() {
<h1>Kapcsolat</h1> <h1>Kapcsolat</h1>
</div> </div>
<br /> <br />
<Sleep />
<br /> <br />
<div className={styles.text}> <div className={styles.text}>
<div>Üzenet küldése</div> <div>Üzenet küldése</div>

View file

@ -21,7 +21,8 @@ export default function contribute() {
<div className={'pageHeader'}> <div className={'pageHeader'}>
<h1>Teendők</h1> <h1>Teendők</h1>
</div> </div>
<div className={styles.description}> <Sleep />
<div className={'description'}>
<p> <p>
Ezen az oldalon új ötleteket adhatsz hozzá megvalósításra a teendők Ezen az oldalon új ötleteket adhatsz hozzá megvalósításra a teendők
listájához. listájához.
@ -66,7 +67,6 @@ export default function contribute() {
</center> </center>
<hr /> <hr />
<Todos /> <Todos />
<Sleep />
<hr /> <hr />
<div className={styles.title}>Git repos</div> <div className={styles.title}>Git repos</div>
<hr /> <hr />

View file

@ -1,12 +1,3 @@
.description {
padding-top: 1px;
padding-bottom: 10px;
font-size: inherit;
color: inherit;
text-align: center;
margin: 10px;
}
.warning { .warning {
color: white; color: white;
padding: 10px; padding: 10px;

View file

@ -255,6 +255,7 @@ export default function FAQ() {
<h1>Gyakran Ismételt Kérdések</h1> <h1>Gyakran Ismételt Kérdések</h1>
</div> </div>
<br /> <br />
<Sleep />
<br /> <br />
<div className={'buttonContainer'}> <div className={'buttonContainer'}>
{Object.keys(pages).map((key) => { {Object.keys(pages).map((key) => {
@ -273,7 +274,7 @@ export default function FAQ() {
})} })}
</div> </div>
{renderCurrPage(currPage)} {renderCurrPage(currPage)}
<Sleep />
<p className={'endofpage'} /> <p className={'endofpage'} />
</div> </div>
) )

View file

@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'
import fetch from 'unfetch' import fetch from 'unfetch'
import Head from 'next/head' import Head from 'next/head'
import Link from 'next/link' import Link from 'next/link'
import Sleep from '../components/sleep'
import styles from './pwRequest.module.css' import styles from './pwRequest.module.css'
import constants from '../constants.json' import constants from '../constants.json'
@ -88,6 +89,7 @@ export default function PwRequest() {
<div className={'pageHeader'}> <div className={'pageHeader'}>
<h1>Jelszó generálás</h1> <h1>Jelszó generálás</h1>
</div> </div>
<Sleep />
<div id="form"> <div id="form">
<div className={styles.text}> <div className={styles.text}>
<p className={styles.descrip}> <p className={styles.descrip}>