BlazorMurals is a Blazor WebAssembly single-page gallery application built with .NET 10.
It is designed for fast, flexible, and content-driven art or photo galleries, with all content managed via a simple JSON file and static assets.
- Dynamic Gallery: Albums and images are loaded from a JSON file (
galleryData.json)—no code changes required to update content. - Responsive UI: Modern, mobile-friendly layout with smooth transitions and animations.
- Image Carousel: Full-screen modal carousel with fade/zoom effects, keyboard navigation, and image captions.
- 18+ Legal Affirmation Modal: Optional mature content gate, configurable via
appsettings.json, requiring user affirmation before viewing the site. - Theme Support: Light/dark mode, user preference saved in localStorage.
- Animated Thumbnails: Album thumbnails feature slow zoom and opacity transitions on hover.
- Accessible: Keyboard navigation for albums and carousel, focus management, and ARIA labels.
- No Backend Required: All data and assets are served statically from
wwwroot.
- .NET 10
- Blazor WebAssembly (client-side)
- C# 14
- Razor components for UI (
.razor) - Static assets in
wwwroot(images, GIFs, CSS, data) - Styling: plain CSS in
wwwroot/css/app.css - Optional: Bootstrap for basic button and layout styles
Pages/Home.razor— landing page showing featured albums and artist/contact info.Gallery.razor— gallery index page.
Shared/AlbumGallery.razor— grid of album cards.AlbumCarousel.razor— full-screen modal carousel with image title, description, and thumbnails.
Shared/Models/Album.cs— domain model:AlbumandAlbumImage.GalleryData.cs— root container for JSON deserialization.
wwwroot/data/galleryData.json— content file for all albums, images, artist, and contact info (editable at runtime).css/app.css— global styles and component sizing (thumbnails, carousel, modals).images/— image and GIF assets referenced ingalleryData.json.appsettings.json— site configuration (theme, 18+ modal, etc).js/site.js— all site JavaScript (theme, legal modal, etc).
- Solution/project files at repository root (open with Visual Studio or
dotnetCLI).
GalleryDataList<Album> AlbumsArtist(object, e.g. name, bio, photo)Contact(object, e.g. email, message)
Albumstring Id,Title,Description,DateCreated,Thumbnail(album cover),List<AlbumImage> Images
AlbumImagestring Id,Title,Description,DateCreated,Thumbnail,ImagePath
- The app reads
wwwroot/data/galleryData.jsonat runtime viaHttpClientand deserializes it intoGalleryData. - Each album's
Thumbnailmaps to the album cover; each image hasThumbnail(small) andImagePath(full image shown in carousel). - If
ImagePathis missing, the app falls back toThumbnail(code already ensures this). - Artist and contact info are also loaded from
galleryData.jsonand displayed on the homepage.
- Controlled by the
RequireLegalAffirmationflag inwwwroot/appsettings.json. - If enabled, users must confirm they are 18+ before accessing the site.
- The modal appears full-screen on first visit (or if not affirmed), and sets a flag in
localStorageif the user affirms. - If the user selects "No", they are redirected to Google.
- All logic and styles are in
js/site.jsandcss/app.css.
- Open the solution in Visual Studio (2026 recommended).
- Set the Blazor WebAssembly project as the startup project.
- Start debugging with F5 or run without debugging using Debug > Start Without Debugging.
- Ensure .NET 10 SDK is installed and on your PATH.
- From repo root:
- Restore:
dotnet restore
- Build:
dotnet build
- Run (project name may vary; replace
<Project.csproj>if needed):dotnet run --project ./YourBlazorProjectName.csproj
- For WebAssembly standalone the local dev server will host the app (check console output for URL, usually
https://localhost:5001or similar).
- Restore:
- Publish the WebAssembly project: