├── .gitignore ├── App.razor ├── BlazorExamples.csproj ├── Data ├── WeatherForecast.cs └── WeatherForecastService.cs ├── Domain └── TrafficLight │ ├── GetReadyToGoState.cs │ ├── GetReadyToStopState.cs │ ├── GoState.cs │ ├── ITrafficLightState.cs │ └── StopState.cs ├── Pages ├── Examples │ ├── Counter.razor │ ├── Error.razor │ ├── FetchData.razor │ ├── MarkdownEditor │ │ ├── Editor.razor │ │ └── Editor.razor.cs │ ├── Nav │ │ ├── Index.razor │ │ ├── NavBar.razor │ │ ├── NavElement.razor │ │ └── NavItem.cs │ ├── StateViaUrl │ │ ├── Index.razor │ │ ├── MovieComparer.razor │ │ └── MovieDatabase.cs │ └── TrafficLight │ │ ├── TrafficLight.razor │ │ ├── TrafficLight.razor.cs │ │ ├── TrafficLightPM.razor │ │ └── TrafficLightPM.razor.cs ├── Index.razor └── _Host.cshtml ├── Program.cs ├── Properties └── launchSettings.json ├── Shared ├── Banner.razor ├── MainLayout.razor └── NavMenu.razor ├── Startup.cs ├── _Imports.razor ├── appsettings.Development.json ├── appsettings.json └── wwwroot ├── css ├── bootstrap │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── open-iconic │ ├── FONT-LICENSE │ ├── ICON-LICENSE │ ├── README.md │ └── font │ │ ├── css │ │ └── open-iconic-bootstrap.min.css │ │ └── fonts │ │ ├── open-iconic.eot │ │ ├── open-iconic.otf │ │ ├── open-iconic.svg │ │ ├── open-iconic.ttf │ │ └── open-iconic.woff └── site.css └── favicon.ico /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #Ignore thumbnails created by Windows 3 | Thumbs.db 4 | #Ignore files built by Visual Studio 5 | *.obj 6 | *.exe 7 | *.pdb 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | [Tt]est[Rr]esult* 30 | .vs/ 31 | #Nuget packages folder 32 | packages/ 33 | /node_modules/ 34 | /.idea/ 35 | -------------------------------------------------------------------------------- /App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /BlazorExamples.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | BlazorExamples 6 | BlazorExamples 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <_ContentIncludedByDefault Remove="Examples\Counter.razor" /> 16 | <_ContentIncludedByDefault Remove="Examples\Error.razor" /> 17 | <_ContentIncludedByDefault Remove="Examples\FetchData.razor" /> 18 | <_ContentIncludedByDefault Remove="Examples\MarkdownEditor\Editor.razor" /> 19 | <_ContentIncludedByDefault Remove="Examples\TrafficLight\TrafficLight.razor" /> 20 | <_ContentIncludedByDefault Remove="Examples\TrafficLight\TrafficLightPM.razor" /> 21 | <_ContentIncludedByDefault Remove="Pages\Examples\ProgressBar\Index.razor" /> 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorExamples.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int) (TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorExamples.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Domain/TrafficLight/GetReadyToGoState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorExamples.Domain.TrafficLight 2 | { 3 | public class GetReadyToGoState : ITrafficLightState 4 | { 5 | public bool RedOn { get; } = true; 6 | public bool AmberOn { get; } = true; 7 | public bool GreenOn { get; } = false; 8 | } 9 | } -------------------------------------------------------------------------------- /Domain/TrafficLight/GetReadyToStopState.cs: -------------------------------------------------------------------------------- 1 | using BlazorExamples.Pages; 2 | 3 | namespace BlazorExamples.Domain.TrafficLight 4 | { 5 | public class GetReadyToStopState : ITrafficLightState 6 | { 7 | public bool RedOn { get; } = false; 8 | public bool AmberOn { get; } = true; 9 | public bool GreenOn { get; } = false; 10 | } 11 | } -------------------------------------------------------------------------------- /Domain/TrafficLight/GoState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorExamples.Domain.TrafficLight 2 | { 3 | public class GoState : ITrafficLightState 4 | { 5 | public bool RedOn { get; } = false; 6 | public bool AmberOn { get; } = false; 7 | public bool GreenOn { get; } = true; 8 | } 9 | } -------------------------------------------------------------------------------- /Domain/TrafficLight/ITrafficLightState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorExamples.Domain.TrafficLight 2 | { 3 | public interface ITrafficLightState 4 | { 5 | bool RedOn { get; } 6 | bool AmberOn { get; } 7 | bool GreenOn { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /Domain/TrafficLight/StopState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorExamples.Domain.TrafficLight 2 | { 3 | public class StopState : ITrafficLightState 4 | { 5 | public bool RedOn { get; } = true; 6 | public bool AmberOn { get; } = false; 7 | public bool GreenOn { get; } = false; 8 | } 9 | } -------------------------------------------------------------------------------- /Pages/Examples/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pages/Examples/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /Pages/Examples/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @using BlazorExamples.Data 3 | @inject WeatherForecastService ForecastService 4 | 5 |

Weather forecast

6 | 7 |

This component demonstrates fetching data from a service.

8 | 9 | @if (forecasts == null) 10 | { 11 |

Loading...

12 | } 13 | else 14 | { 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var forecast in forecasts) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
36 | } 37 | 38 | @code { 39 | private WeatherForecast[] forecasts; 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Pages/Examples/MarkdownEditor/Editor.razor: -------------------------------------------------------------------------------- 1 | @page "/markdown" 2 | @inherits MarkdownEditorBase 3 | 4 |
5 |
6 |

Markdown

7 | 8 |
9 |
10 |

HTML Preview

11 | @((MarkupString) Preview) 12 |
13 |
-------------------------------------------------------------------------------- /Pages/Examples/MarkdownEditor/Editor.razor.cs: -------------------------------------------------------------------------------- 1 | using Markdig; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace BlazorExamples.Pages.Examples.MarkdownEditor 5 | { 6 | public class MarkdownEditorBase : ComponentBase 7 | { 8 | public string Body { get; set; } = string.Empty; 9 | public string Preview => Markdown.ToHtml(Body); 10 | } 11 | } -------------------------------------------------------------------------------- /Pages/Examples/Nav/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/Nav" 2 | 3 | 4 | 5 | @code { 6 | 7 | 8 | 9 | } -------------------------------------------------------------------------------- /Pages/Examples/Nav/NavBar.razor: -------------------------------------------------------------------------------- 1 | @using System.ComponentModel.Design 2 |

NavBar

3 | 4 | @if (subMenus != null) 5 | { 6 | 14 | } 15 | 16 | @code { 17 | 18 | List subMenus; 19 | NavSubMenu selectedSubMenu; 20 | 21 | // is the passed in menu the currently selected menu? 22 | bool isSelectedMenu(NavSubMenu subMenu) => subMenu == selectedSubMenu; 23 | 24 | protected override void OnInitialized() 25 | { 26 | // using a little bit of local state here to drive the UI 27 | // also useful for keeping track of which menu is selected 28 | 29 | var subMenuA = new NavSubMenu("General"); 30 | subMenuA.AddItem(new NavItem("Home", "/")); 31 | subMenuA.AddItem(new NavItem("About", "/about")); 32 | 33 | var subMenuB = new NavSubMenu("Admin"); 34 | subMenuB.AddItem(new NavItem("Manage", "/admin/manage")); 35 | subMenuB.AddItem(new NavItem("Backup", "/admin/backup")); 36 | 37 | subMenus = new List { subMenuA, subMenuB }; 38 | 39 | base.OnInitialized(); 40 | } 41 | 42 | private void Select(NavSubMenu subMenu) 43 | { 44 | selectedSubMenu = subMenu; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /Pages/Examples/Nav/NavElement.razor: -------------------------------------------------------------------------------- 1 |

@Item?.Title

2 | 3 | @if (Expanded) 4 | { 5 |
    6 | @foreach (var item in Item.Items) 7 | { 8 |
  • 9 | @item.Name 10 |
  • 11 | } 12 |
13 | } 14 | 15 | @code { 16 | 17 | [Parameter] 18 | public NavSubMenu Item { get; set; } 19 | 20 | [Parameter] 21 | public bool Expanded { get; set; } 22 | 23 | } -------------------------------------------------------------------------------- /Pages/Examples/Nav/NavItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace BlazorExamples.Pages.Examples.Nav; 4 | 5 | public class NavSubMenu 6 | { 7 | public NavSubMenu(string Title) 8 | { 9 | this.Title = Title; 10 | } 11 | 12 | public string Title { get; set; } 13 | public List Items { get; private set; } 14 | 15 | public void AddItem(NavItem item) 16 | { 17 | Items ??= new List(); 18 | Items.Add(item); 19 | } 20 | } 21 | 22 | public record NavItem(string Name, string Link) 23 | { 24 | public string Link { get; set; } = Link; 25 | public string Name { get; set; } = Name; 26 | } -------------------------------------------------------------------------------- /Pages/Examples/StateViaUrl/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/state" 2 | @inject MovieDatabase MovieDatabase 3 | @inject NavigationManager NavigationManager 4 | 5 |

Select your favourites from the following films

6 | 7 |
    8 | @foreach (var film in possibleFilms) 9 | { 10 |
  • 11 | @film.Title 12 |
  • 13 | } 14 |
15 | 16 | 17 | 18 | @code { 19 | 20 | private readonly List selectedFilms = new(); 21 | 22 | private List possibleFilms; 23 | 24 | protected override Task OnInitializedAsync() 25 | { 26 | possibleFilms = MovieDatabase.GetMovies().ToList(); 27 | return base.OnInitializedAsync(); 28 | } 29 | 30 | private void FilmSelected(Movie film, ChangeEventArgs changeEventArgs) 31 | { 32 | if (changeEventArgs.Value != null && (bool)changeEventArgs.Value) 33 | { 34 | selectedFilms.Add(film); 35 | } 36 | else 37 | { 38 | selectedFilms.Remove(film); 39 | } 40 | } 41 | 42 | private async Task CompareFilms() 43 | { 44 | if (selectedFilms?.Any() ?? false) 45 | { 46 | var readOnlyDictionary = new Dictionary 47 | { 48 | ["film"] = "1", 49 | ["film"] = "2", 50 | }; 51 | 52 | var uri = NavigationManager.GetUriWithQueryParameters(readOnlyDictionary); 53 | 54 | var queryString = string.Join("&", selectedFilms.Select(x=>"film=" + x.Id)); 55 | NavigationManager.NavigateTo("/MovieComparer?" + queryString); 56 | } 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /Pages/Examples/StateViaUrl/MovieComparer.razor: -------------------------------------------------------------------------------- 1 | @page "/MovieComparer" 2 | @inject MovieDatabase MovieDatabase 3 | 4 |

MovieComparer

5 | 6 |
    7 | @foreach (var movie in movieDetails) 8 | { 9 |
  • 10 | @movie.Title 11 |

    @movie.Plot

    12 |
  • 13 | } 14 |
15 | 16 | @code { 17 | 18 | [Parameter] 19 | [SupplyParameterFromQuery(Name = "film")] 20 | public int[] Films { get; set; } 21 | 22 | private IEnumerable movieDetails; 23 | 24 | protected override Task OnInitializedAsync() 25 | { 26 | movieDetails = MovieDatabase.GetMovies(Films); 27 | return Task.CompletedTask; 28 | } 29 | } -------------------------------------------------------------------------------- /Pages/Examples/StateViaUrl/MovieDatabase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace BlazorExamples.Pages.Examples.StateViaUrl; 5 | 6 | public record Movie(int Id, string Title, string Year, string Plot); 7 | 8 | public class MovieDatabase 9 | { 10 | private readonly IEnumerable _movies = new List 11 | { 12 | new Movie(1, "Star Trek II The Wrath of Khan", "1982", 13 | "With the assistance of the Enterprise crew, Admiral Kirk must stop an old nemesis, Khan Noonien Singh, from using the life-generating Genesis Device as the ultimate weapon"), 14 | new Movie(2, "The Matrix", "1999", 15 | "When a beautiful stranger leads computer hacker Neo to a forbidding underworld, he discovers the shocking truth -- the life he knows is the elaborate deception of an evil cyber-intelligence"), 16 | new Movie(3, "Paddington", "2014", "A young Peruvian bear travels to London in search of a home"), 17 | new Movie(4, "Trolls", "2016", 18 | "After the Bergens invade Troll Village, Poppy, the happiest Troll ever born, and the curmudgeonly Branch set off on a journey to rescue her friends.") 19 | }; 20 | 21 | public IEnumerable GetMovies() 22 | { 23 | return _movies; 24 | } 25 | 26 | public IEnumerable GetMovies(IEnumerable ids) 27 | { 28 | return _movies.Where(x => ids.Contains(x.Id)); 29 | } 30 | } -------------------------------------------------------------------------------- /Pages/Examples/TrafficLight/TrafficLight.razor: -------------------------------------------------------------------------------- 1 | @page "/trafficlight" 2 | @inherits TrafficLightBase 3 | 4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 12 |
13 | 16 |
-------------------------------------------------------------------------------- /Pages/Examples/TrafficLight/TrafficLight.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace BlazorExamples.Pages.Examples.TrafficLight 4 | { 5 | public enum State 6 | { 7 | Stop, 8 | GetReadyToGo, 9 | Go, 10 | GetReadyToStop 11 | } 12 | 13 | public class TrafficLightState 14 | { 15 | public bool RedOn { get; } 16 | public bool AmberOn { get; } 17 | public bool GreenOn { get; } 18 | 19 | public TrafficLightState(bool redOn, bool amberOn, bool greenOn) 20 | { 21 | RedOn = redOn; 22 | AmberOn = amberOn; 23 | GreenOn = greenOn; 24 | } 25 | 26 | public static TrafficLightState Resolve(State state) 27 | { 28 | return state switch 29 | { 30 | State.Stop => new TrafficLightState(true, false, false), 31 | State.GetReadyToGo => new TrafficLightState(true, true, false), 32 | State.Go => new TrafficLightState(false, false, true), 33 | State.GetReadyToStop => new TrafficLightState(false, true, false), 34 | _ => new TrafficLightState(true, false, false) 35 | }; 36 | } 37 | } 38 | 39 | public class TrafficLightBase : ComponentBase 40 | { 41 | private State _currentState = State.Stop; 42 | protected TrafficLightState Lights => 43 | TrafficLightState.Resolve(_currentState); 44 | 45 | public void Toggle() 46 | { 47 | _currentState = _currentState switch 48 | { 49 | State.Stop => State.GetReadyToGo, 50 | State.GetReadyToGo => State.Go, 51 | State.Go => State.GetReadyToStop, 52 | State.GetReadyToStop => State.Stop, 53 | _ => _currentState 54 | }; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Pages/Examples/TrafficLight/TrafficLightPM.razor: -------------------------------------------------------------------------------- 1 | @page "/trafficlightPM" 2 | @inherits TrafficLightBasePM 3 | 4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 12 |
13 | 16 |
-------------------------------------------------------------------------------- /Pages/Examples/TrafficLight/TrafficLightPM.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BlazorExamples.Domain.TrafficLight; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace BlazorExamples.Pages.Examples.TrafficLight 6 | { 7 | public class TrafficLightBasePM : ComponentBase 8 | { 9 | protected ITrafficLightState Lights { get; set; } = new StopState(); 10 | 11 | protected void Toggle() 12 | { 13 | Lights = Lights switch 14 | { 15 | StopState _ => new GetReadyToGoState(), 16 | GetReadyToGoState _ => new GoState(), 17 | GoState _ => new GetReadyToStopState(), 18 | GetReadyToStopState _ => new StopState(), 19 | _ => throw new ArgumentOutOfRangeException(nameof(Lights)) 20 | }; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

First attempt

4 | 5 | 6 | 7 |

Second attempt using pattern matching

8 | 9 | -------------------------------------------------------------------------------- /Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorExamples.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BlazorExamples 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace BlazorExamples 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }); 16 | } 17 | } -------------------------------------------------------------------------------- /Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51900", 7 | "sslPort": 44378 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "MiniWalkthrough": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5002;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Shared/Banner.razor: -------------------------------------------------------------------------------- 1 | @inject Blazored.LocalStorage.ILocalStorageService localStorage 2 | 3 | @if (_visible) 4 | { 5 | 9 | } 10 | 11 | @code { 12 | 13 | private bool _visible = false; 14 | 15 | private async Task Dismiss() 16 | { 17 | _visible = false; 18 | await localStorage.SetItemAsync("bannerDismissed", true); 19 | } 20 | 21 | protected override bool ShouldRender() 22 | { 23 | var shouldRender = base.ShouldRender(); 24 | return shouldRender; 25 | } 26 | 27 | protected override async Task OnAfterRenderAsync(bool firstRender) 28 | { 29 | if (firstRender) 30 | { 31 | _visible = !await localStorage.GetItemAsync("bannerDismissed"); 32 | StateHasChanged(); 33 | } 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | 14 | @Body 15 |
16 |
-------------------------------------------------------------------------------- /Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 41 |
42 | 43 | @code { 44 | private bool collapseNavMenu = true; 45 | 46 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 47 | 48 | private void ToggleNavMenu() 49 | { 50 | collapseNavMenu = !collapseNavMenu; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /Startup.cs: -------------------------------------------------------------------------------- 1 | using Blazored.LocalStorage; 2 | using BlazorExamples.Data; 3 | using BlazorExamples.Pages.Examples.StateViaUrl; 4 | using Microsoft.AspNetCore.Builder; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Microsoft.Extensions.Hosting; 9 | 10 | namespace BlazorExamples 11 | { 12 | public class Startup 13 | { 14 | public Startup(IConfiguration configuration) 15 | { 16 | Configuration = configuration; 17 | } 18 | 19 | public IConfiguration Configuration { get; } 20 | 21 | // This method gets called by the runtime. Use this method to add services to the container. 22 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 23 | public void ConfigureServices(IServiceCollection services) 24 | { 25 | services.AddRazorPages(); 26 | services.AddServerSideBlazor(); 27 | services.AddSingleton(); 28 | services.AddBlazoredLocalStorage(); 29 | services.AddSingleton(); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | else 40 | { 41 | app.UseExceptionHandler("/Error"); 42 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 43 | app.UseHsts(); 44 | } 45 | 46 | app.UseHttpsRedirection(); 47 | app.UseStaticFiles(); 48 | 49 | app.UseRouting(); 50 | 51 | app.UseEndpoints(endpoints => 52 | { 53 | endpoints.MapBlazorHub(); 54 | endpoints.MapFallbackToPage("/_Host"); 55 | }); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using BlazorExamples.Shared 9 | @using BlazorExamples.Pages.Examples 10 | @using BlazorExamples.Pages.Examples.TrafficLight -------------------------------------------------------------------------------- /appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonhilt/BlazorExamples/1895b91b650270640bbee76a520aa2f3139ee3ad/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonhilt/BlazorExamples/1895b91b650270640bbee76a520aa2f3139ee3ad/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonhilt/BlazorExamples/1895b91b650270640bbee76a520aa2f3139ee3ad/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonhilt/BlazorExamples/1895b91b650270640bbee76a520aa2f3139ee3ad/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: flex; 20 | flex-direction: column; 21 | } 22 | 23 | .top-row { 24 | height: 3.5rem; 25 | display: flex; 26 | align-items: center; 27 | } 28 | 29 | .lights { 30 | padding: 1em; 31 | border: 1px solid grey; 32 | width: 6em; 33 | background-color: #343a40; 34 | } 35 | 36 | .lights div { 37 | margin-bottom: 0.5em; 38 | border: 2px solid grey; 39 | width: 4em; 40 | height: 4em; 41 | border-radius: 50%; 42 | } 43 | 44 | div.red.on { 45 | background-color: red; 46 | } 47 | 48 | div.amber.on { 49 | background-color: orange; 50 | } 51 | 52 | div.green.on { 53 | background-color: green; 54 | } 55 | 56 | .banner { 57 | padding: 1em; 58 | text-align: center; 59 | vertical-align: center; 60 | background-color: orangered; 61 | color: white; 62 | font-size: 1.2em; 63 | } 64 | 65 | .banner .btn { 66 | color: white; 67 | } 68 | 69 | .main { 70 | flex: 1; 71 | } 72 | 73 | .main .top-row { 74 | background-color: #f7f7f7; 75 | border-bottom: 1px solid #d6d5d5; 76 | justify-content: flex-end; 77 | } 78 | 79 | .main .top-row > a, .main .top-row .btn-link { 80 | white-space: nowrap; 81 | margin-left: 1.5rem; 82 | } 83 | 84 | .main .top-row a:first-child { 85 | overflow: hidden; 86 | text-overflow: ellipsis; 87 | } 88 | 89 | .sidebar { 90 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 91 | } 92 | 93 | .sidebar .top-row { 94 | background-color: rgba(0,0,0,0.4); 95 | } 96 | 97 | .sidebar .navbar-brand { 98 | font-size: 1.1rem; 99 | } 100 | 101 | .sidebar .oi { 102 | width: 2rem; 103 | font-size: 1.1rem; 104 | vertical-align: text-top; 105 | top: -2px; 106 | } 107 | 108 | .sidebar .nav-item { 109 | font-size: 0.9rem; 110 | padding-bottom: 0.5rem; 111 | } 112 | 113 | .sidebar .nav-item:first-of-type { 114 | padding-top: 1rem; 115 | } 116 | 117 | .sidebar .nav-item:last-of-type { 118 | padding-bottom: 1rem; 119 | } 120 | 121 | .sidebar .nav-item a { 122 | color: #d7d7d7; 123 | border-radius: 4px; 124 | height: 3rem; 125 | display: flex; 126 | align-items: center; 127 | line-height: 3rem; 128 | } 129 | 130 | .sidebar .nav-item a.active { 131 | background-color: rgba(255,255,255,0.25); 132 | color: white; 133 | } 134 | 135 | .sidebar .nav-item a:hover { 136 | background-color: rgba(255,255,255,0.1); 137 | color: white; 138 | } 139 | 140 | .content { 141 | padding-top: 1.1rem; 142 | } 143 | 144 | .navbar-toggler { 145 | background-color: rgba(255, 255, 255, 0.1); 146 | } 147 | 148 | .valid.modified:not([type=checkbox]) { 149 | outline: 1px solid #26b050; 150 | } 151 | 152 | .invalid { 153 | outline: 1px solid red; 154 | } 155 | 156 | .validation-message { 157 | color: red; 158 | } 159 | 160 | #blazor-error-ui { 161 | background: lightyellow; 162 | bottom: 0; 163 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 164 | display: none; 165 | left: 0; 166 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 167 | position: fixed; 168 | width: 100%; 169 | z-index: 1000; 170 | } 171 | 172 | #blazor-error-ui .dismiss { 173 | cursor: pointer; 174 | position: absolute; 175 | right: 0.75rem; 176 | top: 0.5rem; 177 | } 178 | 179 | @media (max-width: 767.98px) { 180 | .main .top-row:not(.auth) { 181 | display: none; 182 | } 183 | 184 | .main .top-row.auth { 185 | justify-content: space-between; 186 | } 187 | 188 | .main .top-row a, .main .top-row .btn-link { 189 | margin-left: 0; 190 | } 191 | } 192 | 193 | @media (min-width: 768px) { 194 | app { 195 | flex-direction: row; 196 | } 197 | 198 | .sidebar { 199 | width: 250px; 200 | height: 100vh; 201 | position: sticky; 202 | top: 0; 203 | } 204 | 205 | .main .top-row { 206 | position: sticky; 207 | top: 0; 208 | } 209 | 210 | .main > div { 211 | padding-left: 2rem !important; 212 | padding-right: 1.5rem !important; 213 | } 214 | 215 | .navbar-toggler { 216 | display: none; 217 | } 218 | 219 | .sidebar .collapse { 220 | /* Never collapse the sidebar for wide screens */ 221 | display: block; 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonhilt/BlazorExamples/1895b91b650270640bbee76a520aa2f3139ee3ad/wwwroot/favicon.ico --------------------------------------------------------------------------------