From 55cd69e092634989f7a4e84a7d79552906c2988b Mon Sep 17 00:00:00 2001 From: Kriszti Date: Wed, 27 Mar 2024 14:13:52 +0100 Subject: [PATCH] sub menu fix --- .../Shared/Components/Layout/MainLayout.razor | 12 ++++++------ SharedUI/Shared/Components/Pages/Home.razor | 16 ++++++++++++++++ .../Components/Pages/SoftwareDevelopment.razor | 2 +- SharedUI/Shared/Components/Pages/WebDesign.razor | 2 +- SharedUI/wwwroot/assets/js/scripts.js | 1 - 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/SharedUI/Shared/Components/Layout/MainLayout.razor b/SharedUI/Shared/Components/Layout/MainLayout.razor index f05ec92..0213bea 100644 --- a/SharedUI/Shared/Components/Layout/MainLayout.razor +++ b/SharedUI/Shared/Components/Layout/MainLayout.razor @@ -25,14 +25,14 @@ public static List SubMenu1 = new List { - new NavMenuItem("Weboldal/Applikáció", "/#"), - new NavMenuItem("Landing page", "/#"), - new NavMenuItem("Webdesign", "/#"), - new NavMenuItem("Arculattervezés", "/#"), - new NavMenuItem("Grafikai munkák", "/#"), + new NavMenuItem("Weboldal/Applikáció", "/webdevelopment"), + new NavMenuItem("Landing page", "/landingpage"), + new NavMenuItem("Webdesign", "/webdesign"), + new NavMenuItem("Arculattervezés", "/brand"), + new NavMenuItem("Grafikai munkák", "/graphic"), new NavMenuItem("3D web elemek", "/#"), new NavMenuItem("AI Chatbotok", "/#"), - new NavMenuItem("Egyedi szoftverfejlesztés", "/#"), + new NavMenuItem("Egyedi szoftverfejlesztés", "/softwaredevelopment"), }; diff --git a/SharedUI/Shared/Components/Pages/Home.razor b/SharedUI/Shared/Components/Pages/Home.razor index 7abdf52..405269a 100644 --- a/SharedUI/Shared/Components/Pages/Home.razor +++ b/SharedUI/Shared/Components/Pages/Home.razor @@ -9,6 +9,11 @@ @code { + [Inject] + public IJSRuntime? JSRuntime { get; set; } + + private IJSObjectReference? _jsModule; + public TitlePlusImageModel contentModel1 = new TitlePlusImageModel("Ismerked meg MangoWeb", ContentModel1Description, "https://images.unsplash.com/photo-1540331547168-8b63109225b7?q=80&w=2038&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", CButtons); public static List ContentModel1Description = new List @@ -26,5 +31,16 @@ new ContentButton("Cancel", "#") }; + protected override async Task OnAfterRenderAsync(bool firstRender) + { + base.OnAfterRender(firstRender); + + if (firstRender) + { + _jsModule = await JSRuntime.InvokeAsync("import", "./_content/SharedUI/assets/exampleJsInterop.js"); + await _jsModule.InvokeVoidAsync("getMessage"); + } + } + } diff --git a/SharedUI/Shared/Components/Pages/SoftwareDevelopment.razor b/SharedUI/Shared/Components/Pages/SoftwareDevelopment.razor index 659df58..94480c5 100644 --- a/SharedUI/Shared/Components/Pages/SoftwareDevelopment.razor +++ b/SharedUI/Shared/Components/Pages/SoftwareDevelopment.razor @@ -7,7 +7,7 @@ @code { - public TitlePlusImageModel contentModel1 = new TitlePlusImageModel("Software Development", ContentModel1Description, "https://images.unsplash.com/photo-1540331547168-8b63109225b7?q=80&w=2038&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", CButtons); + public TitlePlusImageModel contentModel1 = new TitlePlusImageModel("Software Development", ContentModel1Description, "https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Nnx8c29mdHdhcmUlMjBkZXZlbG9wbWVudHxlbnwwfHwwfHx8MA%3D%3D", CButtons); public static List ContentModel1Description = new List { diff --git a/SharedUI/Shared/Components/Pages/WebDesign.razor b/SharedUI/Shared/Components/Pages/WebDesign.razor index 77a9d12..0d64ead 100644 --- a/SharedUI/Shared/Components/Pages/WebDesign.razor +++ b/SharedUI/Shared/Components/Pages/WebDesign.razor @@ -6,7 +6,7 @@ @code { - public TitlePlusImageModel contentModel1 = new TitlePlusImageModel("Web Design", ContentModel1Description, "https://unsplash.com/photos/change-by-design-by-tim-brown-book-beside-smartphone-IyaNci0CyRk", CButtons); + public TitlePlusImageModel contentModel1 = new TitlePlusImageModel("Web Design", ContentModel1Description, "https://plus.unsplash.com/premium_photo-1682140914933-f9704d7bc14f?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8ODV8fHNvZnR3YXJlJTIwZGV2ZWxvcG1lbnR8ZW58MHx8MHx8fDA%3D", CButtons); public static List ContentModel1Description = new List { diff --git a/SharedUI/wwwroot/assets/js/scripts.js b/SharedUI/wwwroot/assets/js/scripts.js index 9320176..797c15b 100644 --- a/SharedUI/wwwroot/assets/js/scripts.js +++ b/SharedUI/wwwroot/assets/js/scripts.js @@ -15,7 +15,6 @@ function initMassive() { } -var x = 1;