feat: Implement a new dark theme and refresh UI components with updated styling and icons.
This commit is contained in:
parent
1cb0b6fccb
commit
776f5e8ae5
1
assets/icon.svg
Normal file
1
assets/icon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 27 KiB |
@ -1,9 +1,11 @@
|
|||||||
/* App-wide styling */
|
/* App-wide styling */
|
||||||
body {
|
body {
|
||||||
background-color: #0f1116;
|
background-color: #0f172a;
|
||||||
color: #ffffff;
|
color: #f8fafc;
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
margin: 20px;
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#hero {
|
#hero {
|
||||||
@ -46,8 +48,8 @@ body {
|
|||||||
#navbar {
|
#navbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navbar a {
|
#navbar a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
@ -63,8 +65,8 @@ body {
|
|||||||
/* Blog page */
|
/* Blog page */
|
||||||
#blog {
|
#blog {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#blog a {
|
#blog a {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
25
src/auth.rs
25
src/auth.rs
@ -24,7 +24,7 @@ pub struct UserSafe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[server]
|
#[server]
|
||||||
pub async fn register(username: String, password: String) -> Result<String, ServerFnError> {
|
pub async fn register(username: String, password: String) -> Result<UserSafe, ServerFnError> {
|
||||||
let db = db::establish_connection()
|
let db = db::establish_connection()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
||||||
@ -37,21 +37,31 @@ pub async fn register(username: String, password: String) -> Result<String, Serv
|
|||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let new_user = db::users::ActiveModel {
|
let new_user = db::users::ActiveModel {
|
||||||
username: Set(username),
|
username: Set(username.clone()),
|
||||||
password: Set(password_hash),
|
password: Set(password_hash),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
let _user = new_user
|
let user = new_user
|
||||||
.insert(&db)
|
.insert(&db)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
||||||
|
|
||||||
Ok("Benutzer erfolgreich registriert".to_string())
|
// Log the user in immediately
|
||||||
|
let session: Session = FullstackContext::extract().await?;
|
||||||
|
session
|
||||||
|
.insert("user_id", user.id)
|
||||||
|
.await
|
||||||
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
||||||
|
|
||||||
|
Ok(UserSafe {
|
||||||
|
id: user.id,
|
||||||
|
username: user.username,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[server]
|
#[server]
|
||||||
pub async fn login(username: String, password: String) -> Result<String, ServerFnError> {
|
pub async fn login(username: String, password: String) -> Result<UserSafe, ServerFnError> {
|
||||||
let db = db::establish_connection()
|
let db = db::establish_connection()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
||||||
@ -76,7 +86,10 @@ pub async fn login(username: String, password: String) -> Result<String, ServerF
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
.map_err(|e| ServerFnError::new(e.to_string()))?;
|
||||||
|
|
||||||
Ok("Anmeldung erfolgreich".to_string())
|
Ok(UserSafe {
|
||||||
|
id: user.id,
|
||||||
|
username: user.username,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[server]
|
#[server]
|
||||||
|
|||||||
@ -8,68 +8,74 @@ pub fn Navbar() -> Element {
|
|||||||
let navigator = use_navigator();
|
let navigator = use_navigator();
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
nav {
|
div {
|
||||||
class: "bg-white shadow-lg border-b border-gray-200",
|
class: "h-screen w-screen flex flex-col overflow-hidden bg-slate-900 text-slate-50",
|
||||||
div {
|
nav {
|
||||||
class: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",
|
class: "bg-slate-900/80 backdrop-blur-md border-b border-white/10 shadow-lg flex-shrink-0 z-50",
|
||||||
div {
|
div {
|
||||||
class: "flex justify-between h-16",
|
class: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",
|
||||||
div {
|
div {
|
||||||
class: "flex items-center",
|
class: "flex justify-between h-16",
|
||||||
Link {
|
|
||||||
to: Route::Home {},
|
|
||||||
class: "flex-shrink-0 flex items-center",
|
|
||||||
div {
|
|
||||||
class: "w-8 h-8 bg-indigo-600 rounded-lg flex items-center justify-center mr-3",
|
|
||||||
span { class: "text-white font-bold text-lg", "W" }
|
|
||||||
}
|
|
||||||
span { class: "text-xl font-bold text-gray-900", "Wichtl" }
|
|
||||||
}
|
|
||||||
div {
|
div {
|
||||||
class: "hidden sm:ml-6 sm:flex sm:space-x-8",
|
class: "flex items-center",
|
||||||
Link {
|
Link {
|
||||||
to: Route::Home {},
|
to: Route::Home {},
|
||||||
class: "text-gray-500 hover:text-gray-900 px-3 py-2 rounded-md text-sm font-medium transition-colors",
|
class: "flex-shrink-0 flex items-center group",
|
||||||
"Startseite"
|
div {
|
||||||
|
class: "w-8 h-8 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-lg flex items-center justify-center mr-3 shadow-lg shadow-indigo-500/20 group-hover:shadow-indigo-500/40 transition-all",
|
||||||
|
span { class: "text-white font-bold text-lg", "W" }
|
||||||
|
}
|
||||||
|
span { class: "text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-white to-slate-400", "Wichtl" }
|
||||||
}
|
}
|
||||||
if let Some(_user) = user_state() {
|
div {
|
||||||
|
class: "hidden sm:ml-6 sm:flex sm:space-x-8",
|
||||||
Link {
|
Link {
|
||||||
to: Route::Dashboard {},
|
to: Route::Home {},
|
||||||
class: "text-gray-500 hover:text-gray-900 px-3 py-2 rounded-md text-sm font-medium transition-colors",
|
class: "text-slate-300 hover:text-white hover:bg-white/5 px-3 py-2 rounded-md text-sm font-medium transition-all",
|
||||||
"Dashboard"
|
"Startseite"
|
||||||
|
}
|
||||||
|
if let Some(_user) = user_state() {
|
||||||
|
Link {
|
||||||
|
to: Route::Dashboard {},
|
||||||
|
class: "text-slate-300 hover:text-white hover:bg-white/5 px-3 py-2 rounded-md text-sm font-medium transition-all",
|
||||||
|
"Dashboard"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
div {
|
||||||
div {
|
class: "flex items-center",
|
||||||
class: "flex items-center",
|
if let Some(user) = user_state() {
|
||||||
if let Some(user) = user_state() {
|
div {
|
||||||
div {
|
class: "flex items-center space-x-4",
|
||||||
class: "flex items-center space-x-4",
|
span { class: "text-slate-400 text-sm", "Willkommen, {user.username}!" }
|
||||||
span { class: "text-gray-700 text-sm", "Willkommen, {user.username}!" }
|
button {
|
||||||
button {
|
class: "text-slate-300 hover:text-white hover:bg-white/5 px-3 py-2 rounded-md text-sm font-medium transition-all",
|
||||||
class: "text-gray-500 hover:text-gray-700 px-3 py-2 rounded-md text-sm font-medium transition-colors",
|
onclick: move |_| async move {
|
||||||
onclick: move |_| async move {
|
if auth::logout().await.is_ok() {
|
||||||
if auth::logout().await.is_ok() {
|
user_state.set(None);
|
||||||
user_state.set(None);
|
navigator.push(Route::Home {});
|
||||||
navigator.push(Route::Home {});
|
}
|
||||||
}
|
},
|
||||||
},
|
"Abmelden"
|
||||||
"Abmelden"
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Link {
|
||||||
|
to: Route::Auth {},
|
||||||
|
class: "bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-500 shadow-lg shadow-indigo-500/20 transition-all",
|
||||||
|
"Anmelden"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Link {
|
|
||||||
to: Route::Auth {},
|
|
||||||
class: "bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-700 transition-colors",
|
|
||||||
"Anmelden"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Outlet::<Route> {}
|
div {
|
||||||
|
class: "flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-700 scrollbar-track-transparent",
|
||||||
|
Outlet::<Route> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,153 +4,100 @@ use dioxus::prelude::*;
|
|||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Auth() -> Element {
|
pub fn Auth() -> Element {
|
||||||
let mut active_tab = use_signal(|| "login".to_string());
|
let mut is_login = use_signal(|| true);
|
||||||
let mut username = use_signal(|| String::new());
|
let mut username = use_signal(|| String::new());
|
||||||
let mut password = use_signal(|| String::new());
|
let mut password = use_signal(|| String::new());
|
||||||
let mut error = use_signal(|| String::new());
|
let mut error = use_signal(|| String::new());
|
||||||
let mut success = use_signal(|| String::new());
|
let mut user_state = use_context::<Signal<Option<auth::UserSafe>>>();
|
||||||
let navigator = use_navigator();
|
let navigator = use_navigator();
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "min-h-screen bg-gradient-to-br from-indigo-50 via-white to-cyan-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",
|
class: "min-h-full py-12 px-4 sm:px-6 lg:px-8 flex items-center justify-center",
|
||||||
div {
|
div {
|
||||||
class: "max-w-md w-full space-y-8",
|
class: "max-w-md w-full space-y-8",
|
||||||
div {
|
div {
|
||||||
class: "text-center",
|
class: "text-center",
|
||||||
div {
|
h2 {
|
||||||
class: "w-16 h-16 bg-indigo-600 rounded-lg flex items-center justify-center mx-auto mb-4",
|
class: "text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 to-purple-400",
|
||||||
span { class: "text-white font-bold text-2xl", "W" }
|
if is_login() { "Willkommen zurück" } else { "Konto erstellen" }
|
||||||
}
|
}
|
||||||
h2 { class: "text-3xl font-bold text-gray-900", if active_tab() == "login" { "Melde dich in deinem Konto an" } else { "Erstelle dein Konto" } }
|
p { class: "mt-2 text-sm text-slate-400",
|
||||||
p { class: "mt-2 text-sm text-gray-600", if active_tab() == "login" { "Noch kein Konto? " } else { "Hast du schon ein Konto? " }
|
if is_login() { "Melde dich an, um deine Wichtel-Runden zu verwalten" } else { "Registriere dich, um loszulegen" }
|
||||||
button {
|
|
||||||
class: "font-medium text-indigo-600 hover:text-indigo-500",
|
|
||||||
onclick: move |_| active_tab.set(if active_tab() == "login" { "register".to_string() } else { "login".to_string() }),
|
|
||||||
if active_tab() == "login" { "Registrieren" } else { "Anmelden" }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
div {
|
||||||
class: "bg-white rounded-lg shadow-lg p-8",
|
class: "bg-slate-800/50 backdrop-blur-md border border-white/10 rounded-2xl p-8 shadow-xl",
|
||||||
|
form {
|
||||||
|
class: "space-y-6",
|
||||||
|
onsubmit: move |e| {
|
||||||
|
e.prevent_default();
|
||||||
|
spawn(async move {
|
||||||
|
let res = if is_login() {
|
||||||
|
auth::login(username(), password()).await
|
||||||
|
} else {
|
||||||
|
auth::register(username(), password()).await
|
||||||
|
};
|
||||||
|
|
||||||
// Tab buttons (hidden, using the link above instead)
|
match res {
|
||||||
|
Ok(user) => {
|
||||||
// Login Form
|
user_state.set(Some(user));
|
||||||
if active_tab() == "login" {
|
navigator.push(Route::Dashboard {});
|
||||||
div {
|
|
||||||
class: "space-y-6",
|
|
||||||
div {
|
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "username", "Benutzername" }
|
|
||||||
input {
|
|
||||||
id: "username",
|
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
|
||||||
placeholder: "Benutzername eingeben",
|
|
||||||
value: "{username}",
|
|
||||||
oninput: move |e| username.set(e.value())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div {
|
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "password", "Passwort" }
|
|
||||||
input {
|
|
||||||
id: "password",
|
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
|
||||||
type: "password",
|
|
||||||
placeholder: "Passwort eingeben",
|
|
||||||
value: "{password}",
|
|
||||||
oninput: move |e| password.set(e.value())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
class: "group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors",
|
|
||||||
onclick: move |_| {
|
|
||||||
let mut user_state = use_context::<Signal<Option<auth::UserSafe>>>();
|
|
||||||
async move {
|
|
||||||
error.set("".to_string());
|
|
||||||
success.set("".to_string());
|
|
||||||
match auth::login(username(), password()).await {
|
|
||||||
Ok(_msg) => {
|
|
||||||
success.set("Login successful".to_string());
|
|
||||||
if let Ok(Some(user)) = auth::get_current_user().await {
|
|
||||||
user_state.set(Some(user));
|
|
||||||
navigator.push(Route::Home {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(e) => error.set(e.to_string()),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
Err(e) => error.set(e.to_string()),
|
||||||
"Anmelden"
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
div {
|
||||||
|
label { class: "block text-xs font-medium text-indigo-300 uppercase tracking-wider mb-2", "for": "username", "Benutzername" }
|
||||||
|
input {
|
||||||
|
id: "username",
|
||||||
|
class: "appearance-none block w-full px-4 py-3 bg-slate-900/50 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all sm:text-sm",
|
||||||
|
placeholder: "Dein Name",
|
||||||
|
value: "{username}",
|
||||||
|
oninput: move |e| username.set(e.value()),
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
label { class: "block text-xs font-medium text-indigo-300 uppercase tracking-wider mb-2", "for": "password", "Passwort" }
|
||||||
|
input {
|
||||||
|
id: "password",
|
||||||
|
class: "appearance-none block w-full px-4 py-3 bg-slate-900/50 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all sm:text-sm",
|
||||||
|
type: "password",
|
||||||
|
placeholder: "••••••••",
|
||||||
|
value: "{password}",
|
||||||
|
oninput: move |e| password.set(e.value()),
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
button {
|
||||||
|
type: "submit",
|
||||||
|
class: "group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-bold rounded-xl text-white bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 shadow-lg shadow-indigo-600/20 hover:shadow-indigo-600/40 transform hover:-translate-y-0.5 transition-all",
|
||||||
|
if is_login() { "Anmelden" } else { "Registrieren" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !error().is_empty() {
|
||||||
|
div {
|
||||||
|
class: "bg-red-900/20 border border-red-500/30 rounded-xl p-4",
|
||||||
|
p { class: "text-sm text-red-400", "{error}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register Form
|
div {
|
||||||
if active_tab() == "register" {
|
class: "mt-6 text-center",
|
||||||
div {
|
button {
|
||||||
class: "space-y-6",
|
class: "text-sm text-indigo-400 hover:text-indigo-300 transition-colors",
|
||||||
div {
|
onclick: move |_| {
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "reg-username", "Benutzername" }
|
is_login.set(!is_login());
|
||||||
input {
|
error.set("".to_string());
|
||||||
id: "reg-username",
|
},
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
if is_login() { "Noch kein Konto? Jetzt registrieren" } else { "Bereits ein Konto? Jetzt anmelden" }
|
||||||
placeholder: "Benutzername wählen",
|
|
||||||
value: "{username}",
|
|
||||||
oninput: move |e| username.set(e.value())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div {
|
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "reg-password", "Passwort" }
|
|
||||||
input {
|
|
||||||
id: "reg-password",
|
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
|
||||||
type: "password",
|
|
||||||
placeholder: "Passwort wählen",
|
|
||||||
value: "{password}",
|
|
||||||
oninput: move |e| password.set(e.value())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
class: "group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors",
|
|
||||||
onclick: move |_| {
|
|
||||||
let mut user_state = use_context::<Signal<Option<auth::UserSafe>>>();
|
|
||||||
async move {
|
|
||||||
error.set("".to_string());
|
|
||||||
success.set("".to_string());
|
|
||||||
match auth::register(username(), password()).await {
|
|
||||||
Ok(_msg) => {
|
|
||||||
// Auto-login after successful registration
|
|
||||||
match auth::login(username(), password()).await {
|
|
||||||
Ok(_login_msg) => {
|
|
||||||
if let Ok(Some(user)) = auth::get_current_user().await {
|
|
||||||
user_state.set(Some(user));
|
|
||||||
navigator.push(Route::Home {});
|
|
||||||
} else {
|
|
||||||
success.set("Registration successful. Please log in.".to_string());
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(login_err) => {
|
|
||||||
error.set(format!("Registration successful but auto-login failed: {}", login_err));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(e) => error.set(e.to_string()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Konto erstellen"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Messages
|
|
||||||
if !error().is_empty() {
|
|
||||||
p { class: "text-red-500 mt-4 text-center text-sm", "{error}" }
|
|
||||||
}
|
|
||||||
if !success().is_empty() {
|
|
||||||
p { class: "text-green-500 mt-4 text-center text-sm", "{success}" }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,16 +12,19 @@ pub fn CreateEvent() -> Element {
|
|||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "min-h-screen bg-gradient-to-br from-indigo-50 via-white to-cyan-50 py-12 px-4 sm:px-6 lg:px-8",
|
class: "min-h-full py-12 px-4 sm:px-6 lg:px-8 flex items-center justify-center",
|
||||||
div {
|
div {
|
||||||
class: "max-w-md mx-auto",
|
class: "max-w-md w-full space-y-8",
|
||||||
div {
|
div {
|
||||||
class: "text-center mb-8",
|
class: "text-center",
|
||||||
h2 { class: "text-3xl font-bold text-gray-900", "Neues Event erstellen" }
|
h2 {
|
||||||
p { class: "mt-2 text-sm text-gray-600", "Richte deine Wichtel-Runde ein" }
|
class: "text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 to-purple-400",
|
||||||
|
"Neues Event"
|
||||||
|
}
|
||||||
|
p { class: "mt-2 text-sm text-slate-400", "Erstelle eine neue Wichtel-Runde" }
|
||||||
}
|
}
|
||||||
div {
|
div {
|
||||||
class: "bg-white rounded-lg shadow-lg p-8",
|
class: "bg-slate-800/50 backdrop-blur-md border border-white/10 rounded-2xl p-8 shadow-xl",
|
||||||
form {
|
form {
|
||||||
class: "space-y-6",
|
class: "space-y-6",
|
||||||
onsubmit: move |e| {
|
onsubmit: move |e| {
|
||||||
@ -34,10 +37,10 @@ pub fn CreateEvent() -> Element {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
div {
|
div {
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "event-name", "Event-Name" }
|
label { class: "block text-xs font-medium text-indigo-300 uppercase tracking-wider mb-2", "for": "event-name", "Event-Name" }
|
||||||
input {
|
input {
|
||||||
id: "event-name",
|
id: "event-name",
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
class: "appearance-none block w-full px-4 py-3 bg-slate-900/50 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all sm:text-sm",
|
||||||
placeholder: "z.B. Familienweihnachten 2024",
|
placeholder: "z.B. Familienweihnachten 2024",
|
||||||
value: "{name}",
|
value: "{name}",
|
||||||
oninput: move |e| name.set(e.value()),
|
oninput: move |e| name.set(e.value()),
|
||||||
@ -45,10 +48,10 @@ pub fn CreateEvent() -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
div {
|
div {
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "event-date", "Event-Datum" }
|
label { class: "block text-xs font-medium text-indigo-300 uppercase tracking-wider mb-2", "for": "event-date", "Event-Datum" }
|
||||||
input {
|
input {
|
||||||
id: "event-date",
|
id: "event-date",
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
class: "appearance-none block w-full px-4 py-3 bg-slate-900/50 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all sm:text-sm",
|
||||||
type: "date",
|
type: "date",
|
||||||
value: "{date}",
|
value: "{date}",
|
||||||
oninput: move |e| date.set(e.value()),
|
oninput: move |e| date.set(e.value()),
|
||||||
@ -56,10 +59,10 @@ pub fn CreateEvent() -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
div {
|
div {
|
||||||
label { class: "block text-sm font-medium text-gray-700", "for": "event-budget", "Budget" }
|
label { class: "block text-xs font-medium text-indigo-300 uppercase tracking-wider mb-2", "for": "event-budget", "Budget" }
|
||||||
input {
|
input {
|
||||||
id: "event-budget",
|
id: "event-budget",
|
||||||
class: "appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",
|
class: "appearance-none block w-full px-4 py-3 bg-slate-900/50 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all sm:text-sm",
|
||||||
placeholder: "z.B. 20 EUR",
|
placeholder: "z.B. 20 EUR",
|
||||||
value: "{budget}",
|
value: "{budget}",
|
||||||
oninput: move |e| budget.set(e.value()),
|
oninput: move |e| budget.set(e.value()),
|
||||||
@ -69,14 +72,14 @@ pub fn CreateEvent() -> Element {
|
|||||||
div {
|
div {
|
||||||
button {
|
button {
|
||||||
type: "submit",
|
type: "submit",
|
||||||
class: "group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors",
|
class: "group relative w-full flex justify-center py-3 px-4 border border-transparent text-sm font-bold rounded-xl text-white bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 shadow-lg shadow-indigo-600/20 hover:shadow-indigo-600/40 transform hover:-translate-y-0.5 transition-all",
|
||||||
"Event erstellen"
|
"Event erstellen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !error().is_empty() {
|
if !error().is_empty() {
|
||||||
div {
|
div {
|
||||||
class: "bg-red-50 border border-red-200 rounded-md p-4",
|
class: "bg-red-900/20 border border-red-500/30 rounded-xl p-4",
|
||||||
p { class: "text-sm text-red-700", "{error}" }
|
p { class: "text-sm text-red-400", "{error}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,71 +10,75 @@ pub fn Dashboard() -> Element {
|
|||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "min-h-screen bg-gradient-to-br from-indigo-50 via-white to-cyan-50 py-8",
|
class: "min-h-full py-12 px-4 sm:px-6 lg:px-8",
|
||||||
div {
|
div {
|
||||||
class: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",
|
class: "max-w-7xl mx-auto",
|
||||||
div {
|
div {
|
||||||
class: "mb-8",
|
class: "flex flex-col md:flex-row md:items-center md:justify-between mb-12",
|
||||||
h1 { class: "text-3xl font-bold text-gray-900", "Meine Events" }
|
div {
|
||||||
p { class: "mt-1 text-sm text-gray-600", "Verwalte deine Wichtel-Runden" }
|
h1 {
|
||||||
}
|
class: "text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 to-purple-400 mb-2",
|
||||||
|
"Meine Events"
|
||||||
|
}
|
||||||
|
p { class: "text-slate-400", "Verwalte deine Wichtel-Runden" }
|
||||||
|
}
|
||||||
|
|
||||||
div {
|
|
||||||
class: "mb-8",
|
|
||||||
Link {
|
Link {
|
||||||
to: Route::CreateEvent {},
|
to: Route::CreateEvent {},
|
||||||
class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors",
|
class: "mt-4 md:mt-0 inline-flex items-center px-6 py-3 border border-transparent text-sm font-bold rounded-xl text-white bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 shadow-lg shadow-indigo-600/20 hover:shadow-indigo-600/40 transform hover:-translate-y-0.5 transition-all",
|
||||||
svg {
|
svg {
|
||||||
class: "w-5 h-5 mr-2",
|
class: "w-5 h-5 mr-2",
|
||||||
fill: "none",
|
fill: "none",
|
||||||
stroke: "currentColor",
|
stroke: "currentColor",
|
||||||
view_box: "0 0 24 24",
|
view_box: "0 0 24 24",
|
||||||
path {
|
path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 6v6m0 0v6m0-6h6m-6 0H6" }
|
||||||
stroke_linecap: "round",
|
|
||||||
stroke_linejoin: "round",
|
|
||||||
stroke_width: "2",
|
|
||||||
d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
"Neues Event"
|
||||||
"Neues Event erstellen"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match (&*created_events.read_unchecked(), &*participated_events.read_unchecked()) {
|
match (&*created_events.read_unchecked(), &*participated_events.read_unchecked()) {
|
||||||
(Some(Ok(created_list)), Some(Ok(participated_list))) => rsx! {
|
(Some(Ok(created_list)), Some(Ok(participated_list))) => rsx! {
|
||||||
div {
|
div {
|
||||||
class: "space-y-8",
|
class: "space-y-12",
|
||||||
// Created Events Section
|
// Created Events Section
|
||||||
if !created_list.is_empty() {
|
if !created_list.is_empty() {
|
||||||
div {
|
div {
|
||||||
div {
|
div {
|
||||||
class: "mb-4",
|
class: "mb-6 flex items-center gap-3",
|
||||||
h2 { class: "text-xl font-semibold text-gray-900", "Erstellte Events" }
|
div { class: "p-2 bg-indigo-500/20 rounded-lg", svg { class: "w-5 h-5 text-indigo-400", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" } } }
|
||||||
p { class: "text-sm text-gray-600", "Wichtel-Events, die du organisiert hast" }
|
h2 { class: "text-2xl font-bold text-white", "Erstellte Events" }
|
||||||
}
|
}
|
||||||
div {
|
div {
|
||||||
class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3",
|
class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3",
|
||||||
for event in created_list {
|
for event in created_list {
|
||||||
div {
|
div {
|
||||||
key: "{event.id}",
|
key: "{event.id}",
|
||||||
class: "bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow border-l-4 border-indigo-500",
|
class: "group bg-slate-800/50 backdrop-blur-sm border border-white/5 rounded-2xl p-6 hover:bg-slate-800/80 transition-all hover:-translate-y-1 shadow-lg",
|
||||||
div {
|
div {
|
||||||
class: "p-6",
|
h3 { class: "text-xl font-bold text-white mb-2 group-hover:text-indigo-400 transition-colors", "{event.name}" }
|
||||||
h3 { class: "text-lg font-semibold text-gray-900 mb-2", "{event.name}" }
|
|
||||||
p { class: "text-gray-600 mb-1", "Datum: {event.date}" }
|
|
||||||
p { class: "text-gray-600 mb-4", "Budget: {event.budget}" }
|
|
||||||
div {
|
div {
|
||||||
class: "flex gap-2",
|
class: "space-y-1 mb-6",
|
||||||
|
p { class: "text-slate-400 text-sm flex items-center gap-2",
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" } }
|
||||||
|
"{event.date}"
|
||||||
|
}
|
||||||
|
p { class: "text-slate-400 text-sm flex items-center gap-2",
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" } }
|
||||||
|
"{event.budget}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
class: "flex gap-3",
|
||||||
Link {
|
Link {
|
||||||
to: Route::EventPage { id: event.id },
|
to: Route::EventPage { id: event.id },
|
||||||
class: "flex-1 text-center px-3 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 transition-colors",
|
class: "flex-1 text-center px-4 py-2 bg-indigo-600 text-white text-sm font-medium rounded-lg hover:bg-indigo-500 transition-colors",
|
||||||
"Event verwalten"
|
"Verwalten"
|
||||||
}
|
}
|
||||||
Link {
|
Link {
|
||||||
to: Route::JoinEvent { token: event.invite_token.clone() },
|
to: Route::JoinEvent { token: event.invite_token.clone() },
|
||||||
class: "px-3 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50 transition-colors",
|
class: "px-4 py-2 border border-slate-600 text-slate-300 text-sm font-medium rounded-lg hover:bg-white/5 hover:text-white transition-colors",
|
||||||
"Einladung teilen"
|
"Teilen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,31 +92,39 @@ pub fn Dashboard() -> Element {
|
|||||||
if !participated_list.is_empty() {
|
if !participated_list.is_empty() {
|
||||||
div {
|
div {
|
||||||
div {
|
div {
|
||||||
class: "mb-4",
|
class: "mb-6 flex items-center gap-3",
|
||||||
h2 { class: "text-xl font-semibold text-gray-900", "Beigetretene Events" }
|
div { class: "p-2 bg-emerald-500/20 rounded-lg", svg { class: "w-5 h-5 text-emerald-400", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" } } }
|
||||||
p { class: "text-sm text-gray-600", "Wichtel-Events, an denen du teilnimmst" }
|
h2 { class: "text-2xl font-bold text-white", "Beigetretene Events" }
|
||||||
}
|
}
|
||||||
div {
|
div {
|
||||||
class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3",
|
class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3",
|
||||||
for event in participated_list {
|
for event in participated_list {
|
||||||
div {
|
div {
|
||||||
key: "{event.id}",
|
key: "{event.id}",
|
||||||
class: "bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow border-l-4 border-green-500",
|
class: "group bg-slate-800/50 backdrop-blur-sm border border-white/5 rounded-2xl p-6 hover:bg-slate-800/80 transition-all hover:-translate-y-1 shadow-lg",
|
||||||
div {
|
div {
|
||||||
class: "p-6",
|
h3 { class: "text-xl font-bold text-white mb-2 group-hover:text-emerald-400 transition-colors", "{event.name}" }
|
||||||
h3 { class: "text-lg font-semibold text-gray-900 mb-2", "{event.name}" }
|
|
||||||
p { class: "text-gray-600 mb-1", "Datum: {event.date}" }
|
|
||||||
p { class: "text-gray-600 mb-4", "Budget: {event.budget}" }
|
|
||||||
div {
|
div {
|
||||||
class: "flex gap-2",
|
class: "space-y-1 mb-6",
|
||||||
|
p { class: "text-slate-400 text-sm flex items-center gap-2",
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" } }
|
||||||
|
"{event.date}"
|
||||||
|
}
|
||||||
|
p { class: "text-slate-400 text-sm flex items-center gap-2",
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" } }
|
||||||
|
"{event.budget}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
class: "flex gap-3",
|
||||||
Link {
|
Link {
|
||||||
to: Route::EventPage { id: event.id },
|
to: Route::EventPage { id: event.id },
|
||||||
class: "flex-1 text-center px-3 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors",
|
class: "flex-1 text-center px-4 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-500 transition-colors",
|
||||||
"Event ansehen"
|
"Ansehen"
|
||||||
}
|
}
|
||||||
Link {
|
Link {
|
||||||
to: Route::JoinEvent { token: event.invite_token.clone() },
|
to: Route::JoinEvent { token: event.invite_token.clone() },
|
||||||
class: "px-3 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50 transition-colors",
|
class: "px-4 py-2 border border-slate-600 text-slate-300 text-sm font-medium rounded-lg hover:bg-white/5 hover:text-white transition-colors",
|
||||||
"Teilen"
|
"Teilen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,24 +138,22 @@ pub fn Dashboard() -> Element {
|
|||||||
// Empty State (no events at all)
|
// Empty State (no events at all)
|
||||||
if created_list.is_empty() && participated_list.is_empty() {
|
if created_list.is_empty() && participated_list.is_empty() {
|
||||||
div {
|
div {
|
||||||
class: "text-center py-12",
|
class: "text-center py-24",
|
||||||
svg {
|
div {
|
||||||
class: "mx-auto h-12 w-12 text-gray-400",
|
class: "inline-flex items-center justify-center w-24 h-24 rounded-full bg-slate-800/50 mb-6",
|
||||||
fill: "none",
|
svg {
|
||||||
stroke: "currentColor",
|
class: "h-12 w-12 text-slate-500",
|
||||||
view_box: "0 0 24 24",
|
fill: "none",
|
||||||
path {
|
stroke: "currentColor",
|
||||||
stroke_linecap: "round",
|
view_box: "0 0 24 24",
|
||||||
stroke_linejoin: "round",
|
path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }
|
||||||
stroke_width: "2",
|
|
||||||
d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h3 { class: "mt-2 text-sm font-medium text-gray-900 mb-2", "Noch keine Events" }
|
h3 { class: "text-xl font-medium text-white mb-2", "Noch keine Events" }
|
||||||
p { class: "mt-1 text-sm text-gray-500 mb-4", "Erstelle dein erstes Wichtel-Event, um loszulegen!" }
|
p { class: "text-slate-400 mb-8 max-w-sm mx-auto", "Erstelle dein erstes Wichtel-Event, um loszulegen!" }
|
||||||
Link {
|
Link {
|
||||||
to: Route::CreateEvent {},
|
to: Route::CreateEvent {},
|
||||||
class: "inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",
|
class: "inline-flex items-center px-6 py-3 border border-transparent shadow-lg shadow-indigo-600/20 text-base font-bold rounded-xl text-white bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 transition-all",
|
||||||
"Event erstellen"
|
"Event erstellen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,39 +162,15 @@ pub fn Dashboard() -> Element {
|
|||||||
},
|
},
|
||||||
(Some(Err(e)), _) | (_, Some(Err(e))) => rsx! {
|
(Some(Err(e)), _) | (_, Some(Err(e))) => rsx! {
|
||||||
div {
|
div {
|
||||||
class: "bg-red-50 border border-red-200 rounded-md p-4",
|
class: "bg-red-900/20 border border-red-500/30 rounded-xl p-6 text-center",
|
||||||
div {
|
h3 { class: "text-lg font-medium text-red-400 mb-2", "Fehler beim Laden" }
|
||||||
class: "flex",
|
p { class: "text-red-300", "{e}" }
|
||||||
div {
|
|
||||||
class: "flex-shrink-0",
|
|
||||||
svg {
|
|
||||||
class: "h-5 w-5 text-red-400",
|
|
||||||
fill: "currentColor",
|
|
||||||
view_box: "0 0 20 20",
|
|
||||||
path {
|
|
||||||
fill_rule: "evenodd",
|
|
||||||
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
||||||
clip_rule: "evenodd"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
div {
|
|
||||||
class: "ml-3",
|
|
||||||
div {
|
|
||||||
class: "ml-3",
|
|
||||||
h3 { class: "text-sm font-medium text-red-800", "Fehler beim Laden der Events" }
|
|
||||||
p { class: "mt-2 text-sm text-red-700", "{e}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => rsx! {
|
_ => rsx! {
|
||||||
div {
|
div {
|
||||||
class: "flex justify-center items-center py-12",
|
class: "flex justify-center items-center py-24",
|
||||||
div {
|
div { class: "animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-500" }
|
||||||
class: "animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,103 +39,136 @@ pub fn EventPage(id: i32) -> Element {
|
|||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "flex flex-col items-center min-h-screen py-2",
|
class: "min-h-full py-12 px-4 sm:px-6 lg:px-8",
|
||||||
h1 { class: "text-2xl font-bold mb-4", "Event-Details" }
|
div {
|
||||||
|
class: "max-w-3xl mx-auto",
|
||||||
|
|
||||||
if let Some(link) = invite_link() {
|
// Header
|
||||||
div {
|
div {
|
||||||
class: "mb-4 p-4 bg-gray-100 rounded",
|
class: "text-center mb-12",
|
||||||
p { class: "font-bold", "Einladungslink:" }
|
h1 {
|
||||||
code { "{link}" }
|
class: "text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 to-purple-400 mb-2",
|
||||||
|
"Event Details"
|
||||||
|
}
|
||||||
|
p { class: "text-slate-400", "Verwalte deine Wichtel-Runde" }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Administrative Controls (only for creator)
|
if let Some(link) = invite_link() {
|
||||||
if is_creator() {
|
|
||||||
div {
|
|
||||||
class: "mb-6 p-4 bg-blue-50 rounded-lg border border-blue-200",
|
|
||||||
h3 { class: "text-lg font-semibold text-blue-900 mb-3", "Event-Verwaltung" }
|
|
||||||
|
|
||||||
// Event Details Editing
|
|
||||||
div {
|
div {
|
||||||
class: "space-y-3",
|
class: "mb-8 bg-slate-800/50 backdrop-blur-sm border border-white/10 rounded-2xl p-6 shadow-xl",
|
||||||
div {
|
div {
|
||||||
class: "flex items-center justify-between",
|
class: "flex flex-col space-y-2",
|
||||||
|
label { class: "text-xs font-semibold text-indigo-400 uppercase tracking-wider", "Einladungslink" }
|
||||||
div {
|
div {
|
||||||
p { class: "text-sm font-medium text-gray-700", "Budget:" }
|
class: "flex items-center gap-2 bg-black/30 rounded-lg p-1 border border-white/5",
|
||||||
if edit_budget() {
|
code { class: "flex-1 p-3 font-mono text-sm text-slate-300 break-all bg-transparent", "{link}" }
|
||||||
div {
|
button {
|
||||||
class: "flex gap-2",
|
class: "p-2 text-slate-400 hover:text-white transition-colors",
|
||||||
|
title: "Kopieren",
|
||||||
|
svg { class: "w-5 h-5", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Administrative Controls (only for creator)
|
||||||
|
if is_creator() {
|
||||||
|
div {
|
||||||
|
class: "mb-8 bg-indigo-900/10 border border-indigo-500/20 rounded-2xl p-6 backdrop-blur-sm",
|
||||||
|
div {
|
||||||
|
class: "flex items-center gap-3 mb-6",
|
||||||
|
div { class: "p-2 bg-indigo-500/20 rounded-lg", svg { class: "w-5 h-5 text-indigo-400", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" } } }
|
||||||
|
h3 { class: "text-lg font-semibold text-white", "Verwaltung" }
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
class: "space-y-4",
|
||||||
|
// Budget
|
||||||
|
div {
|
||||||
|
class: "group flex items-center justify-between p-3 rounded-xl hover:bg-white/5 transition-colors",
|
||||||
|
div {
|
||||||
|
p { class: "text-xs font-medium text-indigo-300 uppercase tracking-wider mb-1", "Budget" }
|
||||||
|
if edit_budget() {
|
||||||
input {
|
input {
|
||||||
class: "border rounded px-2 py-1 text-sm",
|
class: "bg-slate-900/50 border border-slate-600 rounded px-2 py-1 text-sm text-white focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none",
|
||||||
value: "{new_budget}",
|
value: "{new_budget}",
|
||||||
oninput: move |e| new_budget.set(e.value())
|
oninput: move |e| new_budget.set(e.value()),
|
||||||
}
|
autofocus: true
|
||||||
button {
|
|
||||||
class: "px-2 py-1 text-xs bg-green-600 text-white rounded hover:bg-green-700",
|
|
||||||
onclick: move |_| async move {
|
|
||||||
if server_fns::update_event_budget(id, new_budget()).await.is_ok() {
|
|
||||||
edit_budget.set(false);
|
|
||||||
event_details.restart();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Speichern"
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
class: "px-2 py-1 text-xs bg-gray-500 text-white rounded hover:bg-gray-600",
|
|
||||||
onclick: move |_| edit_budget.set(false),
|
|
||||||
"Abbrechen"
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
p { class: "text-white font-medium", "{new_budget}" }
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
div {
|
div {
|
||||||
class: "flex items-center gap-2",
|
if edit_budget() {
|
||||||
p { class: "text-gray-900", "{new_budget}" }
|
div {
|
||||||
|
class: "flex gap-2",
|
||||||
|
button {
|
||||||
|
class: "p-1.5 bg-green-500/20 text-green-400 rounded hover:bg-green-500/30 transition-colors",
|
||||||
|
onclick: move |_| async move {
|
||||||
|
if server_fns::update_event_budget(id, new_budget()).await.is_ok() {
|
||||||
|
edit_budget.set(false);
|
||||||
|
event_details.restart();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M5 13l4 4L19 7" } }
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
class: "p-1.5 bg-red-500/20 text-red-400 rounded hover:bg-red-500/30 transition-colors",
|
||||||
|
onclick: move |_| edit_budget.set(false),
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M6 18L18 6M6 6l12 12" } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
button {
|
button {
|
||||||
class: "px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700",
|
class: "text-slate-500 hover:text-indigo-400 transition-colors",
|
||||||
onclick: move |_| edit_budget.set(true),
|
onclick: move |_| edit_budget.set(true),
|
||||||
"Bearbeiten"
|
"Bearbeiten"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
// Date
|
||||||
class: "flex items-center justify-between",
|
|
||||||
div {
|
div {
|
||||||
p { class: "text-sm font-medium text-gray-700", "Datum:" }
|
class: "group flex items-center justify-between p-3 rounded-xl hover:bg-white/5 transition-colors",
|
||||||
if edit_date() {
|
div {
|
||||||
div {
|
p { class: "text-xs font-medium text-indigo-300 uppercase tracking-wider mb-1", "Datum" }
|
||||||
class: "flex gap-2",
|
if edit_date() {
|
||||||
input {
|
input {
|
||||||
class: "border rounded px-2 py-1 text-sm",
|
class: "bg-slate-900/50 border border-slate-600 rounded px-2 py-1 text-sm text-white focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none",
|
||||||
r#type: "date",
|
r#type: "date",
|
||||||
value: "{new_date}",
|
value: "{new_date}",
|
||||||
oninput: move |e| new_date.set(e.value())
|
oninput: move |e| new_date.set(e.value())
|
||||||
}
|
}
|
||||||
button {
|
} else {
|
||||||
class: "px-2 py-1 text-xs bg-green-600 text-white rounded hover:bg-green-700",
|
p { class: "text-white font-medium", "{new_date}" }
|
||||||
onclick: move |_| async move {
|
|
||||||
if server_fns::update_event_date(id, new_date()).await.is_ok() {
|
|
||||||
edit_date.set(false);
|
|
||||||
event_details.restart();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Speichern"
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
class: "px-2 py-1 text-xs bg-gray-500 text-white rounded hover:bg-gray-600",
|
|
||||||
onclick: move |_| edit_date.set(false),
|
|
||||||
"Abbrechen"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
div {
|
div {
|
||||||
class: "flex items-center gap-2",
|
if edit_date() {
|
||||||
p { class: "text-gray-900", "{new_date}" }
|
div {
|
||||||
|
class: "flex gap-2",
|
||||||
|
button {
|
||||||
|
class: "p-1.5 bg-green-500/20 text-green-400 rounded hover:bg-green-500/30 transition-colors",
|
||||||
|
onclick: move |_| async move {
|
||||||
|
if server_fns::update_event_date(id, new_date()).await.is_ok() {
|
||||||
|
edit_date.set(false);
|
||||||
|
event_details.restart();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M5 13l4 4L19 7" } }
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
class: "p-1.5 bg-red-500/20 text-red-400 rounded hover:bg-red-500/30 transition-colors",
|
||||||
|
onclick: move |_| edit_date.set(false),
|
||||||
|
svg { class: "w-4 h-4", fill: "none", stroke: "currentColor", view_box: "0 0 24 24", path { stroke_linecap: "round", stroke_linejoin: "round", stroke_width: "2", d: "M6 18L18 6M6 6l12 12" } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
button {
|
button {
|
||||||
class: "px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700",
|
class: "text-slate-500 hover:text-indigo-400 transition-colors",
|
||||||
onclick: move |_| edit_date.set(true),
|
onclick: move |_| edit_date.set(true),
|
||||||
"Bearbeiten"
|
"Bearbeiten"
|
||||||
}
|
}
|
||||||
@ -143,90 +176,105 @@ pub fn EventPage(id: i32) -> Element {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Danger Zone
|
// Danger Zone
|
||||||
div {
|
div {
|
||||||
class: "mt-4 pt-4 border-t border-blue-200",
|
class: "mt-6 pt-6 border-t border-indigo-500/20",
|
||||||
h4 { class: "text-sm font-medium text-red-700 mb-2", "Gefahrenzone" }
|
button {
|
||||||
button {
|
class: "text-sm text-red-400 hover:text-red-300 hover:underline transition-colors",
|
||||||
class: "px-3 py-2 text-sm bg-red-600 text-white rounded hover:bg-red-700 transition-colors",
|
onclick: move |_| async move {
|
||||||
onclick: move |_| async move {
|
if let Ok(_) = server_fns::delete_event(id).await {
|
||||||
if let Ok(_) = server_fns::delete_event(id).await {
|
navigator.push(Route::Dashboard {});
|
||||||
navigator.push(Route::Dashboard {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Event löschen"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add Participant Form
|
|
||||||
div {
|
|
||||||
class: "flex gap-2 mb-4",
|
|
||||||
input {
|
|
||||||
class: "border p-2 rounded",
|
|
||||||
placeholder: "Name",
|
|
||||||
value: "{new_participant_name}",
|
|
||||||
oninput: move |e| new_participant_name.set(e.value())
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
class: "border p-2 rounded",
|
|
||||||
placeholder: "E-Mail (Optional)",
|
|
||||||
value: "{new_participant_email}",
|
|
||||||
oninput: move |e| new_participant_email.set(e.value())
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
class: "bg-blue-500 text-white p-2 rounded",
|
|
||||||
onclick: move |_| async move {
|
|
||||||
let email = if new_participant_email().is_empty() { None } else { Some(new_participant_email()) };
|
|
||||||
if server_fns::add_participant(id, new_participant_name(), email).await.is_ok() {
|
|
||||||
participants.restart();
|
|
||||||
new_participant_name.set("".to_string());
|
|
||||||
new_participant_email.set("".to_string());
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Hinzufügen"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Participants List
|
|
||||||
h2 { class: "text-xl font-bold mb-2", "Teilnehmer" }
|
|
||||||
match participants().as_ref() {
|
|
||||||
Some(Ok(list)) => rsx! {
|
|
||||||
div {
|
|
||||||
class: "w-96 mb-4",
|
|
||||||
for p in list {
|
|
||||||
div {
|
|
||||||
key: "{p.id}",
|
|
||||||
class: "flex justify-between items-center border-b p-2",
|
|
||||||
div {
|
|
||||||
class: "flex-1",
|
|
||||||
p { class: "font-medium", "{p.name}" }
|
|
||||||
if let Some(email) = &p.email {
|
|
||||||
p { class: "text-sm text-gray-600", "{email}" }
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"Event löschen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Some(Err(e)) => rsx! { p { class: "text-red-500", "Error: {e}" } },
|
|
||||||
None => rsx! { "Loading..." }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw Button
|
// Participants Section
|
||||||
button {
|
div {
|
||||||
class: "bg-purple-500 text-white p-2 rounded hover:bg-purple-600",
|
class: "bg-slate-800/50 backdrop-blur-sm border border-white/10 rounded-2xl p-6 shadow-xl mb-8",
|
||||||
onclick: move |_| async move {
|
h2 { class: "text-xl font-bold text-white mb-6 flex items-center gap-2",
|
||||||
if let Err(e) = server_fns::draw_names(id).await {
|
span { class: "w-1 h-6 bg-gradient-to-b from-indigo-500 to-purple-500 rounded-full block" }
|
||||||
println!("Error drawing names: {}", e);
|
"Teilnehmer"
|
||||||
} else {
|
|
||||||
println!("Names drawn!");
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Namen auslosen"
|
// Add Form
|
||||||
|
div {
|
||||||
|
class: "flex gap-3 mb-6",
|
||||||
|
input {
|
||||||
|
class: "flex-1 bg-slate-900/50 border border-slate-700 rounded-xl px-4 py-3 text-white placeholder-slate-500 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all",
|
||||||
|
placeholder: "Name",
|
||||||
|
value: "{new_participant_name}",
|
||||||
|
oninput: move |e| new_participant_name.set(e.value())
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
class: "flex-1 bg-slate-900/50 border border-slate-700 rounded-xl px-4 py-3 text-white placeholder-slate-500 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all",
|
||||||
|
placeholder: "E-Mail (Optional)",
|
||||||
|
value: "{new_participant_email}",
|
||||||
|
oninput: move |e| new_participant_email.set(e.value())
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
class: "bg-indigo-600 hover:bg-indigo-500 text-white px-6 py-3 rounded-xl font-medium shadow-lg shadow-indigo-600/20 transition-all",
|
||||||
|
onclick: move |_| async move {
|
||||||
|
let email = if new_participant_email().is_empty() { None } else { Some(new_participant_email()) };
|
||||||
|
if server_fns::add_participant(id, new_participant_name(), email).await.is_ok() {
|
||||||
|
participants.restart();
|
||||||
|
new_participant_name.set("".to_string());
|
||||||
|
new_participant_email.set("".to_string());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Hinzufügen"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List
|
||||||
|
match participants().as_ref() {
|
||||||
|
Some(Ok(list)) => rsx! {
|
||||||
|
div {
|
||||||
|
class: "space-y-3",
|
||||||
|
for p in list {
|
||||||
|
div {
|
||||||
|
key: "{p.id}",
|
||||||
|
class: "group flex items-center justify-between p-4 bg-slate-700/30 border border-white/5 rounded-xl hover:bg-slate-700/50 transition-all",
|
||||||
|
div {
|
||||||
|
class: "flex items-center gap-4",
|
||||||
|
div {
|
||||||
|
class: "w-10 h-10 rounded-full bg-gradient-to-br from-slate-600 to-slate-700 flex items-center justify-center text-white font-bold border border-white/10",
|
||||||
|
"{p.name.chars().next().unwrap_or('?')}"
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
p { class: "font-medium text-white", "{p.name}" }
|
||||||
|
if let Some(email) = &p.email {
|
||||||
|
p { class: "text-sm text-slate-400", "{email}" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Some(Err(e)) => rsx! { p { class: "text-red-400", "Error: {e}" } },
|
||||||
|
None => rsx! {
|
||||||
|
div { class: "flex justify-center py-8", div { class: "animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500" } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw Button
|
||||||
|
button {
|
||||||
|
class: "w-full py-4 bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-500 hover:to-pink-500 text-white text-lg font-bold rounded-2xl shadow-lg shadow-purple-600/20 hover:shadow-purple-600/40 transform hover:-translate-y-0.5 transition-all",
|
||||||
|
onclick: move |_| async move {
|
||||||
|
if let Err(e) = server_fns::draw_names(id).await {
|
||||||
|
println!("Error drawing names: {}", e);
|
||||||
|
} else {
|
||||||
|
println!("Names drawn!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"🎲 Namen auslosen"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,126 +5,51 @@ use dioxus::prelude::*;
|
|||||||
#[component]
|
#[component]
|
||||||
pub fn Home() -> Element {
|
pub fn Home() -> Element {
|
||||||
let user_state = use_context::<Signal<Option<auth::UserSafe>>>();
|
let user_state = use_context::<Signal<Option<auth::UserSafe>>>();
|
||||||
let navigator = use_navigator();
|
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div {
|
div {
|
||||||
class: "min-h-screen bg-gradient-to-br from-indigo-50 via-white to-cyan-50",
|
class: "relative overflow-hidden",
|
||||||
div {
|
// Background decoration
|
||||||
class: "container mx-auto px-6 py-16",
|
div { class: "absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[600px] bg-indigo-600/20 rounded-full blur-3xl -z-10" }
|
||||||
div {
|
div { class: "absolute bottom-0 right-0 w-[800px] h-[600px] bg-purple-600/10 rounded-full blur-3xl -z-10" }
|
||||||
class: "max-w-4xl mx-auto text-center",
|
|
||||||
h1 {
|
|
||||||
class: "text-5xl md:text-6xl font-bold text-gray-900 mb-6",
|
|
||||||
"Willkommen bei ",
|
|
||||||
span { class: "text-indigo-600", "Wichtl" }
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
class: "text-xl text-gray-600 mb-8 max-w-2xl mx-auto",
|
|
||||||
"Die moderne Art, Wichteln zu organisieren. Erstelle Events, lade Freunde ein und lose Namen einfach aus."
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(user) = user_state() {
|
div {
|
||||||
div {
|
class: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-20 pb-16 text-center lg:pt-32",
|
||||||
class: "space-y-4",
|
h1 {
|
||||||
p { class: "text-lg text-gray-700", "Willkommen zurück, {user.username}!" }
|
class: "mx-auto max-w-4xl font-display text-5xl font-medium tracking-tight text-slate-50 sm:text-7xl",
|
||||||
div {
|
"Wichteln "
|
||||||
class: "flex flex-col sm:flex-row gap-4 justify-center",
|
span { class: "relative whitespace-nowrap text-indigo-400",
|
||||||
Link {
|
svg {
|
||||||
to: Route::Dashboard {},
|
class: "absolute -bottom-2 -left-2 -right-2 -top-2 text-indigo-900/50",
|
||||||
class: "bg-indigo-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-indigo-700 transition-colors",
|
view_box: "0 0 400 100",
|
||||||
"Zum Dashboard"
|
fill: "currentColor",
|
||||||
}
|
path { d: "M0 50 Q200 100 400 50 T800 50" } // Simple wave
|
||||||
Link {
|
|
||||||
to: Route::CreateEvent {},
|
|
||||||
class: "bg-white text-indigo-600 border-2 border-indigo-600 px-8 py-3 rounded-lg font-semibold hover:bg-indigo-50 transition-colors",
|
|
||||||
"Neues Event erstellen"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
div {
|
|
||||||
class: "space-y-4",
|
|
||||||
div {
|
|
||||||
class: "flex flex-col sm:flex-row gap-4 justify-center",
|
|
||||||
Link {
|
|
||||||
to: Route::Auth {},
|
|
||||||
class: "bg-indigo-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-indigo-700 transition-colors",
|
|
||||||
"Loslegen"
|
|
||||||
}
|
|
||||||
Link {
|
|
||||||
to: Route::Auth {},
|
|
||||||
class: "bg-white text-indigo-600 border-2 border-indigo-600 px-8 py-3 rounded-lg font-semibold hover:bg-indigo-50 transition-colors",
|
|
||||||
"Anmelden"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p { class: "text-sm text-gray-500", "Kein Konto? Die Registrierung dauert nur 30 Sekunden." }
|
|
||||||
}
|
}
|
||||||
|
span { class: "relative", "leicht gemacht" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p { class: "mx-auto mt-6 max-w-2xl text-lg tracking-tight text-slate-400",
|
||||||
// Features section
|
"Organisiere deine Wichtel-Runden stressfrei und elegant. Erstelle Events, lade Freunde ein und lass den Zufall entscheiden."
|
||||||
|
}
|
||||||
div {
|
div {
|
||||||
class: "mt-20 grid md:grid-cols-3 gap-8 max-w-5xl mx-auto",
|
class: "mt-10 flex justify-center gap-x-6",
|
||||||
div {
|
if let Some(_) = user_state() {
|
||||||
class: "text-center p-6",
|
Link {
|
||||||
div {
|
to: Route::Dashboard {},
|
||||||
class: "w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4",
|
class: "group inline-flex items-center justify-center rounded-full py-3 px-8 text-sm font-semibold focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 bg-slate-50 text-slate-900 hover:bg-slate-200 hover:text-slate-700 active:bg-slate-300 active:text-slate-900 focus-visible:outline-white transition-all shadow-lg hover:shadow-xl",
|
||||||
svg {
|
"Zum Dashboard"
|
||||||
class: "w-8 h-8 text-indigo-600",
|
|
||||||
fill: "none",
|
|
||||||
stroke: "currentColor",
|
|
||||||
view_box: "0 0 24 24",
|
|
||||||
path {
|
|
||||||
stroke_linecap: "round",
|
|
||||||
stroke_linejoin: "round",
|
|
||||||
stroke_width: "2",
|
|
||||||
d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
h3 { class: "text-lg font-semibold text-gray-900 mb-2", "Einfache Event-Erstellung" }
|
} else {
|
||||||
p { class: "text-gray-600", "Erstelle dein Wichtel-Event in Sekunden mit unserer intuitiven Oberfläche." }
|
Link {
|
||||||
}
|
to: Route::Auth {},
|
||||||
div {
|
class: "group inline-flex items-center justify-center rounded-full py-3 px-8 text-sm font-semibold focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 bg-slate-50 text-slate-900 hover:bg-slate-200 hover:text-slate-700 active:bg-slate-300 active:text-slate-900 focus-visible:outline-white transition-all shadow-lg hover:shadow-xl",
|
||||||
class: "text-center p-6",
|
"Jetzt loslegen"
|
||||||
div {
|
|
||||||
class: "w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4",
|
|
||||||
svg {
|
|
||||||
class: "w-8 h-8 text-indigo-600",
|
|
||||||
fill: "none",
|
|
||||||
stroke: "currentColor",
|
|
||||||
view_box: "0 0 24 24",
|
|
||||||
path {
|
|
||||||
stroke_linecap: "round",
|
|
||||||
stroke_linejoin: "round",
|
|
||||||
stroke_width: "2",
|
|
||||||
d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
h3 { class: "text-lg font-semibold text-gray-900 mb-2", "Intelligente Auslosung" }
|
Link {
|
||||||
p { class: "text-gray-600", "Unser Algorithmus sorgt für faire und zufällige Zuweisungen mit optionalen Ausschlüssen." }
|
to: Route::Auth {},
|
||||||
}
|
class: "group inline-flex ring-1 ring-slate-700 ring-inset items-center justify-center rounded-full py-3 px-8 text-sm font-semibold focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 bg-slate-800/50 text-white hover:bg-slate-800 hover:ring-slate-600 active:bg-slate-800 active:text-slate-300 focus-visible:outline-slate-900 transition-all backdrop-blur-sm",
|
||||||
div {
|
"Anmelden"
|
||||||
class: "text-center p-6",
|
|
||||||
div {
|
|
||||||
class: "w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4",
|
|
||||||
svg {
|
|
||||||
class: "w-8 h-8 text-indigo-600",
|
|
||||||
fill: "none",
|
|
||||||
stroke: "currentColor",
|
|
||||||
view_box: "0 0 24 24",
|
|
||||||
path {
|
|
||||||
stroke_linecap: "round",
|
|
||||||
stroke_linejoin: "round",
|
|
||||||
stroke_width: "2",
|
|
||||||
d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
h3 { class: "text-lg font-semibold text-gray-900 mb-2", "Teilen & Einladen" }
|
|
||||||
p { class: "text-gray-600", "Erstelle teilbare Links, um Teilnehmer zu deinem Wichteln einzuladen." }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user