From c00836defd73e75d07646cab012afc4a8ce0d030 Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Thu, 26 Sep 2019 17:48:11 +0200 Subject: [PATCH] Installed Bootstrap and jQuery, broke the sidenav --- angular.json | 8 +++-- package-lock.json | 10 +++++++ package.json | 2 ++ src/app/components/nav/nav.component.html | 20 ++++++++++++- src/app/components/nav/nav.component.scss | 36 +++++++++++++++++++++++ src/app/components/nav/nav.component.ts | 9 +++++- 6 files changed, 81 insertions(+), 4 deletions(-) diff --git a/angular.json b/angular.json index e28a5e5..62b88ef 100644 --- a/angular.json +++ b/angular.json @@ -28,9 +28,13 @@ "src/assets" ], "styles": [ - "src/styles.scss" + "src/styles.scss", + "./node_modules/bootstrap/dist/css/bootstrap.min.css" ], - "scripts": [] + "scripts": [ + "./node_modules/jquery/dist/jquery.min.js", + "./node_modules/bootstrap/dist/js/bootstrap.min.js" + ] }, "configurations": { "production": { diff --git a/package-lock.json b/package-lock.json index c50f656..e2f58b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1554,6 +1554,11 @@ "multicast-dns-service-types": "^1.1.0" } }, + "bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -5306,6 +5311,11 @@ "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=", "dev": true }, + "jquery": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", + "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", diff --git a/package.json b/package.json index c41add2..6682e62 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "@fortawesome/angular-fontawesome": "^0.5.0", "@fortawesome/fontawesome-svg-core": "^1.2.24", "@fortawesome/free-solid-svg-icons": "^5.11.1", + "bootstrap": "^4.3.1", + "jquery": "^3.4.1", "rxjs": "~6.4.0", "tslib": "^1.9.0", "zone.js": "~0.9.1" diff --git a/src/app/components/nav/nav.component.html b/src/app/components/nav/nav.component.html index f23d834..303804b 100644 --- a/src/app/components/nav/nav.component.html +++ b/src/app/components/nav/nav.component.html @@ -1 +1,19 @@ -

nav works!

+
+ + +
+ \ No newline at end of file diff --git a/src/app/components/nav/nav.component.scss b/src/app/components/nav/nav.component.scss index e69de29..e1e14b6 100644 --- a/src/app/components/nav/nav.component.scss +++ b/src/app/components/nav/nav.component.scss @@ -0,0 +1,36 @@ +body { + overflow-x: hidden; + } + + #sidebar-wrapper { + min-height: 100vh; + margin-left: -15rem; + -webkit-transition: margin .25s ease-out; + -moz-transition: margin .25s ease-out; + -o-transition: margin .25s ease-out; + transition: margin .25s ease-out; + } + + #sidebar-wrapper .sidebar-heading { + padding: 0.875rem 1.25rem; + font-size: 1.2rem; + } + + #sidebar-wrapper .list-group { + width: 15rem; + } + + #wrapper.toggled #sidebar-wrapper { + margin-left: 0; + } + + @media (min-width: 768px) { + #sidebar-wrapper { + margin-left: 0; + } + + #wrapper.toggled #sidebar-wrapper { + margin-left: -15rem; + } + } + \ No newline at end of file diff --git a/src/app/components/nav/nav.component.ts b/src/app/components/nav/nav.component.ts index 2cc48b6..ff9baa6 100644 --- a/src/app/components/nav/nav.component.ts +++ b/src/app/components/nav/nav.component.ts @@ -6,10 +6,17 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./nav.component.scss'] }) export class NavComponent implements OnInit { +navToggled; - constructor() { } + constructor() { + this.navToggled = false; + } ngOnInit() { } + toggleNav() { + this.navToggled = (this.navToggled) ? false : true; + } + }