Skip to content

Commit 116117f

Browse files
Initial commit; Cleaned-up Blazor WebAssembly project template.
0 parents  commit 116117f

33 files changed

Lines changed: 1483 additions & 0 deletions

.gitignore

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
bld/
21+
[Bb]in/
22+
[Oo]bj/
23+
[Ll]og/
24+
25+
# Visual Studio 2015 cache/options directory
26+
.vs/
27+
28+
# MSTest test Results
29+
[Tt]est[Rr]esult*/
30+
[Bb]uild[Ll]og.*
31+
32+
# NUNIT
33+
*.VisualState.xml
34+
TestResult.xml
35+
36+
# Build Results of an ATL Project
37+
[Dd]ebugPS/
38+
[Rr]eleasePS/
39+
dlldata.c
40+
41+
# DNX
42+
project.lock.json
43+
artifacts/
44+
45+
*_i.c
46+
*_p.c
47+
*_i.h
48+
*.ilk
49+
*.meta
50+
*.obj
51+
*.pch
52+
*.pdb
53+
*.pgc
54+
*.pgd
55+
*.rsp
56+
*.sbr
57+
*.tlb
58+
*.tli
59+
*.tlh
60+
*.tmp
61+
*.tmp_proj
62+
*.log
63+
*.vspscc
64+
*.vssscc
65+
.builds
66+
*.pidb
67+
*.svclog
68+
*.scc
69+
70+
# Visual Studio profiler
71+
*.psess
72+
*.vsp
73+
*.vspx
74+
*.sap
75+
76+
# ReSharper is a .NET coding add-in
77+
_ReSharper*/
78+
*.[Rr]e[Ss]harper
79+
*.DotSettings.user
80+
81+
# Publish Web Output
82+
*.[Pp]ublish.xml
83+
*.azurePubxml
84+
# TODO: Comment the next line if you want to checkin your web deploy settings
85+
# but database connection strings (with potential passwords) will be unencrypted
86+
*.pubxml
87+
*.publishproj
88+
89+
# NuGet Packages
90+
*.nupkg
91+
# The packages folder can be ignored because of Package Restore
92+
**/packages/*
93+
# except build/, which is used as an MSBuild target.
94+
!**/packages/build/
95+
# Uncomment if necessary however generally it will be regenerated when needed
96+
#!**/packages/repositories.config
97+
# NuGet v3's project.json files produces more ignoreable files
98+
*.nuget.props
99+
*.nuget.targets
100+
101+
# Microsoft Azure Build Output
102+
csx/
103+
*.build.csdef
104+
105+
# Microsoft Azure Emulator
106+
ecf/
107+
rcf/
108+
109+
# Visual Studio cache files
110+
# files ending in .cache can be ignored
111+
*.[Cc]ache
112+
# but keep track of directories ending in .cache
113+
!*.[Cc]ache/
114+
115+
# Others
116+
ClientBin/
117+
~$*
118+
*~
119+
*.dbmdl
120+
*.dbproj.schemaview
121+
*.pfx
122+
*.publishsettings
123+
node_modules/
124+
orleans.codegen.cs
125+
126+
# SQL Server files
127+
*.mdf
128+
*.ldf
129+
130+
# Microsoft Fakes
131+
FakesAssemblies/
132+
133+
# Visual Studio LightSwitch build output
134+
**/*.HTMLClient/GeneratedArtifacts
135+
**/*.DesktopClient/GeneratedArtifacts
136+
**/*.DesktopClient/ModelManifest.xml
137+
**/*.Server/GeneratedArtifacts
138+
**/*.Server/ModelManifest.xml
139+
_Pvt_Extensions
140+
141+
# Paket dependency manager
142+
.paket/paket.exe
143+
144+
# FAKE - F# Make
145+
.fake/
146+
147+
**/*appsettings.Development.json
148+
**/local.settings.json

TodoAppBlazorWebAssembly.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33627.172
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoAppBlazorWebAssembly.Server", "TodoAppBlazorWebAssembly\Server\TodoAppBlazorWebAssembly.Server.csproj", "{E37F4D66-A215-49E6-A640-8C659CD10406}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoAppBlazorWebAssembly.Client", "TodoAppBlazorWebAssembly\Client\TodoAppBlazorWebAssembly.Client.csproj", "{AE678B1A-68AE-4732-B194-643DAF339F83}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoAppBlazorWebAssembly.Shared", "TodoAppBlazorWebAssembly\Shared\TodoAppBlazorWebAssembly.Shared.csproj", "{83FBE9C1-D8BE-4295-9774-66A9A3F704F6}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{E37F4D66-A215-49E6-A640-8C659CD10406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{E37F4D66-A215-49E6-A640-8C659CD10406}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{E37F4D66-A215-49E6-A640-8C659CD10406}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{E37F4D66-A215-49E6-A640-8C659CD10406}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{AE678B1A-68AE-4732-B194-643DAF339F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{AE678B1A-68AE-4732-B194-643DAF339F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{AE678B1A-68AE-4732-B194-643DAF339F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{AE678B1A-68AE-4732-B194-643DAF339F83}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{83FBE9C1-D8BE-4295-9774-66A9A3F704F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{83FBE9C1-D8BE-4295-9774-66A9A3F704F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{83FBE9C1-D8BE-4295-9774-66A9A3F704F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{83FBE9C1-D8BE-4295-9774-66A9A3F704F6}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {C1E02A9B-1478-48A9-8595-CDDC97A998BF}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@page "/"
2+
3+
<PageTitle>Index</PageTitle>
4+
5+
<h1>Hello, world!</h1>
6+
7+
Welcome to your new app.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.AspNetCore.Components.Web;
2+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
3+
using TodoAppBlazorWebAssembly.Client;
4+
5+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6+
builder.RootComponents.Add<App>("#app");
7+
builder.RootComponents.Add<HeadOutlet>("head::after");
8+
9+
builder.Services.AddScoped(sp =>
10+
new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
11+
12+
await builder.Build().RunAsync();
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:52268",
7+
"sslPort": 44307
8+
}
9+
},
10+
"profiles": {
11+
"http": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16+
"applicationUrl": "http://localhost:5197",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"https": {
22+
"commandName": "Project",
23+
"dotnetRunMessages": true,
24+
"launchBrowser": true,
25+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
26+
"applicationUrl": "https://localhost:7288;http://localhost:5197",
27+
"environmentVariables": {
28+
"ASPNETCORE_ENVIRONMENT": "Development"
29+
}
30+
},
31+
"IIS Express": {
32+
"commandName": "IISExpress",
33+
"launchBrowser": true,
34+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
35+
"environmentVariables": {
36+
"ASPNETCORE_ENVIRONMENT": "Development"
37+
}
38+
}
39+
}
40+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-card-checklist" viewBox="0 0 16 16">
2+
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z" />
3+
<path d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z" />
4+
</svg>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="page">
4+
<main>
5+
<div class="top-row px-4" style="justify-content: space-between;">
6+
<div style="display: flex; align-items: center;">
7+
<div><ChecklistIcon /></div>
8+
<div style="margin-left: 5px;"><b>Todo List</b></div>
9+
</div>
10+
<div>
11+
<a href="https://www.claudiobernasconi.ch" target="_blank">Blog</a>
12+
<a href="https://youtube.com/claudiobernasconi" target="_blank">YouTube</a>
13+
<a href="https://twitter.com/CHBernasconiC" target="_blank">Twitter</a>
14+
</div>
15+
</div>
16+
17+
<article class="content px-4">
18+
@Body
19+
</article>
20+
</main>
21+
</div>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
29+
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
38+
39+
@media (max-width: 640.98px) {
40+
.top-row:not(.auth) {
41+
display: none;
42+
}
43+
44+
.top-row.auth {
45+
justify-content: space-between;
46+
}
47+
48+
.top-row ::deep a, .top-row ::deep .btn-link {
49+
margin-left: 0;
50+
}
51+
}
52+
53+
@media (min-width: 641px) {
54+
.page {
55+
flex-direction: row;
56+
}
57+
58+
.sidebar {
59+
width: 250px;
60+
height: 100vh;
61+
position: sticky;
62+
top: 0;
63+
}
64+
65+
.top-row {
66+
position: sticky;
67+
top: 0;
68+
z-index: 1;
69+
}
70+
71+
.top-row.auth ::deep a:first-child {
72+
flex: 1;
73+
text-align: right;
74+
width: 0;
75+
}
76+
77+
.top-row, article {
78+
padding-left: 2rem !important;
79+
padding-right: 1.5rem !important;
80+
}
81+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\Shared\TodoAppBlazorWebAssembly.Shared.csproj" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)