diff --git a/app/__pycache__/routes.cpython-312.pyc b/app/__pycache__/routes.cpython-312.pyc index b8235b3..db9072f 100644 Binary files a/app/__pycache__/routes.cpython-312.pyc and b/app/__pycache__/routes.cpython-312.pyc differ diff --git a/app/routes.py b/app/routes.py index 9f09aeb..ba35ffc 100644 --- a/app/routes.py +++ b/app/routes.py @@ -51,14 +51,19 @@ def should_include(q): return redirect(url_for('main.summary')) question = filtered_questions[qid] + print(question) if request.method == 'POST': - if question.get('type') == 'multiple': + if question.get('type') == 'variables_table': + variables_data = request.form.get('variablesData', '[]') + responses[str(question['id'])] = variables_data + elif question.get('type') == 'multiple': answer = request.form.getlist('answer') + responses[str(question['id'])] = answer else: answer = request.form.get('answer', '') + responses[str(question['id'])] = answer - responses[str(question['id'])] = answer session['responses'] = responses direction = request.form.get('direction') @@ -77,6 +82,26 @@ def should_include(q): ) + @main_bp.route('/about') def about(): return render_template('about.html') + + +@main_bp.route('/summary') +def summary(): + if g.user is None: + return redirect(url_for('auth.login')) + + all_questions = current_app.questions + responses = session.get('responses', {}) + + questions_with_answers = [] + for q in all_questions: + answer = responses.get(str(q['id']), None) + questions_with_answers.append({ + 'question': q['text'], + 'answer': answer + }) + + return render_template('summary.html', qa_list=questions_with_answers) diff --git a/app/static/about.css b/app/static/about.css index 4a4a1bc..68ffbac 100644 --- a/app/static/about.css +++ b/app/static/about.css @@ -1,37 +1,45 @@ body { - font-family: 'Vazirmatn', sans-serif; - background-color: #20c997; + font-family: "Vazirmatn", sans-serif; + background-color: #4ea3d4; margin: 0; padding: 0; color: #fff; } .card { + position: relative; max-width: 1000px; margin: 40px auto; padding: 30px; - background-color: #ffffff11; - border-radius: 20px; - box-shadow: 0 8px 30px rgba(0,0,0,0.2); + background-color: #ffffff59; + border-radius: 60px; + box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); text-align: center; } -h1, h2 { - margin-bottom: 20px; +h1, +h2 { + font-size: 50px; } .project-description { - font-size: 20px; + font-size: 30px; font-weight: 500; line-height: 1.8; + margin: 30px; } .team-wrapper { display: grid; - grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); - gap: 30px; - justify-items: center; - margin-top: 30px; + grid-template-columns: repeat(2, minmax(0, 300px)); + gap: 50px 130px; + justify-content: center; + margin-top: 10px; +} + +.team-wrapper > .team-member:last-child { + grid-column: 1 / -1; + justify-self: center; } .team-member { @@ -40,42 +48,77 @@ h1, h2 { overflow: hidden; background: white; box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); + width: 300px; + height: 300px; } .profile-pic { width: 100%; - height: 250px; + height: 100%; object-fit: cover; display: block; + transition: transform 0.5s ease; } .overlay { position: absolute; bottom: 0; - width: 100%; - background: rgba(0, 150, 136, 0.85); + left: 0; + right: 0; + height: 100%; + background: rgba(0, 150, 117, 0.692); color: white; - padding: 12px 10px 10px; text-align: center; + transform: translateY(60%); + opacity: 0; + transition: transform 0.5s ease, opacity 0.5s ease; + font-size: 2rem; + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 30px 15px 20px; +} + +.team-member:hover .overlay { + transform: translateY(0); + opacity: 1; +} + +.team-member:hover .profile-pic { + transform: scale(1.05); } .member-title { - font-size: 14px; + font-size: 25px; font-weight: bold; - margin-bottom: 8px; line-height: 1.4; + margin-top: 110px; + z-index: 2; } .social-icons { display: flex; - justify-content: center; - gap: 10px; + justify-content: space-between; + gap: 20px; + width: 100%; + max-width: 300px; + margin-top: auto; + font-size: 3rem; + opacity: 0; + transform: translateY(10px); + transition: opacity 0.4s ease, transform 0.4s ease; +} + +.team-member:hover .social-icons { + opacity: 1; + transform: translateY(0); } .social-icons a { color: white; - font-size: 18px; transition: transform 0.3s ease; + display: inline-flex; + align-items: center; } .social-icons a:hover { @@ -83,19 +126,36 @@ h1, h2 { } .secondary-button { + position: absolute; + bottom: 100px; + left: 90px; + padding: 10px 20px; - background-color: white; - color: #20c997; - border-radius: 10px; + background-color: rgba(250, 250, 250, 0.945); + color: #06348a; + border: rgb(13, 96, 190) solid 4px; + border-radius: 20px; font-weight: bold; text-decoration: none; - transition: background-color 0.3s ease; + transition: background-color 0.5s ease; } .secondary-button:hover { - background-color: #f1f1f1; + background-color: #096dca; + color: #fafafa; } .button-container { margin-top: 40px; } +.about-section.hidden { + opacity: 0; + transform: translateY(50px); + transition: opacity 1s ease, transform 1s ease; +} + +.about-section.show { + opacity: 1; + transform: translateY(0); +} + diff --git a/app/static/img/logo.jpeg b/app/static/img/logo.jpeg new file mode 100644 index 0000000..7db5b20 Binary files /dev/null and b/app/static/img/logo.jpeg differ diff --git a/app/static/js/about.js b/app/static/js/about.js index 174a40d..4a07c6e 100644 --- a/app/static/js/about.js +++ b/app/static/js/about.js @@ -1,8 +1,17 @@ -{/* */} + \ No newline at end of file diff --git a/app/static/question.css b/app/static/question.css index 4dde925..e23a8a8 100644 --- a/app/static/question.css +++ b/app/static/question.css @@ -14,132 +14,34 @@ body { background-position: center; } -.progress-bar { - background-color: #e0e0e0; - width: 100%; - height: 20px; - border-radius: 10px; - overflow: hidden; - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); - margin-bottom: 100px; -} - -.progress::after { - content: ""; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: linear-gradient( - 90deg, - rgba(255, 255, 255, 0), - rgba(255, 255, 255, 0.8), - rgba(255, 255, 255, 0) - ); - transform: translateX(-100%); -} .question-container-wrapper { - width: 800px; + width: 1000px; margin: auto; transition: height 0.5s ease; } .question-container { - justify-content: center; + display: flex; + gap: 2rem; + align-items: flex-start; position: relative; - height: auto; min-height: 350px; margin: auto; - align-items: center; - background: linear-gradient(135deg, #646666, #2a302c); - border-radius: 1.5rem; - padding: 2rem; - color: white; - transition: all 0.3s ease; - border-radius: 20rem 2rem 2rem 20rem; - overflow: hidden; -} -.question-container { - justify-content: center; - position: relative; - width: 900px; - height: 350px; - margin: auto; background: linear-gradient(135deg, #56e4c5, #016d5e); - border-radius: 1.5rem; + border-radius: 2rem; padding: 2rem; color: white; transition: all 0.3s ease; - border-radius: 20rem 2rem 2rem 20rem; } -.question-container .circle { - position: absolute; - top: 25px; - left: -600px; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - width: 80px; - height: 80px; - border-radius: 50%; -} - -.actions { - display: flex; - justify-content: space-evenly; -} -button { - background-color: blanchedalmond; - color: black; - outline: none; - border: none; - padding: 0.6rem 1rem; - border-radius: 3rem; - font-family: Tahoma; - overflow: hidden; - position: relative; - cursor: pointer; - z-index: 1; - font-family: "Vazir"; - top: 20px; -} -button::before { - position: absolute; - content: ""; - left: 0; - right: 0; - bottom: 0; - top: 0; - border-radius: 3rem; - height: 200; - width: 200; - background-color: rgba(248, 132, 0, 0.801); - z-index: -1; - transform: scaleX(0); - transform-origin: left; - transition: 250ms; -} -button:hover::before { - transform: scaleX(1); -} -button:hover { - color: aliceblue; -} -button:disabled { - background-color: #ffffff; - cursor: not-allowed; -} .container2 { - position: relative; display: flex; justify-content: center; - align-items: center; + align-items: flex-start; gap: 40px; } -.container2 .circle { + +.circle { position: relative; display: flex; justify-content: center; @@ -148,11 +50,9 @@ button:disabled { width: 300px; height: 300px; border-radius: 50%; - top: 50%; - transform: translateY(-50%); - transition: all 0.3s ease; } -.container2 .circle::before { + +.circle::before { content: ""; position: absolute; inset: 5px; @@ -160,7 +60,8 @@ button:disabled { background: rgb(27, 27, 27); opacity: 0.8; } -.container2 .circle::after { + +.circle::after { content: ""; position: absolute; width: 200px; @@ -173,44 +74,138 @@ button:disabled { inset 0 4px 2px rgba(0, 0, 0, 0.25), inset 0 -2px 2px rgba(255, 255, 255, 0.5); } -.container2 .circle .number { + +.circle .number { position: relative; color: #fff; z-index: 10; - line-height: 0rem; font-size: 5rem; - top: 20px; } -.container2 .circle .number span { + +.circle .number span { font-size: 0.5em; font-weight: 500; } -.container2 .circle h4 { + +.circle h4 { position: relative; color: #fff; z-index: 10; font-weight: 500; font-size: 1.5em; - line-height: 0em; - top: -20px; } + .cont3 { + flex: 1; position: relative; - left: -20px; - top: -300px; - width: 500px; + width: 100%; } + textarea { border-radius: 0.25rem; + width: 100%; +} + +/* جدول متغیرها */ +.variables-table { + width: 100%; + border-collapse: collapse; + margin-top: 1rem; + background: rgba(255, 255, 255, 0.1); +} + +.variables-table th, +.variables-table td { + border: 1px solid rgba(255, 255, 255, 0.3); + padding: 0.5rem; + text-align: center; + color: white; +} + +.variables-table th { + background: rgba(0, 0, 0, 0.2); + font-weight: bold; +} + +.variables-table input, +.variables-table select { + width: 100%; + padding: 0.3rem; + border-radius: 5px; + border: none; } +.variables-section .actions { + margin-top: 1rem; + display: flex; + justify-content: flex-start; + gap: 1rem; +} + +.btn-add { + background-color: #ffcc80; + color: black; +} + +.btn-remove { + background-color: #ef5350; + color: white; +} + +.actions { + display: flex; + justify-content: space-evenly; + margin-top: 2rem; +} + +button { + background-color: blanchedalmond; + color: black; + outline: none; + border: none; + padding: 0.6rem 1rem; + border-radius: 3rem; + font-family: "Vazir"; + cursor: pointer; + position: relative; + z-index: 1; +} + +button::before { + position: absolute; + content: ""; + left: 0; + right: 0; + bottom: 0; + top: 0; + border-radius: 3rem; + background-color: rgba(248, 132, 0, 0.801); + z-index: -1; + transform: scaleX(0); + transform-origin: left; + transition: 250ms; +} + +button:hover::before { + transform: scaleX(1); +} + +button:hover { + color: aliceblue; +} + +button:disabled { + background-color: #ffffff; + cursor: not-allowed; +} + +/* لامپ و مودال */ .lamp-btn { background: white !important; border: none; cursor: pointer; font-size: 2rem; color: rgb(87, 86, 86) !important; - bottom: 20px; width: 50px; height: 50px; border-radius: 50%; @@ -218,9 +213,14 @@ textarea { justify-content: center; align-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); - transition: all 0.3s ease; - z-index: 10; } + +.lamp-btn:hover { + background: #f8f8f8 !important; + transform: scale(1.1); + color: #000000 !important; +} + .modal { display: none; position: fixed; @@ -233,11 +233,6 @@ textarea { opacity: 0; transition: opacity 0.3s ease; } -.lamp-btn:hover { - background: #f8f8f8 !important; - transform: scale(1.1); - color: #000000 !important; -} .modal.show { display: block; @@ -252,31 +247,6 @@ textarea { max-width: 400px; margin: 10% auto; position: relative; - transform: translateY(-20px); - transition: transform 0.3s ease; -} - -.modal.show .modal-content { - transform: translateY(0); -} -.close { - position: absolute; - top: 10px; - right: 15px; - font-size: 1.5rem; - cursor: pointer; -} -.lamp-btn { - background: none; - border: none; - cursor: pointer; - font-size: 2rem; - margin: 1rem 0; -} -.explain { - margin-top: 1rem; - padding: 1rem; - border-radius: 8px; } .close { @@ -286,18 +256,3 @@ textarea { font-size: 1.5rem; cursor: pointer; } - -.actions { - margin-top: 2rem; -} - -.cont3 { - opacity: 0; - transform: translateX(80px); - transition: opacity 0.6s ease, transform 0.6s ease; -} - -.cont3.visible { - opacity: 1; - transform: translateX(0); -} diff --git a/app/static/summary.css b/app/static/summary.css new file mode 100644 index 0000000..a5211c7 --- /dev/null +++ b/app/static/summary.css @@ -0,0 +1,87 @@ +/* پس‌زمینه و فونت مشابه صفحه سوالات */ +body { + font-family: "Vazir"; + direction: rtl; + padding: 20px; + position: relative; + display: flex; + justify-content: center; + align-items: flex-start; + min-height: 100vh; + background-image: url(./img/1.jpg); + background-repeat: no-repeat; + background-size: cover; + background-attachment: fixed; + background-position: center; + color: white; +} + +/* کانتینر اصلی صفحه مرور پاسخ‌ها */ +.summary-container { + width: 1000px; + margin: auto; + background: linear-gradient(135deg, #56e4c5, #016d5e); + padding: 2rem; + border-radius: 2rem; + backdrop-filter: blur(6px); + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); +} + +/* عنوان صفحه */ +.summary-container h1 { + text-align: center; + font-size: 2rem; + margin-bottom: 1.5rem; + color: #fff; +} + +/* جدول مرور پاسخ‌ها */ +.summary-table { + width: 100%; + border-collapse: collapse; + background: rgba(255, 255, 255, 0.1); + border-radius: 1rem; + overflow: hidden; +} + +.summary-table th, +.summary-table td { + padding: 1rem; + text-align: right; + border: 1px solid rgba(255, 255, 255, 0.3); +} + +.summary-table th { + background: rgba(0, 0, 0, 0.3); + font-weight: bold; + color: #ffcc80; +} + +.summary-table tr:hover { + background: rgba(255, 255, 255, 0.05); +} + +/* دکمه‌ها */ +.summary-actions { + display: flex; + justify-content: center; + margin-top: 2rem; + gap: 1rem; +} + +.summary-actions a { + background-color: blanchedalmond; + color: black; + padding: 0.6rem 1.2rem; + border-radius: 3rem; + font-family: "Vazir"; + text-decoration: none; + position: relative; + z-index: 1; + transition: all 0.25s ease; +} + +.summary-actions a:hover { + background-color: rgba(248, 132, 0, 0.85); + color: aliceblue; +} diff --git a/app/templates/about.html b/app/templates/about.html index 741631b..5b5b7fa 100644 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -6,25 +6,28 @@ + + -
+