Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
ofiber committed Jun 3, 2024
1 parent 92a0d09 commit c7f025f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 71 deletions.
38 changes: 7 additions & 31 deletions Components/Layout/MainLayout.razor.css
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
.page {
position: relative;
display: flex;
flex-direction: column;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
}

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;
Expand Down
18 changes: 16 additions & 2 deletions Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
private string metar;

private string invalidICAO = "Invalid ICAO! Please enter a new ICAO and try again!";
private string invalidLength = "ICAO must be 4 characters in length! Please enter a valid ICAO and try again!";
private string noICAO = "Please enter an ICAO in the ICAO input";

protected async void AutoResize(KeyboardEventArgs e)
{
Expand All @@ -45,14 +47,26 @@

private void SubmitICAO()
{
if(!ICAODict.icaoDict.ContainsKey(icao))
if (string.IsNullOrEmpty(icao))
{
Alert(noICAO);
icao = "";
return;
}
else if (icao.Length != 4)
{
Alert(invalidLength);
icao = "";
return;
}
else if(!ICAODict.icaoDict.ContainsKey(icao.ToUpper()))
{
Alert(invalidICAO);
icao = "";

return;
}
else
navMan.NavigateTo($"Results/{icao}");
navMan.NavigateTo($"Results/{icao.ToUpper()}");
}
}
29 changes: 16 additions & 13 deletions Components/Pages/Home.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ html {
min-height: 100%;
}

body {
margin-bottom: 60px;
background-color: #95B8D1;
}

h1 {
font-family: CommitMono;
font-size: 2.5em;
Expand Down Expand Up @@ -82,21 +77,30 @@ textarea {
border: thin solid gray;
}

.background {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
}

.icaoDiv {
position: relative;
align-content: center;
align-items: center;
margin-top: 90px;
position: relative;
}

.metarDiv {
position: relative;
align-self: center;
align-items: center;
align-content: center;
margin-top: 130px;
}

#resultsView {
visibility: hidden;
position: relative;
margin-top: 8%;
}

#mainView {
Expand Down Expand Up @@ -141,5 +145,4 @@ button:hover {
text-align: center;
text-transform: uppercase;
color: black;
}

}
27 changes: 10 additions & 17 deletions Components/Pages/Results.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ textarea {
font-weight: bolder;
}

p {
display: block;
font-family: CommitMono;
font-size: 1.5em;
font-weight: bold;
text-align: center;
text-transform: uppercase;
color: #333333;
margin-left: auto;
margin-right: auto;
margin-top: 25%;
}

button {
cursor: pointer;
align-self: center;
Expand All @@ -45,17 +32,23 @@ button {
background-color: #666A86;
}

.backBtn{
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.backBtn {
position: absolute;
right: 160px;
bottom: -200px;
margin-top: 52%;
}

.results {
display: block;
margin-left: auto;
margin-right: auto;
transform: translate(0%, 20%);
transform: translate(0%, 12%);
background-color: lightslategray;
border: thin solid gray;
border-radius: 5px;
Expand Down
9 changes: 1 addition & 8 deletions MetarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,6 @@ private static void GetSeaLevelPressure(Regex sea_level_pressure_regex, string m

decodedMetar.AppendLine("Sea Level Pressure: " + hpa + " hPa");
}


}

private static void GetWeather(out MatchCollection matches, string metar, Regex remarks_regex, Regex weather_regex, Dictionary<string, string> weatherMap)
Expand Down Expand Up @@ -840,12 +838,7 @@ private static void GetNoSig(out MatchCollection matches, string metar, Regex no
}

public static string GetEncodedMetarAsString() { return encodedMetar.ToString(); }
public static string GetDecodedMetarAsString()
{
Console.WriteLine(decodedMetar.ToString());
return decodedMetar.ToString();
}

public static string GetDecodedMetarAsString() { return decodedMetar.ToString(); }
public static void ResetMetarStrings() { decodedMetar.Clear(); encodedMetar.Clear(); }
}
}

0 comments on commit c7f025f

Please sign in to comment.