diff --git a/src/CraftSharp/CraftSharp.csproj b/src/CraftSharp/CraftSharp.csproj index a53aa86..03f17a1 100644 --- a/src/CraftSharp/CraftSharp.csproj +++ b/src/CraftSharp/CraftSharp.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -10,7 +10,20 @@ + + + + + + + + + + + + + diff --git a/src/CraftSharp/CraftSharp.sln b/src/CraftSharp/CraftSharp.sln index 5b7bccb..6662f16 100644 --- a/src/CraftSharp/CraftSharp.sln +++ b/src/CraftSharp/CraftSharp.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftSharp", "CraftSharp.csproj", "{C299F384-0C85-4A98-998B-D2704C557CC0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CraftSharp", "CraftSharp.csproj", "{C299F384-0C85-4A98-998B-D2704C557CC0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/CraftSharp/Models/ConnexionModel.cs b/src/CraftSharp/Models/ConnexionModel.cs new file mode 100644 index 0000000..d5f5bb3 --- /dev/null +++ b/src/CraftSharp/Models/ConnexionModel.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; + +namespace CraftSharp.Models +{ + public class ConnexionModel + { + [Required(ErrorMessage = "Le pseudo est obligatoire.")] + [StringLength(50, ErrorMessage = "Le pseudo est trop long")] + public string? Name { get; set; } + + [Required(ErrorMessage = "Le mot de passe est obligatoire.")] + [StringLength(50, ErrorMessage = "Le mot de passe est trop long")] + public string? Password { get; set; } + } +} diff --git a/src/CraftSharp/Models/InscriptionModel.cs b/src/CraftSharp/Models/InscriptionModel.cs new file mode 100644 index 0000000..c3d0dc2 --- /dev/null +++ b/src/CraftSharp/Models/InscriptionModel.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; + +namespace CraftSharp.Models +{ + public class InscriptionModel + { + + [Required(ErrorMessage ="Le pseudo est obligatoire.")] + [StringLength(50, ErrorMessage = "Le pseudo est trop long")] + public string? Pseudo { get; set; } + + [Required(ErrorMessage = "L'email est obligatoire.")] + [StringLength(50, ErrorMessage = "Le nom ne doit pas dépasser 50 caractères.")] + [RegularExpression(@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$", ErrorMessage = "Le format de l'email n'est pas correcte.")] + public string? Email { get; set; } + + [Required(ErrorMessage = "Le mot de passe est obligatoire.")] + [StringLength(50, ErrorMessage = "Le mot de passe est trop long")] + public string? Password { get; set; } + + [Required(ErrorMessage = "Vous devez confirmer votre mot de passe")] + [StringLength(50, ErrorMessage = "Le pseudo est trop long")] + public string? ConfirmPasswd { get; set; } + } +} diff --git a/src/CraftSharp/Pages/Component.razor b/src/CraftSharp/Pages/Component.razor new file mode 100644 index 0000000..bef1674 --- /dev/null +++ b/src/CraftSharp/Pages/Component.razor @@ -0,0 +1,5 @@ +

Component

+ +@code { + +} diff --git a/src/CraftSharp/Pages/Connexion.razor b/src/CraftSharp/Pages/Connexion.razor new file mode 100644 index 0000000..9503ebc --- /dev/null +++ b/src/CraftSharp/Pages/Connexion.razor @@ -0,0 +1,37 @@ +@page "/connexion" +@layout InscriptionLayout +@inject NavigationManager NavManager + +
+

Connexion

+
+ + + + +
+

+ +

+

+ +

+
+
+ +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/src/CraftSharp/Pages/Connexion.razor.cs b/src/CraftSharp/Pages/Connexion.razor.cs new file mode 100644 index 0000000..2e3bf9a --- /dev/null +++ b/src/CraftSharp/Pages/Connexion.razor.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Logging; +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Components; +using CraftSharp.Models; + +namespace CraftSharp.Pages +{ + public partial class Connexion + { + private readonly ConnexionModel connexion = new(); + + private string _connexionId = "test"; + private string _connexionPasswrd = "test"; + + private void seConnecter() { + if (connexion.Name == _connexionId && connexion.Password == _connexionPasswrd) + { + NavManager.NavigateTo("/counter"); + } + } + } +} diff --git a/src/CraftSharp/Pages/Connexion.razor.css b/src/CraftSharp/Pages/Connexion.razor.css new file mode 100644 index 0000000..900d369 --- /dev/null +++ b/src/CraftSharp/Pages/Connexion.razor.css @@ -0,0 +1,60 @@ + + +.option { + margin-left: auto; + margin-right: auto; + width: 500px +} + +button:hover { + background: url('Images/btn2.png') no-repeat; +} + +h1 { + color: white; + font-family: Minecraft; + margin-left: 25%; + margin-right: 25%; +} + +.choix { + display: flex; + justify-content: space-around; +} + +object{ + visibility: hidden; +} + +button { + width: 12rem; + text-decoration: none; + text-align: center; + color: white; + cursor: pointer; + background: url('Images/btn1.png') no-repeat; + font-family: SilkscreenNormal; + line-height: 26px; + padding-top: 6px; + font-family: Minecraft; +} + +InputText{ + width: 100%; +} + +.ecrire { + margin-left: auto; + margin-right: auto; + width: 6em +} + +label { + width: 15rem; +} + +.editForm { + margin-left: 25%; + margin-right: 25%; + width: 100%; +} \ No newline at end of file diff --git a/src/CraftSharp/Pages/Inscription.razor b/src/CraftSharp/Pages/Inscription.razor new file mode 100644 index 0000000..b3b10c0 --- /dev/null +++ b/src/CraftSharp/Pages/Inscription.razor @@ -0,0 +1,50 @@ +@page "/inscription" +@layout InscriptionLayout +@inject NavigationManager NavManager + +
+

Inscription

+
+ + + + +
+

+ +

+

+ +

+

+ +

+

+ +

+
+
+ +
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/src/CraftSharp/Pages/Inscription.razor.cs b/src/CraftSharp/Pages/Inscription.razor.cs new file mode 100644 index 0000000..f301d29 --- /dev/null +++ b/src/CraftSharp/Pages/Inscription.razor.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Logging; +using System; +using System.ComponentModel.DataAnnotations; +using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Components; +using CraftSharp.Models; + +namespace CraftSharp.Pages +{ + public partial class Inscription + { + private readonly InscriptionModel inscription = new(); + + private void inscrire() + { + } + } +} diff --git a/src/CraftSharp/Pages/Inscription.razor.css b/src/CraftSharp/Pages/Inscription.razor.css new file mode 100644 index 0000000..1d4e742 --- /dev/null +++ b/src/CraftSharp/Pages/Inscription.razor.css @@ -0,0 +1,60 @@ + + +.option { + margin-left: auto; + margin-right: auto; + width: 500px +} + +button:hover { + background: url('Images/btn2.png') no-repeat; +} + +h1 { + color: white; + font-family: Minecraft; + margin-left: 25%; + margin-right: 25%; +} + +.choix { + display: flex; + justify-content: space-around; +} + +object { + visibility: hidden; +} + +button { + width: 12rem; + text-decoration: none; + text-align: center; + color: white; + cursor: pointer; + background: url('Images/btn1.png') no-repeat; + font-family: SilkscreenNormal; + line-height: 26px; + padding-top: 6px; + font-family: Minecraft; +} + +InputText { + width: 100%; +} + +.ecrire { + margin-left: auto; + margin-right: auto; + width: 6em +} + +label { + width: 15rem; +} + +.editForm { + margin-left: 25%; + margin-right: 25%; + width: 100%; +} diff --git a/src/CraftSharp/Program.cs b/src/CraftSharp/Program.cs index 9a940f5..2f651d1 100644 --- a/src/CraftSharp/Program.cs +++ b/src/CraftSharp/Program.cs @@ -1,4 +1,5 @@ using CraftSharp.Data; +using CraftSharp.Pages; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; @@ -11,6 +12,7 @@ builder.Services.AddSingleton(); var app = builder.Build(); + // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { diff --git a/src/CraftSharp/Shared/InscriptionLayout.razor b/src/CraftSharp/Shared/InscriptionLayout.razor new file mode 100644 index 0000000..a2b2f06 --- /dev/null +++ b/src/CraftSharp/Shared/InscriptionLayout.razor @@ -0,0 +1,18 @@ +@inherits LayoutComponentBase +@inject NavigationManager navigationManager + +
+ +
+ +
+ + @Body + +
+

Craft# 1.0

+

Copyright KARTAL Emre, VALIN Arthur, HASSOU Rayhan

+
+
+ + diff --git a/src/CraftSharp/Shared/InscriptionLayout.razor.cs b/src/CraftSharp/Shared/InscriptionLayout.razor.cs new file mode 100644 index 0000000..347eaf0 --- /dev/null +++ b/src/CraftSharp/Shared/InscriptionLayout.razor.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.JSInterop; +using System.Reflection.Metadata; + +namespace CraftSharp.Shared +{ + public partial class InscriptionLayout + { + void getBack() + { + navigationManager.NavigateTo("Home"); + } + } +} diff --git a/src/CraftSharp/Shared/InscriptionLayout.razor.css b/src/CraftSharp/Shared/InscriptionLayout.razor.css new file mode 100644 index 0000000..44ef2e8 --- /dev/null +++ b/src/CraftSharp/Shared/InscriptionLayout.razor.css @@ -0,0 +1,53 @@ +@font-face { + font-family: "Minecraft"; + src: url("fonts/Minecraft.ttf") format("truetype"); +} + +body { + background-image: url("images/fond.jpg"); + height: 100% +} + +.connexionBody { + background-image: url("images/fond.jpg"); + width: 100%; + min-height: 100vh; +} + +header img{ + width: 50%; + display: block; + margin-left: auto; + margin-right: auto; +} + +footer { + position: absolute; + bottom: 0px; + width: 100%; + display:flex; + justify-content: space-between; +} + +footer p{ + color : white; + font-family: Minecraft; +} + +.p2{ + float: right; +} + +button { + width: 12rem; + text-decoration: none; + text-align: center; + color: white; + cursor: pointer; + background: url('Images/btn1.png') no-repeat; + font-family: SilkscreenNormal; + line-height: 26px; + padding-top: 6px; + font-family: Minecraft; +} + diff --git a/src/CraftSharp/wwwroot/audio/audio.mp3 b/src/CraftSharp/wwwroot/audio/audio.mp3 new file mode 100644 index 0000000..c908214 Binary files /dev/null and b/src/CraftSharp/wwwroot/audio/audio.mp3 differ diff --git a/src/CraftSharp/wwwroot/audio/audio.mp4 b/src/CraftSharp/wwwroot/audio/audio.mp4 new file mode 100644 index 0000000..719cac3 Binary files /dev/null and b/src/CraftSharp/wwwroot/audio/audio.mp4 differ diff --git a/src/CraftSharp/wwwroot/audio/bouton.mp3 b/src/CraftSharp/wwwroot/audio/bouton.mp3 new file mode 100644 index 0000000..3e07c0f Binary files /dev/null and b/src/CraftSharp/wwwroot/audio/bouton.mp3 differ diff --git a/src/CraftSharp/wwwroot/fonts/minecraft.zip b/src/CraftSharp/wwwroot/fonts/minecraft.zip new file mode 100644 index 0000000..5301162 Binary files /dev/null and b/src/CraftSharp/wwwroot/fonts/minecraft.zip differ diff --git a/src/CraftSharp/wwwroot/fonts/minecraft/Minecraft.ttf b/src/CraftSharp/wwwroot/fonts/minecraft/Minecraft.ttf new file mode 100644 index 0000000..85c1472 Binary files /dev/null and b/src/CraftSharp/wwwroot/fonts/minecraft/Minecraft.ttf differ diff --git a/src/CraftSharp/wwwroot/images/CraftSharp-Logo.png b/src/CraftSharp/wwwroot/images/CraftSharp-Logo.png new file mode 100644 index 0000000..1932dd0 Binary files /dev/null and b/src/CraftSharp/wwwroot/images/CraftSharp-Logo.png differ diff --git a/src/CraftSharp/wwwroot/images/btn1.png b/src/CraftSharp/wwwroot/images/btn1.png new file mode 100644 index 0000000..a49a1eb Binary files /dev/null and b/src/CraftSharp/wwwroot/images/btn1.png differ diff --git a/src/CraftSharp/wwwroot/images/btn2.png b/src/CraftSharp/wwwroot/images/btn2.png new file mode 100644 index 0000000..fe10fb2 Binary files /dev/null and b/src/CraftSharp/wwwroot/images/btn2.png differ diff --git a/src/CraftSharp/wwwroot/images/fond.jpg b/src/CraftSharp/wwwroot/images/fond.jpg new file mode 100644 index 0000000..6dff98a Binary files /dev/null and b/src/CraftSharp/wwwroot/images/fond.jpg differ diff --git a/src/CraftSharp/wwwroot/index.html b/src/CraftSharp/wwwroot/index.html new file mode 100644 index 0000000..125a5a8 --- /dev/null +++ b/src/CraftSharp/wwwroot/index.html @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file