- {/* Header fixe avec le total */}
+ {/* Header fixe avec le total et le bouton de validation */}
@@ -239,17 +249,31 @@ export default function PublicVotePage() {
-
-
- {totalVoted}€ / {campaign?.budget_per_user}€
-
-
- {voteStatus.message}
+
+
+
+ {totalVoted}€ / {campaign?.budget_per_user}€
+
+
+ {voteStatus.message}
+
+
+
@@ -258,20 +282,11 @@ export default function PublicVotePage() {
{/* Informations de la campagne */}
-
Informations sur la campagne
-
+
Description
{campaign?.description}
-
-
Budget par participant
-
{campaign?.budget_per_user}€
-
-
-
Paliers de dépenses
-
{campaign?.spending_tiers}
-
@@ -297,40 +312,51 @@ export default function PublicVotePage() {
{proposition.description}
-
- Auteur : {proposition.author_first_name} {proposition.author_last_name}
-
-
- {spendingTiers.map((tier) => (
-
- ))}
-
+
+ {/* Slider */}
+
+
{
+ const index = parseInt(e.target.value);
+ const amount = index === 0 ? 0 : spendingTiers[index - 1];
+ handleVoteChange(proposition.id, amount);
+ }}
+ className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer slider"
+ />
+
+ {/* Marqueurs des paliers */}
+
+
+ {spendingTiers.map((tier, index) => (
+
+ ))}
+
+
+
+ {/* Valeur sélectionnée */}
+
+
+ Vote sélectionné : {localVotes[proposition.id] || 0}€
+
+
@@ -339,23 +365,6 @@ export default function PublicVotePage() {
)}
- {/* Bouton de validation */}
- {propositions.length > 0 && (
-
-
-
- )}
-
{error && (
{error}
diff --git a/src/app/globals.css b/src/app/globals.css
index a2dc41e..e8bacd3 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -24,3 +24,68 @@ body {
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}
+
+/* Styles personnalisés pour le slider */
+.slider {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 100%;
+ height: 8px;
+ border-radius: 4px;
+ background: #e5e7eb;
+ outline: none;
+ cursor: pointer;
+}
+
+.slider::-webkit-slider-track {
+ width: 100%;
+ height: 8px;
+ border-radius: 4px;
+ background: #e5e7eb;
+ border: 1px solid #d1d5db;
+}
+
+.slider::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ appearance: none;
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ background: #4f46e5;
+ cursor: pointer;
+ border: 2px solid #ffffff;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+ transition: all 0.2s ease;
+}
+
+.slider::-webkit-slider-thumb:hover {
+ background: #3730a3;
+ transform: scale(1.1);
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
+}
+
+.slider::-moz-range-track {
+ width: 100%;
+ height: 8px;
+ border-radius: 4px;
+ background: #e5e7eb;
+ border: 1px solid #d1d5db;
+ outline: none;
+}
+
+.slider::-moz-range-thumb {
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ background: #4f46e5;
+ cursor: pointer;
+ border: 2px solid #ffffff;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+ transition: all 0.2s ease;
+}
+
+.slider::-moz-range-thumb:hover {
+ background: #3730a3;
+ transform: scale(1.1);
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
+}