Compare commits

...

16 Commits

63 changed files with 7273 additions and 2261 deletions

271
.gitignore vendored
View File

@ -1,10 +1,261 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

1
.npmrc
View File

@ -1 +0,0 @@
engine-strict=true

25
OpenBirchWebsite.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenBirchWebsite", "OpenBirchWebsite\OpenBirchWebsite.csproj", "{545F3FB5-4102-4288-938C-3F4FFC613567}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{545F3FB5-4102-4288-938C-3F4FFC613567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{545F3FB5-4102-4288-938C-3F4FFC613567}.Debug|Any CPU.Build.0 = Debug|Any CPU
{545F3FB5-4102-4288-938C-3F4FFC613567}.Release|Any CPU.ActiveCfg = Release|Any CPU
{545F3FB5-4102-4288-938C-3F4FFC613567}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {428CEA3B-7BD0-4923-B039-219EDEDC86F2}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,12 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>

5
OpenBirchWebsite/MudBlazor.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
</PropertyGroup>
<ItemGroup>
<None Include="wwwroot\JavaScript🤮\eval.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="7.1.1" />
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,37 @@
@implements IDisposable
@inject OpenBirchConsole console
<div>
@for (int i = 0; i < console.history.Count; i++)
{
int temp = i;
ConsoleLine line = console.history[temp];
@if (line.source == ConsoleSource.User)
{
<MudText Align="Align.Start" Class="user-text"><MudText Style="color: #575279;" Inline="true">&gt;</MudText><b> @(' ' + line.text)</b></MudText>
}
else
{
<MudText Align="Align.Start" Class="openbirch-text"><i>@line.text</i></MudText>
<br />
}
}
</div>
@code {
protected override void OnInitialized()
{
OpenBirchConsole.OnLinesChanged += updateComp;
}
public void Dispose()
{
OpenBirchConsole.OnLinesChanged -= updateComp;
}
void updateComp(List<ConsoleLine> _)
{
InvokeAsync(StateHasChanged);
}
}

View File

@ -0,0 +1,7 @@
.user-text{
}
.openbirch-text * {
color: #31748f !important;
}

View File

@ -0,0 +1,5 @@
@page "/download"
<PageTitle>Download OpenBirch</PageTitle>
<MudImage Width="300" Height="300" ObjectFit=ObjectFit.Fill Src="images/edj9g2cqox4d1.webp" Alt="Logo" Elevation="25" Class="rounded-lg" />

View File

@ -0,0 +1,153 @@
@page "/"
@inject OpenBirchConsole console
@inject IJSRuntime jsRuntime
@inject NavigationManager nav
<PageTitle>Home</PageTitle>
<MudStack Row="true">
<div class ="d-flex justify-center" style="position: absolute; height: 85vh; width: 100vw; overflow: hidden; z-index: -1;">
<MudImage Src="/videos/DifferentialEquation.gif" ObjectFit="ObjectFit.Cover" Alt="Background video" Style="filter:blur(10px);" Class="rounded-0 w-100 overflow-hidden" />
</div>
<MudSpacer />
<div class="pt-6 z-10">
<MudText Align="Align.Center" Typo="Typo.h2">Welcome to<br /><b>OpenBirch!!!</b></MudText>
<MudPaper Class="rounded-lg mt-6">
<div class="reverse-stack-direction pa-4" style="width: 25vw; height: 40vh; min-width: 20rem;">
<div class="px-2 h-100 reverse-scroll-start rounded-t-lg" style="background-color: #191724; overflow-y: auto; overflow-x: hidden;">
<ConsoleText />
</div>
<div>
<MudTextField id="console-input" Class="rounded-b-xl" @bind-Value="inputField" Variant="Variant.Outlined" @onclick="OnInputClicked" OnKeyDown="OnKeyDown" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.ArrowForwardIos"></MudTextField>
</div>
</div>
</MudPaper>
</div>
<MudSpacer/>
<MudSpacer/>
<MudSpacer/>
</MudStack>
<MudStack style='margin-top: 15vh; width: 100%; height: 100vh; position: relative; background: linear-gradient(180deg, #101018, #1a1a27 2%); z-index: 1'>
<MudContainer Class="d-flex justify-center">
<MudStack>
<MudStack Class="pt-10" Row="true">
<MudStack>
<MudText Typo="Typo.h2">What is this?</MudText>
<MudText Typo="Typo.body1">This is an open-source solution for your academic math software.</MudText>
</MudStack>
<MudImage Width="100" Src="/images/literally-scam-v0-ssol5c3n5ibd1.webp" />
</MudStack>
<MudStack Class="pt-10" Row="true">
<MudImage Width="100" Src="/images/literally-scam-v0-ssol5c3n5ibd1.webp" />
<MudStack>
<MudText Typo="Typo.h2">Why did we make this?</MudText>
<MudText Typo="Typo.body1">Because linux bad and can't run .exe, and other programs are expendsive.</MudText>
</MudStack>
</MudStack>
</MudStack>
</MudContainer>
</MudStack>
<Footer />
@code {
public string inputField = "";
public bool hasInteracted = false; // Has the user interacted with the input field?
private Task? AutoTypingTask;
readonly string[] exampleInputs = {
"2+2",
"69*420+50",
"sin(2+4)",
"sqrt(9)",
"nroot(27, 3)",
"f(x):=2*x",
"f(5)",
"pi",
"e",
"myvar := 5",
"15 + myvar",
"myfunctionvar := f",
"myfunctionvar(10)",
"d/dx x",
"d/dx x^2",
"d/dx 69*x^2",
"d/dx sin(x)*x^2"
};
private void print(string e)
{
Console.WriteLine(e);
}
protected override async Task OnInitializedAsync()
{
if (!GlobalVariables.HasAutoTypingEd)
AutoTypingTask = StartAutoTyping();
GlobalVariables.HasAutoTypingEd = true;
}
private async void OnInputClicked()
{
hasInteracted = true;
if (AutoTypingTask != null)
await AutoTypingTask;
nav.NavigateTo("openbirch");
}
async void OnKeyDown(KeyboardEventArgs args)
{
if (args.Key == "Enter")
{
await Task.Delay(100);
sendCommand(inputField);
StateHasChanged();
}
}
private async void sendCommand(string command)
{
inputField = "";
await console.pushCommand(command);
await InvokeAsync(StateHasChanged);
}
const int typingDelay = 200;
private async Task StartAutoTyping()
{
await Task.Delay(1000);
foreach (string example in exampleInputs)
{
foreach (char letter in example)
{
inputField += letter;
await InvokeAsync(StateHasChanged); // Trigger UI update
await Task.Delay(200); // Non-blocking delay
// Makes it check if user inputted while waiting
const int waitTime = 10;
int waitedTime = 0;
while (waitedTime < typingDelay)
{
await Task.Delay(waitTime);
waitedTime += waitTime;
if (!hasInteracted) goto earlyExit;
}
inputField = ""; // Clear input and let user input
await InvokeAsync(StateHasChanged);
return;
earlyExit:;
}
sendCommand(inputField);
await Task.Delay(500);
}
}
}

View File

@ -0,0 +1,23 @@
.double_centered_boxes {
display: grid;
grid-template-columns: 1fr 1fr;
/*border: red 1mm solid;*/
gap: 2rem;
place-items: center;
}
.console-container {
display: grid;
grid-template-columns: 1fr 2fr 1fr 1fr;
}
.input-field {
max-width: 400px;
min-width: 300px;
}
.reverse-scroll-start {
display: flex;
flex-direction: column-reverse;
}

View File

@ -0,0 +1,39 @@
@page "/openbirch"
@inject OpenBirchConsole console
@inject IJSRuntime js
<div class="console-container reverse-stack-direction pa-4" Style="height: 90vh;">
<div class="px-2 h-100 reverse-scroll-start overflow-auto">
<ConsoleText/>
</div>
<div>
<MudTextField id="console-input" AutoFocus="true" @bind-Value="inputField" Variant="Variant.Outlined" OnKeyDown="OnKeyDown" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.ArrowForwardIos"></MudTextField>
</div>
</div>
@code {
public string inputField = "";
async void OnKeyDown(KeyboardEventArgs args)
{
if (args.Key == "Enter")
{
await Task.Delay(100);
sendCommand(inputField);
StateHasChanged();
}
}
private async void sendCommand(string command)
{
inputField = "";
await console.pushCommand(command);
await InvokeAsync(StateHasChanged);
}
protected override async Task OnInitializedAsync()
{
}
}

View File

@ -0,0 +1,13 @@
.console-container {
height: 100%;
padding: 0;
}
.console-container > div:first-child {
background-color: #191724;
}
.reverse-scroll-start {
display: flex;
flex-direction: column-reverse;
}

View File

@ -0,0 +1,9 @@
@page "/pricing"
<PageTitle>OpenBirch Pricing</PageTitle>
<MudContainer Class="h-100" Style="border: red 1mm solid">
<MudText>Our calculator is on a different plane—its got all the right angles!</MudText>
</MudContainer>
<Footer/>

View File

@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using OpenBirchWebsite.Services;
namespace OpenBirchWebsite
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped<OpenBirchConsole>();
builder.Services.AddMudServices();
await builder.Build().RunAsync();
}
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net8.0\browser-wasm\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,43 @@
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5126",
"nativeDebugging": true
},
"https": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7127;http://localhost:5126",
"nativeDebugging": true
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:39722",
"sslPort": 44361
}
}
}

View File

@ -0,0 +1,8 @@
namespace OpenBirchWebsite.Services
{
// Cry about it
public static class GlobalVariables
{
public static bool HasAutoTypingEd = false;
}
}

View File

@ -0,0 +1,44 @@
using Microsoft.JSInterop;
namespace OpenBirchWebsite.Services
{
public class OpenBirchConsole(IJSRuntime js) : IDisposable
{
public List<ConsoleLine> history = new();
private readonly IJSRuntime js = js;
public static event Action<List<ConsoleLine>> OnLinesChanged;
public Task pushCommand(string command)
{
history.Add(new ConsoleLine() { source = ConsoleSource.User, text = command });
return ExecuteCommand(command);
}
private async Task ExecuteCommand(string command)
{
string result = await js.InvokeAsync<string>("runEval", command);
history.Add(new ConsoleLine() { source = ConsoleSource.OpenBirch, text = result });
OnLinesChanged?.Invoke(history);
}
public void Dispose()
{
// The following prevents derived types that introduce a
// finalizer from needing to re-implement IDisposable.
GC.SuppressFinalize(this);
}
}
public struct ConsoleLine
{
public ConsoleSource source;
public string text;
}
public enum ConsoleSource
{
User, // From the user
OpenBirch, // Guess
}
}

View File

@ -0,0 +1,7 @@
namespace OpenBirchWebsite.Services
{
public class StateContainer
{
public readonly Dictionary<int, object> ObjectTunnel = new();
}
}

View File

@ -0,0 +1,6 @@
<div >
<MudSpacer />
<div style="height: 10vh; background-color: blue;">
Test
</div>
</div>

View File

@ -0,0 +1,107 @@
@inherits LayoutComponentBase
<MudThemeProvider Theme="@_theme" IsDarkMode="_isDarkMode" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
<MudLayout>
<MudAppBar Elevation="1">
<NavLink ActiveClass="d-flex align-center" href="/">
<MudImage Width="50" Height="50" ObjectFit=ObjectFit.Fill Src="images/fi478h5fj45d1.webp" Alt="Logo" Elevation="25" Class="rounded-lg" />
</NavLink>
<MudText Typo="Typo.h5" Class="ml-3">OpenBirch</MudText>
<MudSpacer />
<MudButton Variant="Variant.Text" Href="/pricing" Class="pr-4">Pricing</MudButton>
<MudButton Variant="Variant.Text" Href="/openbirch" Class="pr-4">Console</MudButton>
<MudButton Variant="Variant.Text" Href="/download" Class="pr-4">Download</MudButton>
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
</MudAppBar>
<MudDrawer @bind-Open="_drawerOpen" Anchor="Anchor.End" ClipMode="DrawerClipMode.Always" Breakpoint="Breakpoint.None" Elevation="2">
</MudDrawer>
<MudMainContent>
@Body
</MudMainContent>
</MudLayout>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@code {
private bool _drawerOpen = false;
private bool _isDarkMode = true;
private MudTheme? _theme = null;
protected override void OnInitialized()
{
base.OnInitialized();
_theme = new()
{
PaletteLight = _lightPalette,
PaletteDark = _darkPalette,
LayoutProperties = new LayoutProperties()
};
}
private void DrawerToggle()
{
_drawerOpen = !_drawerOpen;
}
private void DarkModeToggle()
{
_isDarkMode = !_isDarkMode;
}
private readonly PaletteLight _lightPalette = new()
{
Black = "#110e2d",
AppbarText = "#424242",
AppbarBackground = "rgba(255,255,255,0.8)",
DrawerBackground = "#ffffff",
GrayLight = "#e8e8e8",
GrayLighter = "#f9f9f9",
};
private readonly PaletteDark _darkPalette = new()
{
Primary = "#7e6fff",
Surface = "#1e1e2d",
Background = "#1a1a27",
BackgroundGray = "#151521",
AppbarText = "#92929f",
AppbarBackground = "rgba(26,26,39,0.8)",
DrawerBackground = "#1a1a27",
ActionDefault = "#74718e",
ActionDisabled = "#9999994d",
ActionDisabledBackground = "#605f6d4d",
TextPrimary = "#b2b0bf",
TextSecondary = "#92929f",
TextDisabled = "#ffffff33",
DrawerIcon = "#92929f",
DrawerText = "#92929f",
GrayLight = "#2a2833",
GrayLighter = "#1e1e2d",
Info = "#4a86ff",
Success = "#3dcb6c",
Warning = "#ffb545",
Error = "#ff3f5f",
LinesDefault = "#33323e",
TableLines = "#33323e",
Divider = "#292838",
OverlayLight = "#1e1e2d80",
};
public string DarkLightModeButtonIcon => _isDarkMode switch
{
true => Icons.Material.Rounded.AutoMode,
false => Icons.Material.Outlined.DarkMode,
};
}

View File

@ -0,0 +1,77 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.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 {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.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;
}
}

View File

@ -0,0 +1,13 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using OpenBirchWebsite
@using MudBlazor
@using OpenBirchWebsite.Services
@using OpenBirchWebsite.Pages.Components
@using OpenBirchWebsite.Shared

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,32 @@
function str2C(s) {
var size = lengthBytesUTF8(s) + 1;
var ret = _malloc(size);
stringToUTF8Array(s, HEAP8, ret, size);
return ret;
}
window.runEval = function (inputText) {
console.log("input: " + inputText);
var inputPtr = str2C(inputText);
var resultPointer = Module2._eval(inputPtr);
var resultString = "";
// Convert resultPointer (char*) to JavaScript string
// Here, we treat it as ASCII and convert byte by byte
if (resultPointer) {
var i = 0;
while (true) {
var charCode = Module2.getValue(resultPointer + i, 'i8');
if (charCode === 0) break;
resultString += String.fromCharCode(charCode);
i++;
}
}
console.log("Result from eval:", resultString);
// Free allocated memory
_free(resultPointer);
return resultString;
}

View File

@ -0,0 +1 @@
clickElement = (elementId) => document.getElementById(elementId).click();

View File

@ -0,0 +1,110 @@
html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
h1:focus {
outline: none;
}
a, .btn-link {
color: #0071c1;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
.content {
padding-top: 1.1rem;
}
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
.invalid {
outline: 1px solid red;
}
.validation-message {
color: red;
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
.blazor-error-boundary {
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
padding: 1rem 1rem 1rem 3.7rem;
color: white;
}
.blazor-error-boundary::after {
content: "An error has occurred."
}
.loading-progress {
position: relative;
display: block;
width: 8rem;
height: 8rem;
margin: 20vh auto 1rem auto;
}
.loading-progress circle {
fill: none;
stroke: #e0e0e0;
stroke-width: 0.6rem;
transform-origin: 50% 50%;
transform: rotate(-90deg);
}
.loading-progress circle:last-child {
stroke: #1b6ec2;
stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
position: absolute;
text-align: center;
font-weight: bold;
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after {
content: var(--blazor-load-percentage-text, "Loading");
}
code {
color: #c02d76;
}
.reverse-stack-direction {
display: flex;
justify-content: flex-end;
flex-direction: column;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OpenBirchWebsite</title>
<base href="/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<link href="OpenBirchWebsite.styles.css" rel="stylesheet" />
<link href="manifest.webmanifest" rel="manifest" />
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
<link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
</head>
<body style="background-color: #1a1a27; padding: 0;">
<div id="app">
<svg class="loading-progress">
<circle r="40%" cx="50%" cy="50%" />
<circle r="40%" cx="50%" cy="50%" />
</svg>
<div class="loading-progress-text" style="color: #eeeeee"></div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>
<script>navigator.serviceWorker.register('service-worker.js');</script>
<script src="JavaScript🤮/eval.js"></script>
<script src="JavaScript🤮/OpenBirch.js"></script>
</body>
</html>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>

View File

@ -0,0 +1,22 @@
{
"name": "OpenBirchWebsite",
"short_name": "OpenBirchWebsite",
"id": "./",
"start_url": "./",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#03173d",
"prefer_related_applications": false,
"icons": [
{
"src": "icon-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "icon-192.png",
"type": "image/png",
"sizes": "192x192"
}
]
}

View File

@ -0,0 +1,27 @@
[
{
"date": "2022-01-06",
"temperatureC": 1,
"summary": "Freezing"
},
{
"date": "2022-01-07",
"temperatureC": 14,
"summary": "Bracing"
},
{
"date": "2022-01-08",
"temperatureC": -13,
"summary": "Freezing"
},
{
"date": "2022-01-09",
"temperatureC": -16,
"summary": "Balmy"
},
{
"date": "2022-01-10",
"temperatureC": -2,
"summary": "Chilly"
}
]

View File

@ -0,0 +1,4 @@
// In development, always fetch from the network and do not enable offline support.
// This is because caching would make development more difficult (changes would not
// be reflected on the first load after each change).
self.addEventListener('fetch', () => { });

View File

@ -0,0 +1,55 @@
// Caution! Be sure you understand the caveats before publishing an application with
// offline support. See https://aka.ms/blazor-offline-considerations
self.importScripts('./service-worker-assets.js');
self.addEventListener('install', event => event.waitUntil(onInstall(event)));
self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
const cacheNamePrefix = 'offline-cache-';
const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
const offlineAssetsExclude = [ /^service-worker\.js$/ ];
// Replace with your base path if you are hosting on a subfolder. Ensure there is a trailing '/'.
const base = "/";
const baseUrl = new URL(base, self.origin);
const manifestUrlList = self.assetsManifest.assets.map(asset => new URL(asset.url, baseUrl).href);
async function onInstall(event) {
console.info('Service worker: Install');
// Fetch and cache all matching items from the assets manifest
const assetsRequests = self.assetsManifest.assets
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
.filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
.map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
}
async function onActivate(event) {
console.info('Service worker: Activate');
// Delete unused caches
const cacheKeys = await caches.keys();
await Promise.all(cacheKeys
.filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
.map(key => caches.delete(key)));
}
async function onFetch(event) {
let cachedResponse = null;
if (event.request.method === 'GET') {
// For all navigation requests, try to serve index.html from cache,
// unless that request is for an offline resource.
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
const shouldServeIndexHtml = event.request.mode === 'navigate'
&& !manifestUrlList.some(url => url === event.request.url);
const request = shouldServeIndexHtml ? 'index.html' : event.request;
const cache = await caches.open(cacheName);
cachedResponse = await cache.match(request);
}
return cachedResponse || fetch(event.request);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 KiB

View File

View File

@ -1,18 +0,0 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

2115
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
{
"name": "deprived-main-website",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"typescript": "^5.0.0",
"vite": "^5.0.3"
},
"type": "module"
}

13
src/app.d.ts vendored
View File

@ -1,13 +0,0 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

View File

@ -1,18 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Change theme for site here -->
<link rel="stylesheet" href="/stylesheets/main-theme.css" />
<link rel="stylesheet" href="/stylesheets/global.css" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@ -1 +0,0 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@ -1 +0,0 @@
export const prerender = true;

View File

@ -1,17 +0,0 @@
<div class="main-title">
<h1>The Deprived Devs</h1>
</div>
<style>
.main-title {
font-family: "CozetteVector";
margin: 0 auto;
width: 80%;
text-align: center;
}
.main-title > h1 {
font-size: 4.5vw; /* Change if title changes */
}
</style>

View File

@ -1 +0,0 @@
<p>This is an informative about page :) </p>

View File

@ -1 +0,0 @@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

View File

@ -1,12 +0,0 @@
/* --- FONTS --- */
@font-face {
font-family: "CozetteVector";
src:
local("CozetteVector"),
url("/fonts/CozetteVector.ttf") format("truetype");
}
body {
color: var(--text);
background-color: var(--background);
}

View File

@ -1,7 +0,0 @@
:root {
--text: #ece4ee;
--background: #120c13;
--primary: #ff8552;
--secondary: #6c6b44;
--accent: #7da16a;
}

View File

@ -1,17 +0,0 @@
import adapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
export default {
kit: {
prerender: {
handleHttpError: 'fail'
},
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true
})
}
};

View File

@ -1,6 +0,0 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});