1
0

Added projects page

This commit is contained in:
Michael Gordeev
2019-10-12 18:22:46 +03:00
parent 70276f5fd7
commit b4ce7c9288
19 changed files with 246 additions and 21 deletions
@@ -9,7 +9,6 @@ namespace MyWebsite.Controllers
{
public class GalleryController : Controller
{
public async Task<IActionResult> Index()
{
ViewData["Images"] = JsonConvert.DeserializeObject<Image[]>(await new HttpClient().GetStringAsync($"https://{Request.Host}/Gallery.json"));
@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace MyWebsite.Controllers
{
public class HelloWorldController : Controller
{
public string Index()
{
return "Hi there, bitch!";
}
}
}
@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using MyWebsite.Models;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
namespace MyWebsite.Controllers
{
public class ProjectsController : Controller
{
public async Task<IActionResult> Index()
{
Project[] projects = JsonConvert.DeserializeObject<Project[]>(await new HttpClient().GetStringAsync($"https://{Request.Host}/Projects.json"));
ViewData["Images"] = projects;
return View();
}
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MyWebsite.Models
{
public class Project
{
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,35 @@
@{
ViewData["Title"] = "My projects";
}
<header>
<div class="inline-header">
<h1>My projects</h1>
<h3>Here is presented the most of projects I worked on</h3>
</div>
<iframe src="//githubbadge.appspot.com/xfox111" style="width: 200px; height: 110px;" class="github-stats" frameborder="0"></iframe>
</header>
<article class="projects-block">
@foreach (Project p in ViewData["Images"] as Project[])
{
<div class="project-item">
@if (!string.IsNullOrWhiteSpace(p.ImageName))
{
<a target="_blank" href="~/images/Projects/@(p.ImageName)"><img src="~/images/Projects/@(p.ImageName)" /></a>
}
<div class="text">
<h1>@p.Title</h1>
<p class="description">@p.Description</p>
<a href="@(p.Link)" target="_blank">@p.LinkCaption</a>
<div>
@foreach (string i in p.Badges)
{
<img class="badge @i" />
}
</div>
</div>
</div>
}
</article>
@@ -21,7 +21,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<body onload="UpdateProjects()">
<nav class="navbar">
<a id="header" asp-controller="Home" asp-action="Index">XFox111.NET</a>
<menu type="toolbar" class="main-menu">
+76
View File
@@ -0,0 +1,76 @@
[
{
"Title": "FoxTube",
"Description": "This is my first big project. And the first one published in Microsoft Store.<br />This is a Windows client application for YouTube",
"ImageName": "FoxTube.png",
"Link": "//foxtube.xfox111.net",
"LinkCaption": "Learn more...",
"Badges": [
"csharp", "dotnet", "uwp"
]
},
{
"Title": "My Bonch",
"Description": "",
"ImageName": "",
"Link": "",
"LinkCaption": "Availavle soon...",
"Badges": [
"csharp", "xamarin", "uwp", "android"/*, "ios"*/
]
},
{
"Title": "MotionDecoder",
"Description": "This project is used to analyze videos from security cameras and shows short clips which contain detected motions.<br />I made this projects during scientific projects competition in big data division.",
"ImageName": "MotionDecoder.png",
"Link": "//github.com/XFox111/motiondecoder",
"LinkCaption": "View on GitHub",
"Badges": [
"csharp",
"dotnet",
"win32"
]
},
{
"Title": "2048",
"Description": "Simple classic game. I made it in Unity just for fun",
"ImageName": "2048.png",
"Link": "",
"LinkCaption": "",
"Badges": [
"csharp", "unity", "windows", "android"
]
},
{
"Title": "MiSmartAlarm",
"Description": "Smart alarm app for Xiaomi MiBand",
"ImageName": "MiSmartAlarm.png",
"Link": "https://github.com/XFox111/mismartalarm",
"LinkCaption": "View on GitHub",
"Badges": [
"csharp", "xamarin", "uwp", "android"
]
},
{
"Title": "YouTubeScrapper",
"Description": "A C# library which is used to extend the abilities of YouTube API v3",
"ImageName": "",
"Link": "https://github.com/XFox111/youtubescraper",
"LinkCaption": "View on GitHub",
"Badges": [
"csharp", "dotnet", "uwp"
]
},
{
"Title": "GZipCompression",
"Description": "Console program which splits files on 1MB blocks and compresses them in multi-thread.<br />I made this program as intro challange in Veeam Software",
"ImageName": "",
"Link": "https://github.com/XFox111/gzipcompression",
"LinkCaption": "View on GitHub",
"Badges": [
"csharp",
"dotnet",
"windows"
]
}
]
+48 -1
View File
@@ -73,7 +73,7 @@ main {
}
header {
margin-left: 50px;
margin: 0px 50px;
}
header a {
text-decoration: none;
@@ -118,3 +118,50 @@ article a:visited {
filter: brightness(125%);
transform: scale(1.25);
}
.inline-header {
display: inline-block;
}
.github-stats {
margin-top: 20px;
float: right;
display: none;
}
.projects-block {
margin: 0px 10px;
}
.project-item {
background-color: whitesmoke;
margin-bottom: 10px;
min-height: 200px;
}
.project-item img {
max-height: 200px;
float: left;
}
.project-item .text {
display: inline-block;
margin-left: 20px;
margin-bottom: 15px;
}
.text div {
margin-top: 20px;
}
.badge {
height: 25px;
width: 25px;
margin-right: 10px !important;
}
.csharp { content: url("../images/Badges/csharp.png"); }
.dotnet { content: url("../images/Badges/dotnet.png"); }
.xamarin { content: url("../images/Badges/xamarin.png"); }
.unity { content: url("../images/Badges/unity.png"); }
.android { content: url("../images/Badges/android.png"); }
.uwp { content: url("../images/Badges/windows.png"); }
.win32 { content: url("../images/Badges/windows.png"); }
.windows { content: url("../images/Badges/windows.png"); }
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

+48 -1
View File
@@ -1,4 +1,5 @@
function ToggleImageSize() {
function ToggleImageSize()
{
var image = document.getElementById("image");
if (image.style.maxHeight == "none")
@@ -6,3 +7,49 @@
else
image.style.maxHeight = "none";
}
function UpdateProjects()
{
// Settings badges tooltips
var badges = document.getElementsByClassName("badge");
for (var i = 0; i < badges.length; i++)
{
switch (badges[i].classList[1])
{
case "csharp":
badges[i].setAttribute("title", "C# Programming language");
break;
case "dotnet":
badges[i].setAttribute("title", ".NET Framework");
break;
case "xamarin":
badges[i].setAttribute("title", "Xamarin Framework");
break;
case "unity":
badges[i].setAttribute("title", "Unity Engine");
break;
case "uwp":
badges[i].setAttribute("title", "Universal Windows Platform");
break;
case "windows":
badges[i].setAttribute("title", "Windows Platform");
break;
case "win32":
badges[i].setAttribute("title", "Windows Platform (Win32)");
break;
case "android":
badges[i].setAttribute("title", "Android Platform");
break;
}
}
// Making projects descriptions multiline
var descriptions = document.getElementsByClassName("description");
for (var i = 0; i < descriptions.length; i++)
{
var desc = descriptions[i];
var text = desc.innerText;
desc.innerText = "";
desc.innerHTML = text;
}
}