-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from erinnmclaughlin/ai
add aibba chatbot (preview)
- Loading branch information
Showing
55 changed files
with
1,502 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<span class="terminal-cursor">_</span> | ||
<span class="terminal-cursor">@("> ")</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
59
src/Site/Site.Client/Components/ComingSoon/GlitchText.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
46
src/Site/Site.Client/Components/ComingSoon/StartupProgram.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Site/Site.Client/Components/ComingSoon/StartupProgram.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
35
src/Site/Site.Client/Components/ComingSoon/TerminalCommand.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
95
src/Site/Site.Client/Components/ComingSoon/TerminalCommands.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Site/Site.Client/Components/ComingSoon/TerminalCommands.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/Site/Site.Client/Components/ComingSoon/TerminalCursor.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span class="terminal-cursor">_</span> |
Oops, something went wrong.