Skip to content
Snippets Groups Projects
Commit 74b5bbe5 authored by Paulina Nogal's avatar Paulina Nogal Committed by Joe Van Boxtel
Browse files

Create Web Components header, and Material navigation

parent a9fb5895
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,14 @@ ...@@ -26,7 +26,14 @@
"src/assets/material-theme.scss", "src/assets/material-theme.scss",
"src/styles.css" "src/styles.css"
], ],
"scripts": [] "scripts": [
"./node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js",
"./node_modules/@myuw-web-components/myuw-app-styles/dist/myuw-app-styles.min.js",
"./node_modules/@myuw-web-components/myuw-app-bar/dist/myuw-app-bar.min.js",
"./node_modules/@myuw-web-components/myuw-drawer/dist/myuw-drawer.min.js",
"./node_modules/@myuw-web-components/myuw-profile/dist/myuw-profile.min.js",
"./node_modules/@myuw-web-components/myuw-help/dist/myuw-help.min.js"
]
}, },
"configurations": { "configurations": {
"production": { "production": {
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
<a class="uw-show-on-focus" href="#main" id="uw-skip-link">Skip to main content</a> <myuw-app-bar
<div class="uw-global-bar"> theme-name=""
<a class="uw-global-name-link" href="http://www.wisc.edu">U<span>niversity <span class="uw-of">of</span> </span>W<span>isconsin</span>–Madison</a> app-name="Course Search & Enroll"
</div> app-url="https://my.wisc.edu">
<header id="branding" class="uw-header uw-has-search">
<div class="uw-header-container"> <myuw-drawer slot="myuw-navigation" fxShow fxHide.gt-sm>
<div class="uw-header-crest-title"> <myuw-drawer-link
<div class="uw-header-crest"> slot="myuw-drawer-links"
<!-- <a href="http://www.wisc.edu"><img class="uw-crest-svg" src="assets/uwstyle/images/uw-crest.svg" alt="Link to University of Wisconsin-Madison home page"></a> --> name="Course Search"
</div> icon=""
<div class="uw-title-tagline"> href="/search">
<h1 id="site-title" class="uw-site-title"> </myuw-drawer-link>
<a rel="home">Angular Starter</a> <myuw-drawer-link
</h1> slot="myuw-drawer-links"
<div id="site-description" class="uw-site-tagline">UW-Madison App</div> name="Scheduler"
</div> icon=""
</div> href="/scheduler">
</div> </myuw-drawer-link>
</header> <myuw-drawer-link
slot="myuw-drawer-links"
name="Enrollment"
icon=""
href="/enrollment">
</myuw-drawer-link>
<myuw-drawer-link
slot="myuw-drawer-links"
name="Degree Planner"
icon=""
href="/degree-planner">
</myuw-drawer-link>
</myuw-drawer>
<myuw-help
slot="myuw-help"
myuw-help-title="Need more help?"
show-button
show-default-content>
</myuw-help>
<myuw-profile
slot="myuw-profile"
session-endpoint=""
login-url=""
logout-url="http://login.wisc.edu/logout"
background-color="#9B0000">
</myuw-profile>
</myuw-app-bar>
<app-navigation></app-navigation> <app-navigation></app-navigation>
<main class="uw-row"> <main class="uw-row">
<div class="uw-col"> <div class="uw-col">
......
...@@ -8,3 +8,14 @@ import { Component } from '@angular/core'; ...@@ -8,3 +8,14 @@ import { Component } from '@angular/core';
export class AppComponent { export class AppComponent {
title = 'app'; title = 'app';
} }
document.addEventListener('WebComponentsReady', function() {
let customEvent = new CustomEvent('myuw-login', {
detail: {
person: {
'firstName': 'Bucky'
}
}
});
document.dispatchEvent(customEvent);
});
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppRoutingModule } from './app.routing.module'; import { AppRoutingModule } from './app.routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
...@@ -10,6 +11,7 @@ import { SharedModule } from './shared/shared.module'; ...@@ -10,6 +11,7 @@ import { SharedModule } from './shared/shared.module';
@NgModule({ @NgModule({
imports: [ imports: [
BrowserModule, BrowserModule,
BrowserAnimationsModule,
AppRoutingModule, AppRoutingModule,
CoreModule, CoreModule,
SharedModule SharedModule
...@@ -19,6 +21,7 @@ import { SharedModule } from './shared/shared.module'; ...@@ -19,6 +21,7 @@ import { SharedModule } from './shared/shared.module';
HomeComponent HomeComponent
], ],
providers: [], providers: [],
bootstrap: [ AppComponent ] bootstrap: [ AppComponent ],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
}) })
export class AppModule { } export class AppModule { }
...@@ -5,7 +5,7 @@ import { AppComponent } from './app.component'; ...@@ -5,7 +5,7 @@ import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', component: HomeComponent } { path: 'degree-planner', component: HomeComponent }
]; ];
@NgModule({ @NgModule({
......
<div id="uw-top-menus" class="uw-is-visible uw-horizontal" aria-hidden="false"> <nav mat-tab-nav-bar fxHide fxShow.gt-sm>
<div class="uw-main-nav"> <a mat-tab-link href="https://enroll.wisc.edu/search" routerLinkActive="active">Search</a>
<nav class="uw-nav-menu uw-nav-menu-reverse" aria-label="Main Menu"> <a mat-tab-link href="https://enroll.wisc.edu/scheduler" routerLinkActive="active">Scheduler</a>
<ul id="uw-main-nav" class=""> <a mat-tab-link href="https://enroll.wisc.edu/my-courses" routerLinkActive="active">Enrollment</a>
<li id="menu-item-1" class="home" routerLinkActive="current-menu-item" routerLinkActiveOptions="{exact: true}"> <a mat-tab-link routerLink="/degree-planner" routerLinkActive="active" >Degree Planner</a>
<a routerLink="" aria-current="page">Home</a> </nav>
</li>
<li id="menu-item-2" class="reports uw-dropdown" routerLinkActive="current-menu-item" [class.uw-is-active]="current" (click)="current = !current"> <router-outlet></router-outlet>
<a aria-current="page">Another
<svg class="uw-caret" viewBox="0 0 1792 1792" version="1.1" role="img" aria-labelledby="dynid59778804aac5c7.10843053">
<title id="dynid59778804aac5c7.10843053">Expand</title>
<path d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z"></path>
</svg>
<svg class="uw-caret" viewBox="0 0 1792 1792" version="1.1" role="img" aria-labelledby="dynid59778804aaf5e4.27123023">
<title id="dynid59778804aaf5e4.27123023">Collapse</title>
<path d="M1395 1184q0 13-10 23l-50 50q-10 10-23 10t-23-10l-393-393-393 393q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l466 466q10 10 10 23z"></path>
</svg>
</a>
<ul class="sub-menu menu uw-vertical">
<li><a href="/">Sub-Menu</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
@import '~@angular/material/theming';
@import '~src/assets/material-theme.scss';
.uw-nav-menu .uw-nav-menu-reverse a, .uw-nav-menu .uw-dropdown a { .uw-nav-menu .uw-nav-menu-reverse a, .uw-nav-menu .uw-dropdown a {
cursor: pointer; cursor: pointer;
} }
\ No newline at end of file
.mat-tab-nav-bar {
background-color: #DADFE1;
.mat-tab-link {
opacity: 1;
min-width: auto;
}
.mat-tab-link.active {
border-bottom: 2px solid map-get($uw-primary, 500);
}
}
<p> <p>
home works! home works!
<button mat-raised-button color="primary">Primary</button>
</p> </p>
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule, MatMenuModule, MatIconModule } from '@angular/material'; import { MatButtonModule, MatMenuModule, MatIconModule, MatTabsModule } from '@angular/material';
import { FlexLayoutModule } from '@angular/flex-layout';
const modules = [ const modules = [
CommonModule, CommonModule,
...@@ -9,7 +10,9 @@ const modules = [ ...@@ -9,7 +10,9 @@ const modules = [
ReactiveFormsModule, ReactiveFormsModule,
MatButtonModule, MatButtonModule,
MatMenuModule, MatMenuModule,
MatIconModule MatIconModule,
MatTabsModule,
FlexLayoutModule
]; ];
@NgModule({ @NgModule({
......
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Angular Starter</title> <title>Angular Starter</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<script> <script>
var global = global || window; var global = global || window;
var Buffer = Buffer || []; var Buffer = Buffer || [];
var process = process || { var process = process || {
env: { DEBUG: undefined }, env: { DEBUG: undefined },
version: [] version: []
}; };
</script> </script>
</head> </head>
<body> <body>
<app-root></app-root> <app-root></app-root>
</body> </body>
</html> </html>
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
body {
margin: 0px;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment