feat: redesign homepage layout and fix invite links
- Homepage: Grid-Layout mit 3 Karten (Spiel erstellen, KI, Freunde/Beitreten) statt vertikalem Stack mit Dividers - CreateGame: kompakteres Styling, auf Deutsch, in Primary-Card integriert - Einladungslink: APP_URL statt hardcoded ches.su in GamePage und CopyLink - JoinGame: URL-Parsing für beliebige Domains (nicht nur ches.su) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,35 +33,35 @@ export default function CreateGame() {
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="form-control" onSubmit={submitCreateGame}>
|
||||
<label className="label cursor-pointer">
|
||||
<span className="label-text">Unlisted/invite-only</span>
|
||||
<input type="checkbox" className="checkbox" name="createUnlisted" id="createUnlisted" />
|
||||
<form className="flex flex-col gap-3" onSubmit={submitCreateGame}>
|
||||
<label className="flex items-center justify-between cursor-pointer">
|
||||
<span className="label-text text-sm">Nur per Einladung</span>
|
||||
<input type="checkbox" className="checkbox checkbox-primary checkbox-sm" name="createUnlisted" id="createUnlisted" />
|
||||
</label>
|
||||
<label className="label" htmlFor="createStartingSide">
|
||||
<span className="label-text">Select your side</span>
|
||||
</label>
|
||||
<div className="input-group">
|
||||
<div className="flex gap-2">
|
||||
<select
|
||||
className="select select-bordered"
|
||||
className="select select-bordered select-sm flex-1"
|
||||
name="createStartingSide"
|
||||
id="createStartingSide"
|
||||
>
|
||||
<option value="random">Random</option>
|
||||
<option value="white">White</option>
|
||||
<option value="black">Black</option>
|
||||
<option value="random">Zufällig</option>
|
||||
<option value="white">Weiß</option>
|
||||
<option value="black">Schwarz</option>
|
||||
</select>
|
||||
<button
|
||||
className={
|
||||
"btn" +
|
||||
"btn btn-primary btn-sm" +
|
||||
(buttonLoading ? " loading" : "") +
|
||||
(!session?.user?.id ? " btn-disabled text-base-content" : "")
|
||||
(!session?.user?.id ? " btn-disabled" : "")
|
||||
}
|
||||
type="submit"
|
||||
>
|
||||
Create
|
||||
Erstellen
|
||||
</button>
|
||||
</div>
|
||||
{!session?.user?.id && (
|
||||
<p className="text-xs opacity-60">Bitte einloggen um ein Spiel zu erstellen</p>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ export default function JoinGame() {
|
||||
|
||||
setButtonLoading(true);
|
||||
|
||||
if (code.startsWith("ches.su")) {
|
||||
code = "http://" + code;
|
||||
if (!code.startsWith("http") && code.includes("/")) {
|
||||
code = "https://" + code;
|
||||
}
|
||||
if (code.startsWith("http")) {
|
||||
code = new URL(code).pathname.split("/")[1];
|
||||
|
||||
Reference in New Issue
Block a user