Compare commits
2 commits
cc7fb93439
...
b1cba644b8
Author | SHA1 | Date | |
---|---|---|---|
b1cba644b8 | |||
f268af529b |
12 changed files with 226 additions and 11 deletions
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"dotnet.defaultSolution": "Interlinked.sln"
|
||||||
|
}
|
34
src/Interlinked.Core/Pages/PeopleTable.razor
Normal file
34
src/Interlinked.Core/Pages/PeopleTable.razor
Normal 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>
|
|
@ -80,4 +80,4 @@ main {
|
||||||
padding-left: 2rem !important;
|
padding-left: 2rem !important;
|
||||||
padding-right: 1.5rem !important;
|
padding-right: 1.5rem !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
23
src/Interlinked.Core/Shared/MainLayoutLanding.razor
Normal file
23
src/Interlinked.Core/Shared/MainLayoutLanding.razor
Normal 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>
|
86
src/Interlinked.Core/Shared/MainLayoutLanding.razor.css
Normal file
86
src/Interlinked.Core/Shared/MainLayoutLanding.razor.css
Normal 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;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
<div class="top-row ps-3 navbar navbar-dark">
|
<div class="top-row ps-3 navbar navbar-dark">
|
||||||
<div class="container-fluid">
|
<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">
|
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -11,17 +12,17 @@
|
||||||
<nav class="flex-column">
|
<nav class="flex-column">
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
<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>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="counter">
|
<NavLink class="nav-link" href="project">
|
||||||
<span class="oi oi-plus" aria-hidden="true"></span> Counter
|
<span class="oi oi-plus" aria-hidden="true"></span> Projects
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="fetchdata">
|
<NavLink class="nav-link" href="/user/This could be you!">
|
||||||
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
|
<span class="oi oi-list-rich" aria-hidden="true"></span> Your Profile
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
|
|
|
@ -99,11 +99,13 @@ a,
|
||||||
|
|
||||||
.profile-img {
|
.profile-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 22rem; /* Adjust as needed */
|
object-fit: cover;
|
||||||
left: 15rem; /* Adjust as needed */
|
transform: translate(10%, 25%);
|
||||||
z-index: 1; /* Place the profile picture above the background image */
|
z-index: 1; /* Place the profile picture above the background image */
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
|
min-width: 200px;
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
|
min-height: 200px;
|
||||||
border-radius: 200px;
|
border-radius: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,11 +126,16 @@ a,
|
||||||
}
|
}
|
||||||
|
|
||||||
.background-img{
|
.background-img{
|
||||||
max-width: 1500px;
|
min-width: 100%;
|
||||||
max-height: 800px;
|
max-height: 300px;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-img {
|
.project-img {
|
||||||
max-width: 1500px;
|
max-width: 1500px;
|
||||||
max-height: 450px;
|
max-height: 450px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aboutme{
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
BIN
src/Interlinked.Core/wwwroot/images/DefaultBanner.png
Normal file
BIN
src/Interlinked.Core/wwwroot/images/DefaultBanner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 392 KiB |
BIN
src/Interlinked.Core/wwwroot/images/DefaultUserProfile.jpg
Normal file
BIN
src/Interlinked.Core/wwwroot/images/DefaultUserProfile.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
src/Interlinked.Core/wwwroot/images/InterlinkedLogoBlack.png
Normal file
BIN
src/Interlinked.Core/wwwroot/images/InterlinkedLogoBlack.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
src/Interlinked.Core/wwwroot/images/InterlinkedLogoWhite.png
Normal file
BIN
src/Interlinked.Core/wwwroot/images/InterlinkedLogoWhite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
61
src/Interlinked.Shared/GeoLib.cs
Normal file
61
src/Interlinked.Shared/GeoLib.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue