diff --git a/src/components/Componentes/test-questions-flow.tsx b/src/components/Componentes/test-questions-flow.tsx
index 9cbd01d..1c74335 100644
--- a/src/components/Componentes/test-questions-flow.tsx
+++ b/src/components/Componentes/test-questions-flow.tsx
@@ -198,11 +198,11 @@ export default function TestQuestionsFlow({
[currentQuestion.id]: value,
}));
- // Auto advance to next question if not on last question
+ // Auto advance to next question if not on last question with slide animation
if (!isLastQuestion) {
setTimeout(() => {
setCurrentIndex((prev) => Math.min(prev + 1, totalQuestions - 1));
- }, 250);
+ }, 200);
}
};
@@ -296,84 +296,102 @@ export default function TestQuestionsFlow({
- {/* Question Section */}
-
- {/* Question Title */}
-
- {currentQuestion.text}
-
+ {/* Question Slider Viewport */}
+
+ {questions.map((q, index) => {
+ const offset = index - currentIndex;
+ const isNearby = Math.abs(offset) <= 1;
+
+ if (!isNearby) return null;
- {/* Answer Options Stack */}
- {(() => {
- const options = currentQuestion.options || [];
+ const qSelectedValue = answers[q.id];
+ const options = q.options || [];
return (
-
- {options.map((option) => {
- const isSelected = selectedValue === option.value;
-
- return (
-
handleOptionSelect(option.value)}
- className={[
- "cursor-pointer rounded-[16px] font-semibold text-[15px] transition-all duration-200 active:scale-[0.99] flex items-center gap-3",
- "w-full px-5 py-4 text-start leading-snug",
- isSelected
- ? "bg-[#F0445B] text-white shadow-[0_8px_20px_rgba(240,68,91,0.25)]"
- : "bg-[#FAFAFA] text-[#181818] hover:bg-white shadow-[0_2px_6px_rgba(0,0,0,0.03)] border border-[#F0EDED]",
- ].join(" ")}
- >
-
+ {/* Question Title */}
+
+ {q.text}
+
+
+ {/* Answer Options Stack */}
+
+ {options.map((option) => {
+ const isSelected = qSelectedValue === option.value;
+
+ return (
+
handleOptionSelect(option.value)}
className={[
- "size-[18px] shrink-0 rounded-full border-[2px] transition-all flex items-center justify-center",
+ "cursor-pointer rounded-[16px] font-semibold text-[15px] transition-all duration-200 active:scale-[0.99] flex items-center gap-3",
+ "w-full px-5 py-4 text-start leading-snug",
isSelected
- ? "border-white bg-white text-[#F0445B]"
- : "border-[#D0D5DD] bg-white text-transparent",
+ ? "bg-[#F0445B] text-white shadow-[0_8px_20px_rgba(240,68,91,0.25)]"
+ : "bg-[#FAFAFA] text-[#181818] hover:bg-white shadow-[0_2px_6px_rgba(0,0,0,0.03)] border border-[#F0EDED]",
].join(" ")}
>
- {isSelected && (
-
+
+ {isSelected && (
+
+ )}
+
+
+ {option.label.includes(" - ") ? (
+ (() => {
+ const parts = option.label.split(" - ");
+ const title = formatOptionLabel(parts[0]);
+ const description = formatOptionLabel(
+ parts.slice(1).join(" - "),
+ );
+ return (
+
+ {title}
+
+ {description}
+
+
+ );
+ })()
+ ) : (
+
+ {formatOptionLabel(option.label)}
+
)}
-
-
- {option.label.includes(" - ") ? (
- (() => {
- const parts = option.label.split(" - ");
- const title = formatOptionLabel(parts[0]);
- const description = formatOptionLabel(
- parts.slice(1).join(" - "),
- );
- return (
-
- {title}
-
- {description}
-
-
- );
- })()
- ) : (
-
- {formatOptionLabel(option.label)}
-
- )}
-
- );
- })}
+
+ );
+ })}
+
);
- })()}
+ })}
{/* Bottom Actions Bar */}