This commit is contained in:
None4Now 2023-10-01 11:53:39 +02:00
parent 1540e1ba13
commit f268af529b
14 changed files with 251 additions and 25 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "Interlinked.sln"
}

View file

@ -21,7 +21,7 @@
{
public double Latitude { get; set; }
public double Longitude { get; set; }
public string Name { get; set; }
public string Name { get; set; } = default!;
}
private List<City> Cities = new List<City> {
new City { Latitude = 34.060620, Longitude = -118.330491, Name="California" },

View file

@ -0,0 +1,34 @@
@page "/peopletable"
<h2>Employee Information</h2>
<table border="1">
<tr>
<th>Name</th>
<th>Surname</th>
<th>City</th>
<th>Country</th>
<th>Proficiencies</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>New York</td>
<td>USA</td>
<td>Web Development</td>
</tr>
<tr>
<td>Jane</td>
<td>Smith</td>
<td>Los Angeles</td>
<td>USA</td>
<td>Graphic Design</td>
</tr>
<tr>
<td>Maria</td>
<td>Garcia</td>
<td>Madrid</td>
<td>Spain</td>
<td>Data Analysis</td>
</tr>
</table>

View file

@ -6,21 +6,32 @@
private string FullName = "meow uwu";
private string Bio = "Software Developer";
private List<string> Skills = new List<string> { "C#", "ASP.NET Core", "Blazor" };
private string aboutme = "lorum ipsum, lorum ipsum, lorum ipsum, lorum ipsum, lorum ipsum, lorum ipsum.";
}
<div class="user-profile">
<img class="background" src="images/background.jpg" alt="Background" />
<img class="profile-img" src="images/kuba.jpg" alt="Profile Picture" />
<div class="profile-names">
<h1 class="profile-username">@($"@{Username}")</h1>
<h3 class="profile-fullname">(@FullName)</h3>
<img class="profile-img" src="images/DefaultUserProfile.jpg" alt="Profile Picture" />
<img class="background-img" src="images/DefaultBanner.png" alt="Background" />
<div class="userinfo">
<div class = "vertidiv">
<div class="profile-names">
<h1 class="profile-username">@($"@{Username}")</h1>
<h3 class="profile-fullname">(@FullName)</h3>
</div>
<p>@Bio</p>
<h2>Skills</h2>
<ul>
@foreach (var skill in Skills)
{
<li>@skill</li>
}
</ul>
</div>
<div class = "aboutme">
<h1 style=" width: fit-content;
margin-top: 0.25rem;">About me</h1>
<p>(@aboutme)</p>
</div>
</div>
<p>@Bio</p>
<h2>Skills</h2>
<ul>
@foreach (var skill in Skills)
{
<li>@skill</li>
}
</ul>
</div>

View file

@ -80,4 +80,4 @@ main {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
}

View file

@ -0,0 +1,23 @@
@inherits LayoutComponentBase
@inject UserManager usr
<div class="page">
<main>
<div class="top-row px-4">
@if (!usr.IsAuthorized)
{
<a href="/login">Log in</a>
<a href="/register">Register</a>
}
else
{
<a href="/logout">Log out (@usr.User.Username)</a>
}
</div>
<article class="content px-4">
@Body
</article>
</main>
</div>

View file

@ -0,0 +1,86 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.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:not(.auth) {
display: none;
}
.top-row.auth {
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;
}
}
.form {
min-width: 100%;
min-height: 100%;
flex-wrap: wrap;
flex-direction: column;
}

View file

@ -1,6 +1,7 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Interlinked.Core</a>
<img src="images/InterlinkedLogoWhite.png" style="max-width: 8vw;
">
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
@ -11,17 +12,17 @@
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Home
<span class="oi oi-home" aria-hidden="true"></span> Your community
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="oi oi-plus" aria-hidden="true"></span> Counter
<NavLink class="nav-link" href="project">
<span class="oi oi-plus" aria-hidden="true"></span> Projects
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="fetchdata">
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
<NavLink class="nav-link" href="/user/This could be you!">
<span class="oi oi-list-rich" aria-hidden="true"></span> Your Profile
</NavLink>
</div>
<div class="nav-item px-3">

View file

@ -99,11 +99,13 @@ a,
.profile-img {
position: absolute;
top: 22rem; /* Adjust as needed */
left: 15rem; /* Adjust as needed */
object-fit: cover;
transform: translate(10%, 25%);
z-index: 1; /* Place the profile picture above the background image */
max-width: 200px;
min-width: 200px;
max-height: 200px;
min-height: 200px;
border-radius: 200px;
}
@ -124,11 +126,16 @@ a,
}
.background-img{
max-width: 1500px;
max-height: 800px;
min-width: 100%;
max-height: 300px;
object-fit: cover;
}
.project-img {
max-width: 1500px;
max-height: 450px;
}
.aboutme{
flex-wrap: wrap;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,61 @@
namespace Interlinked.Shared;
public class Geographical{
const double km = 111.1;//one degree in kilometres
public static bool isInArea(Coordinate Center, Coordinate Check, double radius){//longlat given in degrees, radius given in Kilometres
//(Check.x-Center.long)^2+(Check.lat-Center.lat) = (radius/km)^2
double opSign = (Center.Longtitude/(Math.Abs(Center.Longtitude)));
double radiusSquared1 = Math.Pow((Check.Longtitude - Center.Longtitude), 2) +
Math.Pow((Check.Latitude - Center.Latitude), 2);
double radiusSquared2 = Math.Pow(((Check.Longtitude) - Center.Longtitude + (opSign * 180)), 2) +
Math.Pow((Check.Latitude - Center.Latitude), 2);
if(radiusSquared1 <= Math.Pow((radius/km), 2) || radiusSquared2 <= Math.Pow((radius/km), 2)){
return true;
}
else{
return false;
}
}
public static Coordinate[] GetInclusionZone(Coordinate center, double maxInclusion = 20)//maximum distance in kilometres//just use this, the circle is cool but useless.
{
double maxDistance = KilometreToDegree(maxInclusion);
double opSign = (center.Longtitude/(Math.Abs(center.Longtitude)));
return new Coordinate[]
{
new Coordinate(center.Longtitude-maxDistance, center.Latitude-maxDistance),
new Coordinate(center.Longtitude+maxDistance, center.Latitude+maxDistance),
new Coordinate(-(center.Longtitude-maxDistance+(opSign * 180)), center.Latitude-maxDistance),
new Coordinate(-(center.Longtitude+maxDistance+(opSign * 180)), center.Latitude+maxDistance)
};//returns positive and negative inclusion boundaries for either side of the globe
}
public static double DegreeToKilometre(double degree){
return degree * km;
}
public static double KilometreToDegree(double kilometre){
return kilometre/km;
}
public Coordinate ParseStringToCoord(string input){
string Longtitude = "";
string Latitude = "";
bool comma = false;
char c;
for(int i = 0; i < input.Length; i++){
c = input[i];
if(c == ','){comma = true; i++;}
if(comma){Latitude+=c;}
else{Longtitude+=c;}
}
return new Coordinate(Convert.ToDouble(Longtitude), Convert.ToDouble(Latitude));
}
}
public struct Coordinate{
public double Longtitude{get; init;}
public double Latitude{get; init;}
public Coordinate(double longt, double lat)
{
Longtitude = longt;
Latitude = lat;
}
}