Refactoring 1
@@ -9,3 +9,9 @@
|
|||||||
/MyWebsite/MyWebsite/bin/Release/netcoreapp2.1
|
/MyWebsite/MyWebsite/bin/Release/netcoreapp2.1
|
||||||
/MyWebsite/bin
|
/MyWebsite/bin
|
||||||
/MyWebsite/obj
|
/MyWebsite/obj
|
||||||
|
/MyWebsite/MyWebsite/bin/Debug/netcoreapp3.1
|
||||||
|
/MyWebsite.old/.vs/MyWebsite
|
||||||
|
/MyWebsite.old/MyWebsite/bin/Debug/netcoreapp2.1
|
||||||
|
/MyWebsite.old/MyWebsite/obj/Debug/netcoreapp2.1
|
||||||
|
/MyWebsite.old/MyWebsite/obj
|
||||||
|
/MyWebsite.old/obj/Debug/netcoreapp2.1
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.29519.181
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyWebsite", "MyWebsite\MyWebsite.csproj", "{9FB2B925-DC18-4081-AC91-96F2C49415F9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{9FB2B925-DC18-4081-AC91-96F2C49415F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9FB2B925-DC18-4081-AC91-96F2C49415F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9FB2B925-DC18-4081-AC91-96F2C49415F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9FB2B925-DC18-4081-AC91-96F2C49415F9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {DBEA98A5-43F1-4B55-B5E0-F2913A985494}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MyWebsite.Models;
|
||||||
|
|
||||||
|
namespace MyWebsite.Areas.API
|
||||||
|
{
|
||||||
|
[Route("API/[controller]")]
|
||||||
|
[Area("API")]
|
||||||
|
[ApiController]
|
||||||
|
public class FoxTubeController : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpPost("AddMetrics")]
|
||||||
|
public string AddMetrics()
|
||||||
|
{
|
||||||
|
MetricsPackage metrics = new MetricsPackage
|
||||||
|
{
|
||||||
|
Title = Request.Form["Title"],
|
||||||
|
Content = Request.Form["Content"],
|
||||||
|
Version = Request.Form["Version"]
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: Insert package to database
|
||||||
|
|
||||||
|
return metrics.Id.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("Messages")]
|
||||||
|
public IActionResult Messages(bool toast = false, DateTime? publishedAfter = null, string lang = "en-US")
|
||||||
|
{
|
||||||
|
if(toast)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("Changelogs")]
|
||||||
|
public IActionResult Changelogs(bool toast = false, string version = null, string lang = "en-US")
|
||||||
|
{
|
||||||
|
if(toast)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace MyWebsite.Areas.Projects.Controllers
|
||||||
|
{
|
||||||
|
[Area("Projects")]
|
||||||
|
public class FoxTubeController : Controller
|
||||||
|
{
|
||||||
|
public IActionResult Index() =>
|
||||||
|
View("Areas/Projects/Views/FoxTube.cshtml");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "FoxTube";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1>FoxTube</h1>
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MyWebsite.Models;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace MyWebsite.Controllers
|
||||||
|
{
|
||||||
|
public class GalleryController : Controller
|
||||||
|
{
|
||||||
|
public GalleryController(DatabaseContext context) =>
|
||||||
|
Startup.Database = context;
|
||||||
|
|
||||||
|
public IActionResult Index() =>
|
||||||
|
View();
|
||||||
|
|
||||||
|
public async Task<IActionResult> Details(string id) =>
|
||||||
|
View(Startup.Database.Gallery.FirstOrDefault(i => i.FileName == id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MyWebsite.Models;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace MyWebsite.Controllers
|
||||||
|
{
|
||||||
|
public class HomeController : Controller
|
||||||
|
{
|
||||||
|
public HomeController(DatabaseContext context) =>
|
||||||
|
Startup.Database = context;
|
||||||
|
|
||||||
|
public IActionResult Index() =>
|
||||||
|
View();
|
||||||
|
|
||||||
|
[Route("Contacts")]
|
||||||
|
public IActionResult Contacts() =>
|
||||||
|
View();
|
||||||
|
|
||||||
|
[Route("Error")]
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
|
public IActionResult Error() =>
|
||||||
|
View("Views/Shared/Error.cshtml", new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class DatabaseContext : DbContext
|
||||||
|
{
|
||||||
|
public DbSet<Link> Links { get; set; }
|
||||||
|
public DbSet<Image> Gallery { get; set; }
|
||||||
|
public DbSet<Project> Projects { get; set; }
|
||||||
|
|
||||||
|
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
|
||||||
|
{
|
||||||
|
Database.EnsureCreated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class ErrorViewModel
|
||||||
|
{
|
||||||
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class Image
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public DateTime CreationDate { get; set; }
|
||||||
|
[Key]
|
||||||
|
public string FileName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class Link
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
public bool CanContactMe { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class MetricsPackage
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Content { get; set; }
|
||||||
|
public string Version { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace MyWebsite.Models
|
||||||
|
{
|
||||||
|
public class Project
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string ImageName { get; set; }
|
||||||
|
public string Link { get; set; }
|
||||||
|
public string LinkCaption { get; set; }
|
||||||
|
public string Badges { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||||
|
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||||
|
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
|
||||||
|
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
|
||||||
|
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
|
||||||
|
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
|
||||||
|
<WebStackScaffolding_LayoutPageFile />
|
||||||
|
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
||||||
|
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace MyWebsite
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
CreateHostBuilder(args).Build().Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
|
Host.CreateDefaultBuilder(args)
|
||||||
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
|
{
|
||||||
|
webBuilder.UseStartup<Startup>();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:55171",
|
||||||
|
"sslPort": 44386
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MyWebsite": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MyWebsite.Models;
|
||||||
|
|
||||||
|
namespace MyWebsite
|
||||||
|
{
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public static DatabaseContext Database { get; set; }
|
||||||
|
|
||||||
|
public Startup(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
Configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IConfiguration Configuration { get; }
|
||||||
|
|
||||||
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
string connection = Configuration.GetConnectionString("DefaultConnection");
|
||||||
|
services.AddDbContext<DatabaseContext>(options =>
|
||||||
|
options.UseSqlServer(connection));
|
||||||
|
|
||||||
|
services.AddControllersWithViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
public static void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
if (env.IsDevelopment())
|
||||||
|
app.UseDeveloperExceptionPage();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.UseExceptionHandler("/Error");
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
|
app.UseHsts();
|
||||||
|
}
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
app.UseStaticFiles();
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.UseEndpoints(endpoints =>
|
||||||
|
{
|
||||||
|
endpoints.MapAreaControllerRoute(
|
||||||
|
name: "projects",
|
||||||
|
areaName: "Projects",
|
||||||
|
pattern: "Projects/{controller=Projects}/{action=Index}/{id?}");
|
||||||
|
endpoints.MapAreaControllerRoute(
|
||||||
|
name: "api",
|
||||||
|
areaName: "API",
|
||||||
|
pattern: "API/{controller}/{action}");
|
||||||
|
endpoints.MapControllerRoute(
|
||||||
|
name: "default",
|
||||||
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
@model Image;
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = Model.Title;
|
||||||
|
}
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<p> <a asp-action="Index" asp-controller="Gallery">Back to gallery</a></p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<article class="image-overview-block">
|
||||||
|
<img src="~/images/Gallery/@Model.FileName" onclick="ToggleImageSize();" id="image" />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1>@Model.Title</h1>
|
||||||
|
<span>Creation date: @Model.CreationDate.ToShortDateString()</span>
|
||||||
|
<p>@Model.Description</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="~/css/Gallery.css" />
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "My artworks";
|
||||||
|
}
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h1>My arts</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<article class="info-block gallery">
|
||||||
|
@if (Startup.Database.Gallery.Count() > 0)
|
||||||
|
foreach (Image image in Startup.Database.Gallery)
|
||||||
|
{
|
||||||
|
<a asp-action="Details" asp-route-id="@image.FileName"><img title="@image.Title" src="~/images/Gallery/@image.FileName" /></a>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<h3>No content available</h3>
|
||||||
|
}
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="~/css/Gallery.css" />
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Contact info";
|
||||||
|
}
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h1>Contact information</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<p>
|
||||||
|
@foreach (Link link in Startup.Database.Links.Where(i => i.CanContactMe))
|
||||||
|
{
|
||||||
|
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
@foreach (Link link in Startup.Database.Links.Where(i => !i.CanContactMe))
|
||||||
|
{
|
||||||
|
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Home Page";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Welcome</h1>
|
||||||
|
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@using Newtonsoft.Json
|
||||||
|
@using System.Net
|
||||||
|
@{
|
||||||
|
Dictionary<string, Link> links = JsonConvert.DeserializeObject<Dictionary<string, Link>>(new WebClient().DownloadString($"{Context.Request.Scheme}://{Context.Request.Host}/Links.json"));
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="contact-me">
|
||||||
|
<code>
|
||||||
|
<var>if</var> (<var class="class">You</var>.InsterestedInMe)<br />
|
||||||
|
<span class="t1"></span><var class="method">ContactMe</var>();<br />
|
||||||
|
<br />
|
||||||
|
<a class="comment">// All links are clickable</a><br />
|
||||||
|
<var>public void</var> <var class="method">ConatactMe</var>()<br />
|
||||||
|
{<br />
|
||||||
|
<span class="t1"></span><var>string</var> email = <a class="string" href="mailto:michael.xfox@outlook.com">"mihcael.xfox@outlook.com"</a>;<br />
|
||||||
|
<span class="t1"></span><var class="class">Link</var>[] socialNetworks = <var>new</var> <var class="class">Link</var>[]<br />
|
||||||
|
<span class="t1"></span>{<br />
|
||||||
|
<span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"LinkedIn"</a>, <a class="string" target="_blank" href="@(links["linkedin"].Url)">"https:@(links["linkedin"].Url)"</a>),<br />
|
||||||
|
<span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"GitHub"</a>, <a class="string" target="_blank" href="@(links["github"].Url)">"https:@(links["github"].Url)"</a>),<br />
|
||||||
|
<span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"Twitter"</a>, <a class="string" target="_blank" href="@(links["twitter"].Url)">"https:@(links["twitter"].Url)"</a>),<br />
|
||||||
|
<span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"Vkontakte"</a>, <a class="string" target="_blank" href="@(links["vk"].Url)">"https:@(links["vk"].Url)"</a>)<br />
|
||||||
|
<span class="t1"></span>}<br />
|
||||||
|
}<br />
|
||||||
|
<br />
|
||||||
|
<a class="comment">// Copyright ©@(DateTime.Today.Year) Michael "XFox" Gordeev</a>
|
||||||
|
</code>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="~/css/ContactsBlock.css" />
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
@model ErrorViewModel
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Error";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1 class="text-danger">Error.</h1>
|
||||||
|
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||||
|
|
||||||
|
@if (Model.ShowRequestId)
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
|
||||||
|
<h3>Development Mode</h3>
|
||||||
|
<p>
|
||||||
|
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||||
|
It can result in displaying sensitive information from exceptions to end users.
|
||||||
|
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||||
|
and restarting the app.
|
||||||
|
</p>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>@ViewData["Title"] - XFox111.NET</title>
|
||||||
|
<link rel="shortcut icon" href="~/images/favicon.png" type="image/png" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="~/css/style.css" />
|
||||||
|
<link rel="stylesheet" href="https://d1azc1qln24ryf.cloudfront.net/114779/Socicon/style-cf.css?9ukd8d">
|
||||||
|
|
||||||
|
<script src="~/js/site.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<meta name="author" content="Michael 'XFox' Gordeev" />
|
||||||
|
<meta name="description" content="Hi, my name is Michael. I'm C# Developer and this is my personal website. Here you can find info about me, my projects and more. Check it out!" />
|
||||||
|
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:site_name" content="XFox111.NET" />
|
||||||
|
<meta property="og:url" content="//XFox111.NET/" />
|
||||||
|
<meta property="og:locale" content="en_US" />
|
||||||
|
<meta property="og:image" content="~/images/me.png" />
|
||||||
|
<meta property="og:description" content="Hi, my name is Michael. I'm C# Developer and this is my personal website. Here you can find info about me, my projects and more. Check it out!" />
|
||||||
|
<meta property="og:title" content="Michael 'XFox' Gordeev - Personal website" />
|
||||||
|
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="navbar">
|
||||||
|
<a asp-controller="Home" asp-action="Index">XFox111.NET</a>
|
||||||
|
|
||||||
|
<menu type="toolbar" class="main-menu" style="display:none">
|
||||||
|
<li><a asp-controller="About" asp-action="Index">AboutMe();</a></li>
|
||||||
|
<li><a asp-controller="CV" asp-action="Index">CV();</a></li>
|
||||||
|
<li><a asp-controller="Projects" asp-action="Index">Projects();</a></li>
|
||||||
|
<li><a asp-controller="Gallery" asp-action="Index">Arts();</a></li>
|
||||||
|
<li><a asp-controller="Contacts" asp-action="Index">Contacts();</a></li>
|
||||||
|
</menu>
|
||||||
|
|
||||||
|
<a class="language-switch" asp-controller="Home" asp-action="SwitchLanguage" lang="ru">РУС </a>
|
||||||
|
<a class="menu-toggle" onclick="ToggleMenu();"></a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
@RenderBody()
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<span class="comment">// Copyright ©@(DateTime.Today.Year) <b>Michael "XFox" Gordeev</b></span>
|
||||||
|
|
||||||
|
@foreach (Link link in from i in Startup.Database.Links where new string[] { "outlook", "linkedin", "github" }.Contains(i.Name) orderby i.Name descending select i)
|
||||||
|
{
|
||||||
|
<a class="socicon-@(link.Name)" href="@(link.Url)" target="_blank" title="@(link.Title)"></a>
|
||||||
|
}
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||||
|
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@using MyWebsite
|
||||||
|
@using MyWebsite.Models
|
||||||
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@{
|
||||||
|
Layout = "_Layout";
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=xfox111;Trusted_Connection=True;"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
article {
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: -10px;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
.block .content {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.block .background {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: white;
|
||||||
|
background-color: #00a7dc;
|
||||||
|
font-size: 36px;
|
||||||
|
text-shadow: 2px 2px 1px black;
|
||||||
|
}
|
||||||
|
.intro .content {
|
||||||
|
bottom: 50px;
|
||||||
|
left: 50px;
|
||||||
|
max-width: 65%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sut {
|
||||||
|
color: white;
|
||||||
|
background-color: #ff8000;
|
||||||
|
font-size: 28px;
|
||||||
|
text-shadow: 2px 2px 1px black;
|
||||||
|
}
|
||||||
|
.sut .content {
|
||||||
|
margin: 50px 50px;
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
input {
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid black;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid black;
|
||||||
|
border-radius: 10px;
|
||||||
|
width: 100%;
|
||||||
|
-moz-appearance: none; /* Firefox */
|
||||||
|
-webkit-appearance: none; /* Safari and Chrome */
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 0px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
background-color: #343434;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
resize: none;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 200px;
|
||||||
|
font-family: Consolas;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-container::after {
|
||||||
|
content: '>';
|
||||||
|
transform: rotate(90deg);
|
||||||
|
-webkit-transform: rotate(90deg);
|
||||||
|
-moz-transform: rotate(90deg);
|
||||||
|
-ms-transform: rotate(90deg);
|
||||||
|
right: 11px;
|
||||||
|
top: 11px;
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 700px) {
|
||||||
|
form {
|
||||||
|
max-width: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
footer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-me {
|
||||||
|
padding: 30px 50px;
|
||||||
|
background-color: #1e1e1e;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
var {
|
||||||
|
color: #569cd6;
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.class {
|
||||||
|
color: #4ec9b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.string, .string:visited {
|
||||||
|
color: #d69d85;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.string:link:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.method {
|
||||||
|
color: #dcdcaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t1 { margin-right: 25px; }
|
||||||
|
.t2 { margin-right: 50px; }
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
.gallery img {
|
||||||
|
object-fit: cover;
|
||||||
|
max-height: 300px;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 2px;
|
||||||
|
transition: .25s;
|
||||||
|
}
|
||||||
|
.gallery img:hover {
|
||||||
|
filter: brightness(125%);
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-overview-block img {
|
||||||
|
max-height: 50vh;
|
||||||
|
max-width: 100%;
|
||||||
|
float: left;
|
||||||
|
cursor: zoom-in;
|
||||||
|
}
|
||||||
|
.image-overview-block div {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
.image-overview-block h1 {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.gallery img {
|
||||||
|
max-height: none;
|
||||||
|
}
|
||||||
|
.gallery img:hover {
|
||||||
|
filter: brightness(125%);
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
header {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
grid-column-gap: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
article {
|
||||||
|
margin: 0px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-stats {
|
||||||
|
margin-top: 20px;
|
||||||
|
width: 200px;
|
||||||
|
height: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-item {
|
||||||
|
display: grid;
|
||||||
|
padding: 20px;
|
||||||
|
padding-top: 0px;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
grid-row-gap: 20px;
|
||||||
|
background-color: whitesmoke;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
height: 25px;
|
||||||
|
width: 25px;
|
||||||
|
margin-right: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.csharp { background-image: url(../images/Badges/csharp.png); }
|
||||||
|
.dotnet { background-image: url("../images/Badges/dotnet.png"); }
|
||||||
|
.xamarin { background-image: url("../images/Badges/xamarin.png"); }
|
||||||
|
.unity { background-image: url("../images/Badges/unity.png"); }
|
||||||
|
.android { background-image: url("../images/Badges/android.png"); }
|
||||||
|
.uwp { background-image: url("../images/Badges/windows.png"); }
|
||||||
|
.win32 { background-image: url("../images/Badges/windows.png"); }
|
||||||
|
.windows { background-image: url("../images/Badges/windows.png"); }
|
||||||
|
.ios { background-image: url("../images/Badges/ios.png"); }
|
||||||
|
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
|
.github-stats {
|
||||||
|
grid-row: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: 'Consolas';
|
||||||
|
src: url("/fonts/consolas.eot");
|
||||||
|
src: url("/fonts/consolas.eot?#iefix") format("embedded-opentype"), url("/fonts/consolas.otf") format("opentype"), url("/fonts/consolas.svg") format("svg"), url("/fonts/consolas.ttf") format("truetype"), url("/fonts/consolas.woff") format("woff"), url("/fonts/consolas.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Segoe MDL2 Assets';
|
||||||
|
src: url("/fonts/segoeMLD2assets.eot");
|
||||||
|
src: url("/fonts/segoeMLD2assets.eot?#iefix") format("embedded-opentype"), url("/fonts/segoeMLD2assets.otf") format("opentype"), url("/fonts/segoeMLD2assets.svg") format("svg"), url("/fonts/segoeMLD2assets.ttf") format("truetype"), url("/fonts/segoeMLD2assets.woff") format("woff"), url("/fonts/segoeMLD2assets.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Header styles*/
|
||||||
|
.navbar {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr auto auto;
|
||||||
|
grid-column-gap: 10px;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
background-color: #343434;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
padding: 10px;
|
||||||
|
min-height: 33px;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.navbar a:hover {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-menu {
|
||||||
|
margin: 26px auto 26px auto;
|
||||||
|
grid-row: 2;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.main-menu li {
|
||||||
|
font-size: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.language-switch {
|
||||||
|
grid-column: 3;
|
||||||
|
user-select: none
|
||||||
|
}
|
||||||
|
.menu-toggle {
|
||||||
|
grid-column: 4;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Footer styles*/
|
||||||
|
footer {
|
||||||
|
padding: 10px;
|
||||||
|
display: grid;
|
||||||
|
align-items: center;
|
||||||
|
grid-template-columns: 1fr auto auto auto;
|
||||||
|
grid-column-gap: 10px;
|
||||||
|
}
|
||||||
|
footer a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
footer a:hover {
|
||||||
|
color: orangered;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Body styles*/
|
||||||
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
margin-top: 53px;
|
||||||
|
font-family: Consolas, 'Segoe MDL2 Assets';
|
||||||
|
|
||||||
|
/*This stuff is necessary for sticky footer*/
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: 1fr auto;
|
||||||
|
height: calc(100vh - 53px);
|
||||||
|
}
|
||||||
|
|
||||||
|
header a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
header a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
article, header {
|
||||||
|
margin: 0px 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
article a:visited, article a:link {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment, .comment:visited {
|
||||||
|
color: #57a64a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Adaptive code*/
|
||||||
|
@media only screen and (min-width: 1000px) {
|
||||||
|
.main-menu {
|
||||||
|
display: initial !important;
|
||||||
|
grid-row: 1;
|
||||||
|
grid-column: 2;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
.main-menu li {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
.menu-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 1021 KiB After Width: | Height: | Size: 1021 KiB |
|
Before Width: | Height: | Size: 783 KiB After Width: | Height: | Size: 783 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |