Skip to content

Commit

Permalink
Merge pull request #3 from erinnmclaughlin/ai
Browse files Browse the repository at this point in the history
add aibba chatbot (preview)
  • Loading branch information
erinnmclaughlin authored Apr 18, 2024
2 parents de8f25e + 0b21768 commit d09cdf2
Show file tree
Hide file tree
Showing 55 changed files with 1,502 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.cs]

# SKEXP0001: Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
dotnet_diagnostic.SKEXP0001.severity = none

# SKEXP0010: Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
dotnet_diagnostic.SKEXP0010.severity = none
2 changes: 1 addition & 1 deletion .github/workflows/main_erinnmclaughlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
dotnet-version: '8.x'
include-prerelease: true

- name: Build with dotnet
Expand Down
21 changes: 16 additions & 5 deletions PersonalWebsite.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PersonalWebsite", "PersonalWebsite\PersonalWebsite.csproj", "{85090680-1997-49A8-BAB0-2283BD353DC8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Site", "src\Site\Site\Site.csproj", "{478039A1-B85B-4EF9-943E-D2EEEB522919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Site.Client", "src\Site\Site.Client\Site.Client.csproj", "{905FA50A-C616-4339-BFE1-D68CA9C262A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6680D40B-9A58-4838-BCAD-56D382006878}"
ProjectSection(SolutionItems) = preProject
.github\workflows\main_erinnmclaughlin.yml = .github\workflows\main_erinnmclaughlin.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{85090680-1997-49A8-BAB0-2283BD353DC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85090680-1997-49A8-BAB0-2283BD353DC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85090680-1997-49A8-BAB0-2283BD353DC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85090680-1997-49A8-BAB0-2283BD353DC8}.Release|Any CPU.Build.0 = Release|Any CPU
{478039A1-B85B-4EF9-943E-D2EEEB522919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{478039A1-B85B-4EF9-943E-D2EEEB522919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{478039A1-B85B-4EF9-943E-D2EEEB522919}.Release|Any CPU.ActiveCfg = Release|Any CPU
{478039A1-B85B-4EF9-943E-D2EEEB522919}.Release|Any CPU.Build.0 = Release|Any CPU
{905FA50A-C616-4339-BFE1-D68CA9C262A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{905FA50A-C616-4339-BFE1-D68CA9C262A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{905FA50A-C616-4339-BFE1-D68CA9C262A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{905FA50A-C616-4339-BFE1-D68CA9C262A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion PersonalWebsite/Components/TerminalCursor.razor
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span class="terminal-cursor">_</span>
<span class="terminal-cursor">@("> ")</span>
2 changes: 1 addition & 1 deletion PersonalWebsite/PersonalWebsite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions PersonalWebsite/wwwroot/css/app.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
:root {
--woman-width: 550px;

}

* {
Expand All @@ -15,7 +14,6 @@ html, body, #app {

html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
background-color: var(#f1f5f9);
}

html {
Expand Down
9 changes: 9 additions & 0 deletions src/Site/Site.Client/Components/ComingSoon/GlitchText.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<p class="glitch">
<span aria-hidden="true">@Value</span>
@Value
<span aria-hidden="true">@Value</span>
</p>

@code {
[Parameter] public required string Value { get; set; }
}
59 changes: 59 additions & 0 deletions src/Site/Site.Client/Components/ComingSoon/GlitchText.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* https://codepen.io/cbanlawi/pen/xxRBeMY */

.glitch {
font-size: 5rem;
font-weight: bold;
position: relative;
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
animation: glitch 725ms infinite;
}

.glitch span {
position: absolute;
top: 0;
left: 0;
}

.glitch span:first-child {
animation: glitch 500ms infinite;
clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
transform: translate(-0.04em, -0.03em);
opacity: 0.75;
}

.glitch span:last-child {
animation: glitch 375ms infinite;
clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
transform: translate(0.04em, 0.03em);
opacity: 0.75;
}

@keyframes glitch {
0% {
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
}

15% {
text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
}

16% {
text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00;
}

49% {
text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00;
}

50% {
text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00;
}

99% {
text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00;
}

100% {
text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff, -0.04em -0.025em 0 #fffc00;
}
}
46 changes: 46 additions & 0 deletions src/Site/Site.Client/Components/ComingSoon/StartupProgram.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@attribute [StreamRendering]
@rendermode InteractiveAuto

@if (CurrentState is not State.Running)
{
<div class="history">
<TerminalCommands Commands="Commands" OnComplete="OnCommandsCompleted" />

@if (CurrentState is State.Building)
{
<p>Building...</p>
}
</div>
}
else
{
<div style="transform-style: preserve-3d; perspective: 500px; height: 100%; position: relative;">
<VaporwaveBackground />
<div style="height: 100%; display: flex; align-items: center; justify-content: center; text-align: center;">
<GlitchText Value="coming soon" />
</div>
</div>
}

@code {

private string[] Commands { get; set; } = new[]
{
"cd source/repos",
"git clone https://github.com/erinnmclaughlin/PersonalWebsite.git",
"cd PersonalWebsite",
"dotnet run"
};

private State CurrentState { get; set; } = State.EnteringCommands;

private async Task OnCommandsCompleted()
{
CurrentState = State.Building;
await Task.Delay(2000);

CurrentState = State.Running;
}

enum State { EnteringCommands, Building, Running }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.history {
display: flex;
flex-direction: column;
gap: 5px;
height: 100%;
padding: 10px;
}
35 changes: 35 additions & 0 deletions src/Site/Site.Client/Components/ComingSoon/TerminalCommand.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@attribute [StreamRendering]

<p>
<span style="line-break: anywhere">> @TypedCommand</span>
</p>

@code {

[Parameter] public required string Command { get; set; }
[Parameter] public EventCallback OnAnimationComplete { get; set; }

private string TypedCommand { get; set; } = "";

protected override async Task OnInitializedAsync()
{
await Animate();
}

public async Task Animate()
{
TypedCommand = "";
var length = 0;

while (length <= Command.Length)
{
TypedCommand = Command.Substring(0, length);
length++;
StateHasChanged();
await Task.Delay(50);
}

await Task.Delay(200);
await OnAnimationComplete.InvokeAsync();
}
}
95 changes: 95 additions & 0 deletions src/Site/Site.Client/Components/ComingSoon/TerminalCommands.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
@attribute [StreamRendering]
@rendermode InteractiveAuto

@if (CurrentState is State.Waiting)
{
<button id="start" type="button" aria-label="start" @onclick="Start">
@if (ShowInstructions)
{
<span id="mobile-instructions">
<TerminalCommand Command="Tap to start" />
</span>
<span id="desktop-instructions">
<TerminalCommand Command="Click to start" />
</span>
}
else
{
<span>> <TerminalCursor /></span>
}
</button>
}
else
{
for (int i = 0; i <= ExecutedCommandCount - 1; i++)
{
<TerminalCommand Command="@Commands[i]" OnAnimationComplete="OnCommandCompleted" />
}

@if (ShowCursor)
{
<div>> <TerminalCursor /></div>
}
}

@code {

private State CurrentState { get; set; } = State.Waiting;

private bool IsTyping { get; set; }
private bool ShowCursor => HasNext() && !IsTyping;
private bool ShowInstructions { get; set; }

private int ExecutedCommandCount { get; set; } = 0;

[Parameter]
public required string[] Commands { get; set; }

[Parameter]
public EventCallback OnComplete { get; set; }

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await Task.Delay(1500);
ShowInstructions = true;
StateHasChanged();
}
}

private async Task OnCommandCompleted()
{
IsTyping = false;
StateHasChanged();

await Task.Delay(600);

if (!HasNext())
{
await OnComplete.InvokeAsync();
return;
}

EnterNextCommand();
}

private bool HasNext()
{
return ExecutedCommandCount < Commands.Length;
}

private void EnterNextCommand()
{
IsTyping = true;
ExecutedCommandCount++;
}

private void Start()
{
CurrentState = State.Running;
EnterNextCommand();
}

private enum State { Waiting, Running, Completed }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#start {
background: unset;
color: unset;
font-family: unset;
font-size: unset;
cursor: pointer;
border: 0;
height: 100%;
width: 100%;
display: flex;
}

#start:hover {
color: lime;
}

#desktop-instructions {
display: none;
}


@media only screen and (min-width: 600px) {

#desktop-instructions {
display: unset;
}

#mobile-instructions {
display: none;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="terminal-cursor">_</span>
Loading

0 comments on commit d09cdf2

Please sign in to comment.