Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 168 additions & 2 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
-webkit-transform-style: preserve-3d;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
-webkit-transition: -webkit-transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transition: -webkit-transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-face {
Expand Down Expand Up @@ -315,3 +315,169 @@
display: none;
}
*/

/* Enhanced Dropdown Styles */
.dropdown-enhanced {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-image: none;
background-color: white;
border: 1px solid #d1d5db;
border-radius: 0.5rem;
padding: 0.625rem 2.5rem 0.625rem 1rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: #111827;
cursor: pointer;
transition: all 0.2s ease-in-out;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
min-width: 140px;
position: relative;
}

.dropdown-enhanced:hover {
border-color: #9ca3af;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dropdown-enhanced:focus {
outline: none;
border-color: transparent;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.dropdown-enhanced:disabled {
opacity: 0.5;
cursor: not-allowed;
background-color: #f9fafb;
}

/* Dark mode dropdown styles */
.dark .dropdown-enhanced {
background-color: #1f2937;
border-color: #4b5563;
color: #f3f4f6;
}

.dark .dropdown-enhanced:hover {
border-color: #6b7280;
}

.dark .dropdown-enhanced:focus {
border-color: transparent;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.dark .dropdown-enhanced:disabled {
background-color: #374151;
color: #9ca3af;
}

/* Custom dropdown arrow */
.dropdown-wrapper {
position: relative;
display: inline-block;
}

.dropdown-wrapper::after {
content: "";
position: absolute;
right: 0.75rem;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #6b7280;
pointer-events: none;
}

.dark .dropdown-wrapper::after {
border-top-color: #9ca3af;
}

/* Option styling for better visibility */
.dropdown-enhanced option {
background-color: white;
color: #111827;
padding: 0.5rem;
}

.dark .dropdown-enhanced option {
background-color: #1f2937;
color: #f3f4f6;
}

/* Firefox specific styles */
@-moz-document url-prefix() {
.dropdown-enhanced {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1rem;
padding-right: 2.5rem;
}

.dark .dropdown-enhanced {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}
}

/* Edge/IE specific styles */
.dropdown-enhanced::-ms-expand {
display: none;
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
.dropdown-enhanced {
-webkit-appearance: none;
appearance: none;
}
}

/* Responsive dropdown styling */
@media (max-width: 640px) {
.dropdown-enhanced {
min-width: 120px;
font-size: 0.8rem;
padding: 0.5rem 2rem 0.5rem 0.75rem;
}
}

/* Accessibility improvements */
.dropdown-enhanced:focus-visible {
outline: 2px solid #3b82f6;
outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
.dropdown-enhanced {
border-width: 2px;
border-color: #000;
}

.dropdown-enhanced:focus {
border-color: #0066cc;
box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.5);
}

.dark .dropdown-enhanced {
border-color: #fff;
}

.dark .dropdown-enhanced:focus {
border-color: #66b3ff;
}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
.dropdown-enhanced {
transition: none;
}
}
183 changes: 107 additions & 76 deletions app/interview-experiences/(routes)/share-experience/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,61 +66,65 @@ const Page = () => {
};

const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
e.preventDefault();

const processedRounds = interviewRounds.map((round) => ({
round: round.id,
type: round.type,
duration: parseInt(round.duration.toString()),
questions: round.questions.split("\n").filter((q) => q.trim() !== ""),
experience: round.experience,
}));
const processedRounds = interviewRounds.map((round) => ({
round: round.id,
type: round.type,
duration: parseInt(round.duration.toString()),
questions: round.questions.split("\n").filter((q) => q.trim() !== ""),
experience: round.experience,
}));

const finalData = {
company: formData.company,
position: formData.position,
author: formData.author,
date: formData.date,
duration: parseInt(formData.duration.toString()),
rounds: parseInt(formData.rounds.toString()),
level: formData.difficulty.toLowerCase(),
result: formData.outcome.toLowerCase(),
likes: 0,
comments: 0,
tags: formData.tags
.split(",")
.map((tag) => tag.trim())
.filter((tag) => tag !== ""),
preview: formData.overallExperience.substring(0, 100) + "...",
interview: {
rounds: processedRounds,
overallExperience: formData.overallExperience,
tips: formData.tips.split("\n").filter((tip) => tip.trim() !== ""),
finalOutcome: formData.outcome.toLowerCase(), // fix
},
};
const finalData = {
company: formData.company,
position: formData.position,
author: formData.author,
date: formData.date,
duration: parseInt(formData.duration.toString()),
rounds: parseInt(formData.rounds.toString()),
level: formData.difficulty.toLowerCase(),
result: formData.outcome.toLowerCase(),
likes: 0,
comments: 0,
tags: formData.tags
.split(",")
.map((tag) => tag.trim())
.filter((tag) => tag !== ""),
preview: formData.overallExperience.substring(0, 100) + "...",
interview: {
rounds: processedRounds,
overallExperience: formData.overallExperience,
tips: formData.tips.split("\n").filter((tip) => tip.trim() !== ""),
finalOutcome: formData.outcome.toLowerCase(), // fix
},
};

try {
const res = await fetch("/api/interview-experiences", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(finalData),
});
try {
const res = await fetch("/api/interview-experiences", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(finalData),
});

const result = await res.json();
if (result.success) {
showMessage("Interview Experience shared successfully!", "success");
} else {
showMessage("Error sharing experience!", "error");
const result = await res.json();
if (result.success) {
showMessage("Interview Experience shared successfully!", "success");
} else {
showMessage("Error sharing experience!", "error");
}
} catch (error) {
showMessage("Something went wrong!", "error");
}
} catch (error) {
showMessage("Something went wrong!", "error");
}
};
};

return (
<div className="bg-background min-h-screen flex flex-col items-center gap-8">
<Navbar icon={<Share />} pageTitle="Share Experience" onBack="/interview-experiences" />
<Navbar
icon={<Share />}
pageTitle="Share Experience"
onBack="/interview-experiences"
/>
<div className="bg-card p-8 rounded-xl shadow-lg w-full max-w-2xl">
<h1 className="text-2xl md:text-3xl text-center font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
Interview Feedback
Expand Down Expand Up @@ -248,20 +252,34 @@ const Page = () => {
>
Difficulty
</label>
<select
id="difficulty"
name="difficulty"
value={formData.difficulty}
onChange={handleFormChange}
className="mt-1 block w-full rounded-md border-gray-300 shadow-sm p-2 border-2
focus:ring-blue-500 focus:border-blue-500 bg-card text-white"
required
>
<option value="">Select a difficulty</option>
<option value="Easy">Easy</option>
<option value="Medium">Medium</option>
<option value="Hard">Hard</option>
</select>
<div className="relative">
<select
id="difficulty"
name="difficulty"
value={formData.difficulty}
onChange={handleFormChange}
className="appearance-none mt-1 block w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 border border-gray-300 dark:border-gray-600 rounded-lg px-4 py-2.5 pr-10 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-400 dark:hover:border-gray-500 transition-all duration-200 cursor-pointer shadow-sm hover:shadow-md"
required
>
<option value="">Select a difficulty</option>
<option value="Easy">Easy</option>
<option value="Medium">Medium</option>
<option value="Hard">Hard</option>
</select>
<svg
className="absolute right-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-500 dark:text-gray-400 pointer-events-none"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</div>
</div>
<div>
<label
Expand All @@ -270,21 +288,34 @@ const Page = () => {
>
Outcome
</label>
<select
id="outcome"
name="outcome"
value={formData.outcome}
onChange={handleFormChange}
className="mt-1 block w-full rounded-md border-gray-300 shadow-sm p-2 border-2
focus:ring-blue-500 focus:border-blue-500 bg-card text-white"
required
>
<option value="">Select an outcome</option>
<option value="Selected">Selected</option>
<option value="Rejected">Rejected</option>
<option value="Pending">Pending</option>
</select>

<div className="relative">
<select
id="outcome"
name="outcome"
value={formData.outcome}
onChange={handleFormChange}
className="appearance-none mt-1 block w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 border border-gray-300 dark:border-gray-600 rounded-lg px-4 py-2.5 pr-10 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent hover:border-gray-400 dark:hover:border-gray-500 transition-all duration-200 cursor-pointer shadow-sm hover:shadow-md"
required
>
<option value="">Select an outcome</option>
<option value="Selected">Selected</option>
<option value="Rejected">Rejected</option>
<option value="Pending">Pending</option>
</select>
<svg
className="absolute right-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-500 dark:text-gray-400 pointer-events-none"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</div>
</div>
</div>

Expand Down
Loading