Skip to content

Commit

Permalink
Update to .NET 8 and include source-link bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferStrube committed Feb 18, 2024
1 parent 20d5289 commit 63bcdb7
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RunAOTCompilation>true</RunAOTCompilation>
<RunAOTCompilation>false</RunAOTCompilation>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PageTitle>Animation</PageTitle>

<textarea @bind="Input" @bind:event="oninput" style="width:100%;height:150px;" />
<div style="height:80vh">
<div style="height:75vh">
<SVGEditor Input=@Input InputUpdated="(string s) => { Input = s; StateHasChanged(); }" SnapToInteger=true />
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/"

<textarea @bind="Input" @bind:event="oninput" style="width:100%;height:15vh;" />
<div style="height:80vh">
<div style="height:75vh">
<SVGEditor Input=@Input InputUpdated="(string s) => { Input = s; StateHasChanged(); }" SelectionMode="SelectionMode.WindowSelection" />
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
</div>
<textarea @bind="Input" @bind:event="oninput" style="width:100%;height:15vh;" />
<div style="height:75vh">
<div style="height:70vh">
<SVGEditor @ref=@SVG Input=@Input InputUpdated="(string s) => { Input = s; StateHasChanged(); }" SelectionMode="SelectionMode.WindowSelection" />
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PageTitle>Snap To Integer with SVGEditor</PageTitle>

<textarea @bind="Input" @bind:event="oninput" style="width:100%;height:150px;" />
<div style="height:80vh">
<div style="height:75vh">
<SVGEditor Input=@Input InputUpdated="(string s) => { Input = s; StateHasChanged(); }" SnapToInteger=true />
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
@inherits LayoutComponentBase
@inject NavigationManager NavigationManager

<div class="page">
<div class="sidebar">
<NavMenu />
</div>

<div class="main">
<div class="content px-4">
@Body
<main>
<div class="top-row px-4">
<a href="@($"https://github.com/KristofferStrube/Blazor.SVGEditor/blob/main/samples/KristofferStrube.Blazor.SVGEditor.WasmExample/Pages/{page}")" target="_blank" style="position: fixed; top: 5px; right: 5px">
<img src="https://img.shields.io/badge/this%20page%20on%20GitHub-@(page)-green?logo=github" />
</a>
</div>
</div>

<article class="content px-4">
@Body
</article>
</main>
</div>


@code {
private string relativeUri => NavigationManager.ToBaseRelativePath(NavigationManager.Uri);

protected string page => (string.IsNullOrEmpty(relativeUri) ? "Index" : relativeUri) + ".razor";
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
flex-direction: column;
}

.main {
main {
flex: 1;
}

Expand All @@ -21,15 +21,20 @@
align-items: center;
}

.top-row ::deep a, .top-row .btn-link {
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}

.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}

.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row:not(.auth) {
Expand All @@ -40,7 +45,7 @@
justify-content: space-between;
}

.top-row a, .top-row .btn-link {
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
Expand All @@ -63,7 +68,13 @@
z-index: 1;
}

.main > div {
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}

.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Minimal/">
<NavLink class="nav-link" href="Minimal">
<span class="oi oi-box" aria-hidden="true"></span> Minimal
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="CustomElements/">
<NavLink class="nav-link" href="CustomElements">
<span class="oi oi-lightbulb" aria-hidden="true"></span> Custom Elements
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Save/">
<NavLink class="nav-link" href="Save">
<span class="oi oi-hard-drive" aria-hidden="true"></span> Save
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="SnapToInteger/">
<NavLink class="nav-link" href="SnapToInteger">
<span class="oi oi-grid-two-up" aria-hidden="true"></span> Snap To Integer
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Animation/">
<NavLink class="nav-link" href="Animation">
<span class="oi oi-play-circle" aria-hidden="true"></span> Animation
</NavLink>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Blazor SVGEditor</title>

<base />
<script type="text/javascript">
// Single Page Apps for GitHub Pages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
Expand Down

0 comments on commit 63bcdb7

Please sign in to comment.