From 38172e9e975f90e56f28bc51c9759d830a0e1e7c Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Fri, 23 Aug 2024 16:38:58 -0400 Subject: [PATCH] Small style and UX tweaks to question generation modal & confirm bar --- src/components/question-generator.jsx | 14 +- src/components/question-generator.scss | 182 ++++++++++++------------ src/components/widget-creator-page.scss | 10 +- 3 files changed, 106 insertions(+), 100 deletions(-) diff --git a/src/components/question-generator.jsx b/src/components/question-generator.jsx index c92626b93..63cd2300d 100644 --- a/src/components/question-generator.jsx +++ b/src/components/question-generator.jsx @@ -86,9 +86,9 @@ const QsetGenerator = () => { document.getElementById('num-questions').classList.add('invalid') setNumberError('Please enter a number greater than 0') return false - } else if (numQuestions > 8) { + } else if (numQuestions > 16) { document.getElementById('num-questions').classList.add('warning') - setWarning('Note: Generating this many questions may not work, or will take a while.') + setWarning('Note: Generating this many questions will take a while and may not work at all.') return true } else { document.getElementById('num-questions').classList.remove('invalid') @@ -111,13 +111,15 @@ const QsetGenerator = () => { return (
-

Generate Questions (Beta Feature)

+

Generate Questions

{loading &&

Generating questions. Do not close this window.

}
- This question generator is powered by AI, so errors in the generated content can occur. There will be an option after generation is complete to keep or revert all changes. + Question Generation is powered by AI, so errors in the generated content can occur. After generation is complete you will be prompted to keep the content or discard it. You may need + to make edits to the generated content before saving your widget. + Note that this feature will only create text content. Image or media generation is not currently supported. {serverError}
@@ -129,10 +131,10 @@ const QsetGenerator = () => { {numberError}
-
+ {/*
setIncludeImages(e.target.checked)}/> -
+
*/}
setBuildOffExisting(e.target.checked)}/> diff --git a/src/components/question-generator.scss b/src/components/question-generator.scss index ca3607d03..69aa5f416 100644 --- a/src/components/question-generator.scss +++ b/src/components/question-generator.scss @@ -1,95 +1,95 @@ @import './include.scss'; .generate { - border-radius: 5px; - margin: 10px; - - h1 { - background: #10a37f; - padding: 10px; - margin: 0px; - font-size: 1em; - font-weight: bold; - color: #ffffff; - } - - .loading { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - background-color: rgba(0, 0, 0, 0.5); - - backdrop-filter: blur(10px); - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 10; - - p { - margin-bottom: 150px; - font-size: 1.1em; - color: white; - } - } - - #generate_form { - margin: 2em; - display: flex; - flex-direction: column; - gap: 1em; - - #topic-field { - display: flex; - flex-direction: column; - gap: 0.5em; - - #topic { - padding: 0.5em; - } - } - - #num-questions-field { - display: flex; - flex-direction: row; - justify-content: space-between; - - input { - max-width: 100px; - } - } - - } - .actions { - position: fixed; - width: 80px; - left: 50%; - bottom: 0px; - margin-left: -40px; - padding-bottom: 14px; - z-index: 10; - - text-align: center; - font-size: 1.1em; - - a { - color: #000000; - } - } - - .error { - color: red; - font-size: 0.8em; - } - - .invalid { - border: 2px solid red; - border-radius: 3px; - } - - .warning { - color: #f1814b; - font-size: 0.8em; - } + border-radius: 5px; + margin: 10px; + + h1 { + background: #3690E6; + padding: 10px; + margin: 0px; + font-size: 1em; + font-weight: bold; + color: #ffffff; + } + + .loading { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: rgba(0, 0, 0, 0.5); + + backdrop-filter: blur(10px); + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 10; + + p { + margin-bottom: 150px; + font-size: 1.1em; + color: white; + } + } + + #generate_form { + margin: 2em; + display: flex; + flex-direction: column; + gap: 1em; + + #topic-field { + display: flex; + flex-direction: column; + gap: 0.5em; + + #topic { + padding: 0.5em; + } + } + + #num-questions-field { + display: flex; + flex-direction: row; + justify-content: space-between; + + input { + max-width: 100px; + } + } + + } + .actions { + position: fixed; + width: 80px; + left: 50%; + bottom: 0px; + margin-left: -40px; + padding-bottom: 14px; + z-index: 10; + + text-align: center; + font-size: 1.1em; + + a { + color: #000000; + } + } + + .error { + color: red; + font-size: 0.8em; + } + + .invalid { + border: 2px solid red; + border-radius: 3px; + } + + .warning { + color: #f1814b; + font-size: 0.8em; + } } diff --git a/src/components/widget-creator-page.scss b/src/components/widget-creator-page.scss index 9ac33658c..b6c53df53 100644 --- a/src/components/widget-creator-page.scss +++ b/src/components/widget-creator-page.scss @@ -156,10 +156,14 @@ a { background: linear-gradient(#ffffff, #ffe5cc); } } -} -#qset-generation-confirmation-bar { - background-color: #10a37f; + &#qset-generation-confirmation-bar { + background-color: #3690E6; + + button:hover { + background: linear-gradient(#ffffff, #bbdeff); + } + } } .dot {