Login remake

This commit is contained in:
2026-05-20 16:38:20 +02:00
parent 428812cda5
commit c48180e1b8
3 changed files with 284 additions and 86 deletions
+138 -19
View File
@@ -1,31 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.image.ImageView?>
<StackPane xmlns="http://javafx.com/javafx/21"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="it.polimi.ingsw.gc14.View.GUI.LoginFXMLController"
prefWidth="1280" prefHeight="720"
style="-fx-background-color: #09060300;">
<VBox spacing="10" alignment="CENTER_LEFT"
xmlns:fx="http://javafx.com/fxml"
fx:controller="it.polimi.ingsw.gc14.View.GUI.LoginFXMLController">
<ImageView fx:id="backgroundImage" fitWidth="1920" fitHeight="1080" preserveRatio="false"/>
<padding><Insets top="40" right="40" bottom="40" left="40"/></padding>
<!-- Corner decorations -->
<Region prefWidth="52" prefHeight="52"
style="-fx-border-color: rgba(200,120,20,0.35); -fx-border-width: 1.5 0 0 1.5;"
StackPane.alignment="TOP_LEFT">
<StackPane.margin><Insets top="18" left="18"/></StackPane.margin>
</Region>
<Region prefWidth="52" prefHeight="52"
style="-fx-border-color: rgba(200,120,20,0.35); -fx-border-width: 1.5 1.5 0 0;"
StackPane.alignment="TOP_RIGHT">
<StackPane.margin><Insets top="18" right="18"/></StackPane.margin>
</Region>
<Region prefWidth="52" prefHeight="52"
style="-fx-border-color: rgba(200,120,20,0.35); -fx-border-width: 0 0 1.5 1.5;"
StackPane.alignment="BOTTOM_LEFT">
<StackPane.margin><Insets bottom="18" left="18"/></StackPane.margin>
</Region>
<Region prefWidth="52" prefHeight="52"
style="-fx-border-color: rgba(200,120,20,0.35); -fx-border-width: 0 1.5 1.5 0;"
StackPane.alignment="BOTTOM_RIGHT">
<StackPane.margin><Insets bottom="18" right="18"/></StackPane.margin>
</Region>
<Label text="Nome utente:"/>
<TextField fx:id="campoNome" promptText="Nome utente"/>
<!-- Central panel -->
<VBox fx:id="formPanel" alignment="CENTER" spacing="0" maxWidth="420" maxHeight="600"
StackPane.alignment="CENTER"
style="-fx-background-color: rgba(9,6,3,0.72);
-fx-border-color: rgba(200,120,20,0.40);
-fx-border-width: 1;
-fx-border-radius: 4;
-fx-background-radius: 4;
-fx-effect: dropshadow(gaussian, rgba(0,0,0,0.7), 40, 0, 0, 8);">
<padding><Insets top="44" bottom="44" left="48" right="48"/></padding>
<Label text="Num. giocatori:"/>
<TextField fx:id="campoNumPlayers" promptText="Numero di giocatori"/>
<!-- Title -->
<Label text="MESOS"
style="-fx-font-family: 'Cinzel Decorative'; -fx-font-size: 28; -fx-font-weight: bold;
-fx-text-fill: #f4c05a;
-fx-effect: dropshadow(gaussian, rgba(244,192,90,0.4), 28, 0, 0, 0);">
<VBox.margin><Insets bottom="4"/></VBox.margin>
</Label>
<Label text="Protocollo:"/>
<RadioButton fx:id="btnRMI" text="RMI" selected="true"/>
<RadioButton fx:id="btnTCP" text="TCP"/>
<!-- Divider -->
<Region prefHeight="1" prefWidth="260"
style="-fx-background-color: linear-gradient(to right, transparent, #c8791a, #f4c05a, #c8791a, transparent);">
<VBox.margin><Insets top="10" bottom="30"/></VBox.margin>
</Region>
<Label text="IP server:"/>
<TextField fx:id="campoIP" promptText="IP server"/>
<!-- Username -->
<Label text="USERNAME"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 9; -fx-letter-spacing: 3;
-fx-text-fill: rgba(244,192,90,0.7);">
<VBox.margin><Insets bottom="6"/></VBox.margin>
</Label>
<TextField fx:id="campoNome" promptText="Enter your name"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12;
-fx-text-fill: #f0e0c0; -fx-prompt-text-fill: rgba(200,150,80,0.45);
-fx-background-color: rgba(244,192,90,0.07);
-fx-border-color: rgba(200,120,20,0.45); -fx-border-width: 0 0 1 0;
-fx-background-radius: 0; -fx-border-radius: 0;
-fx-padding: 10 12 10 12;">
<VBox.margin><Insets bottom="20"/></VBox.margin>
</TextField>
<Label text="Interfaccia di rete:"/>
<ComboBox fx:id="comboInterfaccia" maxWidth="Infinity"/>
<!-- Num players -->
<Label text="NUMBER OF PLAYERS"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 9; -fx-letter-spacing: 3;
-fx-text-fill: rgba(244,192,90,0.7);">
<VBox.margin><Insets bottom="6"/></VBox.margin>
</Label>
<TextField fx:id="campoNumPlayers" promptText="2 5"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12;
-fx-text-fill: #f0e0c0; -fx-prompt-text-fill: rgba(200,150,80,0.45);
-fx-background-color: rgba(244,192,90,0.07);
-fx-border-color: rgba(200,120,20,0.45); -fx-border-width: 0 0 1 0;
-fx-background-radius: 0; -fx-border-radius: 0;
-fx-padding: 10 12 10 12;">
<VBox.margin><Insets bottom="20"/></VBox.margin>
</TextField>
<Label fx:id="labelErrore" style="-fx-text-fill: red;"/>
<Button fx:id="btnAccedi" text="Connetti"/>
<!-- Server IP -->
<Label text="SERVER IP"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 9; -fx-letter-spacing: 3;
-fx-text-fill: rgba(244,192,90,0.7);">
<VBox.margin><Insets bottom="6"/></VBox.margin>
</Label>
<TextField fx:id="campoIP" promptText="localhost"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12;
-fx-text-fill: #f0e0c0; -fx-prompt-text-fill: rgba(200,150,80,0.45);
-fx-background-color: rgba(244,192,90,0.07);
-fx-border-color: rgba(200,120,20,0.45); -fx-border-width: 0 0 1 0;
-fx-background-radius: 0; -fx-border-radius: 0;
-fx-padding: 10 12 10 12;">
<VBox.margin><Insets bottom="20"/></VBox.margin>
</TextField>
</VBox>
<!-- Protocol toggle -->
<Label text="PROTOCOL"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 9; -fx-letter-spacing: 3;
-fx-text-fill: rgba(244,192,90,0.7);">
<VBox.margin><Insets bottom="8"/></VBox.margin>
</Label>
<StackPane fx:id="protocolToggle" prefWidth="220" maxWidth="220" prefHeight="36" alignment="CENTER_LEFT">
<VBox.margin><Insets bottom="28"/></VBox.margin>
<Region prefWidth="220" prefHeight="36"
style="-fx-background-color: rgba(244,192,90,0.07);
-fx-border-color: rgba(200,120,20,0.45);
-fx-border-width: 1; -fx-border-radius: 2; -fx-background-radius: 2;"/>
<Region fx:id="toggleThumb" prefWidth="110" maxWidth="110" prefHeight="36"
style="-fx-background-color: linear-gradient(to right, #f4c05a, #c8791a);
-fx-background-radius: 2;"
StackPane.alignment="CENTER_LEFT"/>
<HBox prefWidth="220" prefHeight="36">
<Label fx:id="labelRMI" text="RMI" prefWidth="110" prefHeight="36" alignment="CENTER"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 11; -fx-font-weight: bold;
-fx-text-fill: #0c0601;"/>
<Label fx:id="labelTCP" text="TCP" prefWidth="110" prefHeight="36" alignment="CENTER"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 11; -fx-font-weight: bold;
-fx-text-fill: rgba(244,192,90,0.55);"/>
</HBox>
</StackPane>
<!-- Error label -->
<Label fx:id="labelErrore" maxWidth="Infinity" wrapText="true" textAlignment="CENTER"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 10; -fx-text-fill: #e05050;
-fx-min-height: 18;">
<VBox.margin><Insets bottom="16"/></VBox.margin>
</Label>
<!-- Connect button -->
<Button fx:id="btnAccedi" text="CONNECT" maxWidth="Infinity"
style="-fx-font-family: 'Cinzel'; -fx-font-size: 12; -fx-font-weight: bold;
-fx-letter-spacing: 4; -fx-text-fill: #0c0601;
-fx-background-color: linear-gradient(to right, #f4c05a, #c8791a, #f4c05a);
-fx-padding: 13 48 13 48; -fx-background-radius: 2;
-fx-cursor: hand;"/>
</VBox>
</StackPane>