diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..83da336 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/CourseApp/bin/Debug/netcoreapp3.0/CourseApp.dll", + "args": [], + "cwd": "${workspaceFolder}/CourseApp", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..7dea23c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/CourseApp/CourseApp.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/CourseApp/CourseApp.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "${workspaceFolder}/CourseApp/CourseApp.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Contact.html b/Contact.html new file mode 100644 index 0000000..ecddf2f --- /dev/null +++ b/Contact.html @@ -0,0 +1,143 @@ + + + + + + + + + + + + Moro WebSite + + + + + + + + + +
+
+
+
+


+
+
+
+

About Me

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sed + blanditiis, consequuntur, soluta labore incidunt repudiandae? + In dolorum rem voluptas soluta dolore, quae autem, natus hic + numquam obcaecati aliquam, molestiae fugit! +

+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. + Quibusdam at maxime sunt, magni officia consequuntur, + voluptate cumque sint voluptatibus facilis rerum, voluptas? + Labore, ab consequuntur optio ipsum alias dolores, eius! +

+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+ +
+ + + + + +
+ + diff --git a/CourseApp.Tests/AgeTest.cs b/CourseApp.Tests/AgeTest.cs new file mode 100644 index 0000000..2cbfd5a --- /dev/null +++ b/CourseApp.Tests/AgeTest.cs @@ -0,0 +1,45 @@ +using System; +using Xunit; + +namespace CourseApp.Tests +{ + public class AgeTest + { + [Fact] + public void TestDate() + { + double a = DateTime.Now.Ticks - new DateTime(1998, 08, 04).Ticks; + double b = AgeClass.DateCompare(new DateTime(1998, 08, 04), DateTime.Now).Ticks; + if (b - a > 0.000000001) + { + Assert.True(true); + } + } + + [Fact] + public void TestTodayBirthday() + { + try + { + Assert.Equal(0, DateTime.Compare(DateTime.Now, AgeClass.DateCompare(DateTime.Now, DateTime.Now))); + } + catch (Exception) + { + Console.WriteLine("Birthday == Today"); + } + } + + [Fact] + public void BirthdayAboveToday() + { + try + { + Assert.Equal(0, DateTime.Compare(DateTime.Now, AgeClass.DateCompare(DateTime.Now, new DateTime(2048, 8, 16)))); + } + catch (Exception) + { + Console.WriteLine("Birthday > Today"); + } + } + } +} diff --git a/CourseApp.Tests/PersonTest.cs b/CourseApp.Tests/PersonTest.cs index bc89213..4ad4ec2 100644 --- a/CourseApp.Tests/PersonTest.cs +++ b/CourseApp.Tests/PersonTest.cs @@ -6,33 +6,54 @@ namespace CourseApp.Tests public class PersonTest { [Fact] - public void TestConstructor() + public void TestConstructorStudent() { - var item = new Person(); + var item = new Student(); Assert.Equal(18, item.Age); Assert.Equal("Name", item.Name); Assert.Equal("LastName", item.LastName); + Assert.True(item.IsMale); + Assert.True(item.Starvation); } [Fact] - public void TestSetAge() + public void TestConstructorChildren() { - var item = new Person(); - item.Age = 30; - Assert.Equal(30, item.Age); + var item = new Children(); + Assert.Equal(1, item.Age); + Assert.Equal("Name", item.Name); + Assert.Equal("LastName", item.LastName); + Assert.True(item.IsMale); + Assert.False(item.Happy); + } + + [Fact] + public void TestSetAgeChildren() + { + var item = new Children(); + item.Age = 9; + Assert.Equal(9, item.Age); + } + + [Fact] + public void TestSetAgeStudent() + { + var item = new Student(); + item.Age = 20; + Assert.Equal(20, item.Age); } [Fact] - public void TestIncorrectSetAge() + public void TestIncorrectSetAgeChildren() { try { - var item = new Person(); + var item = new Children(); item.Age = -1000; } catch (System.Exception) { - Console.WriteLine("Age should be more 0 and less than 100"); + Console.WriteLine("Age should be more 0 and less than 12"); Assert.True(true); } } @@ -40,7 +61,7 @@ public void TestIncorrectSetAge() [Fact] public void TestCorrectIncorrectSetAge() { - var item = new Person(); + var item = new Student(); item.Age = 27; try { @@ -54,25 +75,5 @@ public void TestCorrectIncorrectSetAge() Assert.Equal(27, item.Age); } - - [Fact] - public void TestIncorrectSetString() - { - var item = new Person(); - item.Name = string.Empty; - item.LastName = string.Empty; - Assert.Equal(string.Empty, item.Name); - Assert.Equal(string.Empty, item.LastName); - } - - [Fact] - public void TestCorrectSetString() - { - var item = new Person(); - item.Name = "VikiVik"; - item.LastName = "Moro"; - Assert.Equal("VikiVik", item.Name); - Assert.Equal("Moro", item.LastName); - } } } diff --git a/CourseApp/AgeClass.cs b/CourseApp/AgeClass.cs new file mode 100644 index 0000000..5697515 --- /dev/null +++ b/CourseApp/AgeClass.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CourseApp +{ + public class AgeClass + { + public static string Age() + { + Console.WriteLine("Введите год своего рождения:"); + int years = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Введите месяц своего рождения:"); + int months = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Введите день своего рождения:"); + int days = Convert.ToInt32(Console.ReadLine()); + DateTime result = DateCompare(new DateTime(years, months, days), DateTime.Now); + return $"Вам {result.Year - 1} лет, {result.Month - 1} месяцев и {result.Day - 1} дня"; + } + + public static string Age(int days, int months, int years) + { + DateTime result = DateCompare(new DateTime(years, months, days), DateTime.Now); + return $"Вам {result.Year - 1} лет, {result.Month - 1} месяцев и {result.Day - 1} дня"; + } + + public static DateTime DateCompare(DateTime date1, DateTime date2) + { + if (date1.Ticks < date2.Ticks) + { + DateTime res = new DateTime(date2.Ticks - date1.Ticks); + return res; + } + + throw new Exception(); + } + + public static string Age(DateTime date) + { + return $"Вам {DateCompare(date, DateTime.Now).Year - 1} лет, {DateCompare(date, DateTime.Now).Month - 1} месяцев и {DateCompare(date, DateTime.Now).Day - 1} дня"; + } + } +} diff --git a/CourseApp/Children.cs b/CourseApp/Children.cs new file mode 100644 index 0000000..077999d --- /dev/null +++ b/CourseApp/Children.cs @@ -0,0 +1,66 @@ +using System; + +namespace CourseApp +{ + public class Children : Person + { + public Children() + : this("Name") + { + } + + public Children(string name) + : this(name, "LastName") + { + } + + public Children(string name, string lastname) + : this(name, lastname, 1) + { + } + + public Children(string name, string lastname, int age) + : this(name, lastname, age, true) + { + } + + public Children(string name, string lastname, int age, bool isMale) + : this(name, lastname, age, isMale, false) + { + } + + public Children(string name, string lastname, int age, bool isMale, bool happy) + : base(name, lastname, age, isMale) + { + this.Happy = happy; + } + + public bool Happy { get; set; } + + public override int Age + { + set + { + if (value >= 0 && value < 12) + { + base.Age = value; + } + else + { + throw new System.Exception("Age should be more 0 and less than 12"); + } + } + } + + public override string ToString() + { + string s = $"Hi. I am {Name} {LastName}. I am {Age} years old. I am a {(IsMale ? "male" : "female")} and {(Happy ? "unhappy" : "happy")}"; + return s; + } + + public override string Replica() + { + return "I want to go to school"; + } + } +} \ No newline at end of file diff --git a/CourseApp/Person.cs b/CourseApp/Person.cs index e069e53..c0f3887 100644 --- a/CourseApp/Person.cs +++ b/CourseApp/Person.cs @@ -2,7 +2,7 @@ namespace CourseApp { - public class Person + public abstract class Person { private int age; @@ -22,13 +22,19 @@ public Person(string name, string lastname) } public Person(string name, string lastname, int age) + : this(name, lastname, age, true) + { + } + + public Person(string name, string lastname, int age, bool isMale) { this.Name = name; this.LastName = lastname; this.age = age; + this.IsMale = isMale; } - public int Age + public virtual int Age { get { @@ -52,10 +58,14 @@ public int Age public string LastName { get; set; } + public bool IsMale { get; set; } + public override string ToString() { - string s = $"Hi. I am {Name} {LastName}. I am {Age} years old."; + string s = $"Hi. I am {Name} {LastName}. I am {Age} years old. I am a {(IsMale ? "male" : "female")}"; return s; } + + public abstract string Replica(); } } \ No newline at end of file diff --git a/CourseApp/Program.cs b/CourseApp/Program.cs index ac6d37a..f32636c 100644 --- a/CourseApp/Program.cs +++ b/CourseApp/Program.cs @@ -59,14 +59,20 @@ public static void Main(string[] args) Console.WriteLine($"y = {item}"); } - Person[] people = new Person[2]; - people[0] = new Person("Sasha", "Smirnov", 25); - people[1] = new Person("Polina", "Suvorova", 22); - foreach (var item in people) + Console.WriteLine(); + + Person[] masss = new Person[2]; + masss[0] = new Student("Artem", "Scherbinin", 18, true, true); + masss[1] = new Children("Alina", "Kotova", 7, false, true); + foreach (var item in masss) { - Console.WriteLine(item); + Console.WriteLine(item.ToString()); + Console.WriteLine(item.Replica()); + Console.WriteLine(); } + Console.WriteLine(AgeClass.Age()); + Console.WriteLine(); Console.ReadLine(); } } diff --git a/CourseApp/Student.cs b/CourseApp/Student.cs new file mode 100644 index 0000000..e5e2599 --- /dev/null +++ b/CourseApp/Student.cs @@ -0,0 +1,51 @@ +using System; + +namespace CourseApp +{ + public class Student : Person + { + public Student() + : this("Name") + { + } + + public Student(string name) + : this(name, "LastName") + { + } + + public Student(string name, string lastname) + : this(name, lastname, 18) + { + } + + public Student(string name, string lastname, int age) + : this(name, lastname, age, true) + { + } + + public Student(string name, string lastname, int age, bool isMale) + : this(name, lastname, age, isMale, true) + { + } + + public Student(string name, string lastname, int age, bool isMale, bool starvation) + : base(name, lastname, age, isMale) + { + this.Starvation = starvation; + } + + public bool Starvation { get; set; } + + public override string ToString() + { + string s = $"Hi. I am {Name} {LastName}. I am {Age} years old. I am a {(IsMale ? "male" : "female")} and {(Starvation ? "hungry" : "full")}"; + return s; + } + + public override string Replica() + { + return "I want to go to kindergarten"; + } + } +} \ No newline at end of file diff --git a/Info.html b/Info.html new file mode 100644 index 0000000..dbeef10 --- /dev/null +++ b/Info.html @@ -0,0 +1,194 @@ + + + + + + + + + + + + Moro WebSite + + + + + + +
+ +
+
+

Page Number 2

+

Check it!

+ + +
+
+ + + +
+ +
+ +
+ +
+ + + + +
+ + diff --git a/courseworkspace.code-workspace b/courseworkspace.code-workspace index 4f9af01..4e689d4 100644 --- a/courseworkspace.code-workspace +++ b/courseworkspace.code-workspace @@ -1,11 +1,16 @@ { - "folders": [ - { - "path": "CourseApp" - }, - { - "path": "CourseApp.Tests" - } - ], - "settings": {} -} \ No newline at end of file + "folders": [ + { + "path": "CourseApp" + }, + { + "path": "CourseApp.Tests" + }, + { + "path": "docs" + } + ], + "settings": { + "liveServer.settings.multiRootWorkspaceName": "HTML" + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..c202ba8 --- /dev/null +++ b/index.html @@ -0,0 +1,131 @@ + + + + + + + + + + + + Moro WebSite + + + + + + +
+ +
+
+

Добро пожаловать

+

Самое время ужаснуться контенту!

+
+
+ + + +
+
+
+
+ +
+
+
+
+ +
+ +
+ + + + +
+ + diff --git a/public/audio/Devault - Sapphire.mp3 b/public/audio/Devault - Sapphire.mp3 new file mode 100644 index 0000000..aee5989 Binary files /dev/null and b/public/audio/Devault - Sapphire.mp3 differ diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..35ace6f --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,199 @@ +/* фон начало*/ +.jumbotron1 { + color: rgb(255, 255, 255); + background-image: url("../img/1.jpg"); + background-position: center; + background-repeat: no-repeat; + background-attachment: fixed; + height: 100vh; + background-size: cover; + -webkit-background-size: cover; + -o-background-size: cover; + -moz-background-size: cover; + -khtml-background-size: cover; + -ms-background-size: cover; +} +.jumbotron2 { + color: rgb(255, 255, 255); + background-image: url("../img/2.jpg"); + background-position: center center; + background-repeat: no-repeat; + background-attachment: fixed; + height: 100vh; + background-size: cover; + -webkit-background-size: cover; + -o-background-size: cover; + -moz-background-size: cover; + -khtml-background-size: cover; + -ms-background-size: cover; +} +.jumbotron3 { + color: rgb(255, 255, 255); + background-image: url("../img/Muscle-Car-SplitShire-3D-0009.jpg"); + background-position: center; + background-repeat: no-repeat; + background-attachment: fixed; + height: 100vh; + background-size: cover; + -webkit-background-size: cover; + -o-background-size: cover; + -moz-background-size: cover; + -khtml-background-size: cover; + -ms-background-size: cover; +} +/* фон конец*/ + +/*нижняя панель начало*/ + +footer { + background: #16222a; + background: -webkit-linear-gradient(59deg, #3a6073, #16222a); + background: linear-gradient(59deg, #3a6073, #16222a); + color: white; + margin-top: 100px; +} + +footer a { + color: #fff; + font-size: 14px; + transition-duration: 0.2s; +} + +footer a:hover { + color: #fa944b; + text-decoration: none; +} + +.copy { + font-size: 12px; + padding: 10px; + border-top: 1px solid #ffffff; +} + +.footer-middle { + padding-top: 2em; + color: white; +} + +/*SOCİAL İCONS*/ + +/* footer social icons */ + +ul.social-network { + list-style: none; + display: inline; + margin-left: 0 !important; + padding: 0; +} + +ul.social-network li { + display: inline; + margin: 0 5px; +} + +/* footer social icons */ + +.social-network a.icoFacebook:hover { + background-color: #3b5998; +} + +.social-network a.icoLinkedin:hover { + background-color: #007bb7; +} + +.social-network a.icoFacebook:hover i, +.social-network a.icoLinkedin:hover i { + color: #fff; +} + +.social-network a.socialIcon:hover, +.socialHoverClass { + color: #44bcdd; +} + +.social-circle li a { + display: inline-block; + position: relative; + margin: 0 auto 0 auto; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + border-radius: 50%; + text-align: center; + width: 30px; + height: 30px; + font-size: 15px; +} + +.social-circle li i { + margin: 0; + line-height: 30px; + text-align: center; +} + +.social-circle li a:hover i, +.triggeredHover { + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms--transform: rotate(360deg); + transform: rotate(360deg); + -webkit-transition: all 0.2s; + -moz-transition: all 0.2s; + -o-transition: all 0.2s; + -ms-transition: all 0.2s; + transition: all 0.2s; +} + +.social-circle i { + color: #595959; + -webkit-transition: all 0.8s; + -moz-transition: all 0.8s; + -o-transition: all 0.8s; + -ms-transition: all 0.8s; + transition: all 0.8s; +} + +.social-network a { + background-color: #f9f9f9; +} + +/* нижняя панель конец */ + +html, +body { + height: 100%; + font-family: "Lato", sans-serif; +} +.section-content { + padding: 6rem 0; +} +#about { + background: transparent; + background-size: cover; +} +.about-text { + background: rgba(0, 0, 0, 0.6); + color: white; + padding: 1.87rem; + border-radius: 0.2rem; +} +#footer-main { + background: #222; + color: white; + font-size: 0.8rem; + padding: 2.5rem; +} +#pagination { + text-align: center; + padding: 5rem 0; +} +/* точки останова для адаптивного дизайна */ +@media only screen and (max-width: 400px) { + .display-3 { + display: none; + } +} +@media only screen and (max-width: 990px) { + .name { + margin-right: 8rem; + } +} diff --git a/public/img/1.jpg b/public/img/1.jpg new file mode 100644 index 0000000..7532a35 Binary files /dev/null and b/public/img/1.jpg differ diff --git a/public/img/2.jpg b/public/img/2.jpg new file mode 100644 index 0000000..218479e Binary files /dev/null and b/public/img/2.jpg differ diff --git a/public/img/Muscle-Car-SplitShire-3D-0009.jpg b/public/img/Muscle-Car-SplitShire-3D-0009.jpg new file mode 100644 index 0000000..270b763 Binary files /dev/null and b/public/img/Muscle-Car-SplitShire-3D-0009.jpg differ diff --git a/public/img/logo.png b/public/img/logo.png new file mode 100644 index 0000000..fba342d Binary files /dev/null and b/public/img/logo.png differ diff --git a/public/img/theme.png b/public/img/theme.png new file mode 100644 index 0000000..6bcbb29 Binary files /dev/null and b/public/img/theme.png differ diff --git a/public/js/script.js b/public/js/script.js new file mode 100644 index 0000000..10cd842 --- /dev/null +++ b/public/js/script.js @@ -0,0 +1,47 @@ +// для фона начало +$(".jumbotron1").css({ height: $(window).height() + "px" }); + +$(window).on("resize", function() { + $(".jumbotron1").css({ height: $(window).height() + "px" }); +}); +$(".jumbotron2").css({ height: $(window).height() + "px" }); + +$(window).on("resize", function() { + $(".jumbotron2").css({ height: $(window).height() + "px" }); +}); +$(".jumbotron3").css({ height: $(window).height() + "px" }); + +$(window).on("resize", function() { + $(".jumbotron3").css({ height: $(window).height() + "px" }); +}); +// для фона конец + +// MDB Lightbox Init +$(function() { + $("#mdb-lightbox-ui").load("mdb-addons/mdb-lightbox-ui.html"); +}); + +//карточка в контактах +var card = new TimelineMax(); + +card + .set(".card", { autoAlpha: 0 }) + .set(".card-top-section", { y: -100, autoAlpha: 0 }) + .set(".card-block, .card-action", { y: 100, autoAlpha: 0 }) + .set(".card-img-top", { autoAlpha: 0, scale: 0.5 }) + .to(".card", 0.5, { autoAlpha: 1, ease: Quad.easeInOut }) + .to(".card-top-section, .card-block, .card-action", 0.35, { + autoAlpha: 1, + y: 0, + ease: Quad.easeInOut + }) + .to(".card-img-top", 0.5, { + autoAlpha: 1, + scale: 1, + ease: Elastic.easeInOut + }); + +$(document).ready(function(e) { + var h = $("nav").height() + 20; + $("body").animate({ paddingTop: h }); +});