Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • adi-ia/ia-angular2-seed-project
  • PNOGAL/ia-angular2-seed-project
  • KJOYNER/ia-angular2-seed-project
  • jvanboxtel/ia-angular2-seed-project
4 results
Show changes
Commits on Source (15)
Showing
with 5062 additions and 8235 deletions
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular starter"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"assets/uwstyle/fonts/uw160/fonts.0.0.1.css",
"assets/uwstyle/dist/css/uw-style.min.css",
"styles.css",
"assets/material-theme.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"lintFix": true,
"styleExt": "scss",
"component": {}
}
}
......@@ -3,7 +3,7 @@ root = true
[*]
charset = utf-8
indent_style = tabs
indent_style = tab
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
......
# IA Angular5 Starter
# IA Angular6 Starter
#### Run `npm install -g @angular/cli` then `npm install` to get started
## Required Reading!
New to Angular? [Angular tutorial](https://angular.io/tutorial)
[Official Angular Style Guide](https://angular.io/guide/styleguide) Go to source for all things Angular
New to Angular Material? [Angular Material](https://material.angular.io/compents/categories)
[Angular Material Guides](https://material.angular.io/guides) Set of nice howtos
## Before you start
Consider a lightweight IDE for developing [Visual Studio Code](https://code.visualstudio.com/)
works great with typescript ecosystem.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
......@@ -12,7 +26,7 @@ Run `ng generate component component-name` to generate a new component. You can
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
......@@ -30,13 +44,72 @@ Run `ng lint` to excute typescript linting. `ng lint --fix` will attempt to fix
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
## Dependances
### [Angular](http://angular.io)
### [Angular CLI](https://github.com/angular/angular-cli)
### [Angular Material 2](https://material.angular.io)
### [UW Style](https://git.doit.wisc.edu/uw-madison-digital-strategy/uw-style)
Have a look at the `package.json` for more a more detailed view.
## Dependancies
[Angular](http://angular.io)
[Angular CLI](https://github.com/angular/angular-cli)
[Angular Material 2](https://material.angular.io)
[UW Style](https://git.doit.wisc.edu/uw-madison-digital-strategy/uw-style)
[Material Design Icons](https://material.io/icons/) If searching for an icon look here: [Material Icons](https://material.io/icons/) These icons are added by a `<link>` tag in the `index.html` file.
## Grid System
UW-Style comes with a basic grid system borrowed from Foundation 6. See their documentation here: [Foundation Grid](https://foundation.zurb.com/sites/docs/flex-grid.html). **Note:** that the `.column` and `.row` classes for Foundation have been renamed to `.uw-row` and `.uw-col` and you will need to use the `uw-flex-column` mixin to build your grid widths. You cannot use `small-6, medium-8` etc. There are various examples in the [UW Style](https://git.doit.wisc.edu/uw-madison-digital-strategy/uw-style) repository.
If you are doing a more complicated layout it is recommended that you use Angular's official layout engine [Angular Flex Layout](https://github.com/angular/flex-layout). This layout is not CSS based and integrates deeper with Angular. Follow their documentation and `npm install` and add this to your project. To learn more about the grid system see their docs here: [Angular Flex Layout Wiki](https://github.com/angular/flex-layout/wiki)
### Removing UW-Style sass imports
If you want to use a different grid system or find yourself wanting to remove a portion of the css, comment out any `@imports` located here: `/assets/uwstyle/assets/scss/uw_style.scss`
## Basic project structure
<pre>
|-- app
| |-- app.component.html
| |-- app.component.scss
| |-- app.component.spec.ts # All tests end with .spec.ts
| |-- app.component.ts
| |-- app.module.ts # Parent app module
| |-- app.routing.module.ts # Primary place to add new routes
| |-- core
| | |-- config.service.ts # Used for config vars
| | |-- core.module.ts
| | |-- data.service.spec.ts # Designed to mock data
| | |-- data.service.ts # One catch all service for data transmission
| | |-- models # Placeholder for user created models/interfaces
| | |-- module-import-check.ts # Prevents the core module from loading twice.
| | `-- navigation # Shared navigation component
| | |-- navigation.component.html
| | |-- navigation.component.scss
| | |-- navigation.component.spec.ts
| | `-- navigation.component.ts
| |-- home # Starter component using the router
| | |-- home.component.html
| | |-- home.component.scss
| | |-- home.component.spec.ts
| | `-- home.component.ts
| `-- shared # App wide shared directory. All modules could have a shared Directory too
| `-- shared.module.ts # Only add Material components here!
|-- assets
| |-- material-theme.scss # Custom Material theme
| `-- uwstyle # Copy of UWStyle
| |-- dist
| |-- fonts
| `-- images
|-- index.html # html entry point gets app.component
|-- main.ts
|-- polyfills.ts # Enables compatibility for older browsers
|-- styles.css # Could be used for global styles/imports
|-- test.ts # Required by karma
|-- tsconfig.app.json
`-- tsconfig.spec.json
../angular.json # All project config for the angular cli
../tslint.json # All project lint settings ex: "ng lint"
../e2e/ # All project end to end tests ex: "ng e2e"
../tsconfig.json # Primary typescript config
</pre>
## Developing
### [Visual Studio Code](https://code.visualstudio.com/)
Works great with typescript ecosystem.
\ No newline at end of file
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ia-angular2-seed-project": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ia-angular2-seed-project",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/assets/uwstyle/fonts/uw160/fonts.0.0.1.css",
"src/assets/uwstyle/assets/scss/uw_style.scss",
"src/assets/material-theme.scss",
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ia-angular2-seed-project:build"
},
"configurations": {
"production": {
"browserTarget": "ia-angular2-seed-project:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ia-angular2-seed-project:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ia-angular2-seed-project-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ia-angular2-seed-project:serve"
},
"configurations": {
"production": {
"devServerTarget": "ia-angular2-seed-project:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ia-angular2-seed-project"
}
\ No newline at end of file
import { AppPage } from './app.po';
describe('Angular Starter', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('ANGULAR STARTER');
});
});
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display app title in header', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('ANGULAR STARTER');
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
......@@ -11,4 +10,4 @@
"node"
]
}
}
}
\ No newline at end of file
This diff is collapsed.
{
"name": "angular-starter",
"name": "ia-angular2-seed-project",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.2",
"@angular/cdk": "^5.1.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/material": "^5.1.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@angular/animations": "^6.1.9",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.1.9",
"@angular/compiler": "^6.1.9",
"@angular/core": "^6.1.9",
"@angular/forms": "^6.1.9",
"@angular/http": "^6.1.9",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.9",
"@angular/platform-browser-dynamic": "^6.1.9",
"@angular/router": "^6.1.9",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"core-js": "^2.5.4",
"intl": "^1.2.5",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
"rxjs": "^6.3.3",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular/cli": "1.6.6",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"@angular-devkit/build-angular": "^0.7.5",
"@angular/cli": "^6.1.5",
"@angular/compiler-cli": "^6.1.9",
"@angular/language-service": "^6.1.9",
"@types/jasmine": "^2.8.9",
"@types/jasminewd2": "^2.0.5",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"protractor": "^5.4.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
"typescript": "~2.7.2"
}
}
......@@ -12,7 +12,7 @@
<h1 id="site-title" class="uw-site-title">
<a rel="home">Angular Starter</a>
</h1>
<div id="site-description" class="uw-site-tagline">UW-Madison Housing</div>
<div id="site-description" class="uw-site-tagline">UW-Madison App</div>
</div>
</div>
</div>
......
......@@ -14,14 +14,14 @@ const routes: Routes = [
@Component({
template: '<div>lazy-loaded</div>'
})
class LazyComponent { }
@NgModule({
})
class LazyComponent { }
@NgModule({
imports: [RouterModule],
declarations: [LazyComponent]
})
class LazyModule { }
})
class LazyModule { }
describe('AppComponent', () => {
beforeEach(async(() => {
......@@ -55,5 +55,5 @@ describe('AppComponent', () => {
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('router-outlet').textContent).toBeDefined();
}));
}));
});
......@@ -2,11 +2,7 @@ import { identifierModuleUrl } from '@angular/compiler';
import { Injectable } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
import 'rxjs/add/observable/of';
import { Observable } from 'rxjs';
import { ConfigService } from './config.service';
......
uw_utils.ready(function() {
// TODO: allow breakpoint to be configured
// assumes only one instance of header search and .uw_main_nav
function add_searchform_to_access() {
var uw_search_list_items = document.querySelectorAll(".uw-nav-menu > ul li.uw-search-list-item"),
uw_main_ul = document.querySelectorAll(".uw-nav-menu:not(.uw-nav-menu-secondary) > ul")[0],
uw_search_form = document.querySelectorAll("header .uw-search-form")[0];
if( window.matchMedia('(max-width: 31.2em)').matches && uw_search_list_items.length < 1 && uw_search_form ) {
var uw_search_li_el = document.createElement('li'),
uw_main_ul_first_child = uw_main_ul.firstElementChild;
uw_search_li_el.classList.add('page_item');
uw_search_li_el.classList.add('uw-search-list-item');
uw_search_li_el.appendChild(uw_search_form);
uw_main_ul.insertBefore(uw_search_li_el, uw_main_ul_first_child);
} else if ( window.matchMedia('(min-width: 31.25em)').matches && uw_search_list_items.length > 0 ) {
var uw_search_form_in_nav = document.querySelectorAll(".uw-nav-menu .uw-search-form")[0],
uw_header_search = document.querySelectorAll(".uw-header-search")[0],
uw_search_list_item = uw_search_list_items[0];
if ( !uw_search_form_in_nav )
return false;
uw_header_search.appendChild(uw_search_form_in_nav);
uw_search_list_item.parentNode.removeChild(uw_search_list_item);
}
}
function mediaQueriesSupported() {
return (typeof window.matchMedia != "undefined" || typeof window.msMatchMedia != "undefined");
}
//On resize and load, if screen is less than breakpoint, move search form into nav bar or vice versa
var uw_main_menu_ul = document.querySelectorAll(".uw-main-nav > nav > ul");
if( uw_main_menu_ul.length && mediaQueriesSupported() ){
add_searchform_to_access();
window.addEventListener('resize', function() {
var uw_search_form_in_nav = document.querySelectorAll(".uw-nav-menu .uw-search-form")[0];
add_searchform_to_access();
}, false);
}
});
uw_utils.ready(function() {
var initMenuButton = function() {
uw_menu_button.addEventListener("click", function(e) {
uw_menu.classList.toggle("uw-is-visible");
uw_utils.toggleBooleanAttr(uw_menu,"aria-hidden");
uw_utils.toggleBooleanAttr(this,"aria-expanded");
return false;
});
};
var initDropdowns = function() {
// Bind click event to toggle child menu and its related attributes
// Also hides any siblings child menus that may be open
var dropdown_buttons = document.querySelectorAll(".uw-dropdown > a");
if (dropdown_buttons.length == 0) {
return;
}
[].forEach.call(dropdown_buttons, function(el) {
el.addEventListener("click", function(e) {
e.preventDefault();
var parent = this.parentNode,
parent_siblings = uw_utils.getSiblings(parent),
child_menu = parent.querySelector('.uw-child-menu');
parent.classList.toggle("uw-is-active");
uw_utils.toggleBooleanAttr(this,"aria-expanded");
uw_utils.toggleBooleanAttr(child_menu,"aria-hidden");
[].forEach.call(parent_siblings, function(el) {
if (el.classList.contains("uw-dropdown")) {
el.classList.remove("uw-is-active");
el.querySelector("a:first-child").setAttribute("aria-expanded",false);
el.querySelector(".uw-child-menu").setAttribute("aria-hidden",true);
};
});
});
});
};
// our main menu items
var main_nav_items = document.querySelectorAll("#uw-main-nav > li");
var calcMainMenuWidth = function() {
var main_nav_width = 0;
[].forEach.call(main_nav_items, function(el){
main_nav_width = main_nav_width + parseInt(window.getComputedStyle(el).width, 10);
});
var add_width = 32; // add 2rem for out padding
if ( supportsGetComputedStyleWidth === undefined)
supportsGetComputedStyleWidth = testGetComputedWidth();
// if not full getComputedStyle support:
// - Add more width for padding in between menu items;
// each item has 15.2px left and right padding
// except the first has 0 left and the last has 0 right padding
if ( !supportsGetComputedStyleWidth ) {
add_width = parseInt( add_width + ( ( (main_nav_items.length*2)-2 ) * 15.2), 10 );
}
main_nav_width = main_nav_width + add_width;
return main_nav_width;
};
// a hack method for detecting IE11 and lack of full support
// for getComputedStyle widths
var testGetComputedWidth = function() {
var test_el = document.getElementById("test-get-computed-style-width");
if ( !test_el ) {
test_el = document.createElement('div');
test_el.setAttribute("id","test-get-computed-style-width");
document.body.appendChild(test_el);
}
if ( parseInt(window.getComputedStyle(test_el).width, 10) < 100 ) {
return false;
} else {
return true;
}
};
var uwMobileMenuResize = function() {
// init windowWidth to 0 to force our dynamic menu recalculations
if ("undefined" == typeof windowWidth) {
windowWidth = 0;
}
// only act if width resized
if ( windowWidth != window.innerWidth ) {
windowWidth = window.innerWidth;
var min_mobile_breakpoint = 500,
menu_width = calcMainMenuWidth();
// calculate menu width if it's visible
if (uw_menu.classList.contains("uw-is-visible")) {
if (window.innerWidth < menu_width || window.innerWidth < min_mobile_breakpoint) {
uw_menu_button.classList.add("uw-is-visible");
uw_menu_button.setAttribute("aria-expanded",false);
uw_menu.classList.remove("uw-horizontal");
uw_menu.classList.add("uw-stacked");
uw_menu.classList.remove("uw-is-visible");
uw_menu.setAttribute("aria-hidden",true);
}
uw_menu.classList.remove("uw-hidden");
} else {
if (window.innerWidth > min_mobile_breakpoint) {
// render menu in non-mobile state but hidden,
// and calculate its width
uw_menu.classList.add("uw-hidden","uw-is-visible","uw-horizontal");
uw_menu.classList.remove("uw-stacked");
menu_width = calcMainMenuWidth();
// if our menu will fit, unhide it and hide the mobile button
if (window.innerWidth > menu_width) {
uw_menu.classList.remove("uw-hidden");
uw_menu.setAttribute("aria-hidden",false);
uw_menu_button.classList.remove("uw-is-visible");
uw_menu_button.setAttribute("aria-expanded",true);
// restore the mobile menu and button classes
} else {
uw_menu.classList.remove("uw-is-visible","uw-hidden","uw-horizontal");
uw_menu.classList.add("uw-stacked");
}
} else {
uw_menu.classList.remove("uw-horizontal");
uw_menu.classList.add("uw-stacked");
}
}
}
};
// on page load
var uw_menu_buttons = document.querySelectorAll(".uw-mobile-menu-button-bar"),
uw_menu = document.getElementById("uw-top-menus"),
windowWidth,
supportsGetComputedStyleWidth;
if (uw_menu_buttons.length > 0) {
var uw_menu_button = uw_menu_buttons[0];
initMenuButton();
}
if (uw_menu) {
initDropdowns();
uwMobileMenuResize();
// run again to workaround iOS Safari delay in setting window.innerWidth
window.setTimeout(function(){
uwMobileMenuResize();
}, 150);
// bind on resize
window.addEventListener("resize", uwMobileMenuResize);
}
});
uw_utils.ready(function() {
// side navigation
var uw_breakpoint = 640;
var side_nav_menu = document.querySelectorAll(".uw-side-nav")[0];
var side_nav_button = document.querySelectorAll(".uw-side-nav-button")[0];
var side_nav_menu_hidden_class = "uw-side-nav-is-hidden";
var side_nav_menu_open_class = "uw-side-menu-open";
var overlay = document.querySelectorAll(".uw-overlay")[0];
window.uwShowSideNavMenu = function(){
overlay.classList.remove("uw-is-active");
side_nav_menu.parentNode.classList.remove(side_nav_menu_hidden_class);
}
window.uwHideSideNavMenu = function(){
if (!side_nav_menu.parentNode.classList.contains(side_nav_menu_open_class)) {
side_nav_menu.parentNode.classList.add(side_nav_menu_hidden_class);
} else {
overlay.classList.add("uw-is-active");
}
}
var sideNavMenuToggle = function(){
if (window.innerWidth > uw_breakpoint) {
uwShowSideNavMenu();
} else {
uwHideSideNavMenu();
}
}
if (side_nav_menu) {
sideNavMenuToggle();
window.addEventListener("resize", sideNavMenuToggle);
}
var toggle_side_nav_menu = function(){
var el = side_nav_menu.parentNode;
el.classList.toggle(side_nav_menu_hidden_class);
el.classList.toggle(side_nav_menu_open_class);
if (el.classList.contains(side_nav_menu_hidden_class)) {
overlay.classList.remove("uw-is-active");
} else {
overlay.classList.add("uw-is-active");
bindOverlayEvents();
}
}
if (side_nav_button)
side_nav_button.addEventListener("click", toggle_side_nav_menu);
// close sub page menu when clicking overlay
var body_for_overlay = document.querySelectorAll("body .uw-overlay.uw-is-active")[0];
var clearMenuOverlay = function(){
toggle_side_nav_menu();
};
var bindOverlayEvents = function(){
var body_for_overlay = document.querySelectorAll("body .uw-overlay.uw-is-active")[0];
body_for_overlay.addEventListener("click", clearMenuOverlay);
body_for_overlay.addEventListener("touchend", clearMenuOverlay);
};
if (body_for_overlay) {
bindOverlayEvents();
}
});
\ No newline at end of file
// via http://gomakethings.com/ditching-jquery/#waiting-until-the-dom-is-ready
var uw_utils = {
ready: function ( fn ) {
// Sanity check
if ( typeof fn !== 'function' ) return;
// If document is already loaded, run method
if ( document.readyState === 'complete' ) {
return fn();
}
// Otherwise, wait until document is loaded
document.addEventListener( 'DOMContentLoaded', fn, false );
},
// toggle boolean element attribute
toggleBooleanAttr: function (el, attr) {
var current_value, new_value;
if (el.hasAttribute(attr)) {
current_value = el.getAttribute(attr);
new_value = current_value == "true" ? false : true;
el.setAttribute(attr,new_value);
}
},
getSiblings: function (el) {
var siblings = [];
var sibling = el.parentNode.firstChild;
for ( ; sibling; sibling = sibling.nextSibling ) {
if ( sibling.nodeType === 1 && sibling !== el ) {
siblings.push( sibling );
}
}
return siblings;
}
}
// support node
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports.ready = uw_utils.ready;
module.exports.toggleBooleanAttr = uw_utils.toggleBooleanAttr;
module.exports.getSiblings = uw_utils.getSiblings;
}
\ No newline at end of file
.uw-breadcrumbs {
margin: $uw-padding 0;
padding: 0 $uw-padding;
ul {
margin-left: 0;
}
@include uw-container($uw-max-content-width);
display: flex;
flex-flow: row wrap;
li {
list-style: none;
text-transform: uppercase;
float: left;
color: black;
font-size: .7875rem;
margin-bottom: 0;
}
li:not(:last-child)::after {
color: $uw-gray-darker;
content: "/";
margin: 0 .5rem;
position: relative;
}
}
\ No newline at end of file
.uw-button {
background-color: $uw-anchor-color;
color: white;
display: inline-block;
line-height: 1;
cursor: pointer;
transition: all .2s ease-out;
border: 1px solid rgba(0, 0, 0, 0);
border-radius: 0;
position: relative;
// box-shadow: 0 1.5px 4px rgba(0,0,0,.24),0 1.5px 6px rgba(0,0,0,.12);
padding: .6rem;
font-family: $uw-verlag-font;
font-size: .775rem;
font-weight: 700;
text-transform: uppercase;
&:hover {
background-color: scale-color($uw-anchor-color, $lightness: -15%);
// box-shadow: 0 1.5px 4px rgba(0,0,0,.34),0 1.5px 6px rgba(0,0,0,.22);
}
&.uw-button-inverse {
background-color: white;
color: $uw-anchor-color;
border-color: $uw-anchor-color;
}
+ .uw-button {
margin-left: 0.5rem;
}
}
a.uw-button:hover {
text-decoration: none;
}
.uw-button-unstyle {
background-color: transparent;
color: $uw-anchor-color;
}
\ No newline at end of file
.uw-card {
@include uw-flex-column(33.333333%, 500px);
padding: $uw-padding*1;
display: flex;
.uw-card-content {
background-color: $uw-white;
img {
width: 100%;
}
}
.uw-card-copy {
padding: 0 1rem 1rem;
}
}
\ No newline at end of file