- init: init repo
This commit is contained in:
16
LaborWork.Browser/LaborWork.Browser.csproj
Normal file
16
LaborWork.Browser/LaborWork.Browser.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-browser</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Browser"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LaborWork\LaborWork.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
15
LaborWork.Browser/Program.cs
Normal file
15
LaborWork.Browser/Program.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Browser;
|
||||
using LaborWork;
|
||||
|
||||
internal sealed partial class Program
|
||||
{
|
||||
private static Task Main(string[] args) => BuildAvaloniaApp()
|
||||
.WithInterFont()
|
||||
.StartBrowserAppAsync("out");
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>();
|
||||
}
|
||||
1
LaborWork.Browser/Properties/AssemblyInfo.cs
Normal file
1
LaborWork.Browser/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1 @@
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatform("browser")]
|
||||
13
LaborWork.Browser/Properties/launchSettings.json
Normal file
13
LaborWork.Browser/Properties/launchSettings.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"profiles": {
|
||||
"LaborWork.Browser": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:7169;http://localhost:5235",
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
LaborWork.Browser/runtimeconfig.template.json
Normal file
10
LaborWork.Browser/runtimeconfig.template.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"wasmHostProperties": {
|
||||
"perHostConfig": [
|
||||
{
|
||||
"name": "browser",
|
||||
"host": "browser"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
58
LaborWork.Browser/wwwroot/app.css
Normal file
58
LaborWork.Browser/wwwroot/app.css
Normal file
@@ -0,0 +1,58 @@
|
||||
/* HTML styles for the splash screen */
|
||||
.avalonia-splash {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: white;
|
||||
font-family: 'Outfit', sans-serif;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Light theme styles */
|
||||
@media (prefers-color-scheme: light) {
|
||||
.avalonia-splash {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
color: #1b2a4e;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
color: #0D6EFD;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.avalonia-splash {
|
||||
background: #1b2a4e;
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.avalonia-splash h2 {
|
||||
font-weight: 400;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.avalonia-splash a {
|
||||
text-decoration: none;
|
||||
font-size: 2.5rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.avalonia-splash.splash-close {
|
||||
transition: opacity 200ms, display 200ms;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
}
|
||||
BIN
LaborWork.Browser/wwwroot/favicon.ico
Normal file
BIN
LaborWork.Browser/wwwroot/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
22
LaborWork.Browser/wwwroot/index.html
Normal file
22
LaborWork.Browser/wwwroot/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>LaborWork.Browser</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
</head>
|
||||
|
||||
<body style="margin: 0; overflow: hidden">
|
||||
<div id="out">
|
||||
<div class="avalonia-splash">
|
||||
<h2>
|
||||
Загрузка...
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<script type='module' src="./main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
13
LaborWork.Browser/wwwroot/main.js
Normal file
13
LaborWork.Browser/wwwroot/main.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { dotnet } from './_framework/dotnet.js'
|
||||
|
||||
const is_browser = typeof window != "undefined";
|
||||
if (!is_browser) throw new Error(`Expected to be running in a browser`);
|
||||
|
||||
const dotnetRuntime = await dotnet
|
||||
.withDiagnosticTracing(false)
|
||||
.withApplicationArgumentsFromQuery()
|
||||
.create();
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [globalThis.location.href]);
|
||||
Reference in New Issue
Block a user