├── src ├── assets │ ├── .gitkeep │ ├── images │ │ ├── poetry.ico │ │ ├── need_bg.png │ │ ├── sliders │ │ │ ├── 1.jpg │ │ │ ├── 10.jpg │ │ │ ├── 11.jpg │ │ │ ├── 12.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ ├── 8.jpg │ │ │ ├── 9.jpg │ │ │ ├── dot_down.png │ │ │ ├── dot_next.png │ │ │ └── dot_pre.png │ │ ├── demo │ │ │ └── partner.png │ │ ├── role │ │ │ └── pattern.png │ │ ├── why_show_icon.png │ │ └── presentatin_us.jpg │ └── css │ │ ├── font-awesome │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── reset.css │ │ └── loading.css ├── app │ ├── app.component.scss │ ├── pages │ │ ├── home │ │ │ ├── home.component.scss │ │ │ ├── home.component.html │ │ │ ├── home-content │ │ │ │ ├── partner-and-footer │ │ │ │ │ ├── partner-and-footer.component.html │ │ │ │ │ ├── partner-and-footer.component.scss │ │ │ │ │ ├── partner-and-footer.component.ts │ │ │ │ │ └── partner │ │ │ │ │ │ ├── partner.component.ts │ │ │ │ │ │ ├── partner.component.html │ │ │ │ │ │ └── partner.component.scss │ │ │ │ ├── presentation-us │ │ │ │ │ ├── reasons │ │ │ │ │ │ ├── reasons.component.html │ │ │ │ │ │ ├── reasons.component.ts │ │ │ │ │ │ └── reasons.component.scss │ │ │ │ │ ├── our-skills │ │ │ │ │ │ ├── our-skills.component.html │ │ │ │ │ │ ├── our-skills.component.ts │ │ │ │ │ │ └── our-skills.component.scss │ │ │ │ │ ├── he-said │ │ │ │ │ │ ├── he-said.component.html │ │ │ │ │ │ ├── he-said.component.ts │ │ │ │ │ │ └── he-said.component.scss │ │ │ │ │ ├── presentation-us.component.ts │ │ │ │ │ ├── presentation-us.component.html │ │ │ │ │ └── presentation-us.component.scss │ │ │ │ ├── slideshow │ │ │ │ │ ├── change-dot │ │ │ │ │ │ ├── change-dot.component.html │ │ │ │ │ │ ├── change-dot.component.ts │ │ │ │ │ │ └── change-dot.component.scss │ │ │ │ │ ├── slideshow.component.html │ │ │ │ │ └── slideshow.component.ts │ │ │ │ ├── poetry-news │ │ │ │ │ ├── move-img │ │ │ │ │ │ ├── move-img.component.html │ │ │ │ │ │ ├── move-img.component.scss │ │ │ │ │ │ └── move-img.component.ts │ │ │ │ │ ├── poetry-news.component.html │ │ │ │ │ ├── poetry-news.component.ts │ │ │ │ │ └── poetry-news.component.scss │ │ │ │ ├── need-poetry │ │ │ │ │ ├── need-poetry.component.ts │ │ │ │ │ └── need-poetry.component.html │ │ │ │ ├── home-content.component.html │ │ │ │ ├── home-content.component.scss │ │ │ │ └── home-content.component.ts │ │ │ ├── home.component.ts │ │ │ ├── home-routing.module.ts │ │ │ └── home.module.ts │ │ ├── pages.component.scss │ │ ├── routes │ │ │ ├── guard │ │ │ │ ├── guard.component.scss │ │ │ │ ├── can-admin-visit │ │ │ │ │ ├── can-admin-visit.component.scss │ │ │ │ │ ├── can-admin-visit.component.html │ │ │ │ │ └── can-admin-visit.component.ts │ │ │ │ ├── can-user-visit │ │ │ │ │ ├── can-user-visit.component.scss │ │ │ │ │ ├── can-user-visit.component.ts │ │ │ │ │ └── can-user-visit.component.html │ │ │ │ ├── can-anybody-visit │ │ │ │ │ ├── can-anybody-visit.component.scss │ │ │ │ │ ├── can-anybody-visit.component.ts │ │ │ │ │ └── can-anybody-visit.component.html │ │ │ │ ├── guard.component.html │ │ │ │ ├── leave-authorization │ │ │ │ │ ├── leave-authorization.component.scss │ │ │ │ │ ├── leave-authorization.component.html │ │ │ │ │ └── leave-authorization.component.ts │ │ │ │ ├── test-set.ts │ │ │ │ ├── guard.component.ts │ │ │ │ ├── guard.module.ts │ │ │ │ └── guard.routing.ts │ │ │ ├── lazy-load │ │ │ │ ├── lazy-load.component.scss │ │ │ │ ├── lazy-load.component.html │ │ │ │ ├── lazy-load.component.ts │ │ │ │ ├── lazy-load.routing.ts │ │ │ │ └── lazy-load.module.ts │ │ │ ├── preview-load │ │ │ │ ├── preview-load.component.scss │ │ │ │ ├── preview-load.component.html │ │ │ │ ├── preview-load.component.ts │ │ │ │ ├── preview-load.routing.ts │ │ │ │ └── preview-load.module.ts │ │ │ ├── routes.component.html │ │ │ ├── signin │ │ │ │ ├── signin.component.scss │ │ │ │ ├── signin.component.html │ │ │ │ └── signin.component.ts │ │ │ ├── routes.component.scss │ │ │ ├── shared │ │ │ │ ├── index.ts │ │ │ │ ├── preview-load.service.ts │ │ │ │ ├── authorization.service.ts │ │ │ │ ├── can-leave.provider.ts │ │ │ │ ├── can-admin-visit.provider.ts │ │ │ │ └── can-signin-visit.provider.ts │ │ │ ├── routes.component.ts │ │ │ ├── routes.routing.ts │ │ │ └── routes.module.ts │ │ ├── pages.component.html │ │ ├── pages.component.ts │ │ ├── pages.module.ts │ │ └── pages.routing.ts │ ├── shared │ │ ├── components │ │ │ ├── footer │ │ │ │ ├── footer.component.scss │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.ts │ │ │ │ └── footer.component.spec.ts │ │ │ ├── ng-content │ │ │ │ ├── ng-content.component.scss │ │ │ │ ├── ng-content.component.html │ │ │ │ └── ng-content.component.ts │ │ │ ├── index.ts │ │ │ └── header │ │ │ │ ├── header.component.scss │ │ │ │ ├── header.component.spec.ts │ │ │ │ ├── header.component.html │ │ │ │ └── header.component.ts │ │ ├── service │ │ │ ├── static-role-info.providers.ts │ │ │ └── return-window.service.ts │ │ ├── animations │ │ │ ├── autoWidth.ts │ │ │ └── fadeInUp.ts │ │ └── shared.module.ts │ ├── app.component.html │ ├── theme │ │ ├── scss │ │ │ ├── atoms │ │ │ │ ├── _image.scss │ │ │ │ ├── _font-weight.scss │ │ │ │ ├── _center-block.scss │ │ │ │ ├── _button.scss │ │ │ │ ├── _font-size.scss │ │ │ │ ├── _align.scss │ │ │ │ ├── _cursor.scss │ │ │ │ ├── _scaffolding.scss │ │ │ │ ├── _grid.scss │ │ │ │ ├── _colors.scss │ │ │ │ ├── _display.scss │ │ │ │ ├── _index.scss │ │ │ │ ├── _line-height.scss │ │ │ │ ├── _background.scss │ │ │ │ ├── _sizes.scss │ │ │ │ ├── _text.scss │ │ │ │ ├── _whitespace.scss │ │ │ │ ├── _flex.scss │ │ │ │ └── _border.scss │ │ │ ├── themes │ │ │ │ ├── _theme.default.scss │ │ │ │ └── index.scss │ │ │ ├── layout │ │ │ │ └── _index.scss │ │ │ ├── base │ │ │ │ ├── _index.scss │ │ │ │ └── _base.scss │ │ │ ├── molecules │ │ │ │ ├── _index.scss │ │ │ │ └── _image.scss │ │ │ ├── libs │ │ │ │ ├── _index.scss │ │ │ │ ├── _iconfont.scss │ │ │ │ └── _normalize.scss │ │ │ ├── utilities │ │ │ │ ├── _utilities.scss │ │ │ │ ├── _index.scss │ │ │ │ ├── _mixin.scss │ │ │ │ └── _config.scss │ │ │ └── main.scss │ │ └── theme.scss │ ├── app.routing.ts │ ├── app.component.ts │ └── app.module.ts ├── environments │ ├── demo.json │ ├── test.json │ ├── development.json │ ├── common.json │ ├── production.json │ ├── environment.test.ts │ ├── environment.demo.ts │ ├── environment.prod.ts │ └── environment.ts ├── styles.scss ├── main.ts ├── typings.d.ts ├── tsconfig.app.json ├── index.html ├── tsconfig.spec.json ├── kama.config.js ├── tsconfig.json ├── test.ts └── polyfills.ts ├── CNAME ├── _config.yml ├── README.pdf ├── .gitattributes ├── test.html ├── .editorconfig ├── .vscode └── launch.json ├── typedoc.json ├── .gitignore ├── protractor.conf.js ├── karma.conf.js ├── package.json ├── .angular-cli.json └── tslint.json /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | www.angular-school.cn -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-merlot -------------------------------------------------------------------------------- /src/app/pages/home/home.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/pages.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/guard.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/lazy-load/lazy-load.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/shared/components/footer/footer.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/pages/routes/preview-load/preview-load.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/shared/components/ng-content/ng-content.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/pages.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-admin-visit/can-admin-visit.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-user-visit/can-user-visit.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/README.pdf -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-anybody-visit/can-anybody-visit.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/guard.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/leave-authorization/leave-authorization.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/lazy-load/lazy-load.component.html: -------------------------------------------------------------------------------- 1 |

2 | 懒加载模块 3 |

-------------------------------------------------------------------------------- /src/app/shared/components/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |

2 | 脚部,暂未想好放什么 3 |

4 | -------------------------------------------------------------------------------- /src/app/pages/routes/preview-load/preview-load.component.html: -------------------------------------------------------------------------------- 1 |

2 | preview-load works! 3 |

-------------------------------------------------------------------------------- /src/assets/images/poetry.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/poetry.ico -------------------------------------------------------------------------------- /src/assets/images/need_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/need_bg.png -------------------------------------------------------------------------------- /src/environments/demo.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "/", 3 | "env": "demo", 4 | "api": { 5 | "host": "" 6 | } 7 | } -------------------------------------------------------------------------------- /src/environments/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "/", 3 | "env": "test", 4 | "api": { 5 | "host": "" 6 | } 7 | } -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_image.scss: -------------------------------------------------------------------------------- 1 | // Fluid image 2 | %image-fluid { 3 | max-width: 100%; 4 | height: auto; 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/images/sliders/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/1.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/10.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/11.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/12.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/2.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/3.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/4.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/5.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/6.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/7.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/8.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/9.jpg -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.php linguist-language=TypeScript 2 | *.css linguist-language=TypeScript 3 | *.js linguist-language=TypeScript -------------------------------------------------------------------------------- /src/app/pages/routes/routes.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /src/app/theme/scss/themes/_theme.default.scss: -------------------------------------------------------------------------------- 1 | // Default theme 2 | // -------------------------------------------------- 3 | -------------------------------------------------------------------------------- /src/assets/images/demo/partner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/demo/partner.png -------------------------------------------------------------------------------- /src/assets/images/role/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/role/pattern.png -------------------------------------------------------------------------------- /src/assets/images/why_show_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/why_show_icon.png -------------------------------------------------------------------------------- /src/assets/images/presentatin_us.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/presentatin_us.jpg -------------------------------------------------------------------------------- /src/assets/images/sliders/dot_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/dot_down.png -------------------------------------------------------------------------------- /src/assets/images/sliders/dot_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/dot_next.png -------------------------------------------------------------------------------- /src/assets/images/sliders/dot_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/images/sliders/dot_pre.png -------------------------------------------------------------------------------- /src/assets/css/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/css/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/environments/development.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "/", 3 | "env": "dev", 4 | "api": { 5 | "host": "http://localhost:3000/lms" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/app/theme/scss/layout/_index.scss: -------------------------------------------------------------------------------- 1 | // Layout Rules 2 | // @source http://smacss.com/book/type-layout 3 | // -------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_font-weight.scss: -------------------------------------------------------------------------------- 1 | // Font weight 2 | @for $i from 1 through 10 { 3 | %font-weight-#{$i * 100} { 4 | font-weight: $i * 100; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/assets/css/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/css/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/assets/css/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/css/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/assets/css/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/css/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/environments/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "pro-test", 3 | "question": { 4 | "url": "" 5 | }, 6 | "list": { 7 | "pageSize": 10 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/environments/production.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "/", 3 | "env": "prod", 4 | "api": { 5 | "host": "https://github.com/deepthan/deepthan.github.io" 6 | } 7 | } -------------------------------------------------------------------------------- /src/assets/css/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deepthan/blog-angular/HEAD/src/assets/css/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/app/shared/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './footer/footer.component'; 2 | export * from './header/header.component'; 3 | export * from './ng-content/ng-content.component'; 4 | -------------------------------------------------------------------------------- /src/app/shared/service/static-role-info.providers.ts: -------------------------------------------------------------------------------- 1 | 2 | export class ROLE_INFO { 3 | ADMIN : 'admin'; 4 | USER: 'user' 5 | } 6 | 7 | ROLE_INFO.prototype.ADMIN === 'admin' 8 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_center-block.scss: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | %center-block { 3 | display: block; 4 | margin-left: auto; 5 | margin-right: auto; 6 | } 7 | -------------------------------------------------------------------------------- /src/environments/environment.test.ts: -------------------------------------------------------------------------------- 1 | export const environment = Object.assign({}, require('./common.json'), require('./test.json'), { 2 | production: false, 3 | envName: 'test' 4 | }); -------------------------------------------------------------------------------- /src/app/pages/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/environments/environment.demo.ts: -------------------------------------------------------------------------------- 1 | export const environment = Object.assign({}, require('./common.json'), require('./demo.json'), { 2 | production: true, 3 | envName: 'demo' 4 | }); 5 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = Object.assign({}, require('./common.json'), require('./production.json'), { 2 | production: true, 3 | envName: 'prod' 4 | }); 5 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_button.scss: -------------------------------------------------------------------------------- 1 | // Button base 2 | %btn-base { 3 | display: inline-block; 4 | font-weight: 400; 5 | text-align: center; 6 | vertical-align: middle; 7 | cursor: pointer; 8 | } 9 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner-and-footer.component.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /src/app/pages/routes/signin/signin.component.scss: -------------------------------------------------------------------------------- 1 | .login-form { 2 | max-width: 300px; 3 | } 4 | 5 | .login-form-forgot { 6 | float: right; 7 | } 8 | 9 | .login-form-button { 10 | width: 100%; 11 | } -------------------------------------------------------------------------------- /src/app/pages/routes/routes.component.scss: -------------------------------------------------------------------------------- 1 | .routes { 2 | margin: 0 auto; 3 | width: 1200px; 4 | padding-top: 100px; 5 | button { 6 | line-height: 40px; 7 | margin-bottom: 20px; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/app/theme/scss/base/_index.scss: -------------------------------------------------------------------------------- 1 | // Base Rules 2 | // @source - http://smacss.com/book/type-base 3 | // -------------------------------------------------- 4 | 5 | 6 | // $Base 7 | // ---------------------------------- 8 | @import 'base'; 9 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/leave-authorization/leave-authorization.component.html: -------------------------------------------------------------------------------- 1 |

2 | leave-authorization works! 3 |

4 | 7 | -------------------------------------------------------------------------------- /src/app/theme/scss/themes/index.scss: -------------------------------------------------------------------------------- 1 | // Themes 2 | // @source http://smacss.com/book/type-theme 3 | // -------------------------------------------------- 4 | 5 | 6 | // $Theme default 7 | // ---------------------------------- 8 | @import 'theme.default'; 9 | -------------------------------------------------------------------------------- /src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes } from '@angular/router'; 3 | 4 | export const AppRouting: Routes = [ 5 | { 6 | path: '', 7 | redirectTo: 'home', 8 | pathMatch: 'full' 9 | } 10 | ]; 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/app/shared/components/ng-content/ng-content.component.html: -------------------------------------------------------------------------------- 1 |
2 |

123

3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

456

11 |
12 | -------------------------------------------------------------------------------- /src/app/shared/service/return-window.service.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Injectable } from '@angular/core'; 3 | 4 | function getWindow (): any { 5 | return window; 6 | } 7 | 8 | @Injectable() 9 | export class WindowRefService { 10 | get nativeWindow (): any { 11 | return getWindow(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/app/theme/theme.scss: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | 3 | // Theme 4 | // -------------------------------------------------- 5 | 6 | 7 | // $Main 8 | // ---------------------------------- 9 | // @import 'scss/main'; 10 | 11 | // $Themes 12 | // ---------------------------------- 13 | // @import 'scss/themes/index'; 14 | -------------------------------------------------------------------------------- /test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 123 11 | 12 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/test-set.ts: -------------------------------------------------------------------------------- 1 | export class TestSet { 2 | 3 | private _setVal : string = 'set初始值'; 4 | 5 | noset(){ 6 | return '这是没set的方法' 7 | } 8 | 9 | get getv(){ 10 | return this._setVal 11 | } 12 | 13 | set set(name: any) { 14 | this._setVal = name +'set后面加的内容'; 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/app/pages/routes/shared/index.ts: -------------------------------------------------------------------------------- 1 | export { AuthorizationService } from './authorization.service'; 2 | export { PreloadService } from './preview-load.service'; 3 | export { CanSigninVisitProvide } from './can-signin-visit.provider'; 4 | export { CanAdminVisitProvide } from './can-admin-visit.provider'; 5 | export { CanLeaveProvide } from './can-leave.provider'; 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | # 给你的编辑器看的一个简单配置文件,它用来确保参与你项目的每个人都具有基本的编辑器配置。 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = off 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /src/app/pages/pages.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-pages', 5 | templateUrl: './pages.component.html', 6 | styleUrls: ['./pages.component.scss'] 7 | }) 8 | export class PagesComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/theme/scss/molecules/_index.scss: -------------------------------------------------------------------------------- 1 | // Molecules 2 | // @source - http://atomicdesign.bradfrost.com/chapter-2/ 3 | // -------------------------------------------------- 4 | 5 | 6 | // $Mixin 7 | // ---------------------------------- 8 | @import '../utilities/mixin'; 9 | 10 | // Molecules 11 | // ---------------------------------- 12 | @import 'image'; 13 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner-and-footer.component.scss: -------------------------------------------------------------------------------- 1 | 2 | @media screen and(min-width:768px){ 3 | .footer{ 4 | position: absolute; 5 | bottom: 0; 6 | } 7 | } 8 | 9 | @media screen and(max-width:767px){ 10 | .footer{ 11 | position: relative; 12 | } 13 | } 14 | 15 | .footer{ 16 | width: 100%; 17 | } -------------------------------------------------------------------------------- /src/app/pages/routes/routes.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-routes', 5 | templateUrl: './routes.component.html', 6 | styleUrls: ['./routes.component.scss'] 7 | }) 8 | export class RoutesComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * auther: deepthan 3 | * createDate: 2017.10.23 4 | * explain: 定义AppModule,告诉Angular如何组装该应用 5 | * 6 | * */ 7 | import { Component } from '@angular/core'; 8 | 9 | @Component({ 10 | selector: 'app-root', 11 | templateUrl: './app.component.html', 12 | styleUrls: ['./app.component.scss'] 13 | }) 14 | export class AppComponent { 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.scss'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | // 首页添加动画、轮播图等。 17 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/guard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-guard', 5 | templateUrl: './guard.component.html', 6 | styleUrls: ['./guard.component.scss'] 7 | }) 8 | export class GuardComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/app/shared/components/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.scss'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-admin-visit/can-admin-visit.component.html: -------------------------------------------------------------------------------- 1 |

2 | can-admin-visit works! 3 |

4 | 5 |
不登录,往任何人都可以访问的地址跳,对应地址 routes/guard/anybody
6 |
登录后的地址
7 |
管理员的地址: routes/guard/admin
8 |
普通用户的的地址: routes/guard/user
-------------------------------------------------------------------------------- /src/app/pages/routes/lazy-load/lazy-load.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'lazy-load', 5 | templateUrl: './lazy-load.component.html', 6 | styleUrls: ['./lazy-load.component.scss'] 7 | }) 8 | export class LazyLoadComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/shared/components/ng-content/ng-content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'fill', 5 | templateUrl: './ng-content.component.html', 6 | styleUrls: ['./ng-content.component.scss'] 7 | }) 8 | export class NgContentComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/theme/scss/libs/_index.scss: -------------------------------------------------------------------------------- 1 | // Third-Party Styles 2 | // -------------------------------------------------- 3 | 4 | 5 | // $Normalize 6 | // ---------------------------------- 7 | @import 'normalize'; 8 | 9 | // $Iconfont 10 | // ---------------------------------- 11 | @import 'iconfont'; 12 | 13 | // $Font-awesome 14 | // ---------------------------------- 15 | @import 'font-awesome'; 16 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * auther: deepthan 3 | * createDate: 2017.10.23 4 | * explain: 可以在这里写公共样式,或者引入其他css文件 5 | * **这里是你的全局样式。 大多数情况下,你会希望在组件中使用局部样式,以利于维护,不过那些会影响你整个应用的样式你还是需要集中存放在这里。 6 | * */ 7 | 8 | /*表格的点击显示详情选项*/ 9 | .click-link{ 10 | color: #0061ae; 11 | cursor: pointer; 12 | } 13 | @import '~font-awesome/css/font-awesome.min.css'; 14 | @import '~bootstrap/dist/css/bootstrap.min.css'; -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_font-size.scss: -------------------------------------------------------------------------------- 1 | // Font size 2 | // -------------------------------------------------- 3 | 4 | 5 | // Map $headings 6 | // %#{$prop} 7 | @each $prop, $value in $headings { 8 | %#{$prop} { 9 | font-size: $value; 10 | } 11 | } 12 | 13 | // Custom font-size 14 | // %fs-#{$i} 15 | @for $i from 12 through 36 { 16 | %fs-#{$i} { 17 | font-size: $i / 10 + rem; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/reasons/reasons.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{ reasons.title }} 3 |
4 |
5 |
6 | {{ reasons.detail }} 7 |
8 | 9 | -------------------------------------------------------------------------------- /src/app/pages/routes/preview-load/preview-load.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-preview-load', 5 | templateUrl: './preview-load.component.html', 6 | styleUrls: ['./preview-load.component.scss'] 7 | }) 8 | export class PreviewLoadComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "launch", 7 | "name": "Launch Program", 8 | "program": "${file}", 9 | "outFiles": [ 10 | "${workspaceRoot}/out/**/*.js" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /src/app/pages/routes/lazy-load/lazy-load.routing.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 路由配置,显示内容 3 | */ 4 | import { Routes } from '@angular/router'; 5 | 6 | import { LazyLoadComponent } from './lazy-load.component'; 7 | 8 | export const LazyLoadRouting: Routes = [ 9 | { 10 | path: '', 11 | component: LazyLoadComponent 12 | }, 13 | { 14 | path: '**', 15 | component: LazyLoadComponent 16 | } 17 | ]; 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-user-visit/can-user-visit.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-can-user-visit', 5 | templateUrl: './can-user-visit.component.html', 6 | styleUrls: ['./can-user-visit.component.scss'] 7 | }) 8 | export class CanUserVisitComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_align.scss: -------------------------------------------------------------------------------- 1 | // Align 2 | %align-baseline { 3 | vertical-align: baseline; 4 | } 5 | 6 | %align-top { 7 | vertical-align: top; 8 | } 9 | 10 | %align-middle { 11 | vertical-align: middle; 12 | } 13 | 14 | %align-bottom { 15 | vertical-align: bottom; 16 | } 17 | 18 | %align-text-bottom { 19 | vertical-align: text-bottom; 20 | } 21 | 22 | %align-text-top { 23 | vertical-align: text-top; 24 | } 25 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-admin-visit/can-admin-visit.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-can-admin-visit', 5 | templateUrl: './can-admin-visit.component.html', 6 | styleUrls: ['./can-admin-visit.component.scss'] 7 | }) 8 | export class CanAdminVisitComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/routes/preview-load/preview-load.routing.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 路由配置,显示内容 3 | */ 4 | import { Routes } from '@angular/router'; 5 | 6 | import { PreviewLoadComponent } from './preview-load.component'; 7 | 8 | export const PreviewLoadRouting: Routes = [ 9 | { 10 | path: '', 11 | component: PreviewLoadComponent 12 | }, 13 | { 14 | path: '**', 15 | component: PreviewLoadComponent 16 | } 17 | ]; 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_cursor.scss: -------------------------------------------------------------------------------- 1 | // Cursor 2 | %cursor-pointer { 3 | cursor: pointer; 4 | } 5 | 6 | %cursor-text { 7 | cursor: text; 8 | } 9 | 10 | %cursor-help { 11 | cursor: help; 12 | } 13 | 14 | %cursor-move { 15 | cursor: move; 16 | } 17 | 18 | %cursor-not-allowed { 19 | cursor: not-allowed; 20 | } 21 | 22 | %cursor-zoom-in { 23 | cursor: zoom-in; 24 | } 25 | 26 | %cursor-zoom-out { 27 | cursor: zoom-out; 28 | } 29 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // 当前环境的文件内容将在构建期间覆盖这些内容。 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // 在“angular - cli.json”中可以找到该文件的env映射列表。 5 | 6 | export const environment = Object.assign({}, require('./common.json'), require('./development.json'), { 7 | production: false, 8 | envName: 'dev' 9 | }); 10 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/our-skills/our-skills.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ skillMeta.name }} 4 | {{ skillMeta.percentage }} 5 |
6 |
10 |
11 |
-------------------------------------------------------------------------------- /src/app/pages/home/home-content/slideshow/change-dot/change-dot.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-anybody-visit/can-anybody-visit.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-can-anybody-visit', 5 | templateUrl: './can-anybody-visit.component.html', 6 | styleUrls: ['./can-anybody-visit.component.scss'] 7 | }) 8 | export class CanAnybodyVisitComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_scaffolding.scss: -------------------------------------------------------------------------------- 1 | // Scaffolding 2 | // -------------------------------------------------- 3 | 4 | 5 | // Separator 6 | %separator { 7 | margin: -0.5rem 0 1.5rem; 8 | border-top: .1rem solid $gray-light; 9 | } 10 | 11 | %radius-img { 12 | width: 100%; 13 | height: 100%; 14 | border-radius: 50%; 15 | } 16 | 17 | %border-radius-img { 18 | @extend %radius-img; 19 | border: .1rem solid rgba($gray-light, .2); 20 | } 21 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "mode": "modules", 3 | "out": "doc", 4 | "theme": "default", 5 | "ignoreCompilerErrors": "true", 6 | "experimentalDecorators": "true", 7 | "emitDecoratorMetadata": "true", 8 | "target": "ES5", 9 | "moduleResolution": "node", 10 | "preserveConstEnums": "true", 11 | "stripInternal": "true", 12 | "suppressExcessPropertyErrors": "true", 13 | "suppressImplicitAnyIndexErrors": "true", 14 | "module": "commonjs" 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/move-img/move-img.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

5 | {{ newItem.tit }} 6 | 7 |

8 |

9 | {{ newItem.det }} 10 | 11 |

12 |
13 | 14 |
15 | -------------------------------------------------------------------------------- /src/app/pages/home/home-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { HomeComponent } from './home.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', 8 | component: HomeComponent 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | 17 | export class HomeRoutingModule { } 18 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/leave-authorization/leave-authorization.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'demo-leave-authorization', 5 | templateUrl: './leave-authorization.component.html', 6 | styleUrls: ['./leave-authorization.component.scss'] 7 | }) 8 | export class LeaveAuthorizationComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/shared/animations/autoWidth.ts: -------------------------------------------------------------------------------- 1 | import { trigger, state, animate, transition, style, keyframes } from '@angular/animations'; 2 | 3 | export const autoWidth = trigger('autoWidth', [ 4 | 5 | transition('void => *', [ 6 | animate(1000, keyframes([ 7 | style({ 8 | width: 0 9 | }), 10 | style({ 11 | width: '*' 12 | }) 13 | ])) 14 | ]) 15 | 16 | ]) 17 | 18 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_grid.scss: -------------------------------------------------------------------------------- 1 | // Grid 2 | // -------------------------------------------------- 3 | 4 | 5 | // Make grid placehold 6 | @mixin make-grid($infix: md, $columns: 24) { 7 | // col 8 | @for $i from 1 through $columns { 9 | %col-#{$infix}-#{$i} { 10 | width: percentage($i / $columns); 11 | } 12 | } 13 | // offset col 14 | @for $i from 1 through $columns { 15 | %col-#{$infix}-offset-#{$i} { 16 | margin-left: percentage($i / $columns); 17 | } 18 | } 19 | } 20 | 21 | @include make-grid(md); 22 | 23 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * auther: deepthan 3 | * createDate: 2017.10.23 4 | * explain: 应用的主要入口点。 5 | * 6 | * */ 7 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 8 | import { enableProdMode } from '@angular/core'; 9 | import { environment } from './environments/environment'; 10 | import { AppModule } from './app/app.module'; 11 | 12 | if (environment.production) { 13 | enableProdMode(); 14 | } 15 | 16 | platformBrowserDynamic().bootstrapModule(AppModule) 17 | .catch(err => console.log(err)); 18 | -------------------------------------------------------------------------------- /src/app/shared/components/header/header.component.scss: -------------------------------------------------------------------------------- 1 | .header{ 2 | height: 58px; 3 | color: #fff; 4 | } 5 | .fixed-top{ 6 | position: fixed; 7 | right: 0; 8 | left: 0; 9 | z-index: 1030; 10 | } 11 | .transparent-Bg{ 12 | background-color: transparent; 13 | } 14 | .blue-Bg{ 15 | background-color: #5984A4; 16 | } 17 | .be-fixed{ 18 | position: fixed; 19 | right: 0; 20 | left: 0; 21 | z-index: 1030; 22 | } 23 | .be-relative{ 24 | position: relative; 25 | background-color: #5984A4; 26 | } -------------------------------------------------------------------------------- /src/app/theme/scss/molecules/_image.scss: -------------------------------------------------------------------------------- 1 | // Image package 2 | %image-package { 3 | @include sizing-custom(70rem); 4 | @include text(text-center); 5 | @include spacing-custom(margin, $left: -4rem); 6 | 7 | .image-package__alt { 8 | @include sizing(maxw-100); 9 | @include align(align-middle); 10 | @include atoms(cursor-zoom-in); 11 | } 12 | 13 | .image-package__alt { 14 | @include display(d-inline-block); 15 | @include sizing(minw-20, maxw-80); 16 | @include colors(text-gray); 17 | 18 | border-bottom: .1rem solid #d9d9d9; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/pages/pages.module.ts: -------------------------------------------------------------------------------- 1 | import { RouterModule } from '@angular/router'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { SharedModule } from '../shared/shared.module'; 5 | 6 | import { PagesRouting } from './pages.routing'; 7 | import { PagesComponent } from './pages.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | CommonModule, 12 | SharedModule, 13 | RouterModule.forChild( PagesRouting ) 14 | ], 15 | declarations: [ 16 | PagesComponent 17 | ] 18 | }) 19 | 20 | export class PagesModule { } -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_colors.scss: -------------------------------------------------------------------------------- 1 | // Colors 2 | $colors: ( 3 | gray-base: $gray-base, 4 | gray-darker: $gray-darker, 5 | gray-dark: $gray-dark, 6 | gray-light: $gray-light, 7 | gray-lighter: $gray-lighter, 8 | primary: $primary, 9 | success: $brand-success, 10 | info: $brand-info, 11 | warning: $brand-warning, 12 | danger: $brand-danger 13 | ); 14 | 15 | @each $parent, $color in $colors { 16 | %color-#{$parent} { 17 | color: $color; 18 | } 19 | } 20 | 21 | %color-white { 22 | border-color: #fff; 23 | } 24 | 25 | %color-gray { 26 | border-color: $gray; 27 | } 28 | -------------------------------------------------------------------------------- /src/app/theme/scss/utilities/_utilities.scss: -------------------------------------------------------------------------------- 1 | .has-header { 2 | margin-top: $nav-bar-height; 3 | } 4 | 5 | .container { 6 | @extend %mx-4; 7 | } 8 | 9 | .hide { 10 | display: none; 11 | } 12 | 13 | .icon { 14 | margin-right: .5rem; 15 | font-size: $icon-font-size; 16 | line-height: normal; 17 | } 18 | 19 | .btn { 20 | display: inline-block; 21 | line-height: $btn-default-height; 22 | margin: $btn-default-margin; 23 | border-radius: $btn-default-border-radius; 24 | font-size: $btn-default-font-size; 25 | font-weight: 400; 26 | text-align: center; 27 | white-space: nowrap; 28 | cursor: pointer; 29 | } 30 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-user-visit/can-user-visit.component.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_display.scss: -------------------------------------------------------------------------------- 1 | // Display 2 | // Custom styles for display 3 | // @source - https://v4-alpha.getbootstrap.com/utilities/display-property/ 4 | // -------------------------------------------------- 5 | 6 | %d-none { 7 | display: none; 8 | } 9 | 10 | %d-inline { 11 | display: inline; 12 | } 13 | 14 | %d-inline-block { 15 | display: inline-block; 16 | } 17 | 18 | %d-block { 19 | display: block; 20 | } 21 | 22 | %d-table { 23 | display: table; 24 | } 25 | 26 | %d-table-cell { 27 | display: table-cell; 28 | } 29 | 30 | %d-flex { 31 | display: flex; 32 | } 33 | 34 | %d-inline-flex { 35 | display: inline-flex; 36 | } 37 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_index.scss: -------------------------------------------------------------------------------- 1 | // Atoms 2 | // @source - http://atomicdesign.bradfrost.com/chapter-2/ 3 | // -------------------------------------------------- 4 | 5 | // $Atoms 6 | // ---------------------------------- 7 | @import "scaffolding"; 8 | @import "border"; 9 | @import "center-block"; 10 | @import "cursor"; 11 | @import "colors"; 12 | @import "whitespace"; 13 | @import "font-size"; 14 | @import "font-weight"; 15 | @import "sizes"; 16 | @import "align"; 17 | @import "text"; 18 | @import "line-height"; 19 | @import "background"; 20 | @import "image"; 21 | @import "display"; 22 | @import "flex"; 23 | @import "grid"; 24 | @import "button"; 25 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_line-height.scss: -------------------------------------------------------------------------------- 1 | // Line-height 2 | // %line-height-10 3 | @for $i from 1 through 26 { 4 | %line-height-#{(1 + ($i - 1) * 0.2) * 10} { 5 | line-height: 1 + ($i - 1) * 0.2 + rem; 6 | } 7 | } 8 | 9 | // Custom line-height 10 | %line-height-base { 11 | line-height: $line-height-base; 12 | } 13 | 14 | %line-height-sm { 15 | line-height: $line-height-sm; 16 | } 17 | 18 | %line-height-lg { 19 | line-height: $line-height-lg; 20 | } 21 | 22 | %line-height-0 { 23 | line-height: 0; 24 | } 25 | 26 | %line-height-inherit { 27 | line-height: inherit; 28 | } 29 | 30 | %line-height-normal { 31 | line-height: normal; 32 | } 33 | -------------------------------------------------------------------------------- /src/app/theme/scss/main.scss: -------------------------------------------------------------------------------- 1 | @charset 'utf-8'; 2 | 3 | // Main Styles 4 | // -------------------------------------------------- 5 | 6 | 7 | // $Config 8 | // ---------------------------------- 9 | @import 'utilities/config'; 10 | 11 | // $Libs 12 | // ---------------------------------- 13 | @import 'libs/index'; 14 | 15 | // $Base 16 | // ---------------------------------- 17 | @import 'base/index'; 18 | 19 | // $Atoms 20 | // ---------------------------------- 21 | @import 'atoms/index'; 22 | 23 | // $Molecules 24 | // ---------------------------------- 25 | @import 'molecules/index'; 26 | 27 | // $Layout 28 | // ---------------------------------- 29 | @import 'layout/index'; 30 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner-and-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, OnChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-partner-and-footer', 5 | templateUrl: './partner-and-footer.component.html', 6 | styleUrls: ['./partner-and-footer.component.scss'] 7 | }) 8 | export class PartnerAndFooterComponent implements OnInit, OnChanges { 9 | 10 | @Input() public whitchSatrt: any; 11 | 12 | partnerStart : boolean = false; 13 | ngOnChanges(){ 14 | if(this.whitchSatrt === 4){ 15 | this.partnerStart = true; 16 | } 17 | } 18 | 19 | constructor() { } 20 | 21 | ngOnInit() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/can-anybody-visit/can-anybody-visit.component.html: -------------------------------------------------------------------------------- 1 |

2 | can-anybody-visit works! 3 |

4 | 5 | 8 | 9 | 12 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /src/app/pages/routes/lazy-load/lazy-load.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | 5 | import { LazyLoadRouting } from './lazy-load.routing'; 6 | import { LazyLoadComponent } from './lazy-load.component'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | CommonModule, 11 | RouterModule.forChild(LazyLoadRouting) // 引入路由 12 | ], 13 | declarations: [ 14 | LazyLoadComponent 15 | ] 16 | 17 | }) 18 | 19 | export class LazyLoadModule { } 20 | 21 | 22 | /** 23 | * 24 | * 懒加载模块检测方法: 25 | * 26 | * 1. 进入其他的路由 27 | * 2. 谷歌浏览器 network点击js,先清空 28 | * 3. 再进入此模块的路由,查看加载了哪个文件 29 | * 30 | * 31 | */ -------------------------------------------------------------------------------- /src/app/pages/pages.routing.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Routes } from '@angular/router'; 3 | 4 | import { PagesComponent } from './pages.component'; 5 | 6 | export const PagesRouting: Routes = [ 7 | { 8 | path: '', 9 | component: PagesComponent, // 它有个侧边栏,可以选择home、routes等 10 | children: [ 11 | { 12 | path: '', 13 | redirectTo: 'home', 14 | pathMatch: 'full' 15 | }, 16 | { 17 | path: 'home', // home模块,点击可以进入看此里面的效果 18 | loadChildren: 'app/pages/home/home.module#HomeModule' 19 | }, 20 | { 21 | path: 'routes', // routes模块,包含懒加载、预加载、路由守卫、离开提示、阻止懒加载、阻止预加载 22 | loadChildren: 'app/pages/routes/routes.module#RoutesModule', 23 | } 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /src/app/theme/scss/utilities/_index.scss: -------------------------------------------------------------------------------- 1 | // utilities 2 | // -------------------------------------------------- 3 | 4 | 5 | // $Config 6 | // ---------------------------------- 7 | @import 'config'; 8 | 9 | // $Atoms 10 | // ---------------------------------- 11 | @import '../atoms/index'; 12 | 13 | // $Layout 14 | // ---------------------------------- 15 | @import '../layout/index'; 16 | 17 | // $Molecules 18 | // ---------------------------------- 19 | @import '../molecules/index'; 20 | 21 | // $Mixin 22 | // ---------------------------------- 23 | @import 'mixin'; 24 | 25 | // $Utilities 26 | // ---------------------------------- 27 | @import 'utilities'; 28 | 29 | // $Themes 30 | // ---------------------------------- 31 | @import '../themes/index'; 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # 一个Git的配置文件,用来确保某些自动生成的文件不会被提交到源码控制系统中。 3 | 4 | # See http://help.github.com/ignore-files/ for more about ignoring files. 5 | # compiled output 6 | /dist 7 | /tmp 8 | /out-tsc 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # IDEs and editors 14 | /.idea 15 | .project 16 | .classpath 17 | .c9/ 18 | *.launch 19 | .settings/ 20 | *.sublime-workspace 21 | 22 | # IDE - VSCode 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | 29 | # misc 30 | /.sass-cache 31 | /connect.lock 32 | /coverage 33 | /libpeerconnection.log 34 | npm-debug.log 35 | testem.log 36 | /typings 37 | 38 | # e2e 39 | /e2e/*.js 40 | /e2e/*.map 41 | 42 | # System Files 43 | .DS_Store 44 | Thumbs.db 45 | .beiwang.md -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_background.scss: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | $bg-colors: ( 3 | gray-base: $gray-base, 4 | gray-darker: $gray-darker, 5 | gray-dark: $gray-dark, 6 | gray-light: $gray-light, 7 | gray-lighter: $gray-lighter, 8 | primary: $primary, 9 | success: $brand-success, 10 | info: $brand-info, 11 | warning: $brand-warning, 12 | danger: $brand-danger 13 | ); 14 | 15 | @each $parent, $color in $bg-colors { 16 | %bg-#{$parent} { 17 | background-color: $color; 18 | } 19 | } 20 | 21 | %bg-white { 22 | background-color: #fff; 23 | } 24 | 25 | %bg-faded { 26 | background-color: darken($body-bg, 3%); 27 | } 28 | 29 | %bg-gray { 30 | background-color: $gray; 31 | } 32 | 33 | %bg-transparent { 34 | background-color: transparent; 35 | } 36 | -------------------------------------------------------------------------------- /src/app/shared/components/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/pages/routes/preview-load/preview-load.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | 5 | import { PreviewLoadComponent } from './preview-load.component'; 6 | import { PreviewLoadRouting } from './preview-load.routing'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | CommonModule, 11 | RouterModule.forChild(PreviewLoadRouting) 12 | ], 13 | declarations: [ 14 | PreviewLoadComponent 15 | ] 16 | 17 | }) 18 | export class PreviewLoadModule { } 19 | 20 | 21 | 22 | /** 23 | * 24 | * 预加载模块检测方法: 25 | * 26 | * 1. 把 ../routes,routing.ts文件中 34 行false改成true 27 | * 2. 谷歌浏览器 network点击js,先清空 28 | * 3. 进入其他的路由 29 | * 4. 查看加载了哪些文件以及加载时间和顺序 30 | * 31 | * 32 | */ -------------------------------------------------------------------------------- /src/app/pages/routes/shared/preview-load.service.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'rxjs/Rx'; 2 | import { PreloadingStrategy, Route } from '@angular/router'; 3 | import { Injectable, NgZone } from '@angular/core'; 4 | 5 | export function requestIdle(zone: NgZone) { 6 | const win: any = window; 7 | if (win.requestIdleCallback) { 8 | return (fn) => win.requestIdleCallback(fn); 9 | } 10 | return (fn) => zone.runOutsideAngular(() => win.setTimeout(fn, 10)); 11 | } 12 | 13 | @Injectable() 14 | export class PreloadService implements PreloadingStrategy { 15 | 16 | constructor( 17 | private zone: NgZone 18 | ) { } 19 | 20 | preload(route: Route, fn: () => Observable): Observable { 21 | requestIdle(this.zone)(fn); 22 | return Observable.of(null); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/need-poetry/need-poetry.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnChanges } from '@angular/core'; 2 | import { fadeInUp } from './../../../../shared/animations/fadeInUp'; 3 | 4 | @Component({ 5 | selector: 'need-poetry', 6 | templateUrl: './need-poetry.component.html', 7 | styleUrls: ['./need-poetry.component.scss'], 8 | animations: [ 9 | fadeInUp 10 | ] 11 | }) 12 | 13 | export class NeedPoetryComponent implements OnChanges { 14 | 15 | @Input() public whitchSatrt : any ; 16 | 17 | startAnimationTit : boolean = false; 18 | startAnimationDet : boolean = false; 19 | 20 | ngOnChanges(){ 21 | if(this.whitchSatrt === 1){ 22 | this.startAnimationTit = true; 23 | setTimeout(()=>{ 24 | this.startAnimationDet = true; 25 | },100) 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner/partner.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, OnChanges } from '@angular/core'; 2 | import { fadeInUp } from './../../../../../shared/animations/fadeInUp'; 3 | 4 | @Component({ 5 | selector: 'poetry-partner', 6 | templateUrl: './partner.component.html', 7 | styleUrls: ['./partner.component.scss'], 8 | animations: [ 9 | fadeInUp 10 | ] 11 | }) 12 | export class PartnerComponent implements OnInit, OnChanges { 13 | 14 | @Input() public partnerStart: any; 15 | imgStart : boolean = false; 16 | 17 | ngOnChanges(){ 18 | this.partnerStart ? this.beginImg() : null; 19 | } 20 | 21 | beginImg(){ 22 | setTimeout(()=>{ 23 | this.imgStart = true; 24 | },300) 25 | } 26 | 27 | constructor() { } 28 | 29 | ngOnInit() { 30 | } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/app/shared/animations/fadeInUp.ts: -------------------------------------------------------------------------------- 1 | import { trigger, state, animate, transition, style, keyframes } from '@angular/animations'; 2 | 3 | export const fadeInUp = trigger('fadeInUp', [ 4 | 5 | transition('void => *', [ 6 | animate(500, keyframes([ 7 | style({ 8 | opacity: 0, 9 | transform: 'translate3d(0, 100%, 0)', 10 | offset: 0 11 | }), 12 | style({ 13 | opacity: 0, 14 | transform: 'translate3d(0, 80%, 0)', 15 | offset: 0.5 16 | }), 17 | style({ 18 | opacity: 1, 19 | transform: 'none', 20 | offset: 1 21 | }), 22 | ])) 23 | ]) 24 | 25 | ]) 26 | 27 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | // Typings reference file, you can add your own global typings here 2 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html 3 | 4 | // declare var System: any; 5 | // support NodeJS modules without type definitions 6 | 7 | 8 | // Extra variables that live on Global that will be replaced by webpack DefinePlugin 9 | declare var ENV: string; 10 | declare var HMR: boolean; 11 | declare var System: SystemJS; 12 | declare var tinymce: any; 13 | 14 | interface SystemJS { 15 | import: (path?: string) => Promise; 16 | } 17 | 18 | declare module 'markdown-it' { 19 | function markdownit(option: any): any; 20 | 21 | export default markdownit; 22 | } 23 | 24 | declare module 'highlight.js' { 25 | export function getLanguage(lang: string): string; 26 | 27 | export function highlight(lang: string, code: string): any; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/docs/referenceConf.js 3 | 4 | /*global jasmine */ 5 | const SpecReporter = require('jasmine-spec-reporter'); 6 | 7 | exports.config = { 8 | allScriptsTimeout: 11000, 9 | specs: [ 10 | './e2e/**/*.e2e-spec.ts' 11 | ], 12 | capabilities: { 13 | 'browserName': 'chrome' 14 | }, 15 | directConnect: true, 16 | baseUrl: 'http://localhost:4201/', 17 | framework: 'jasmine', 18 | jasmineNodeOpts: { 19 | showColors: true, 20 | defaultTimeoutInterval: 30000, 21 | print: function() {} 22 | }, 23 | beforeLaunch: function() { 24 | require('ts-node').register({ 25 | project: 'e2e' 26 | }); 27 | }, 28 | onPrepare: function() { 29 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 30 | } 31 | }; -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/poetry-news.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 新闻中心 5 |
6 |
7 | 8 |
9 |
10 |
11 |
12 |
13 |

诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的

14 |

诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的诗词有新的见解之类的

15 |
16 |
17 | 18 |
19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/reasons/reasons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnChanges, Input, Output, EventEmitter } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-reasons', 5 | templateUrl: './reasons.component.html', 6 | styleUrls: ['./reasons.component.scss'] 7 | }) 8 | export class ReasonsComponent implements OnInit, OnChanges { 9 | 10 | @Output() sendVal: EventEmitter = new EventEmitter(); 11 | @Input() public formParentShowDet : any; 12 | @Input() public reasons : any; 13 | 14 | showDet : boolean = false; 15 | 16 | clickTit(){ 17 | this.showDet = true; 18 | this.sendVal.emit(this); 19 | } 20 | 21 | ngOnChanges(){ 22 | this.formParentShowDet === this ? null : this.showDet = false; 23 | } 24 | 25 | constructor() { } 26 | 27 | ngOnInit() { 28 | this.reasons.default ? this.showDet = true : null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/home-content.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "target": "es5", 9 | "lib": [ 10 | "es2016", 11 | "dom" 12 | ], 13 | "outDir": "../out-tsc/app", 14 | "module": "es2015", 15 | "baseUrl": "", 16 | "types": ["node"] 17 | }, 18 | "exclude": [ 19 | "test.ts", 20 | "**/*.spec.ts" 21 | ], 22 | "paths": { 23 | "@angular/common": ["../node_modules/@angular/common"], 24 | "@angular/compiler": ["../node_modules/@angular/compiler"], 25 | "@angular/core": ["../node_modules/@angular/core"], 26 | "@angular/forms": ["../node_modules/@angular/forms"], 27 | "@angular/platform-browser": ["../node_modules/@angular/platform-browser"], 28 | "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"], 29 | "@angular/router": ["../node_modules/@angular/router"], 30 | "@angular/http": ["../node_modules/@angular/http"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 5 | import { HttpModule } from '@angular/http'; 6 | import { Routes, RouterModule } from '@angular/router'; 7 | 8 | import { NgZorroAntdModule } from 'ng-zorro-antd'; 9 | 10 | import { AppComponent } from './app.component'; 11 | import { AppRouting } from './app.routing'; 12 | import { PagesModule } from './pages/pages.module'; 13 | 14 | import { PreloadService } from './pages/routes/shared/preview-load.service'; 15 | 16 | @NgModule({ 17 | declarations: [ 18 | AppComponent 19 | ], 20 | imports: [ 21 | BrowserModule, 22 | BrowserAnimationsModule, 23 | HttpModule, 24 | PagesModule, 25 | NgZorroAntdModule.forRoot(), 26 | RouterModule.forRoot(AppRouting, {useHash: true }) // 预加载 1 RouterModule 传入服务 27 | ], 28 | providers: [ 29 | PreloadService // 预加载 2 注册服务 30 | ], 31 | bootstrap: [AppComponent] 32 | }) 33 | export class AppModule { } 34 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/guard.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | import { NgZorroAntdModule } from 'ng-zorro-antd'; 5 | 6 | import { GuardRoutes } from './guard.routing'; 7 | import { GuardComponent } from './guard.component'; 8 | import { CanAdminVisitComponent } from './can-admin-visit/can-admin-visit.component'; 9 | import { CanUserVisitComponent } from './can-user-visit/can-user-visit.component'; 10 | import { CanAnybodyVisitComponent } from './can-anybody-visit/can-anybody-visit.component'; 11 | import { LeaveAuthorizationComponent } from './leave-authorization/leave-authorization.component'; 12 | 13 | const GUARD_COMPONENT = [ 14 | GuardComponent, 15 | CanAdminVisitComponent, 16 | CanUserVisitComponent, 17 | CanAnybodyVisitComponent, 18 | LeaveAuthorizationComponent 19 | ] 20 | 21 | @NgModule({ 22 | imports: [ 23 | CommonModule, 24 | NgZorroAntdModule, 25 | RouterModule.forChild(GuardRoutes) 26 | ], 27 | declarations: [ 28 | ...GUARD_COMPONENT, 29 | ] 30 | 31 | }) 32 | export class GuardModule { } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | broken-bridge 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016", 10 | "dom" 11 | ], 12 | "outDir": "../out-tsc/spec", 13 | "module": "commonjs", 14 | "target": "es5", 15 | "baseUrl": "", 16 | "types": [ 17 | "jasmine", 18 | "node" 19 | ] 20 | }, 21 | "files": [ 22 | "test.ts" 23 | ], 24 | "include": [ 25 | "**/*.spec.ts", 26 | "**/*.d.ts" 27 | ], 28 | "paths": { 29 | "@angular/common": ["../node_modules/@angular/common"], 30 | "@angular/compiler": ["../node_modules/@angular/compiler"], 31 | "@angular/core": ["../node_modules/@angular/core"], 32 | "@angular/forms": ["../node_modules/@angular/forms"], 33 | "@angular/platform-browser": ["../node_modules/@angular/platform-browser"], 34 | "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"], 35 | "@angular/router": ["../node_modules/@angular/router"], 36 | "@angular/http": ["../node_modules/@angular/http"] 37 | } 38 | } -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, ModuleWithProviders } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { Http, XHRBackend, RequestOptions, HttpModule, JsonpModule } from '@angular/http'; 4 | import { Router, RouterModule } from '@angular/router'; 5 | import { NgZorroAntdModule } from 'ng-zorro-antd'; 6 | 7 | import { HeaderComponent, FooterComponent, NgContentComponent } from './components/index'; 8 | import { WindowRefService } from './service/return-window.service'; 9 | 10 | const SHARED_COMPONENTS = [ 11 | HeaderComponent, 12 | FooterComponent, 13 | NgContentComponent 14 | ] 15 | 16 | const SHARED_SERVICE = [ 17 | WindowRefService 18 | ] 19 | 20 | @NgModule({ 21 | imports: [ 22 | CommonModule, 23 | RouterModule, 24 | HttpModule, 25 | NgZorroAntdModule 26 | ], 27 | declarations: [ // 先声明 28 | ...SHARED_COMPONENTS 29 | ], 30 | 31 | providers: [ 32 | ...SHARED_SERVICE 33 | ], 34 | exports: [ 35 | ...SHARED_COMPONENTS, 36 | ] 37 | }) 38 | 39 | export class SharedModule { 40 | static forRoot(): ModuleWithProviders { 41 | return { 42 | ngModule: SharedModule 43 | }; 44 | } 45 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/our-skills/our-skills.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, ElementRef, ViewChild, Renderer2, OnChanges } from '@angular/core'; 2 | import { autoWidth } from './../../../../../shared/animations/autoWidth'; 3 | 4 | @Component({ 5 | selector: 'poetry-our-skills', 6 | templateUrl: './our-skills.component.html', 7 | styleUrls: ['./our-skills.component.scss'], 8 | animations: [ 9 | autoWidth 10 | ] 11 | }) 12 | export class OurSkillsComponent implements OnInit, OnChanges { 13 | 14 | @Input() public skillMeta: any; 15 | @Input() public skillsBarStart: any; 16 | // @ViewChild('processBar') processBar: ElementRef; 17 | 18 | constructor(private renderer2: Renderer2) { } 19 | 20 | ngOnInit() { } 21 | 22 | ngOnChanges() { 23 | // if (this.skillsBarStart) { 24 | // console.log("this.skillsBarStart1111", this.skillsBarStart) 25 | // this.renderer2.setProperty(this.processBar.nativeElement, "width", this.skillMeta.percentage); 26 | // this.renderer2.setStyle(this.processBar.nativeElement, "background-color", this.skillMeta.color ? this.skillMeta.color : "#0061ea"); 27 | // } 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/kama.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | basePath: '', 4 | frameworks: ['jasmine', '@angular/cli'], 5 | plugins: [ 6 | require('karma-jasmine-html-reporter'), 7 | require('karma-coverage-istanbul-reporter'), 8 | require('karma-jasmine'), 9 | require('karma-chrome-launcher'), 10 | require('@angular/cli/plugins/karma') 11 | ], 12 | client:{ 13 | clearContext: false // leave Jasmine Spec Runner output visible in browser 14 | }, 15 | files: [ 16 | { pattern: './src/test.ts', watched: false } 17 | ], 18 | preprocessors: { 19 | './src/test.ts': ['@angular/cli'] 20 | }, 21 | mime: { 22 | 'text/x-typescript': ['ts','tsx'] 23 | }, 24 | coverageIstanbulReporter: { 25 | reports: [ 'html', 'lcovonly' ], 26 | fixWebpackSourcePaths: true 27 | }, 28 | reporters: config.angularCli && config.angularCli.codeCoverage 29 | ? ['progress', 'coverage-istanbul'] 30 | : ['progress', 'kjhtml'], 31 | port: 9876, 32 | colors: true, 33 | logLevel: config.LOG_INFO, 34 | autoWatch: true, 35 | browsers: ['Chrome'], 36 | singleRun: false 37 | }); 38 | }; -------------------------------------------------------------------------------- /src/app/pages/routes/shared/authorization.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | const sessionStroageKey = "currentUser"; 4 | 5 | @Injectable() 6 | export class AuthorizationService { 7 | 8 | private _currentUser: any; 9 | 10 | private _role: string[]; 11 | 12 | isLogin(role?): boolean { 13 | this.getCurrentUser(); 14 | return role ? 15 | role === this._currentUser ? true : false 16 | : 17 | this._currentUser 18 | } 19 | 20 | hasRole(name): boolean { 21 | this.getCurrentUser(); 22 | this._role = [this._currentUser]; 23 | return this._role.includes(name); 24 | } 25 | 26 | getCurrentUser(): any { 27 | let currentUser = JSON.parse(sessionStorage.getItem(sessionStroageKey)); 28 | return this._currentUser = currentUser ? currentUser.role : null; 29 | } 30 | 31 | saveAccount(meta: any): boolean { 32 | sessionStorage.setItem(sessionStroageKey, JSON.stringify(meta)); 33 | return true; 34 | } 35 | 36 | removeAccount(): boolean { 37 | sessionStorage.removeItem(sessionStroageKey); 38 | return true; 39 | } 40 | 41 | 42 | 43 | 44 | } -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "baseUrl": "src", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "module": "es6", 14 | "types": [ 15 | "node" 16 | ], 17 | "typeRoots": [ 18 | "node_modules/@types" 19 | ], 20 | "lib": [ 21 | "es2016", 22 | "dom" 23 | ], 24 | "paths": { 25 | "@angular/common": ["../node_modules/@angular/common"], 26 | "@angular/compiler": ["../node_modules/@angular/compiler"], 27 | "@angular/core": ["../node_modules/@angular/core"], 28 | "@angular/forms": ["../node_modules/@angular/forms"], 29 | "@angular/platform-browser": ["../node_modules/@angular/platform-browser"], 30 | "@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"], 31 | "@angular/router": ["../node_modules/@angular/router"], 32 | "@angular/http": ["../node_modules/@angular/http"] 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/home-content.component.scss: -------------------------------------------------------------------------------- 1 | .home-full-container{ 2 | position: relative; 3 | } 4 | 5 | // 第一部分,轮播大图 6 | @media screen and(min-width:768px){ 7 | .home-full-container{ 8 | width: 100%; 9 | height: 100%; 10 | } 11 | 12 | .fixed-btn{ 13 | cursor: pointer; 14 | padding: 13px; 15 | background: #222; 16 | width: 45px; 17 | height: 45px; 18 | display: block; 19 | position: fixed; 20 | right: 10px; 21 | z-index: 99999; 22 | -webkit-box-shadow: 2px 0 3px rgba(0,0,0,0.1); 23 | -moz-box-shadow: 2px 0 2px rgba(0,0,0,0.1); 24 | box-shadow: 2px 0 2px rgba(0,0,0,0.1); 25 | transition: .4s all ease; 26 | i{ 27 | color: #eee; 28 | cursor: pointer; 29 | font-size: 24px; 30 | } 31 | } 32 | .fixed-btn-top{ 33 | top: 100px; 34 | } 35 | .fixed-btn-bottom{ 36 | top: 150px; 37 | } 38 | 39 | .partner-tips{ 40 | margin-top: -58px; 41 | } 42 | } 43 | 44 | 45 | @media screen and(max-width:767px){ 46 | .fixed-btn{ 47 | display: none 48 | } 49 | 50 | .partner-tips{ 51 | margin-top: 0; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/app/pages/routes/routes.routing.ts: -------------------------------------------------------------------------------- 1 | /*** 2 | * 此为路由介绍的模块,包括: 3 | * @param 懒加载 4 | * 5 | * 6 | * 7 | * */ 8 | import { Routes } from '@angular/router'; 9 | 10 | import { RoutesComponent } from './routes.component'; 11 | import { SigninComponent } from './signin/signin.component'; 12 | 13 | export const RoutesRouting: Routes = [ 14 | { 15 | path: '', 16 | component: RoutesComponent, 17 | children: [ 18 | { 19 | path: '', 20 | redirectTo: 'signin', 21 | pathMatch: 'full' 22 | }, 23 | { 24 | path: 'signin', 25 | component: SigninComponent 26 | }, 27 | { 28 | path: 'lazyload', // 懒加载模块用法 29 | loadChildren: './lazy-load/lazy-load.module#LazyLoadModule' // !* 只需要在这里这样配置即可懒加载模块 * ! 30 | }, 31 | { 32 | path: 'previewload', // 预加载模块用法 33 | loadChildren: './preview-load/preview-load.module#PreviewLoadModule', 34 | data: { preload: false } // true表示要启用预加载, false表示禁用预加载,这里禁用了可以改成true查看效果。 35 | }, 36 | { 37 | path: 'guard', // 路由守卫模块 38 | loadChildren: './guard/guard.module#GuardModule' 39 | }, 40 | { 41 | path: '**', 42 | redirectTo: 'signin' 43 | } 44 | ] 45 | } 46 | ]; 47 | 48 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // https://karma-runner.github.io/0.13/config/configuration-file.html 2 | 3 | module.exports = function (config) { 4 | config.set({ 5 | basePath: '', 6 | frameworks: ['jasmine', '@angular/cli'], 7 | plugins: [ 8 | require('karma-jasmine-html-reporter'), 9 | require('karma-coverage-istanbul-reporter'), 10 | require('karma-jasmine'), 11 | require('karma-chrome-launcher'), 12 | require('@angular/cli/plugins/karma') 13 | ], 14 | client:{ 15 | clearContext: false // leave Jasmine Spec Runner output visible in browser 16 | }, 17 | files: [ 18 | { pattern: './src/test.ts', watched: false } 19 | ], 20 | preprocessors: { 21 | './src/test.ts': ['@angular/cli'] 22 | }, 23 | mime: { 24 | 'text/x-typescript': ['ts','tsx'] 25 | }, 26 | coverageIstanbulReporter: { 27 | reports: [ 'html', 'lcovonly' ], 28 | fixWebpackSourcePaths: true 29 | }, 30 | reporters: config.angularCli && config.angularCli.codeCoverage 31 | ? ['progress', 'coverage-istanbul'] 32 | : ['progress', 'kjhtml'], 33 | port: 9876, 34 | colors: true, 35 | logLevel: config.LOG_INFO, 36 | autoWatch: true, 37 | browsers: ['Chrome'], 38 | singleRun: false 39 | }); 40 | }; -------------------------------------------------------------------------------- /src/app/pages/routes/shared/can-leave.provider.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import { NzModalService } from 'ng-zorro-antd'; 5 | 6 | @Injectable() 7 | export class CanLeaveProvide implements CanDeactivate { 8 | constructor (private confirmSrv: NzModalService) {} 9 | 10 | canDeactivate( 11 | component: any, 12 | currentRoute: ActivatedRouteSnapshot, 13 | currentState: RouterStateSnapshot, 14 | nextState?: RouterStateSnapshot): boolean | Observable | Promise { 15 | return new Observable((observer) => { 16 | this.confirmSrv.confirm({ 17 | title: '确认要离开吗?', 18 | content: '你已经填写了部分表单离开会放弃已经填写的内容。', 19 | okText: '离开', 20 | cancelText: '取消', 21 | onOk: () => { 22 | observer.next(true); 23 | observer.complete(); 24 | }, 25 | onCancel: () => { 26 | observer.next(false); 27 | observer.complete(); 28 | } 29 | }); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/he-said/he-said.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ companyInfo.det }} 4 |
5 |
6 |
7 | 8 |
9 | 10 |
11 | 12 |
13 |
14 |
15 | 16 |
17 | {{ companyInfo.tit }} 18 |
19 | 20 |
21 |
    22 |
  • 23 |
    24 |
  • 25 |
  • 26 |
    27 |
  • 28 |
  • 29 |
    30 |
  • 31 |
  • 32 |
    33 |
  • 34 |
35 |
36 | 37 |
38 | 39 |
-------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_sizes.scss: -------------------------------------------------------------------------------- 1 | // Sizing 2 | // @source - https://v4-alpha.getbootstrap.com/utilities/sizing/ 3 | // ---------------------------------- 4 | 5 | // %#{$abbrev}-#{$size} 6 | @each $prop, $abbrev in (width: w, height: h) { 7 | @each $size, $length in $sizes { 8 | %#{$abbrev}-#{$size} { 9 | #{$prop}: $length; 10 | } 11 | } 12 | } 13 | 14 | // Container widths 15 | // %maxw-#{$prop} %minw-#{$prop} 16 | @each $prop, $value in $container-widths { 17 | %c-maxw-#{$prop} { 18 | max-width: $value; 19 | }; 20 | %c-minw-#{$prop} { 21 | min-width: $value; 22 | }; 23 | } 24 | 25 | // Screen breakpoints 26 | // %minw-#{$prop} %maxw-#{$prop} 27 | @each $prop, $value in $screen-breakpoints { 28 | %b-maxw-#{$prop} { 29 | max-width: $value; 30 | }; 31 | %b-minw-#{$prop} { 32 | min-width: $value; 33 | }; 34 | } 35 | 36 | // %maxw-#{$prop} %minw-#{$prop} 37 | @for $i from 1 through 10 { 38 | %maxw-#{$i * 10} { 39 | max-width: percentage($i / 10); 40 | } 41 | %minw-#{$i * 10} { 42 | max-width: percentage($i / 10); 43 | } 44 | } 45 | 46 | // Some special sizes 47 | %mh-100 { 48 | max-height: 100%; 49 | } 50 | 51 | %wh-100 { 52 | width: 100%; 53 | height: 100%; 54 | } 55 | 56 | %w-auto { 57 | width: auto; 58 | } 59 | 60 | %h-auto { 61 | height: auto; 62 | } 63 | -------------------------------------------------------------------------------- /src/app/pages/routes/shared/can-admin-visit.provider.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, CanLoad, ActivatedRouteSnapshot, RouterStateSnapshot, Route } from '@angular/router'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import { AuthorizationService } from './authorization.service'; 5 | 6 | import { NzMessageService } from 'ng-zorro-antd'; 7 | 8 | @Injectable() 9 | export class CanAdminVisitProvide implements CanActivate, CanLoad { 10 | 11 | constructor(private AuthSrv: AuthorizationService, private msg: NzMessageService, ) {} 12 | 13 | check(): Observable { 14 | return new Observable((observer) => { 15 | if (this.AuthSrv.hasRole('admin')) { 16 | observer.next(true); 17 | observer.complete(); 18 | return; 19 | } 20 | this.msg.error('权限不足'); 21 | observer.next(false); 22 | observer.complete(); 23 | 24 | }); 25 | } 26 | 27 | canActivate( 28 | route: ActivatedRouteSnapshot, 29 | state: RouterStateSnapshot): boolean | Observable | Promise { 30 | return this.check(); 31 | } 32 | 33 | canLoad(route: Route): boolean | Observable | Promise { 34 | return this.check(); 35 | } 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/our-skills/our-skills.component.scss: -------------------------------------------------------------------------------- 1 | .skill-wrap{ 2 | height: 4px; 3 | margin-top: 53px; 4 | margin-bottom: 58px; 5 | background: #f7f7f7; 6 | position: relative; 7 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset; 8 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset; 9 | 10 | .skill-name{ 11 | color: #333; 12 | font-size: 12px; 13 | font-weight: 600; 14 | position: relative; 15 | z-index: 1; 16 | top: -28px; 17 | span{ 18 | float: right; 19 | color: #333; 20 | } 21 | } 22 | 23 | .process-bar{ 24 | position: absolute; 25 | height: 100%; 26 | top: 0; 27 | left: 0; 28 | &:before{ 29 | content: ''; 30 | background-color: #fff; 31 | width: 4px; 32 | height: 4px; 33 | border-radius: 50%; 34 | position: absolute; 35 | top: 0; 36 | right: 1px; 37 | z-index: 1000; 38 | } 39 | &:after{ 40 | content: ''; 41 | background-color: inherit; 42 | width: 14px; 43 | height: 14px; 44 | border-radius: 50%; 45 | position: absolute; 46 | top: -5px; 47 | right: -4px; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/move-img/move-img.component.scss: -------------------------------------------------------------------------------- 1 | @media screen and(min-width:768px){ 2 | .content { 3 | font-size: 24px; 4 | } 5 | .det{ 6 | font-size: 14px; 7 | } 8 | } 9 | 10 | @media screen and(max-width:767px){ 11 | .content { 12 | font-size: 14px; 13 | } 14 | .det{ 15 | font-size: 10px; 16 | } 17 | } 18 | 19 | 20 | .container { 21 | width: 1000px; 22 | margin: 50px auto; 23 | } 24 | .itemWrap { 25 | height: auto; 26 | box-sizing: border-box; 27 | position: relative; 28 | overflow: hidden; 29 | display: inline-block; 30 | padding: 0; 31 | img{ 32 | width: 100%; 33 | height: auto; 34 | } 35 | } 36 | .content { 37 | position: absolute; 38 | z-index: 2; 39 | // background: rgba(0, 0, 0, 0.5); 40 | background-color: rgba(19,192,223,0.65); 41 | width: 100%; 42 | height: 100%; 43 | left: -100%; 44 | top: -100%; 45 | text-align: center; 46 | color: #fff; 47 | line-height: 2; 48 | padding: 20px 30px; 49 | .det{ 50 | text-align: left; 51 | line-height: 1.5; 52 | color: #f5f5f5; 53 | } 54 | } 55 | 56 | .content.active { 57 | transition: all .3s ; 58 | -webkit-transition: all .3s ; 59 | -ms-transition: all .3s ; 60 | -o-transition: all .3s ; 61 | -moz-transition: all .3s ; 62 | backface-visibility: hidden; 63 | } 64 | -------------------------------------------------------------------------------- /src/app/pages/routes/shared/can-signin-visit.provider.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, CanLoad, ActivatedRouteSnapshot, RouterStateSnapshot, Route } from '@angular/router'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import { AuthorizationService } from './authorization.service'; 5 | 6 | import { NzMessageService } from 'ng-zorro-antd'; 7 | 8 | @Injectable() 9 | export class CanSigninVisitProvide implements CanActivate, CanLoad { 10 | 11 | constructor(private AuthSrv: AuthorizationService, private msg: NzMessageService, ) {} 12 | 13 | check(): Observable { 14 | return new Observable((observer) => { 15 | if (this.AuthSrv.isLogin()) { 16 | observer.next(true); 17 | observer.complete(); 18 | return; 19 | } 20 | this.msg.error('权限不足'); 21 | observer.next(false); 22 | observer.complete(); 23 | 24 | }); 25 | } 26 | 27 | canActivate( 28 | route: ActivatedRouteSnapshot, 29 | state: RouterStateSnapshot): boolean | Observable | Promise { 30 | // console.log("路由配置",route.routeConfig.canActivate[1],'路由配置中的定义', state.root) 31 | return this.check(); 32 | } 33 | 34 | canLoad(route: Route): boolean | Observable | Promise { 35 | return this.check(); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | // 这是单元测试的主要入口点。 它有一些你不熟悉的自定义配置,不过你并不需要编辑这里的任何东西。 3 | import 'rxjs/Rx'; 4 | 5 | import 'zone.js/dist/long-stack-trace-zone'; 6 | import 'zone.js/dist/proxy.js'; 7 | import 'zone.js/dist/sync-test'; 8 | import 'zone.js/dist/jasmine-patch'; 9 | import 'zone.js/dist/async-test'; 10 | import 'zone.js/dist/fake-async-test'; 11 | 12 | /* tslint:disable */ 13 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 14 | declare var __karma__: any; 15 | declare var require: any; 16 | 17 | // Prevent Karma from running prematurely. 18 | __karma__.loaded = function () { 19 | 20 | }; 21 | 22 | 23 | Promise.all([ 24 | System.import('@angular/core/testing'), 25 | System.import('@angular/platform-browser-dynamic/testing') 26 | ]) 27 | // First, initialize the Angular testing environment. 28 | .then(([testing, testingBrowser]) => { 29 | testing.getTestBed().initTestEnvironment( 30 | testingBrowser.BrowserDynamicTestingModule, 31 | testingBrowser.platformBrowserDynamicTesting() 32 | ); 33 | }) 34 | // Then we find all the tests. 35 | .then(() => require.context('./', true, /\.spec\.ts/)) 36 | // And load the modules. 37 | .then(context => context.keys().map(context)) 38 | // Finally, start Karma to run the tests. 39 | .then(__karma__.start, __karma__.error); 40 | /* tslint:enable */ 41 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/slideshow/change-dot/change-dot.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 下面的切换轮播图小点 3 | */ 4 | import { Component, OnInit, OnChanges, ElementRef, ViewChild, Renderer2, Input, Output, EventEmitter } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'change-dot', 8 | templateUrl: './change-dot.component.html', 9 | styleUrls: ['./change-dot.component.scss'] 10 | }) 11 | export class ChangeDotComponent implements OnInit, OnChanges { 12 | 13 | 14 | @ViewChild('firDot') firDot: ElementRef; 15 | @ViewChild('secDot') secDot: ElementRef; 16 | @ViewChild('thiDot') thiDot: ElementRef; 17 | @ViewChild('fouDot') fouDot: ElementRef; 18 | 19 | @Input() public currentIndex: number; 20 | @Output() sendIndex: EventEmitter = new EventEmitter(); 21 | 22 | changBg(temp){ 23 | this.changeDotStyle(temp); 24 | this.sendIndex.emit(temp); 25 | } 26 | 27 | changeDotStyle(temp){ 28 | let domArray = [this.firDot, this.secDot, this.thiDot, this.fouDot]; 29 | domArray.forEach((item, index) => { 30 | if(temp === index) { 31 | this.renderer2.addClass(item.nativeElement, "active-dot"); 32 | }else{ 33 | this.renderer2.removeClass(item.nativeElement, "active-dot"); 34 | } 35 | }); 36 | } 37 | 38 | ngOnChanges(){ 39 | this.changeDotStyle(this.currentIndex); 40 | } 41 | 42 | constructor(private renderer2: Renderer2 ) { } 43 | 44 | ngOnInit() { 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/app/theme/scss/base/_base.scss: -------------------------------------------------------------------------------- 1 | // Base Rules 2 | // -------------------------------------------------- 3 | 4 | 5 | // App Structure 6 | // ---------------------------------- 7 | * { 8 | box-sizing: border-box; 9 | } 10 | 11 | // All font sizes use rem units 12 | // By default, 1rem equals 10px. For example, 1.4rem === 14px 13 | // $font-size-root value, which is on the element 14 | // is what can scale all fonts 15 | html { 16 | width: 100%; 17 | height: 100%; 18 | 19 | font-size: $font-size-root; 20 | } 21 | 22 | body { 23 | width: 100%; 24 | max-width: 100%; 25 | 26 | min-width: $nav-bar-min-width; 27 | 28 | height: 100%; 29 | max-height: 100%; 30 | 31 | font-family: $font-family-base; 32 | font-size: $font-size-base; 33 | color: $text-color; 34 | background-color: $body-bg; 35 | } 36 | 37 | // Font size of heading 38 | // ---------------------------------- 39 | 40 | @each $h, $s in $headings { 41 | #{$h} { 42 | font-size: $s; 43 | } 44 | } 45 | 46 | // Element base rule 47 | // ---------------------------------- 48 | 49 | h1, h2 { 50 | margin-top: ($spacer * 2); 51 | margin-bottom: $spacer; 52 | } 53 | 54 | p { 55 | line-height: $line-height-base; 56 | margin-bottom: $spacer; 57 | } 58 | 59 | a { 60 | color: $link-color; 61 | background: transparent; 62 | text-decoration: none; 63 | 64 | &:hover { 65 | color: $link-hover-color; 66 | } 67 | } 68 | 69 | ul, li { 70 | padding: 0; 71 | } 72 | 73 | li { 74 | list-style: none; 75 | } 76 | -------------------------------------------------------------------------------- /src/assets/css/reset.css: -------------------------------------------------------------------------------- 1 | /*公共样式--开始*/ 2 | html, body, div, ul, li, h1, h2, h3, h4, h5, h6, p, dl, dt, dd, ol, form, input, textarea, th, td, select { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | *{box-sizing: border-box;} 7 | html, body { 8 | width: 100%; 9 | height: 100%; 10 | } 11 | 12 | body { 13 | font-family: "Microsoft YaHei"; 14 | font-size:14px; 15 | color:#333; 16 | } 17 | h1, h2, h3, h4, h5, h6{font-weight:normal;} 18 | ul,ol { 19 | list-style: none; 20 | } 21 | 22 | img { 23 | border: none; 24 | vertical-align: middle; 25 | } 26 | 27 | a { 28 | text-decoration: none; 29 | color: #232323; 30 | } 31 | 32 | table { 33 | border-collapse: collapse; 34 | table-layout: fixed; 35 | } 36 | 37 | input, textarea,div { 38 | outline: none; 39 | border: none; 40 | } 41 | 42 | 43 | textarea { 44 | resize: none; 45 | overflow: auto; 46 | } 47 | 48 | .clearfix { 49 | zoom: 1; 50 | } 51 | 52 | .clearfix:after { 53 | content: "."; 54 | width: 0; 55 | height: 0; 56 | visibility: hidden; 57 | display: block; 58 | clear: both; 59 | overflow:hidden; 60 | } 61 | 62 | .fl { 63 | float: left 64 | } 65 | 66 | .fr { 67 | float: right 68 | } 69 | 70 | .tl { 71 | text-align: left; 72 | } 73 | 74 | .tc { 75 | text-align: center 76 | } 77 | 78 | .tr { 79 | text-align: right; 80 | } 81 | 82 | .ellipse { 83 | overflow: hidden; 84 | text-overflow: ellipsis; 85 | white-space: nowrap; 86 | } 87 | .inline{ 88 | display: inline-block; 89 | *display: inline; 90 | *zoom: 1; 91 | } -------------------------------------------------------------------------------- /src/app/shared/components/header/header.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | logo 5 |
6 | 7 | 8 | 9 | 32 | 33 | 36 | 37 |
38 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/slideshow/change-dot/change-dot.component.scss: -------------------------------------------------------------------------------- 1 | // 最底下的按钮 2 | .dot-change-bg{ 3 | position: absolute; 4 | text-align: center; 5 | z-index: 99; 6 | li{ 7 | width: 16px; 8 | height: 16px; 9 | border-radius: 16px; 10 | margin: 0 0 0 10px ; 11 | display: inline-block; 12 | z-index: 100; 13 | span{ 14 | cursor: pointer; 15 | text-indent: -9999px; 16 | -webkit-border-radius: 20px; 17 | -moz-border-radius: 20px; 18 | -o-border-radius: 20px; 19 | border-radius: 20px; 20 | width: 100%; 21 | height: 100%; 22 | display: block; 23 | border: 3px solid rgba(255,255,255,.3); 24 | transition: border .5s; 25 | -webkit-transition: border .5s; 26 | -moz-transition: border .5s; 27 | -ms-transition: border .5s; 28 | &:hover{ 29 | border: 3px solid rgba(255,255,255,1); 30 | transition: border .5s; 31 | -webkit-transition: border .5s; 32 | -moz-transition: border .5s; 33 | -ms-transition: border .5s; 34 | } 35 | } 36 | .active-dot{ 37 | background: #ECECEC; 38 | } 39 | 40 | } 41 | } 42 | 43 | @media screen and(min-width:768px){ 44 | .dot-change-bg{ 45 | top: 95%; 46 | left: 47%; 47 | } 48 | } 49 | 50 | @media screen and(max-width:767px){ 51 | .dot-change-bg{ 52 | top: 86%; 53 | left: 33%; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_text.scss: -------------------------------------------------------------------------------- 1 | // $Text 2 | // -------------------------------------------------- 3 | 4 | // Alignment 5 | %text-justify { 6 | text-align: justify; 7 | } 8 | 9 | %text-nowrap { 10 | white-space: nowrap; 11 | } 12 | 13 | %text-truncate { 14 | overflow: hidden; 15 | text-overflow: ellipsis; 16 | white-space: nowrap; 17 | } 18 | 19 | // Responsive alignment 20 | %text-left { 21 | text-align: left; 22 | } 23 | 24 | %text-right { 25 | text-align: right; 26 | } 27 | 28 | %text-center { 29 | text-align: center; 30 | } 31 | 32 | // Transformation 33 | %text-lowercase { 34 | text-transform: lowercase; 35 | } 36 | 37 | %text-uppercase { 38 | text-transform: uppercase; 39 | } 40 | 41 | %text-capitalize { 42 | text-transform: capitalize; 43 | } 44 | 45 | // Weight and italics 46 | %font-weight-normal { 47 | font-weight: normal; 48 | } 49 | 50 | %font-weight-bold { 51 | font-weight: bold; 52 | } 53 | 54 | %font-italic { 55 | font-style: italic; 56 | } 57 | 58 | // Text color 59 | $text-colors: ( 60 | gray-base: $gray-base, 61 | gray-darker: $gray-darker, 62 | gray-dark: $gray-dark, 63 | gray-light: $gray-light, 64 | gray-lighter: $gray-lighter, 65 | muted: $gray-light, 66 | primary: $primary, 67 | success: $brand-success, 68 | info: $brand-info, 69 | warning: $brand-warning, 70 | danger: $brand-danger 71 | ); 72 | 73 | @each $parent, $color in $text-colors { 74 | %text-#{$parent} { 75 | color: $color; 76 | } 77 | } 78 | 79 | %text-white { 80 | color: #fff; 81 | } 82 | 83 | %text-gray { 84 | color: $gray; 85 | } 86 | 87 | %text-transparent { 88 | color: transparent; 89 | } 90 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Angular-demo", 3 | "version": "0.0.1", 4 | "license": "MIT", 5 | "scripts": { 6 | "gitee" : "ng build --prod --aot --base-href", 7 | "github": "ng build --prod --aot --base-href 'https://deepthan.github.io/blog-angular/'" 8 | }, 9 | "private": true, 10 | "dependencies": { 11 | "@angular/animations": "^4.2.4", 12 | "@angular/common": "^4.2.4", 13 | "@angular/compiler": "^4.2.4", 14 | "@angular/core": "^4.2.4", 15 | "@angular/forms": "^4.2.4", 16 | "@angular/http": "^4.2.4", 17 | "@angular/platform-browser": "^4.2.4", 18 | "@angular/platform-browser-dynamic": "^4.2.4", 19 | "@angular/router": "^4.2.4", 20 | "core-js": "^2.4.1", 21 | "rxjs": "^5.4.2", 22 | "tinymce": "^4.6.4", 23 | "zone.js": "^0.8.14", 24 | "node-sass": "^3.4.0", 25 | "bootstrap": "^3.3.7", 26 | "font-awesome": "^4.6.3" 27 | }, 28 | "devDependencies": { 29 | "@angular/cli": "1.4.3", 30 | "@angular/compiler-cli": "^4.2.4", 31 | "@angular/language-service": "^4.2.4", 32 | "@types/jasmine": "~2.5.53", 33 | "@types/jasminewd2": "~2.0.2", 34 | "@types/node": "~6.0.60", 35 | "codelyzer": "~3.1.1", 36 | "jasmine-core": "~2.6.2", 37 | "jasmine-spec-reporter": "~4.1.0", 38 | "karma": "~1.7.0", 39 | "karma-chrome-launcher": "~2.1.1", 40 | "karma-cli": "~1.0.1", 41 | "karma-coverage-istanbul-reporter": "^1.2.1", 42 | "karma-jasmine": "~1.1.0", 43 | "karma-jasmine-html-reporter": "^0.2.2", 44 | "protractor": "~5.1.2", 45 | "ts-node": "~3.2.0", 46 | "tslint": "~5.3.2", 47 | "ng-zorro-antd": "^0.5.3", 48 | "typescript": "~2.3.3" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/pages/routes/guard/guard.routing.ts: -------------------------------------------------------------------------------- 1 | import { CanLeaveProvide } from './../shared/can-leave.provider'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { CanSigninVisitProvide } from './../shared/can-signin-visit.provider'; 5 | import { CanAdminVisitProvide } from './../shared/can-admin-visit.provider'; 6 | 7 | import { GuardComponent } from './guard.component'; 8 | import { CanAdminVisitComponent } from './can-admin-visit/can-admin-visit.component'; 9 | import { CanUserVisitComponent } from './can-user-visit/can-user-visit.component'; 10 | import { CanAnybodyVisitComponent } from './can-anybody-visit/can-anybody-visit.component'; 11 | import { LeaveAuthorizationComponent } from './leave-authorization/leave-authorization.component'; 12 | 13 | 14 | export const GuardRoutes: Routes = [ 15 | { 16 | path: '', 17 | component: GuardComponent, 18 | children: [ 19 | { 20 | path: '', 21 | redirectTo: 'anybody', 22 | pathMatch: 'full' 23 | }, 24 | { 25 | path: 'anybody', 26 | component: CanAnybodyVisitComponent 27 | 28 | }, 29 | { 30 | path: 'admin', 31 | component: CanAdminVisitComponent, 32 | canActivate: [ CanAdminVisitProvide ], 33 | canLoad: [ CanAdminVisitProvide ] 34 | }, 35 | { 36 | path: 'user', 37 | component: CanUserVisitComponent, 38 | canActivate: [ CanSigninVisitProvide ], 39 | canLoad: [ CanSigninVisitProvide ] 40 | }, 41 | { 42 | path: 'leave', 43 | component: LeaveAuthorizationComponent, 44 | canDeactivate: [ CanLeaveProvide] 45 | } 46 | ] 47 | } 48 | 49 | ]; 50 | 51 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/slideshow/slideshow.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
诗意生活,从这里开始
4 |
以更加饱满的状态迎接黎明
5 |
    6 |
  • 了解更多
  • 7 |
8 |
9 | 10 |
11 |
诗意生活,从你我做起
12 |
感受生活的美好,有趣灵动
13 |
    14 |
  • 立即试用
  • 15 |
16 |
17 | 18 |
19 |
诗意生活,爱的伊始
20 |
这里是美好的发源地,感动你我
21 |
    22 |
  • 了解更多
  • 23 |
24 |
25 | 26 |
27 |
诗意生活,点燃你的情感
28 |
感受世间的美好,拥抱未来
29 |
    30 |
  • 了解更多
  • 31 |
32 |
33 | 34 |
    35 |
  • 36 |
  • 37 |
38 | 39 | 40 | 41 | 42 | 43 |
-------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_whitespace.scss: -------------------------------------------------------------------------------- 1 | // Spacing Shorthand placeholder 2 | // @source - https://v4-alpha.getbootstrap.com/utilities/spacing/ 3 | // ---------------------------------- 4 | 5 | 6 | // Margin and Padding 7 | @each $prop, $abbrev in (margin: m, padding: p) { 8 | @each $size, $lengths in $spacers { 9 | $length-x: map-get($lengths, x); 10 | $length-y: map-get($lengths, y); 11 | $symbols: (positive: null, negative: '-'); 12 | 13 | @each $symbol, $short in $symbols { 14 | %#{$short}#{$abbrev}-#{$size} { 15 | #{$prop}: #{$short}#{$length-y} #{$short}#{$length-x}; 16 | } 17 | %#{$short}#{$abbrev}t-#{$size} { 18 | #{$prop}-top: #{$short}#{$length-y}; 19 | } 20 | %#{$short}#{$abbrev}r-#{$size} { 21 | #{$prop}-right: #{$short}#{$length-x}; 22 | } 23 | %#{$short}#{$abbrev}b-#{$size} { 24 | #{$prop}-bottom: #{$short}#{$length-y}; 25 | } 26 | %#{$short}#{$abbrev}l-#{$size} { 27 | #{$prop}-left: #{$short}#{$length-x}; 28 | } 29 | %#{$short}#{$abbrev}x-#{$size} { 30 | #{$prop}-right: #{$short}#{$length-x}; 31 | #{$prop}-left: #{$short}#{$length-x}; 32 | } 33 | %#{$short}#{$abbrev}y-#{$size} { 34 | #{$prop}-top: #{$short}#{$length-y}; 35 | #{$prop}-bottom: #{$short}#{$length-y}; 36 | } 37 | } 38 | } 39 | } 40 | 41 | // Some special margin utils 42 | %m-auto { 43 | margin: auto; 44 | } 45 | 46 | %mt-auto { 47 | margin-top: auto; 48 | } 49 | 50 | %mr-auto { 51 | margin-right: auto; 52 | } 53 | 54 | %mb-auto { 55 | margin-bottom: auto; 56 | } 57 | 58 | %ml-auto { 59 | margin-left: auto; 60 | } 61 | 62 | %mx-auto { 63 | margin-right: auto; 64 | margin-left: auto; 65 | } 66 | 67 | %my-auto { 68 | margin-top: auto; 69 | margin-bottom: auto; 70 | } 71 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/poetry-news.component.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Component, OnInit, Input } from '@angular/core'; 3 | import { fadeInUp } from './../../../../shared/animations/fadeInUp'; 4 | 5 | @Component({ 6 | selector: 'poetry-news', 7 | templateUrl: './poetry-news.component.html', 8 | styleUrls: ['./poetry-news.component.scss'], 9 | animations: [ 10 | fadeInUp 11 | ] 12 | }) 13 | export class PoetryNewsComponent implements OnInit { 14 | 15 | @Input() public whitchSatrt: any; 16 | 17 | startAnimationTit: boolean = false; 18 | startAnimationDet: boolean = false; 19 | 20 | ngOnChanges() { 21 | if (this.whitchSatrt === 3) { 22 | this.startAnimationTit = true; 23 | setTimeout(() => { 24 | this.startAnimationDet = true; 25 | }, 100) 26 | } 27 | } 28 | 29 | newsList = [ 30 | { 31 | img: './assets/images/sliders/1.jpg', 32 | tit: '新闻标题', 33 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 34 | }, 35 | { 36 | img: './assets/images/sliders/2.jpg', 37 | tit: '新闻标题', 38 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 39 | }, 40 | { 41 | img: './assets/images/sliders/3.jpg', 42 | tit: '新闻标题', 43 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 44 | }, 45 | { 46 | img: './assets/images/sliders/4.jpg', 47 | tit: '新闻标题', 48 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 49 | }, 50 | { 51 | img: './assets/images/sliders/5.jpg', 52 | tit: '新闻标题', 53 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 54 | }, 55 | { 56 | img: './assets/images/sliders/6.jpg', 57 | tit: '新闻标题', 58 | det: '新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容新闻内容' 59 | } 60 | ] 61 | 62 | ngOnInit(){} 63 | 64 | constructor() { } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/app/shared/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, EventEmitter, Output, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core'; 2 | import { WindowRefService } from './../../service/return-window.service'; 3 | import { Router } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'poetry-header', 7 | templateUrl: './header.component.html', 8 | styleUrls: ['./header.component.scss'] 9 | }) 10 | export class HeaderComponent implements OnInit { 11 | 12 | eventListener: any; 13 | public _window: Window; 14 | public blueBg: boolean; 15 | // public yOffset; 16 | 17 | /** 18 | * 在调用头部组件时 : 19 | * 若传入 true 头部为开始透明然后变色,绝对定位为fixed 20 | * 若不传参数或传入的为 false 则表示规定为#0061ae且定位为relative 21 | */ 22 | @Input() public canchange: boolean; 23 | 24 | constructor(private router: Router, 25 | private windowRef: WindowRefService, 26 | ) { 27 | this._window = windowRef.nativeWindow; 28 | } 29 | 30 | ngOnInit(): void { 31 | this.canchange ? this.addListener() : null; 32 | } 33 | 34 | addListener() { 35 | let that = this; 36 | this.eventListener = this._window.addEventListener("scroll", () => { 37 | window.pageYOffset > 70 ? that.blueBg = true : that.blueBg = false; 38 | // this.yOffset.saveOffsetY(window.pageYOffset); 39 | }); 40 | } 41 | 42 | ngOnDestroy() { 43 | this._window.removeEventListener("scroll", this.eventListener); 44 | } 45 | 46 | private showSmall : boolean = false; 47 | // 手机端的 48 | smallNav(){ 49 | this.showSmall = !this.showSmall; 50 | } 51 | 52 | // goToNavPage(e,navUrl: string) { 53 | // this.stopPropagation(e); 54 | // this.router.navigateByUrl(navUrl); 55 | // // console.log("navUrl",navUrl); 56 | // } 57 | 58 | // stopPropagation(e) { 59 | // e = e || window.event; 60 | // if(e.stopPropagation) { 61 | // e.stopPropagation(); 62 | // } else { 63 | // e.cancelBubble = true; 64 | // } 65 | // } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/app/pages/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { HomeRoutingModule } from './home-routing.module'; 5 | import { SharedModule } from '../../shared/shared.module'; 6 | 7 | import { HomeComponent } from './home.component'; 8 | import { HomeContentComponent } from './home-content/home-content.component'; 9 | import { SlideshowComponent } from './home-content/slideshow/slideshow.component'; 10 | import { ChangeDotComponent } from './home-content/slideshow/change-dot/change-dot.component'; 11 | import { NeedPoetryComponent } from './home-content/need-poetry/need-poetry.component'; 12 | import { presentationUsComponent } from './home-content/presentation-us/presentation-us.component'; 13 | import { ReasonsComponent } from './home-content/presentation-us/reasons/reasons.component'; 14 | import { OurSkillsComponent } from './home-content/presentation-us/our-skills/our-skills.component'; 15 | import { HeSaidComponent } from './home-content/presentation-us/he-said/he-said.component'; 16 | import { PoetryNewsComponent } from './home-content/poetry-news/poetry-news.component'; 17 | import { MoveImgComponent } from './home-content/poetry-news/move-img/move-img.component'; 18 | import { PartnerAndFooterComponent } from './home-content/partner-and-footer/partner-and-footer.component'; 19 | import { PartnerComponent } from './home-content/partner-and-footer/partner/partner.component'; 20 | 21 | const HOME_COMPOENTS = [ 22 | HomeComponent, 23 | HomeContentComponent, 24 | 25 | SlideshowComponent, 26 | ChangeDotComponent, 27 | 28 | NeedPoetryComponent, 29 | 30 | presentationUsComponent, 31 | ReasonsComponent, 32 | OurSkillsComponent, 33 | HeSaidComponent, 34 | 35 | PoetryNewsComponent, 36 | MoveImgComponent, 37 | 38 | PartnerAndFooterComponent, 39 | PartnerComponent 40 | ] 41 | 42 | @NgModule({ 43 | imports: [ 44 | CommonModule, 45 | HomeRoutingModule, 46 | SharedModule 47 | ], 48 | declarations: [ 49 | ...HOME_COMPOENTS 50 | ] 51 | }) 52 | export class HomeModule { } 53 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/presentation-us.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, OnChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-presentation-us', 5 | templateUrl: './presentation-us.component.html', 6 | styleUrls: ['./presentation-us.component.scss'] 7 | }) 8 | export class presentationUsComponent implements OnInit { 9 | 10 | @Input() public whitchSatrt: any; 11 | 12 | public showDet: boolean; 13 | /* 传递过来的是判断为 this ,指定被点击的组件,由此可判别是哪个组件的被点击了 */ 14 | getVal(val) { 15 | this.showDet = val; 16 | } 17 | 18 | public skillsBarStart : boolean = false; 19 | ngOnChanges(){ 20 | if(this.whitchSatrt === 2){ 21 | this.skillsBarStart = true; 22 | } 23 | } 24 | 25 | constructor() { } 26 | 27 | ngOnInit() { 28 | } 29 | 30 | whyChooseUs = [ 31 | { 32 | title: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋", 33 | detail: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋", 34 | default: 'true' 35 | }, 36 | { 37 | title: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋", 38 | detail: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋" 39 | }, 40 | { 41 | title: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋", 42 | detail: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋" 43 | }, 44 | { 45 | title: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋", 46 | detail: "诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋诗词歌赋" 47 | }, 48 | ] 49 | 50 | skillMetas = [ 51 | { 52 | name: '唐诗', 53 | percentage: '40%', 54 | color: '#0061ea' 55 | }, 56 | { 57 | name: '唐诗', 58 | percentage: '80%', 59 | color: '#5D9CEC' 60 | }, 61 | { 62 | name: '唐诗', 63 | percentage: '95%', 64 | color: '#FC6E52' 65 | }, 66 | { 67 | name: '唐诗', 68 | percentage: '99%', 69 | color: '#5D9CEC' 70 | }, 71 | { 72 | name: '唐诗', 73 | percentage: '100%', 74 | color: '#AC92EC' 75 | }, 76 | { 77 | name: '唐诗', 78 | percentage: '50%', 79 | color: '#656D78' 80 | } 81 | 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner/partner.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 贡献人简介 5 |
6 |
7 | 8 |
9 |
10 |
11 |
12 | 13 |
14 |
    15 |
  • 16 | 17 |
  • 18 |
  • 19 | 20 |
  • 21 |
  • 22 | 23 |
  • 24 |
  • 25 | 26 |
  • 27 |
  • 28 | 29 |
  • 30 |
  • 31 | 32 |
  • 33 |
  • 34 | 35 |
  • 36 |
  • 37 | 38 |
  • 39 |
  • 40 | 41 |
  • 42 |
  • 43 | 44 |
  • 45 |
  • 46 | 47 |
  • 48 |
  • 49 | 50 |
  • 51 |
52 |
53 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/poetry-news.component.scss: -------------------------------------------------------------------------------- 1 | 2 | @media screen and(min-width:768px){ 3 | .news-top{ 4 | .news-tit{ 5 | width: 1200px; 6 | font-size: 33px; 7 | .tit-box{ 8 | padding: 15px 0 25px; 9 | } 10 | } 11 | } 12 | .news-bottom{ 13 | width: 100%; 14 | position: absolute; 15 | bottom: 58px; 16 | left: 0; 17 | } 18 | .news-detail{ 19 | font-size: 16px; 20 | margin-top: 2%; 21 | } 22 | } 23 | 24 | @media screen and(max-width:767px){ 25 | .news-top{ 26 | margin-top: 60px; 27 | .news-tit{ 28 | width: 100%; 29 | font-size: 20px; 30 | .tit-box{ 31 | padding: 17px 0 16px; 32 | } 33 | } 34 | 35 | } 36 | .news-bottom{ 37 | width: 100%; 38 | } 39 | .news-detail{ 40 | font-size: 10px; 41 | padding: 20px; 42 | } 43 | } 44 | 45 | 46 | .news-top{ 47 | width: 100%; 48 | padding: 1px 0; 49 | .news-tit{ 50 | letter-spacing: 5px; 51 | line-height: 1.1; 52 | text-align: center; 53 | color: #272727; 54 | margin: 0 auto; 55 | margin-top: 3%; 56 | .tit-box{ 57 | display:inline-block !important; 58 | width: auto; 59 | border-bottom: 2px #E5E5E5 solid; 60 | position: relative; 61 | .icon-wrap{ 62 | width: 100%; 63 | height: 30px; 64 | position: absolute; 65 | bottom: -21px; 66 | padding-right: 40px; 67 | .protect-icon{ 68 | width: 40px; 69 | height: 30px; 70 | margin-left: 50%; 71 | background: #f5f5f5; 72 | font-size: 19px; 73 | text-align: center; 74 | padding-left: 7px; 75 | color: #0061ae; 76 | } 77 | } 78 | } 79 | } 80 | .news-detail{ 81 | line-height: 2; 82 | text-align: center; 83 | font-weight: 300; 84 | color: #272727; 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/app/pages/routes/signin/signin.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 10 | 11 | 14 | 15 | 18 | 19 | 52 | 53 |
54 | 55 |
-------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * auther: deepthan 3 | * createDate: 2017.10.23 4 | * explain: 处理浏览器兼容问题 5 | * 不同的浏览器对Web标准的支持程度也不同,填充库(polyfill)能帮我们把这些不同点进行标准化 6 | * */ 7 | 8 | /** 9 | * angular和应用加载之前需要这个文件所包含的填充库。 10 | * 你可以添加你自己的填充库到这个文件 11 | * 12 | * 这个文件被分为两个部分: 13 | * 1. 浏览器填充库: 这些在加载ZoneJS之前被应用,并被浏览器分类。 14 | * 2. 应用引用: 在ZoneJS之后导入的文件,应该在您的主文件之前加载。 15 | * 16 | * 目前的设置是所谓的“常用”浏览器; 最新版本的浏览器都会自动更新,包括 Safari >= 10, Chrome >= 55 (包括 Opera), 17 | * Edge >= 13 桌面应用, iOS 10 和 Chrome 移动应用. 18 | * 19 | * 了解更多: https://angular.io/docs/ts/latest/guide/browser-support.html 20 | */ 21 | 22 | /*************************************************************************************************** 23 | * 浏览器填充库 24 | */ 25 | 26 | 27 | /** IE9, IE10 和 IE11 需要下面的所有填充库 **/ 28 | // import 'core-js/es6/symbol'; 29 | // import 'core-js/es6/object'; 30 | // import 'core-js/es6/function'; 31 | // import 'core-js/es6/parse-int'; 32 | // import 'core-js/es6/parse-float'; 33 | // import 'core-js/es6/number'; 34 | // import 'core-js/es6/math'; 35 | // import 'core-js/es6/string'; 36 | // import 'core-js/es6/date'; 37 | // import 'core-js/es6/array'; 38 | // import 'core-js/es6/regexp'; 39 | // import 'core-js/es6/map'; 40 | // import 'core-js/es6/weak-map'; 41 | // import 'core-js/es6/set'; 42 | 43 | /** 在IE10和IE11上SVG元素使用NgClass需要引入下面的依赖包 */ 44 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 45 | 46 | /** 常用浏览器需要这些 **/ 47 | import 'core-js/es6/reflect'; 48 | import 'core-js/es7/reflect'; 49 | 50 | /** 51 | * 使用动画需要引入: `@angular/platform-browser/animations`. 52 | * 需要的: 除了Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /*************************************************************************************************** 57 | * angular 需要引入zone.js. 58 | */ 59 | import 'zone.js/dist/zone'; // Angular CLI 包括这个. 60 | 61 | 62 | 63 | /*************************************************************************************************** 64 | * 应用引入的文件 65 | */ 66 | 67 | /** 68 | * Date(日期), currency(货币), decimal(小数) and percent pipes(管道百分比). 69 | * 需要的: 除了 Chrome, Firefox, Edge, IE11 和 Safari 10 70 | */ 71 | // import 'intl'; // Run `npm install --save intl`. 72 | /** 73 | * 使用intl至少需要引入一个本地数据. 74 | */ 75 | // import 'intl/locale-data/jsonp/en'; 76 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/partner-and-footer/partner/partner.component.scss: -------------------------------------------------------------------------------- 1 | @media screen and(min-width:768px){ 2 | .news-top{ 3 | .news-tit{ 4 | width: 1200px; 5 | font-size: 33px; 6 | margin: 0 auto; 7 | margin-top: 58px; 8 | 9 | } 10 | } 11 | .container{ 12 | margin-top: 5%; 13 | } 14 | } 15 | 16 | @media screen and(max-width:767px){ 17 | .news-top{ 18 | .news-tit{ 19 | width: 100%; 20 | font-size: 20px; 21 | margin: 0 auto; 22 | margin-top: 10px; 23 | } 24 | } 25 | .container{ 26 | padding: 40px 0; 27 | } 28 | } 29 | 30 | 31 | 32 | .news-top{ 33 | width: 100%; 34 | padding: 1px 0; 35 | .news-tit{ 36 | letter-spacing: 5px; 37 | line-height: 1.1; 38 | text-align: center; 39 | color: #272727; 40 | padding-top: 3%; 41 | .tit-box{ 42 | display:inline-block !important; 43 | width: auto; 44 | padding: 15px 0 25px; 45 | border-bottom: 2px #E5E5E5 solid; 46 | position: relative; 47 | .icon-wrap{ 48 | width: 100%; 49 | height: 30px; 50 | position: absolute; 51 | bottom: -21px; 52 | padding-right: 40px; 53 | .protect-icon{ 54 | width: 40px; 55 | height: 30px; 56 | margin-left: 50%; 57 | background: #f5f5f5; 58 | font-size: 19px; 59 | text-align: center; 60 | padding-left: 7px; 61 | color: #0061ae; 62 | } 63 | } 64 | } 65 | } 66 | // .news-detail{ 67 | // font-size: 16px; 68 | // margin-top: 2%; 69 | // line-height: 2; 70 | // text-align: center; 71 | // font-weight: 300; 72 | // color: #272727; 73 | // } 74 | } 75 | 76 | 77 | .img-wrap li{ 78 | padding: 7px 15px; 79 | text-align: center; 80 | min-height: 130px; 81 | vertical-align: middle; 82 | border-bottom: 1px solid #e9e9e9; 83 | border-right: 1px solid #e9e9e9; 84 | } 85 | .img-wrap li:nth-child(n+7) { 86 | border-bottom: none; 87 | } 88 | .img-wrap li:nth-child(6n) { 89 | border-right: none; 90 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/presentation-us.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
您好,我是诗生活
4 | 5 |
6 | 诗意您的生活,享受您的快乐。 7 |
8 | 9 |
10 |
了解更多
11 |
联系我们
12 |
13 | 14 |
15 | 16 |
17 |
18 |
19 | 20 |
21 |
22 |
23 |
为什么
24 |
喜欢我们
25 |
26 |

我们的网站很有特色

27 |
28 | 29 |
30 | 31 | 32 |
33 |
34 | 35 |
36 | 37 |
38 |
39 |
我们的
40 |
特别之处
41 |
42 |

诗词美人更美

43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 |
52 | 53 |
54 |
55 |
优美的
56 |
诗词案例
57 |
58 |

诗词案例诗词案例

59 |
60 | 61 | 62 | 63 |
64 | 65 |
66 | 67 |
68 |
-------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_flex.scss: -------------------------------------------------------------------------------- 1 | // Flex variation 2 | // Custom styles for additional flex alignment options 3 | // @source - https://v4-alpha.getbootstrap.com/utilities/flexbox/ 4 | // -------------------------------------------------- 5 | 6 | %flex-first { 7 | order: -1; 8 | } 9 | 10 | %flex-last { 11 | order: 1; 12 | } 13 | 14 | %flex-unordered { 15 | order: 0; 16 | } 17 | 18 | 19 | %flex-row { 20 | flex-direction: row; 21 | } 22 | 23 | %flex-column { 24 | flex-direction: column; 25 | } 26 | 27 | %flex-row-reverse { 28 | flex-direction: row-reverse; 29 | } 30 | 31 | %flex-column-reverse { 32 | flex-direction: column-reverse; 33 | } 34 | 35 | 36 | %flex-wrap { 37 | flex-wrap: wrap; 38 | } 39 | 40 | %flex-nowrap { 41 | flex-wrap: nowrap; 42 | } 43 | 44 | %flex-wrap-reverse { 45 | flex-wrap: wrap-reverse; 46 | } 47 | 48 | 49 | %justify-content-start { 50 | justify-content: flex-start; 51 | } 52 | 53 | %justify-content-end { 54 | justify-content: flex-end; 55 | } 56 | 57 | %justify-content-center { 58 | justify-content: center; 59 | } 60 | 61 | %justify-content-between { 62 | justify-content: space-between; 63 | } 64 | 65 | %justify-content-around { 66 | justify-content: space-around; 67 | } 68 | 69 | 70 | %align-items-start { 71 | align-items: flex-start; 72 | } 73 | 74 | %align-items-end { 75 | align-items: flex-end; 76 | } 77 | 78 | %align-items-center { 79 | align-items: center; 80 | } 81 | 82 | %align-items-baseline { 83 | align-items: baseline; 84 | } 85 | 86 | %align-items-stretch { 87 | align-items: stretch; 88 | } 89 | 90 | 91 | %align-content-start { 92 | align-content: flex-start; 93 | } 94 | 95 | %align-content-end { 96 | align-content: flex-end; 97 | } 98 | 99 | %align-content-center { 100 | align-content: center; 101 | } 102 | 103 | %align-content-between { 104 | align-content: space-between; 105 | } 106 | 107 | %align-content-around { 108 | align-content: space-around; 109 | } 110 | 111 | %align-content-stretch { 112 | align-content: stretch; 113 | } 114 | 115 | 116 | %align-self-auto { 117 | align-self: auto; 118 | } 119 | 120 | %align-self-start { 121 | align-self: flex-start; 122 | } 123 | 124 | %align-self-end { 125 | align-self: flex-end; 126 | } 127 | 128 | %align-self-center { 129 | align-self: center; 130 | } 131 | 132 | %align-self-baseline { 133 | align-self: baseline; 134 | } 135 | 136 | %align-self-stretch { 137 | align-self: stretch; 138 | } 139 | -------------------------------------------------------------------------------- /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "pro0-test", 5 | "ejected": false 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "poetry", 21 | "styles": [ 22 | "app/theme/theme.scss", 23 | "styles.scss" 24 | ], 25 | "scripts": [ 26 | "../node_modules/tinymce/tinymce.js", 27 | "../node_modules/tinymce/themes/modern/theme.js", 28 | "../node_modules/tinymce/plugins/link/plugin.js", 29 | "../node_modules/tinymce/plugins/paste/plugin.js", 30 | "../node_modules/tinymce/plugins/table/plugin.js", 31 | "../node_modules/tinymce/plugins/preview/plugin.js", 32 | "../node_modules/tinymce/plugins/fullscreen/plugin.js", 33 | "../node_modules/tinymce/plugins/textcolor/plugin.js", 34 | "../node_modules/tinymce/plugins/image/plugin.js", 35 | "../node_modules/tinymce/plugins/imagetools/plugin.js", 36 | "../node_modules/tinymce/plugins/code/plugin.js" 37 | ], 38 | "environmentSource": "environments/environment.ts", 39 | "environments": { 40 | "dev": "environments/environment.ts", 41 | "demo": "environments/environment.demo.ts", 42 | "prod": "environments/environment.prod.ts", 43 | "test": "environments/environment.test.ts", 44 | "github": "environments/environment.github.ts" 45 | } 46 | } 47 | ], 48 | "e2e": { 49 | "protractor": { 50 | "config": "./protractor.conf.js" 51 | } 52 | }, 53 | "lint": [ 54 | { 55 | "project": "src/tsconfig.app.json" 56 | }, 57 | { 58 | "project": "src/tsconfig.spec.json" 59 | }, 60 | { 61 | "project": "e2e/tsconfig.e2e.json" 62 | } 63 | ], 64 | "test": { 65 | "karma": { 66 | "config": "./karma.conf.js" 67 | } 68 | }, 69 | "defaults": { 70 | "styleExt": "scss", 71 | "component": { 72 | "flat": false, 73 | "inlineStyle": false, 74 | "inlineTemplate": false, 75 | "spec": false 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/poetry-news/move-img/move-img.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, ElementRef, ViewChild, Renderer2 } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-move-img', 5 | templateUrl: './move-img.component.html', 6 | styleUrls: ['./move-img.component.scss'] 7 | }) 8 | export class MoveImgComponent implements OnInit { 9 | 10 | @Input() public newItem: any ; 11 | @ViewChild('itemWrap') itemWrap: ElementRef; 12 | @ViewChild('content') content: ElementRef; 13 | 14 | private mousePos = { 15 | top: "top: -100%; left: 0", 16 | right: "top: 0; left: 100%", 17 | bottom: "top: 100%; left: 0", 18 | left: "top: 0; left: -100%" 19 | }; 20 | 21 | mouseenter(e){ 22 | let direction = this.getDirection(e); 23 | // console.log("进来的方向",direction,"初始化的样式",this.mousePos[direction]) 24 | 25 | this.renderer2.removeClass(this.content.nativeElement, "active"); 26 | this.renderer2.setAttribute(this.content.nativeElement, "style",this.mousePos[direction]); 27 | setTimeout(()=>{ 28 | this.renderer2.addClass(this.content.nativeElement, "active"); 29 | this.renderer2.setAttribute(this.content.nativeElement, "style","left: 0;top: 0" ); 30 | },1) 31 | } 32 | 33 | mouseleave(e){ 34 | let direction = this.getDirection(e); 35 | // console.log("离开的方向",direction,"进行的样式",this.mousePos[direction]) 36 | this.renderer2.setAttribute(this.content.nativeElement, "style",this.mousePos[direction]); 37 | } 38 | 39 | getDirection(e){ 40 | let dire = ['top', 'right', 'bottom', 'left']; 41 | // console.log("获得的数字",this.moveInWay(e)) 42 | return dire[this.moveInWay(e)] 43 | } 44 | 45 | /** 46 | * @todo 判断移入方式 47 | * @param 事件属性 48 | * @returns number 0-3 上右下左 49 | */ 50 | moveInWay(e){ 51 | let item = this.itemWrap.nativeElement; // 获得dom节点 52 | // var w = item.offsetWidth; // 获得节点的宽 53 | // var h = item.offsetWidth; // 获得节点的高 因为无margin所以可以用 54 | var b = item.getBoundingClientRect(); // 获得元素的大小及其相对于视口的位置 55 | var w = b.width; 56 | var h = b.height; 57 | var t = document.body.scrollTop; // 获得卷曲值 58 | // console.log("节点的宽",w,"节点的高",h,"相对视口的位置",b,"卷曲值",t) 59 | var x = (e.pageX - b.left - (w / 2)) * (w > h ? (h / w) : 1); 60 | var y = (e.pageY - b.top - t - (h / 2)) * (h > w ? (w / h) : 1); 61 | return Math.round((((Math.atan2(y, x) * (180 / Math.PI)) + 180) / 90) + 3) % 4; 62 | } 63 | 64 | 65 | 66 | constructor( private renderer2 : Renderer2 ) { } 67 | 68 | ngOnInit() { 69 | // this.renderer2.setStyle(this.itemWrap.nativeElement,"background","url("+ this.newItem.img +")"); 70 | this.renderer2.setStyle(this.itemWrap.nativeElement,"background","#0061ae"); 71 | 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/app/theme/scss/atoms/_border.scss: -------------------------------------------------------------------------------- 1 | // Border 2 | %border-0 { 3 | border: 0; 4 | } 5 | 6 | %border-top-0 { 7 | border-top: 0; 8 | } 9 | 10 | %border-right-0 { 11 | border-right: 0; 12 | } 13 | 14 | %border-bottom-0 { 15 | border-bottom: 0; 16 | } 17 | 18 | %border-left-0 { 19 | border-left: 0; 20 | } 21 | 22 | // Border width 23 | @for $i from 1 through 10 { 24 | %border-#{$i} { 25 | border-width: ($i / 10) + rem; 26 | } 27 | %border-top-#{$i} { 28 | border-top-width: ($i / 10) + rem; 29 | } 30 | %border-right-#{$i} { 31 | border-right-width: ($i / 10) + rem; 32 | } 33 | %border-bottom-#{$i} { 34 | border-bottom-width: ($i / 10) + rem; 35 | } 36 | %border-left-#{$i} { 37 | border-left-width: ($i / 10) + rem; 38 | } 39 | } 40 | 41 | // Border-radius 42 | $radius-sizes: ( 43 | base: $border-radius-base, 44 | sm: $border-radius-sm, 45 | md: $border-radius-md, 46 | lg: $border-radius-lg 47 | ); 48 | 49 | @each $size, $value in $radius-sizes { 50 | %rounded-#{$size} { 51 | border-radius: $value; 52 | } 53 | 54 | %rounded-top-#{$size} { 55 | border-top-left-radius: $value; 56 | border-top-right-radius: $value; 57 | } 58 | 59 | %rounded-right-#{$size} { 60 | border-top-right-radius: $value; 61 | border-bottom-right-radius: $value; 62 | } 63 | 64 | %rounded-bottom-#{$size} { 65 | border-bottom-left-radius: $value; 66 | border-bottom-right-radius: $value; 67 | } 68 | 69 | %rounded-left-#{$size} { 70 | border-top-left-radius: $value; 71 | border-bottom-left-radius: $value; 72 | } 73 | } 74 | 75 | %rounded-circle { 76 | border-radius: 50%; 77 | } 78 | 79 | %rounded-0 { 80 | border-radius: 0; 81 | } 82 | 83 | // Border color 84 | $border-colors: ( 85 | gray-base: $gray-base, 86 | gray-darker: $gray-darker, 87 | gray-dark: $gray-dark, 88 | gray-light: $gray-light, 89 | gray-lighter: $gray-lighter, 90 | primary: $primary, 91 | success: $brand-success, 92 | info: $brand-info, 93 | warning: $brand-warning, 94 | danger: $brand-danger 95 | ); 96 | 97 | @each $parent, $color in $border-colors { 98 | %border-#{$parent} { 99 | border-color: $color; 100 | } 101 | } 102 | 103 | %border-white { 104 | border-color: #fff; 105 | } 106 | 107 | %border-gray { 108 | border-color: $gray; 109 | } 110 | 111 | %border-transparent { 112 | border-color: transparent; 113 | } 114 | 115 | // border style 116 | @each $p in (null, -top, -right, -bottom, -left) { 117 | %dotted#{$p} { 118 | border#{$p}-style: dotted; 119 | } 120 | %dashed#{$p} { 121 | border#{$p}-style: dashed; 122 | } 123 | %solid#{$p} { 124 | border#{$p}-style: solid; 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/need-poetry/need-poetry.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 为什么要做这个网站? 5 |
6 |
7 | 8 |
9 |
10 |
11 |
12 | 13 |
14 |

古诗是中华民族乃至全世界的瑰宝,我们应该传承下去, 虽然有古典文集, 但大多数人并没有拥有这些书籍。

15 |

从某种意义上来说,这些庞大的文集离我们是有一定距离的。因此本网站诞生了,你可以在此享受诗词的饕餮盛宴。

16 |
17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 |
27 |
28 | 29 |
30 |
生活需要诗意
31 |

我们生活在都市里面,生活节奏越来越快的我们少了一颗能静下来慢慢欣赏美好的心。中国的诗词有着无限的魅力,只是未曾发现。

32 |
了解更多
33 |
34 |
35 | 36 |
37 |
38 |
39 | 40 |
41 |
你需要诗意
42 |

田园的美好我们或许不理解,但是短暂的生命总是有些东西值得我们追求,千年的时光过去,诗词的美丽依旧。

43 |
了解更多
44 |
45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 |
要善于发现
53 |

你需要诗意,你需要诗意

54 |
了解更多
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 |
63 |
你需要诗意
64 |

你需要诗意,你需要诗意

65 |
了解更多
66 |
67 |
68 | 69 |
70 | 71 |
72 | 73 |
-------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/reasons/reasons.component.scss: -------------------------------------------------------------------------------- 1 | .the-tit{ 2 | min-height: 63px; 3 | position: relative; 4 | padding: 19px 38px 16px 22px; 5 | font-size: 15px; 6 | font-weight: bold; 7 | line-height: 1.5; 8 | margin-top: 6px; 9 | cursor: pointer; 10 | .icon-common{ 11 | width: 24px; 12 | height: 24px; 13 | position: absolute; 14 | right: 10px; 15 | top: 19px; 16 | left: auto; 17 | } 18 | .tit-icon{ 19 | background: url("../../../../../../assets/images/why_show_icon.png") no-repeat 0px 0px; 20 | } 21 | .click-tit-icon{ 22 | background: url("../../../../../../assets/images/why_show_icon.png") no-repeat 0px -70px; 23 | } 24 | &:hover{ 25 | background-color: #f5f5f5; 26 | color: #e9573f; 27 | } 28 | } 29 | .the-det{ 30 | padding: 0 24px 15px; 31 | border: 5px solid #bdc3c7; 32 | border-top: none; 33 | border-bottom-left-radius: 4px; 34 | border-bottom-right-radius: 4px; 35 | 36 | } 37 | 38 | .default-tit{ 39 | color: #656f78; 40 | border-bottom: none; 41 | background-color: rgb(236, 236, 236); 42 | } 43 | .click-tit{ 44 | color: #e9573f; 45 | background: #fff !important; 46 | border: 5px solid #bdc3c7; 47 | border-bottom: none; 48 | } 49 | .show-det{ 50 | display: block; 51 | -webkit-animation: fadeinT .5s ease-out backwards; 52 | -moz-animation: fadeinT .5s ease-out backwards; 53 | -ms-animation: fadeinT.5s ease-out backwards; 54 | animation: fadeinT .5s ease-out backwards; 55 | } 56 | .hide-det{ 57 | display: none; 58 | -webkit-animation: fadeOutB .5s ease-out backwards; 59 | -moz-animation: fadeOutB .5s ease-out backwards; 60 | -ms-animation: fadeOutB.5s ease-out backwards; 61 | animation: fadeOutB .5s ease-out backwards; 62 | } 63 | /* 淡入-从上 */ 64 | @-webkit-keyframes fadeinT{ 65 | 0%{-webkit-transform:translateY(-10px);} 66 | 100%{-webkit-transform:translateY(0);} 67 | } 68 | @-moz-keyframes fadeinT{ 69 | 0%{-webkit-transform:translateY(-10px);} 70 | 100%{-webkit-transform:translateY(0);} 71 | } 72 | @-ms-keyframes fadeinT{ 73 | 0%{-webkit-transform:translateY(-10px);} 74 | 100%{-webkit-transform:translateY(0);} 75 | } 76 | @keyframes fadeinT{ 77 | 0%{-webkit-transform:translateY(-10px);} 78 | 100%{-webkit-transform:translateY(0);} 79 | } 80 | 81 | /* 淡出-从上 */ 82 | @-webkit-keyframes fadeOutB{ 83 | 0%{opacity:1;-webkit-transform:translateY(0);} 84 | 100%{display:none;opacity:0;-webkit-transform:translateY(-10px);} 85 | } 86 | @-moz-keyframes fadeinT{ 87 | 0%{opacity:1;-webkit-transform:translateY(0);} 88 | 100%{opacity:0;-webkit-transform:translateY(-10px);} 89 | } 90 | @-ms-keyframes fadeinT{ 91 | 0%{opacity:1;-webkit-transform:translateY(0);} 92 | 100%{opacity:0;-webkit-transform:translateY(-10px);} 93 | } 94 | @keyframes fadeOutB{ 95 | 0%{opacity:1;-webkit-transform:translateY(0);} 96 | 100%{opacity:0;-webkit-transform:translateY(-10px);} 97 | } 98 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/he-said/he-said.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ElementRef, ViewChild, Renderer2 } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'poetry-he-said', 5 | templateUrl: './he-said.component.html', 6 | styleUrls: ['./he-said.component.scss'] 7 | }) 8 | export class HeSaidComponent implements OnInit { 9 | 10 | companyInfo: any; 11 | index: number = 0; 12 | 13 | @ViewChild('headImg') headImg: ElementRef; 14 | 15 | constructor(private renderer2: Renderer2) { } 16 | 17 | ngOnInit() { 18 | this.changeCom(0); 19 | setInterval(() => { this.addDot() }, 4000); 20 | } 21 | 22 | changeCom(index) { 23 | this.index = index; 24 | this.companyInfo = this.companyArray[index]; 25 | this.renderer2.setStyle(this.headImg.nativeElement, 'background-image', 'url(' + this.companyInfo.img + ')'); 26 | this.changeDot(index); 27 | } 28 | 29 | firDot: boolean = false; 30 | secDot: boolean = false; 31 | thiDot: boolean = false; 32 | fouDot: boolean = false; 33 | 34 | changeDot(index) { 35 | this.resetDot(); 36 | switch (index) { 37 | case 0: this.firDot = true; break; 38 | case 1: this.secDot = true; break; 39 | case 2: this.thiDot = true; break; 40 | case 3: this.fouDot = true; break; 41 | } 42 | // let dots = [this.firDot, this.secDot, this.thiDot, this.fouDot]; 43 | // console.log("dots.",dots[index],this.firDot,this.secDot); 44 | // dots.forEach( (item, num) => { 45 | // num === index ? item = true : item = false; 46 | // console.log("item",item, num) 47 | // }) 48 | // console.log("this.",dots[index],this.firDot,this.secDot) 49 | } 50 | 51 | addDot() { 52 | if (this.index >= 3) { 53 | this.index = 0; 54 | return; 55 | } else { 56 | this.index++; 57 | } 58 | this.changeCom(this.index); 59 | } 60 | 61 | resetDot() { 62 | this.firDot = false; 63 | this.secDot = false; 64 | this.thiDot = false; 65 | this.fouDot = false; 66 | } 67 | 68 | 69 | private companyArray = [ 70 | { 71 | img: './assets/images/home_icon_1.png', 72 | tit: '诗名字', 73 | det: '诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容' 74 | }, 75 | { 76 | img: './assets/images/home_icon_2.png', 77 | tit: '诗名字', 78 | det: '诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容' 79 | }, 80 | { 81 | img: './assets/images/home_icon_3.png', 82 | tit: '诗名字', 83 | det: '诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容' 84 | }, 85 | { 86 | img: './assets/images/home_icon_2.png', 87 | tit: '诗名字', 88 | det: '诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容诗内容' 89 | } 90 | ]; 91 | 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/app/pages/routes/signin/signin.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 3 | import { Observable } from 'rxjs/Observable'; 4 | import { Router } from '@angular/router'; 5 | 6 | import { AuthorizationService } from '../shared/authorization.service'; 7 | import { NzNotificationService } from 'ng-zorro-antd'; 8 | 9 | @Component({ 10 | selector: 'app-signin', 11 | templateUrl: './signin.component.html', 12 | styleUrls: ['./signin.component.scss'] 13 | }) 14 | export class SigninComponent implements OnInit { 15 | 16 | validateForm: FormGroup; 17 | 18 | _submitForm() { 19 | for (const i in this.validateForm.controls) { 20 | this.validateForm.controls[i].markAsDirty(); 21 | } 22 | this.signin(this.validateForm.value) 23 | } 24 | 25 | roleInfo: any; 26 | 27 | signin(userInfo) { 28 | this.signCheck(userInfo); 29 | if (this.roleInfo.role) { 30 | this.authService.saveAccount(this.roleInfo); 31 | this.router.navigateByUrl('/routes/guard'); 32 | this.createNotification('success', '恭喜', '登录成功'); 33 | } else { 34 | this.createNotification('error', '登录失败', '用户名或密码错误!'); 35 | } 36 | } 37 | 38 | signCheck(userInfo) { 39 | let userName = userInfo.userName; 40 | if (userName == 'admin') { 41 | this.setRoleInfo('admin'); 42 | } else if (userName == 'user') { 43 | this.setRoleInfo('user'); 44 | } else { 45 | this.setRoleInfo(false); 46 | } 47 | } 48 | 49 | setRoleInfo(role) { 50 | this.roleInfo = { 51 | role: role 52 | } 53 | } 54 | 55 | signout() { 56 | this.authService.removeAccount(); 57 | this.createNotification('success', '成功', '已清除'); 58 | } 59 | 60 | constructor( 61 | private fb: FormBuilder, 62 | private authService: AuthorizationService, 63 | private _notification: NzNotificationService, 64 | private router: Router ) { } 65 | 66 | ngOnInit() { 67 | this.validateForm = this.fb.group({ 68 | userName: [null, [Validators.required]], 69 | password: [null, [Validators.required]], 70 | remember: [true], 71 | }); 72 | 73 | } 74 | 75 | // private userName : string = ''; 76 | // ngOnChanges(){ 77 | // this.userName = this.authService.getCurrentUser(); 78 | // console.log("userName",this.userName); 79 | // } 80 | 81 | createNotification = (type, tit, content) => { 82 | this._notification.create(type, tit, content); 83 | }; 84 | 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/home-content.component.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 文件名称:首页 3 | * 编写人:何林昆 4 | * 编写日期:2017.5.2 5 | * 变更人: 6 | * 变更内容: 7 | **/ 8 | 9 | import { Component, OnInit, ViewContainerRef, ViewChild, OnDestroy } from '@angular/core'; 10 | import { WindowRefService } from './../../../shared/service/return-window.service'; 11 | 12 | @Component({ 13 | selector: 'home-content', 14 | styleUrls: [ 15 | './home-content.component.scss' 16 | ], 17 | templateUrl: './home-content.component.html', 18 | }) 19 | 20 | export class HomeContentComponent implements OnInit { 21 | 22 | private documentH = document.documentElement.offsetHeight || document.body.offsetHeight; // 屏幕高度 23 | 24 | /** 25 | * 往下滚动的时候 26 | * 1. 正好在节点上 直接加上屏幕大小 27 | * 2. 本页面往下一点 屏幕大小 - 往下的一点 28 | * 3. 往下的卷曲值取余屏幕大小 29 | */ 30 | goDown() { 31 | let defaultOffY = window.pageYOffset; //页面卷曲值 32 | // let willScrTop = ele.offsetHeight - 58 + Math.floor(defaultOffY/ele.offsetHeight)*ele.offsetHeight ; // 将要跳转到的位置 33 | let willScrTop = defaultOffY + this.documentH - 58 - defaultOffY % this.documentH; 34 | willScrTop === defaultOffY ? willScrTop = defaultOffY + this.documentH : null; 35 | let tempOffY = defaultOffY; 36 | var timmer = requestAnimationFrame(function fn() { 37 | tempOffY = tempOffY + 50; 38 | if (willScrTop > tempOffY) { 39 | window.scrollTo(0, tempOffY); 40 | setTimeout(() => { 41 | timmer = requestAnimationFrame(fn) 42 | }, 1) 43 | } else { 44 | window.scrollTo(0, willScrTop); 45 | } 46 | }) 47 | } 48 | 49 | goUp() { 50 | let defaultOffY = window.pageYOffset; //页面卷曲值 51 | if (defaultOffY <= 0) { 52 | return; 53 | } 54 | let willScrTop = defaultOffY - 58 - defaultOffY % this.documentH; 55 | let tempOffY = defaultOffY; 56 | var timmer = requestAnimationFrame(function fn() { 57 | tempOffY = tempOffY - 50; 58 | if (willScrTop < tempOffY) { 59 | window.scrollTo(0, tempOffY); 60 | setTimeout(() => { 61 | timmer = requestAnimationFrame(fn) 62 | }, 1) 63 | } else { 64 | window.scrollTo(0, willScrTop); 65 | } 66 | }) 67 | } 68 | 69 | private eventListener; 70 | 71 | addListener() { 72 | let that = this; 73 | this.eventListener = this._window.addEventListener("scroll", () => { 74 | that.startAnimations(); 75 | }); 76 | } 77 | 78 | whitchSatrt: number; 79 | private readyAnimateArray = []; 80 | 81 | startAnimations() { 82 | let ratio = Math.ceil((window.pageYOffset - this.documentH / 5) / this.documentH); 83 | if (this.readyAnimateArray.indexOf(ratio) == -1) { 84 | this.readyAnimateArray.push(ratio); 85 | } else { 86 | return; 87 | } 88 | this.whitchSatrt = ratio; 89 | } 90 | 91 | ngOnDestroy() { 92 | this._window.removeEventListener("scroll", this.eventListener); 93 | } 94 | 95 | private _window: Window; 96 | 97 | constructor(private windowRef: WindowRefService) { 98 | this._window = windowRef.nativeWindow; 99 | } 100 | 101 | private documentW = document.documentElement.offsetWidth || document.body.offsetWidth; // 屏幕宽度 102 | 103 | ngOnInit() { 104 | console.log("this.documentW",this.documentW) 105 | if(this.documentW < 768){ 106 | for(let item = 0; item<=5; item++){ 107 | setTimeout(()=>{ 108 | this.whitchSatrt = item; 109 | },1) 110 | } 111 | }else{ 112 | this.addListener(); 113 | } 114 | } 115 | 116 | 117 | } 118 | 119 | -------------------------------------------------------------------------------- /src/app/pages/routes/routes.module.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * module Name: 路由相关模块 3 | * Description: 模块懒加载(延迟加载)、预加载、路由守卫、离开提示。 4 | * module URI: https://deepthan.gitee.io/angular-demo/#/routes/signin 5 | * Author: deepthan 6 | * Author URI: https://github.com/deepthan 7 | */ 8 | import { RouterModule } from '@angular/router'; 9 | import { NgModule } from '@angular/core'; 10 | import { CommonModule } from '@angular/common'; 11 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 12 | import { NgZorroAntdModule } from 'ng-zorro-antd'; 13 | 14 | import { SharedModule } from '../../shared/shared.module'; 15 | import { RoutesRouting } from './routes.routing'; 16 | import { RoutesComponent } from './routes.component'; 17 | import { SigninComponent } from './signin/signin.component'; 18 | import { CanSigninVisitProvide, PreloadService, AuthorizationService, CanAdminVisitProvide, CanLeaveProvide } from './shared/index' 19 | 20 | const ROUTES_COMPONENT = [ 21 | RoutesComponent, 22 | SigninComponent 23 | ] 24 | 25 | const ROUTES_PROVIDERS = [ 26 | PreloadService, 27 | AuthorizationService, 28 | CanSigninVisitProvide, 29 | CanAdminVisitProvide, 30 | CanLeaveProvide 31 | ] 32 | 33 | @NgModule({ 34 | imports: [ 35 | CommonModule, 36 | FormsModule, 37 | ReactiveFormsModule, 38 | SharedModule, 39 | NgZorroAntdModule, 40 | RouterModule.forChild(RoutesRouting), 41 | ], 42 | declarations: [ 43 | ...ROUTES_COMPONENT 44 | ], 45 | providers: [ 46 | ...ROUTES_PROVIDERS 47 | ] 48 | 49 | }) 50 | 51 | 52 | export class RoutesModule { } 53 | 54 | 55 | // \\ 56 | /******************************************************************************************************************************************************************\ 57 | * 58 | * 此为路由模块,包括的功能: 59 | * 60 | * * 下面介绍的 service 或 provider 都放在 routes 目录下的 shared 文件夹下,且都在routes.module.ts里面注册。 61 | * 62 | * 1. 模块懒加载 63 | * 原理:点击到哪个模块才加载哪个模块的js文件。 64 | * 实现方法&位置: 65 | * routes/routes.routing.ts文件,第27~30行进行配置, 懒加载的测试模块:lazy-load 。 66 | * 67 | * 68 | * 2. 模块预加载: 69 | * 原理:只有配置了懒加载可以进行预加载,在加载了本模块文件并且页面渲染完全之后,再去自动加载指定的模块文件,好处是用户打开其他模块会非常快因为文件已经加载过了。 70 | * 实现方法&位置: 71 | * 1) 定义预加载 service : shared/service/preview-load.ts , 抛出 PreloadService。 72 | * 2) 在app.module.ts里面注册此服务。因为RouterModule.forRoot()可传入路由、指令和服务参数,但RouterModule.forChild()却只接收路由、指令,不可传入服务。 73 | * 3) 服务注册好了,在路由里面直接用 ./routes.routing.ts的 34 行进行预加载设置,默认全局开始预加载,如若不想预加载则设置 preload : false 即可。 74 | * 75 | * 76 | * 3. 路由守卫: 77 | * 原理: 只有登录或相应权限的用户才可以访问某个url,否则会拦截。 78 | * 实现方法&位置: 79 | * 不登录不给访问uri 80 | * [routerLink]="['/routes/guard/admin']" : 顶级路由开始写。 81 | * 0) 模拟登录并存用户信息,供后面验证用。 authorization.provider.ts 82 | * 1) 新建任何人、user、admin 可以访问的组件 83 | * 2) 定义登录、admin访问限制文件 can-signin-visit.provider,ts 和 can-admin-visit.provider.ts文件。 84 | * 3) 在 guard 文件夹下的 guard.routing.ts文件 27-32行配置登录方可访问 和 34-38行admin方可访问的路由守卫。 85 | * 4)账号密码: 普通用户 账号: user 密码: 123 86 | * admin admin 123 87 | * 5) 对应的情况: 88 | * i. 未登录访问 user和admin提示权限不足,可以访问 /routes/guard/anybody 但无法访问 /routes/guard/user 和 /admin 89 | * ii. 登录user可以访问 /routes/guard/anybody 和 /user 但是无法访问 .admin 90 | * iii. 登录admin全都可以访问 91 | * 92 | * 实现原理? 93 | * 源码解读(待续)。 94 | * 95 | * 96 | * 97 | * 98 | * 99 | */ -------------------------------------------------------------------------------- /src/assets/css/loading.css: -------------------------------------------------------------------------------- 1 | #loading{ 2 | background-color: #fff; 3 | height: 100%; 4 | width: 100%; 5 | position: fixed; 6 | z-index: 1; 7 | margin-top: 0px; 8 | top: 0px; 9 | } 10 | #loading-center{ 11 | width: 100%; 12 | height: 100%; 13 | position: relative; 14 | } 15 | #loading-center-absolute { 16 | position: absolute; 17 | left: 50%; 18 | top: 50%; 19 | height: 50px; 20 | width: 50px; 21 | margin-top: -25px; 22 | margin-left: -25px; 23 | -ms-transform: rotate(45deg); 24 | -webkit-transform: rotate(45deg); 25 | transform: rotate(45deg); 26 | -webkit-animation: loading-center-absolute 1.5s infinite; 27 | animation: loading-center-absolute 1.5s infinite; 28 | 29 | } 30 | .object{ 31 | width: 25px; 32 | height: 25px; 33 | background-color: #337ab7; 34 | float: left; 35 | 36 | } 37 | #object_one { 38 | -webkit-animation: object_one 1.5s infinite; 39 | animation: object_one 1.5s infinite; 40 | } 41 | #object_two { 42 | -webkit-animation: object_two 1.5s infinite; 43 | animation: object_two 1.5s infinite; 44 | } 45 | #object_three { 46 | -webkit-animation: object_three 1.5s infinite; 47 | animation: object_three 1.5s infinite; 48 | } 49 | #object_four { 50 | -webkit-animation: object_four 1.5s infinite; 51 | animation: object_four 1.5s infinite; 52 | } 53 | 54 | 55 | @-webkit-keyframes loading-center-absolute { 56 | 100% { -webkit-transform: rotate(-45deg); } 57 | 58 | } 59 | 60 | @keyframes loading-center-absolute { 61 | 100% { 62 | transform: rotate(-45deg); 63 | -webkit-transform: rotate(-45deg); 64 | } 65 | } 66 | @-webkit-keyframes object_one { 67 | 25% { -webkit-transform: translate(0,-50px) rotate(-180deg); } 68 | 100% { -webkit-transform: translate(0,0) rotate(-180deg); } 69 | 70 | } 71 | 72 | @keyframes object_one { 73 | 25% { 74 | transform: translate(0,-50px) rotate(-180deg); 75 | -webkit-transform: translate(0,-50px) rotate(-180deg); 76 | } 77 | 100% { 78 | transform: translate(0,0) rotate(-180deg); 79 | -webkit-transform: translate(0,0) rotate(-180deg); 80 | } 81 | } 82 | @-webkit-keyframes object_two { 83 | 25% { -webkit-transform: translate(50px,0) rotate(-180deg); } 84 | 100% { -webkit-transform: translate(0,0) rotate(-180deg); } 85 | } 86 | 87 | @keyframes object_two { 88 | 25% { 89 | transform: translate(50px,0) rotate(-180deg); 90 | -webkit-transform: translate(50px,0) rotate(-180deg); 91 | } 92 | 100% { 93 | transform: translate(0,0) rotate(-180deg); 94 | -webkit-transform: translate(0,0) rotate(-180deg); 95 | } 96 | } 97 | 98 | @-webkit-keyframes object_three { 99 | 25% { -webkit-transform: translate(-50px,0) rotate(-180deg); } 100 | 100% { -webkit-transform: translate(0,0) rotate(-180deg); } 101 | } 102 | 103 | @keyframes object_three { 104 | 25% { 105 | transform: translate(-50px,0) rotate(-180deg); 106 | -webkit-transform: translate(-50px,0) rotate(-180deg); 107 | } 108 | 100% { 109 | transform: translate(0,0) rotate(-180deg); 110 | -webkit-transform: translate(0,0) rotate(-180deg); 111 | } 112 | } 113 | @-webkit-keyframes object_four { 114 | 25% { -webkit-transform: translate(0,50px) rotate(-180deg); } 115 | 100% { -webkit-transform: translate(0,0) rotate(-180deg); } 116 | } 117 | 118 | @keyframes object_four { 119 | 25% { 120 | transform: translate(0,50px) rotate(-180deg); 121 | -webkit-transform: translate(0,50px) rotate(-180deg); 122 | } 123 | 100% { 124 | transform: translate(0,0) rotate(-180deg); 125 | -webkit-transform: translate(0,0) rotate(-180deg); 126 | } 127 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/he-said/he-said.component.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | @media screen and(min-width:768px){ 4 | .exp-det{ 5 | font-size: 16px; 6 | } 7 | 8 | .company-info{ 9 | font-size: 16px; 10 | } 11 | } 12 | 13 | @media screen and(max-width:767px){ 14 | .exp-det{ 15 | font-size: 13px; 16 | } 17 | 18 | .company-info{ 19 | font-size: 12px; 20 | } 21 | } 22 | 23 | 24 | .exp-wrap{ 25 | border: 1px solid #dcdcdc; 26 | -webkit-box-shadow: 0 -4px 0 0 #656d78; 27 | box-shadow: 0 -4px 0 0 #656d78; 28 | text-align: left; 29 | text-indent: 32px; 30 | padding: 14px 35px 30px 33px; 31 | // padding: 16px 35px 30px 70px; 32 | margin: 5px auto; 33 | position: relative; 34 | border-radius: 5px; 35 | 36 | .exp-det{ 37 | line-height: 1.8; 38 | color: #595959; 39 | margin-top: 5px; 40 | // &::before{ 41 | // content: '\201C'; 42 | // color: #37a7c1; 43 | // font-size: 80px; 44 | // font-weight: bold; 45 | // font-family: sans-serif, Arial, Helvetica; 46 | // padding-right: 3px; 47 | // margin: 0 7px; 48 | // position: absolute; 49 | // left: -3px; 50 | // top: -13px; 51 | // opacity: 0.7; 52 | // } 53 | } 54 | 55 | .exp-arrow{ 56 | width: 117px; 57 | left: 0; 58 | position: absolute; 59 | height: 14px; 60 | right: 0px; 61 | bottom: -14px; 62 | &::before{ 63 | content: ''; 64 | height: 0; 65 | width: 0; 66 | border-style: solid; 67 | border-width: 10px; 68 | // border-color: #dcdcdc transparent transparent transparent; 69 | border-color: #fff transparent transparent transparent; 70 | border-top-width: 16px; 71 | border-left-width: 21px; 72 | position: absolute; 73 | right: 58px; 74 | top: -1px; 75 | left: 49px; 76 | z-index: 9; 77 | } 78 | &::after{ 79 | content: ''; 80 | height: 0; 81 | width: 0; 82 | border-style: solid; 83 | border-width: 10px; 84 | // border-color: #dcdcdc transparent transparent transparent; 85 | border-color: #dcdcdc transparent transparent transparent; 86 | border-top-width: 17px; 87 | border-left-width: 22px; 88 | position: absolute; 89 | right: 58px; 90 | top: 0px; 91 | left: 49px; 92 | z-index: 8; 93 | } 94 | } 95 | 96 | } 97 | 98 | .company-info{ 99 | margin-top: 20px; 100 | padding-left: 20px; 101 | color: #2f2f2f; 102 | line-height: 1.2; 103 | .img-wrap{ 104 | width: 85px; 105 | height: 85px; 106 | // background-image: url("../../../../../assets/images/home_icon_1.png"); 107 | background-size: 100% 100%; 108 | border-radius: 50%; 109 | } 110 | .exp-tit{ 111 | margin-top: 10px; 112 | padding-left: 25px; 113 | } 114 | .lists-tips{ 115 | padding-right: 0; 116 | } 117 | .company-list{ 118 | li{ 119 | clear: both; 120 | overflow: hidden; 121 | cursor: pointer; 122 | div{ 123 | width: 12px; 124 | height: 12px; 125 | // border: 2px solid #d1d1d1; 126 | border-radius: 6px; 127 | margin-bottom: 10px; 128 | float: right; 129 | } 130 | 131 | } 132 | } 133 | } 134 | 135 | .activeDot{ 136 | background: #d1d1d1; 137 | } 138 | .defaultDot{ 139 | border: 2px solid #d1d1d1; 140 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [ 5 | true, 6 | "check-space" 7 | ], 8 | "curly": true, 9 | "eofline": true, 10 | "forin": true, 11 | "indent": [ 12 | true, 13 | "spaces" 14 | ], 15 | "label-position": true, 16 | "label-undefined": true, 17 | "max-line-length": [ 18 | true, 19 | 140 20 | ], 21 | "max-file-line-count": [ 22 | true, 23 | 300 24 | ], 25 | "member-access": false, 26 | "member-ordering": [ 27 | true, 28 | "public-before-private", 29 | "static-before-instance", 30 | "variables-before-functions" 31 | ], 32 | "no-arg": true, 33 | "no-bitwise": true, 34 | "no-console": [ 35 | true, 36 | "debug", 37 | "info", 38 | "time", 39 | "timeEnd", 40 | "trace" 41 | ], 42 | "no-construct": true, 43 | "no-debugger": true, 44 | "no-duplicate-key": true, 45 | "no-duplicate-variable": true, 46 | "no-empty": true, 47 | "no-eval": true, 48 | "no-inferrable-types": [ 49 | true, 50 | "ignore-params" 51 | ], 52 | "callable-types": true, 53 | "import-blacklist": [ 54 | true, 55 | "rxjs" 56 | ], 57 | "import-spacing": true, 58 | "interface-over-type-literal": true, 59 | "no-empty-interface": true, 60 | "no-string-throw": true, 61 | "prefer-const": true, 62 | "typeof-compare": true, 63 | "unified-signatures": true, 64 | "no-shadowed-variable": false, 65 | "no-string-literal": true, 66 | "no-switch-case-fall-through": true, 67 | "no-trailing-whitespace": false, 68 | "no-unused-expression": true, 69 | "no-unused-variable": false, 70 | "no-unreachable": true, 71 | "no-use-before-declare": true, 72 | "no-var-keyword": true, 73 | "object-literal-sort-keys": false, 74 | "one-line": [ 75 | true, 76 | "check-open-brace", 77 | "check-catch", 78 | "check-else", 79 | "check-finally", 80 | "check-whitespace" 81 | ], 82 | "quotemark": [ 83 | true, 84 | "avoid-escape" 85 | ], 86 | "radix": true, 87 | "semicolon": true, 88 | "trailing-comma": [ 89 | false, 90 | { 91 | "singleline": "never", 92 | "multiline": "always" 93 | } 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "variable-name": false, 110 | "whitespace": [ 111 | true, 112 | "check-branch", 113 | "check-decl", 114 | "check-operator", 115 | "check-separator", 116 | "check-type" 117 | ], 118 | "directive-selector-name": [ 119 | true, 120 | "camelCase" 121 | ], 122 | "component-selector-name": [ 123 | false, 124 | "kebab-case" 125 | ], 126 | "directive-selector-type": [ 127 | true, 128 | "attribute" 129 | ], 130 | "component-selector-type": [ 131 | true, 132 | "element" 133 | ], 134 | "directive-selector-prefix": [ 135 | false, 136 | "" 137 | ], 138 | "component-selector-prefix": [ 139 | false, 140 | "" 141 | ], 142 | "use-input-property-decorator": true, 143 | "use-output-property-decorator": true, 144 | "use-host-property-decorator": true, 145 | "no-attribute-parameter-decorator": true, 146 | "no-input-rename": true, 147 | "no-output-rename": true, 148 | "no-forward-ref": true, 149 | "use-life-cycle-interface": true, 150 | "use-pipe-transform-interface": true, 151 | "pipe-naming": [ 152 | true, 153 | "camelCase", 154 | "re" 155 | ], 156 | "component-class-suffix": true, 157 | "directive-class-suffix": true, 158 | "import-destructuring-spacing": true 159 | }, 160 | "rulesDirectory": [ 161 | "node_modules/codelyzer" 162 | ] 163 | } -------------------------------------------------------------------------------- /src/app/pages/home/home-content/presentation-us/presentation-us.component.scss: -------------------------------------------------------------------------------- 1 | @media screen and(min-width:768px){ 2 | .why-sz-top { 3 | height: 30%; 4 | padding-top: 3%; 5 | 6 | .why-tit{ 7 | font-size: 33px; 8 | } 9 | .why-det{ 10 | font-size: 15px; 11 | } 12 | .why-tit, 13 | .why-det { 14 | width: 1200px; 15 | padding: 0 15px; 16 | margin-left: auto; 17 | margin-right: auto; 18 | } 19 | 20 | 21 | } 22 | .why-sz-bottom { 23 | width: 1200px; 24 | margin: 0 auto; 25 | padding-top: 30px; 26 | height: 70%; 27 | } 28 | .choosed-common-style{ 29 | .choosed-tit{ 30 | font-size: 24px; 31 | .sp2{ 32 | font-size: 29px; 33 | } 34 | } 35 | p{ 36 | font-size: 14px; 37 | } 38 | } 39 | 40 | } 41 | 42 | @media screen and(max-width:767px){ 43 | .why-sz-top { 44 | padding: 30px 20px; 45 | .why-tit{ 46 | font-size: 20px; 47 | } 48 | .why-det{ 49 | font-size: 12px; 50 | line-height: 1.6; 51 | } 52 | } 53 | 54 | .why-sz-bottom { 55 | width: 100%; 56 | padding: 0 10px; 57 | } 58 | 59 | .choosed-common-style{ 60 | margin-top: 30px; 61 | .choosed-tit{ 62 | font-size: 16px; 63 | .sp2{ 64 | font-size: 18px; 65 | } 66 | } 67 | p{ 68 | font-size: 12px; 69 | } 70 | } 71 | } 72 | 73 | .why-sz-top { 74 | width: 100%; 75 | background-image: url("../../../../../assets/images/presentatin_us.jpg"); 76 | background-size: 100% 100%; 77 | background-attachment: fixed; 78 | text-align: center; 79 | .why-tit{ 80 | line-height: 1.1; 81 | font-weight: 300; 82 | color: #fff; 83 | } 84 | .why-det{ 85 | color: rgba(255, 255, 255, 0.9); 86 | margin-top: 30px; 87 | margin-bottom: 30px; 88 | line-height: 1.6; 89 | font-weight: 300; 90 | letter-spacing: 0.2px; 91 | } 92 | 93 | .middle-btn-wrap{ 94 | margin: 0 auto; 95 | width: 300px; 96 | height: 35px; 97 | .more-btn, 98 | .buy-btn{ 99 | width: 115px; 100 | height: 35px; 101 | font-size: 14px; 102 | border-radius: 5px; 103 | color: #fff; 104 | letter-spacing: 1px; 105 | border-bottom: 3px solid rgba(0,0,0,.2); 106 | display: inline-block; 107 | cursor: pointer; 108 | user-select: none; 109 | transition: all .75s ease; 110 | -moz-transition: all .75s ease; 111 | -webkit-transition: all .75s ease; 112 | -o-transition: all .75s ease; 113 | } 114 | .more-btn{ 115 | border: 2px#fff solid; 116 | margin-right: 10px; 117 | line-height: 32px; 118 | -webkit-transition:color 0.28s ease; 119 | -moz-transition: color 0.28s ease; 120 | -o-transition: color 0.28s ease; 121 | transition: color 0.28s ease; 122 | &:hover{ 123 | background: #fff; 124 | color:#000; 125 | -webkit-transition:color 0.28s ease; 126 | -moz-transition: color 0.28s ease; 127 | -o-transition: color 0.28s ease; 128 | transition: color 0.28s ease; 129 | } 130 | } 131 | .buy-btn{ 132 | line-height: 35px; 133 | text-indent: 15px; 134 | background: #f98805; 135 | &:hover{ 136 | background: #0061ae; 137 | color: #fff; 138 | text-indent: 10px; 139 | transition: all .75s ease; 140 | -moz-transition: all .75s ease; 141 | -webkit-transition: all .75s ease; 142 | -o-transition: all .75s ease; 143 | } 144 | .btn-arrows{ 145 | text-indent: 0px; 146 | opacity: 0; 147 | transition: all .75s ease; 148 | -moz-transition: all .75s ease; 149 | -webkit-transition: all .75s ease; 150 | -o-transition: all .75s ease; 151 | } 152 | &:hover .btn-arrows { 153 | color: #fff; 154 | opacity: 1; 155 | text-indent: 7px; 156 | transition: all .75s ease; 157 | -moz-transition: all .75s ease; 158 | -webkit-transition: all .75s ease; 159 | -o-transition: all .75s ease; 160 | } 161 | } 162 | 163 | } 164 | 165 | 166 | } 167 | 168 | 169 | .choosed-common-style{ 170 | margin-bottom: 30px; 171 | padding: 0 3px; 172 | .choosed-tit{ 173 | line-height: 1.5; 174 | color: #de4217; 175 | &:after{ 176 | content: ""; 177 | margin: 6px 0 15px; 178 | width: 69px; 179 | height: 0; 180 | display: block; 181 | position: relative; 182 | border-bottom: 4px solid; 183 | } 184 | .sp2{ 185 | font-weight: 800; 186 | color: #363636; 187 | letter-spacing: -1.5px; 188 | } 189 | } 190 | p{ 191 | line-height: 1; 192 | margin-top: -5px; 193 | font-weight: 400; 194 | color: #707070; 195 | letter-spacing: -0.4px; 196 | font-family: 'Montserrat','Roboto', Helvetica, Arial, sans-serif; 197 | } 198 | 199 | } 200 | 201 | /* 为什么选择我们 */ 202 | .why-choose-wrap{ 203 | min-height: 1px; 204 | padding-left: 15px; 205 | padding-right: 15px; 206 | 207 | } 208 | -------------------------------------------------------------------------------- /src/app/theme/scss/utilities/_mixin.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | 5 | // Atoms 6 | // -------------------------------------------------- 7 | 8 | 9 | // $Atoms 10 | // Extend atoms placeholder 11 | @mixin atoms($collection...) { 12 | @each $el in $collection { 13 | @extend %#{$el}; 14 | } 15 | } 16 | 17 | 18 | // Spacing 19 | // -------------------------------------------------- 20 | 21 | // $Spacing 22 | // @param $spacers - spacers list 23 | // Usage: spacing(mt-0, px-1) 24 | // ---------------------------------- 25 | @mixin spacing($spacers...) { 26 | @each $spacer in $spacers { 27 | @extend %#{$spacer}; 28 | } 29 | } 30 | 31 | // $Spacing-custom 32 | // @param $type - spacing type, margin, padding 33 | // @param $top $right $bottom $left - values 34 | // Usage: spacing-custom(padding, 1rem, $left: 1rem) 35 | // ---------------------------------- 36 | @mixin spacing-custom($type, $top: null, $right: null, $bottom: null, $left: null) { 37 | #{$type}-top: $top; 38 | #{$type}-right: $right; 39 | #{$type}-bottom: $bottom; 40 | #{$type}-left: $left; 41 | } 42 | 43 | 44 | // Sizing 45 | // -------------------------------------------------- 46 | 47 | 48 | // $Sizing 49 | // @param $size - sizes list 50 | // Usage: sizing(w-25, w-100) 51 | // ---------------------------------- 52 | @mixin sizing($sizes...) { 53 | @each $size in $sizes { 54 | @extend %#{$size}; 55 | } 56 | } 57 | 58 | // $Sizing-custom 59 | // @param $width - width 60 | // @param $height - height 61 | // Usage: sizing-custom(2rem) 62 | // ---------------------------------- 63 | @mixin sizing-custom($width: null, $height: null) { 64 | width: $width; 65 | height: $height; 66 | } 67 | 68 | 69 | // Grid 70 | // -------------------------------------------------- 71 | 72 | 73 | // $Grid 74 | // @param $cols - column list 75 | // Usage: grid(col-md-7, col-md-offset-1) 76 | // ---------------------------------- 77 | @mixin grid($cols...) { 78 | @each $col in $cols { 79 | @extend %#{$col}; 80 | } 81 | } 82 | 83 | 84 | // Flex 85 | // -------------------------------------------------- 86 | 87 | 88 | // $Flex box 89 | // @param $utilities - utilitie placeholder 90 | // Usage: flex-box(d-flex) 91 | // ---------------------------------- 92 | @mixin flex-box($utilities...) { 93 | @include atoms($utilities...); 94 | } 95 | 96 | 97 | // Font-size 98 | // -------------------------------------------------- 99 | 100 | 101 | // $Font size 102 | // @param $size - font size 103 | // Usage: font-size(h1) font-size(fs-13) 104 | // ---------------------------------- 105 | @mixin font-size($size) { 106 | @include atoms($size); 107 | } 108 | 109 | 110 | // Colors 111 | // -------------------------------------------------- 112 | 113 | 114 | // $Color 115 | // @param $color - text color and bg color 116 | // Usage: colors(text-gray-light) 117 | // ---------------------------------- 118 | @mixin colors($color...) { 119 | @include atoms($color...); 120 | } 121 | 122 | 123 | // Text 124 | // -------------------------------------------------- 125 | 126 | 127 | // $Text 128 | // @param $props - text 129 | // Usage: text(text-left) 130 | // ---------------------------------- 131 | @mixin text($props...) { 132 | @include atoms($props...); 133 | } 134 | 135 | // Text 136 | // -------------------------------------------------- 137 | 138 | 139 | // $Display 140 | // @param $display - display 141 | // Usage: display(d-flex) 142 | // ---------------------------------- 143 | @mixin display($display) { 144 | @include atoms($display); 145 | } 146 | 147 | 148 | // Align 149 | // -------------------------------------------------- 150 | 151 | 152 | // $Align 153 | // @param $align - align 154 | // Usage: align(align-middle) 155 | // ---------------------------------- 156 | @mixin align($align) { 157 | @include atoms($align); 158 | } 159 | 160 | 161 | // Variant 162 | // -------------------------------------------------- 163 | 164 | 165 | // $Variant 166 | // @param $variant - variant, Contains the following attributes: 167 | // background-color border-color color 168 | // Usage: variant(bg-primary, border-success, color-info) 169 | // ---------------------------------- 170 | @mixin variant($variant...) { 171 | @include atoms($variant...); 172 | } 173 | 174 | 175 | // Border 176 | // -------------------------------------------------- 177 | 178 | 179 | // $Border 180 | // @param $border - style, width, radius 181 | // Usage: border(border-1, border-solid, rounded) 182 | // ---------------------------------- 183 | @mixin border($border...) { 184 | @include atoms($border...); 185 | } 186 | 187 | 188 | 189 | // Button 190 | // -------------------------------------------------- 191 | 192 | 193 | // %Button 194 | // @param $size - button size 195 | // @param $variant - button variant 196 | // Usage: 197 | // button( 198 | // $size: (fs-15, line-height-38), 199 | // $variant: (text-success, border-success) 200 | // ); 201 | // ---------------------------------- 202 | @mixin button($size: null, $variant: null) { 203 | @extend %btn-base; 204 | 205 | @include atoms($size...); 206 | @include variant($variant...); 207 | } 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | // Reset form input border radius 217 | @mixin form-border-radius($elem, $nth, $dir) { 218 | #{$elem}:nth-child(#{$nth}) { 219 | input { 220 | @if $dir == top { 221 | border-radius: $btn-default-border-radius $btn-default-border-radius 0 0; 222 | } @else if $dir == bottom { 223 | border-radius: 0 0 $btn-default-border-radius $btn-default-border-radius; 224 | } 225 | } 226 | } 227 | } 228 | 229 | // Position 230 | // @param position, $top, $left, $right, $bottom - Position 231 | // ---------------------------------- 232 | @mixin position($position, $top: null, $left: null, $right: null, $bottom: null) { 233 | $list: (top: $top, left: $left, right: $right, bottom: $bottom); 234 | 235 | position: $position; 236 | 237 | @each $k, $v in $list { 238 | @if $v != null { 239 | #{$k}:$v; 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /src/app/theme/scss/utilities/_config.scss: -------------------------------------------------------------------------------- 1 | // Variables 2 | // -------------------------------------------------- 3 | 4 | 5 | // $Colors 6 | // ---------------------------------- 7 | $gray-base: #000 !default; 8 | $gray-darker: lighten($gray-base, 13.5%) !default; // #222 9 | $gray-dark: lighten($gray-base, 20%) !default; // #333 10 | $gray: lighten($gray-base, 60.8%) !default; // #9b9b9b 11 | $gray-light: lighten($gray-base, 86.5%) !default; // #dddddd 12 | $gray-lighter: lighten($gray-base, 95%) !default; // #f7f7f7 13 | 14 | $primary: #ea6f5a !default; 15 | $brand-success: #00bb29 !default; 16 | $brand-info: #498ad5 !default; 17 | $brand-warning: #f0ad4e !default; 18 | $brand-danger: #f53d3d !default; 19 | 20 | // $Scaffolding 21 | // ---------------------------------- 22 | // Background color for ``. 23 | $body-bg: #fff !default; 24 | // Global text color on ``. 25 | $text-color: $gray-dark !default; 26 | // Global textual link color. 27 | $link-color: $primary !default; 28 | // Link hover color set via `darken()` function. 29 | $link-hover-color: darken($link-color, 15%) !default; 30 | // Link hover decoration. 31 | $link-hover-decoration: underline !default; 32 | 33 | // $Typography 34 | // ---------------------------------- 35 | $font-family-base: -apple-system, SF UI Text, Arial, PingFang SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif !default; 36 | // Font size of the root html 37 | $font-size-root: 62.5% !default; 38 | // 1.4rem == 14px 39 | $font-size-base: 1.4rem !default; 40 | 41 | $line-height-base: 1.5 !default; 42 | $line-height-sm: 1 !default; 43 | $line-height-lg: 2 !default; 44 | 45 | $headings: ( 46 | h1: 3.6rem, 47 | h2: 3rem, 48 | h3: 2.4rem, 49 | h4: 1.8rem, 50 | h5: $font-size-base, 51 | h6: 1.2rem 52 | ) !default; 53 | 54 | // $Border 55 | // ---------------------------------- 56 | $border-radius-base: .4rem !default; 57 | $border-radius-sm: 1rem !default; 58 | $border-radius-md: 2rem !default; 59 | $border-radius-lg: 4rem !default; 60 | 61 | // $Iconography 62 | // ---------------------------------- 63 | $icon-font-path: "/assets/fonts/" !default; 64 | 65 | // Spacing 66 | // ---------------------------------- 67 | $spacer: 1rem !default; 68 | $spacer-x: $spacer !default; 69 | $spacer-y: $spacer !default; 70 | 71 | $spacers: ( 72 | 0: ( 73 | x: 0, 74 | y: 0 75 | ), 76 | 1: ( 77 | x: ($spacer-x * .5), 78 | y: ($spacer-y * .5) 79 | ), 80 | 2: ( 81 | x: $spacer-x, 82 | y: $spacer-y 83 | ), 84 | 3: ( 85 | x: ($spacer-x * 1.5), 86 | y: ($spacer-y * 1.5) 87 | ), 88 | 4: ( 89 | x: ($spacer-x * 2), 90 | y: ($spacer-y * 2) 91 | ), 92 | 5: ( 93 | x: ($spacer-x * 2.5), 94 | y: ($spacer-y * 2.5) 95 | ), 96 | 6: ( 97 | x: ($spacer-x * 3), 98 | y: ($spacer-y * 3) 99 | ) 100 | ) !default; 101 | 102 | // Sizes 103 | // ---------------------------------- 104 | $sizes: ( 105 | 25: 25%, 106 | 33: 33.33333%, 107 | 50: 50%, 108 | 66: 66.66667%, 109 | 75: 75%, 110 | 100: 100% 111 | ) !default; 112 | 113 | // $Container max widths 114 | // ---------------------------------- 115 | $container-widths: ( 116 | sm: 54rem, 117 | md: 72rem, 118 | lg: 96rem, 119 | xl: 114rem 120 | ) !default; 121 | 122 | // $Screen breakpoints 123 | // Adapting to different screen sizes, for use in media queries 124 | // ---------------------------------- 125 | $screen-breakpoints: ( 126 | xs: 0, 127 | sm: 57.6rem, 128 | md: 76.8rem, 129 | lg: 99.2rem, 130 | xl: 120rem 131 | ) !default; 132 | 133 | 134 | // Components 135 | // -------------------------------------------------- 136 | 137 | 138 | // Nav 139 | // ---------------------------------- 140 | $nav-bar-height: 5.6rem !default; 141 | $nav-bar-min-width: 76.8rem !default; 142 | $nav-bar-max-width: 144rem !default; 143 | 144 | // Btn 145 | // ---------------------------------- 146 | $btn-default-height: 3.8rem !default; 147 | $btn-default-margin-left: 1.5rem !default; 148 | $btn-default-padding-left: 1.5rem !default; 149 | $btn-default-margin: .8rem $btn-default-margin-left !default; 150 | $btn-default-border-radius: .4rem !default; 151 | $btn-default-font-size: 1.5rem !default; 152 | 153 | // Card 154 | // ---------------------------------- 155 | $card-box-shadow: 0 0 .8rem rgba(0,0,0,.1) !default; 156 | 157 | // Avatar 158 | // ---------------------------------- 159 | $avatar-default-font-size: 1.3rem !default; 160 | $avatar-name-font-size: 1.6rem !default; 161 | 162 | // Icon 163 | // ---------------------------------- 164 | $icon-font-size: 2rem !default; 165 | 166 | // Article 167 | // ---------------------------------- 168 | $post-limit-width: 62rem !default; 169 | $p-font-size: 1.6rem !default; 170 | $p-margin-bottom: 2.5rem !default; 171 | $p-line-height: 1.7 !default; 172 | $p-font-weight: 400 !default; 173 | 174 | 175 | // Pages 176 | // src/app/pages 177 | // -------------------------------------------------- 178 | 179 | 180 | // $Note 181 | // src/app/pages/note 182 | // ---------------------------------- 183 | 184 | // @prop Post content width 185 | $note-post-width: 62rem !default; 186 | 187 | // $Collection 188 | // src/app/pages/collection 189 | // ---------------------------------- 190 | 191 | // @prop Avatar width 192 | $collection-avatar-width: 8rem !default; 193 | // @prop Avatar height 194 | $collection-avatar-height: $collection-avatar-width !default; 195 | // @prop button width 196 | $collection-btn-width: 10rem !default; 197 | // @prop button width 198 | $collection-btn-height: 3.8rem !default; 199 | 200 | -------------------------------------------------------------------------------- /src/app/pages/home/home-content/slideshow/slideshow.component.ts: -------------------------------------------------------------------------------- 1 | import { style } from '@angular/animations'; 2 | import { Component, OnInit, ElementRef, ViewChild, Renderer2 } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'slideshow', 6 | templateUrl: './slideshow.component.html', 7 | styleUrls: ['./slideshow.component.scss'] 8 | }) 9 | export class SlideshowComponent implements OnInit { 10 | 11 | /** 12 | * 步骤: 13 | * 1. 确定是查看下一张图片 add() 还是上一张 reduce() 14 | * 2. 设置下一张图片的 frontIndex 或上一张的 nextIndex, setFrontOrNextIndex() 15 | * 3. 设置背景图 changeBg() 16 | */ 17 | 18 | @ViewChild('firSlider') firSlider: ElementRef; 19 | @ViewChild('secSlider') secSlider: ElementRef; 20 | @ViewChild('thiSlider') thiSlider: ElementRef; 21 | @ViewChild('fouSlider') fouSlider: ElementRef; 22 | 23 | index : number = 0; 24 | private frontIndex : number; 25 | private nextIndex : number; 26 | 27 | add(){ 28 | this.setFrontOrNextIndex(true); 29 | this.index >= 3 ? this.index = -1 : null 30 | this.index += 1; 31 | this.changeBg(true); 32 | } 33 | 34 | reduce(){ 35 | this.setFrontOrNextIndex(false); 36 | this.index <= 0 ? this.index = 4 : null 37 | this.index -= 1; 38 | this.changeBg(false); 39 | } 40 | 41 | /** 42 | * @param flag boolean 切换图片 43 | */ 44 | changeBg(flag:boolean){ 45 | this.renderer2.removeClass(this.firSlider.nativeElement, "default-left"); 46 | this.upDateInterval(); 47 | let allSlider = [ this.firSlider, this.secSlider, this.thiSlider, this.fouSlider ]; 48 | allSlider.forEach((item, index) => { 49 | this.resetClass(item); 50 | this.index == index ? flag ? this.renderer2.addClass(item.nativeElement, "next-in") 51 | : this.renderer2.addClass(item.nativeElement, "front-in") 52 | : null; 53 | }) 54 | 55 | flag ? this.renderer2.addClass(allSlider[this.frontIndex].nativeElement, "next-leave") 56 | : this.renderer2.addClass(allSlider[this.nextIndex].nativeElement, "front-leave"); 57 | this.innerAnimat(flag); 58 | } 59 | 60 | /** 61 | * 62 | * @param val 要切换到的index ,是子组件切换轮播图的按钮传过来的数据 63 | */ 64 | getIndex(val){ 65 | let flag : boolean; 66 | if(this.index === val){ 67 | return; 68 | }else if( this.index > val ){ 69 | this.setFrontOrNextIndex(false); 70 | flag = false; 71 | }else{ 72 | this.setFrontOrNextIndex(true); 73 | flag = true; 74 | } 75 | this.index = val; 76 | this.changeBg(flag); 77 | } 78 | 79 | /** 80 | * 定时自动切换 81 | */ 82 | private autoTimer; 83 | 84 | setAutoChange(){ 85 | this.autoTimer = setInterval(()=>{ 86 | this.add(); 87 | }, 4000); 88 | } 89 | 90 | clearAutoChange(){ 91 | clearInterval(this.autoTimer); 92 | } 93 | 94 | upDateInterval(){ 95 | this.clearAutoChange(); 96 | this.setAutoChange(); 97 | } 98 | 99 | setFrontOrNextIndex(flag){ 100 | flag ? this.frontIndex = this.index : this.nextIndex = this.index; 101 | } 102 | 103 | /** 104 | * 105 | * @param item element 要去除样式的元素 106 | */ 107 | resetClass(item){ 108 | let classArr = ["next-in", "next-leave", "front-in", "front-leave"]; 109 | classArr.forEach(classItem =>{ 110 | this.renderer2.removeClass(item.nativeElement, classItem); 111 | }) 112 | } 113 | 114 | /** 115 | * 轮播图里面的动画 116 | */ 117 | 118 | @ViewChild('firTit') firTit: ElementRef; 119 | @ViewChild('firDet') firDet: ElementRef; 120 | @ViewChild('firBtn') firBtn: ElementRef; 121 | 122 | @ViewChild('secTit') secTit: ElementRef; 123 | @ViewChild('secDet') secDet: ElementRef; 124 | @ViewChild('secBtn') secBtn: ElementRef; 125 | 126 | @ViewChild('thiTit') thiTit: ElementRef; 127 | @ViewChild('thiDet') thiDet: ElementRef; 128 | @ViewChild('thiBtn') thiBtn: ElementRef; 129 | 130 | @ViewChild('fouTit') fouTit: ElementRef; 131 | @ViewChild('fouDet') fouDet: ElementRef; 132 | @ViewChild('fouBtn') fouBtn: ElementRef; 133 | 134 | private animateArr = [ 135 | "a-bounceinB", "a-fadeinT", 136 | "a-flipinX", "a-rotateinLB", 137 | "a-bounceinL", "a-fadeinL", 138 | "a-fadeinL", "a-fadeinL", 139 | "a-fadeinT", "a-fadeinL" 140 | ]; 141 | private newAnimate : string; 142 | private oldAnimate : string; 143 | private pageTimer = {} 144 | 145 | innerAnimat(flag){ 146 | this.oldAnimate = this.newAnimate; 147 | this.newAnimate = this.animateArr[this.rd()]; 148 | for(let item in this.pageTimer){ 149 | clearTimeout(this.pageTimer[item]); 150 | } 151 | this.cleanOrAddClass(this.index, true); 152 | if(flag === 'default'){ return } 153 | if(flag){ 154 | this.cleanOrAddClass(this.frontIndex, false); 155 | }else{ 156 | this.cleanOrAddClass(this.nextIndex, false); 157 | } 158 | } 159 | 160 | cleanOrAddClass(arrIndex, flag){ 161 | let domArr = [ 162 | [this.firTit,this.firDet,this.firBtn], 163 | [this.secTit,this.secDet,this.secBtn], 164 | [this.thiTit,this.thiDet,this.thiBtn], 165 | [this.fouTit,this.fouDet,this.fouBtn], 166 | ] 167 | domArr[arrIndex].forEach( (item, index) =>{ 168 | if(flag){ 169 | // index === 0 ? this.addAnimate(item) 170 | // : index === 1 ? setTimeout(()=>{ this.addAnimate(item) },550) 171 | // : setTimeout(()=>{ this.addAnimate(item) },900) 172 | switch(index){ 173 | case 0 : this.addAnimate(item); break; 174 | case 1 : this.pageTimer["timer1"] = setTimeout(()=>{this.addAnimate(item)}, 550); break; 175 | case 2 : this.pageTimer["timer2"] = setTimeout(()=>{this.addAnimate(item)}, 900); break; 176 | default: break; 177 | } 178 | }else{ 179 | this.removeAnimate(item) 180 | } 181 | }) 182 | } 183 | 184 | addAnimate (ele) { 185 | this.renderer2.addClass(ele.nativeElement, this.newAnimate); 186 | } 187 | 188 | removeAnimate(ele){ 189 | this.renderer2.removeClass(ele.nativeElement, this.oldAnimate); 190 | } 191 | 192 | rd(){ 193 | return Math.floor(Math.random()*10); 194 | } 195 | 196 | goDown(){ 197 | let ele = document.documentElement || document.body; 198 | let willScrTop = ele.offsetHeight - 58; 199 | let offY = window.pageYOffset; 200 | var timmer = requestAnimationFrame(function fn(){ 201 | offY = offY + 50; 202 | if(willScrTop> offY){ 203 | window.scrollTo(0,offY); 204 | setTimeout(()=>{ 205 | timmer=requestAnimationFrame(fn) 206 | },1) 207 | }else{ 208 | window.scrollTo(0,willScrTop); 209 | } 210 | }) 211 | } 212 | 213 | ngOnInit() { 214 | this.innerAnimat("default"); 215 | this.setAutoChange(); 216 | } 217 | 218 | constructor( private renderer2 : Renderer2) { } 219 | 220 | 221 | } 222 | -------------------------------------------------------------------------------- /src/app/theme/scss/libs/_iconfont.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: iconfont; 3 | src: url($icon-font-path + "iconfont/iconfont.eot"); 4 | src: url($icon-font-path + "iconfont/iconfont.eot") format("embedded-opentype"), url($icon-font-path + "iconfont/iconfont.woff") format("woff"), url($icon-font-path + "iconfont/iconfont.ttf") format("truetype"), url($icon-font-path + "iconfont/iconfont.svg") format("svg") 5 | } 6 | 7 | .iconfont { 8 | font-family: iconfont!important; 9 | font-size: inherit; 10 | font-style: normal; 11 | font-weight: 400!important; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale 14 | } 15 | 16 | .ic-info:before { 17 | content: "\E60C" 18 | } 19 | 20 | .ic-arrow:before { 21 | content: "\E61E" 22 | } 23 | 24 | .ic-search:before { 25 | content: "\E618" 26 | } 27 | 28 | .ic-qq_connect:before { 29 | content: "\E603" 30 | } 31 | 32 | .ic-douban:before { 33 | content: "\E601" 34 | } 35 | 36 | .ic-location:before { 37 | content: "\E627" 38 | } 39 | 40 | .ic-next:before { 41 | content: "\E62D" 42 | } 43 | 44 | .ic-previous:before { 45 | content: "\E62F" 46 | } 47 | 48 | .ic-unfollow:before { 49 | content: "\E631" 50 | } 51 | 52 | .ic-phone:before { 53 | content: "\E602" 54 | } 55 | 56 | .ic-catalog:before { 57 | content: "\E694" 58 | } 59 | 60 | .ic-search-history:before { 61 | content: "\E640" 62 | } 63 | 64 | .ic-share-more:before { 65 | content: "\E623" 66 | } 67 | 68 | .ic-work:before { 69 | content: "\E628" 70 | } 71 | 72 | .ic-share-wechat:before { 73 | content: "\E625" 74 | } 75 | 76 | .ic-education:before { 77 | content: "\E62B" 78 | } 79 | 80 | .ic-social:before { 81 | content: "\E62A" 82 | } 83 | 84 | .ic-question:before { 85 | content: "\E60D" 86 | } 87 | 88 | .ic-google_oauth2:before { 89 | content: "\E600" 90 | } 91 | 92 | .ic-share-weibo:before { 93 | content: "\E626" 94 | } 95 | 96 | .ic-edit-s:before { 97 | content: "\E619" 98 | } 99 | 100 | .ic-wechat:before { 101 | content: "\E604" 102 | } 103 | 104 | .ic-weibo:before { 105 | content: "\E605" 106 | } 107 | 108 | .ic-hot:before { 109 | content: "\E607" 110 | } 111 | 112 | .ic-feed:before { 113 | content: "\E608" 114 | } 115 | 116 | .ic-latestcomments:before { 117 | content: "\E609" 118 | } 119 | 120 | .ic-articles:before { 121 | content: "\E60A" 122 | } 123 | 124 | .ic-official:before { 125 | content: "\E60B" 126 | } 127 | 128 | .ic-write:before { 129 | content: "\E60E" 130 | } 131 | 132 | .ic-discover-collections:before { 133 | content: "\E61A" 134 | } 135 | 136 | .ic-discover-user:before { 137 | content: "\E61B" 138 | } 139 | 140 | .ic-back:before { 141 | content: "\E61C" 142 | } 143 | 144 | .ic-article-mark:before { 145 | content: "\E629" 146 | } 147 | 148 | .ic-article-like:before { 149 | content: "\E62C" 150 | } 151 | 152 | .ic-collections-followed:before { 153 | content: "\E62E" 154 | } 155 | 156 | .ic-collection:before { 157 | content: "\E615" 158 | } 159 | 160 | .ic-settings-money:before { 161 | content: "\E63A" 162 | } 163 | 164 | .ic-settings-profile:before { 165 | content: "\E63B" 166 | } 167 | 168 | .ic-settings-basic:before { 169 | content: "\E63C" 170 | } 171 | 172 | .ic-settings-verify:before { 173 | content: "\E63D" 174 | } 175 | 176 | .ic-settings-account:before { 177 | content: "\E63E" 178 | } 179 | 180 | .ic-settings-block:before { 181 | content: "\E63F" 182 | } 183 | 184 | .ic-search-collection:before { 185 | content: "\E641" 186 | } 187 | 188 | .ic-search-notebook:before { 189 | content: "\E643" 190 | } 191 | 192 | .ic-money:before { 193 | content: "\E606" 194 | } 195 | 196 | .ic-comment-emotions:before { 197 | content: "\E64A" 198 | } 199 | 200 | .ic-comment-at:before { 201 | content: "\E64B" 202 | } 203 | 204 | .ic-navigation-night:before { 205 | content: "\E64D" 206 | } 207 | 208 | .ic-navigation-mark:before { 209 | content: "\E64F" 210 | } 211 | 212 | .ic-navigation-profile:before { 213 | content: "\E650" 214 | } 215 | 216 | .ic-navigation-help:before { 217 | content: "\E651" 218 | } 219 | 220 | .ic-navigation-settings:before { 221 | content: "\E652" 222 | } 223 | 224 | .ic-navigation-wallet:before { 225 | content: "\E653" 226 | } 227 | 228 | .ic-navigation-like:before { 229 | content: "\E654" 230 | } 231 | 232 | .ic-navigation-feedback:before { 233 | content: "\E655" 234 | } 235 | 236 | .ic-filter:before { 237 | content: "\E657" 238 | } 239 | 240 | .ic-subscribed:before { 241 | content: "\E630" 242 | } 243 | 244 | .ic-fail:before { 245 | content: "\E65B" 246 | } 247 | 248 | .ic-addcollection:before { 249 | content: "\E65C" 250 | } 251 | 252 | .ic-phonenumber:before { 253 | content: "\E65D" 254 | } 255 | 256 | .ic-user:before { 257 | content: "\E65E" 258 | } 259 | 260 | .ic-list-comments:before { 261 | content: "\E660" 262 | } 263 | 264 | .ic-list-like:before { 265 | content: "\E661" 266 | } 267 | 268 | .ic-list-read:before { 269 | content: "\E662" 270 | } 271 | 272 | .ic-list-money:before { 273 | content: "\E60F" 274 | } 275 | 276 | .ic-followed:before { 277 | content: "\E610" 278 | } 279 | 280 | .ic-follow:before { 281 | content: "\E611" 282 | } 283 | 284 | .ic-friends:before { 285 | content: "\E617" 286 | } 287 | 288 | .ic-like-active:before { 289 | content: "\E613" 290 | } 291 | 292 | .ic-like:before { 293 | content: "\E663" 294 | } 295 | 296 | .ic-navigation-signout:before { 297 | content: "\E61D" 298 | } 299 | 300 | .ic-others:before { 301 | content: "\E633" 302 | } 303 | 304 | .ic-requests:before { 305 | content: "\E635" 306 | } 307 | 308 | .ic-follows:before { 309 | content: "\E636" 310 | } 311 | 312 | .ic-chats:before { 313 | content: "\E637" 314 | } 315 | 316 | .ic-comments:before { 317 | content: "\E656" 318 | } 319 | 320 | .ic-likes:before { 321 | content: "\E664" 322 | } 323 | 324 | .ic-woman:before { 325 | content: "\E645" 326 | } 327 | 328 | .ic-man:before { 329 | content: "\E646" 330 | } 331 | 332 | .ic-password:before { 333 | content: "\E614" 334 | } 335 | 336 | .ic-ios:before { 337 | content: "\E612" 338 | } 339 | 340 | .ic-error:before { 341 | content: "\E648" 342 | } 343 | 344 | .ic-qrcode:before { 345 | content: "\E649" 346 | } 347 | 348 | .ic-android:before { 349 | content: "\E65F" 350 | } 351 | 352 | .ic-verify:before { 353 | content: "\E61F" 354 | } 355 | 356 | .ic-show:before { 357 | content: "\E621" 358 | } 359 | 360 | .ic-hide:before { 361 | content: "\E622" 362 | } 363 | 364 | .ic-previous-s:before { 365 | content: "\E647" 366 | } 367 | 368 | .ic-next-s:before { 369 | content: "\E659" 370 | } 371 | 372 | .ic-go:before { 373 | content: "\E65A" 374 | } 375 | 376 | .ic-none:before { 377 | content: "\E665" 378 | } 379 | 380 | .ic-zan-active:before { 381 | content: "\E638" 382 | } 383 | 384 | .ic-comment:before { 385 | content: "\E639" 386 | } 387 | 388 | .ic-zan:before { 389 | content: "\E666" 390 | } 391 | 392 | .ic-share:before { 393 | content: "\E683" 394 | } 395 | 396 | .ic-backtop:before { 397 | content: "\E684" 398 | } 399 | 400 | .ic-addcollectionmodal:before { 401 | content: "\E668" 402 | } 403 | 404 | .ic-link:before { 405 | content: "\E616" 406 | } 407 | 408 | .ic-more:before { 409 | content: "\E620" 410 | } 411 | 412 | .ic-report:before { 413 | content: "\E624" 414 | } 415 | 416 | .ic-block:before { 417 | content: "\E632" 418 | } 419 | 420 | .ic-delete:before { 421 | content: "\E66B" 422 | } 423 | 424 | .ic-email:before { 425 | content: "\E66C" 426 | } 427 | 428 | .ic-recommend:before { 429 | content: "\E66D" 430 | } 431 | 432 | .ic-city:before { 433 | content: "\E66E" 434 | } 435 | 436 | .ic-recommend-collection:before { 437 | content: "\E66F" 438 | } 439 | 440 | .ic-recommend-user:before { 441 | content: "\E670" 442 | } 443 | 444 | .ic-article-s:before { 445 | content: "\E671" 446 | } 447 | 448 | .ic-collection-s:before { 449 | content: "\E672" 450 | } 451 | 452 | .ic-subcomment:before { 453 | content: "\E698" 454 | } 455 | 456 | .ic-navigation-discover:before { 457 | content: "\E69A" 458 | } 459 | 460 | .ic-navigation-notification:before { 461 | content: "\E69B" 462 | } 463 | 464 | .ic-navigation-follow:before { 465 | content: "\E69C" 466 | } 467 | 468 | .ic-navigation-download:before { 469 | content: "\E69D" 470 | } 471 | 472 | .ic-successed:before { 473 | content: "\E69E" 474 | } 475 | 476 | .ic-unblock:before { 477 | content: "\E6A2" 478 | } 479 | 480 | .ic-applying:before { 481 | content: "\E6A7" 482 | } 483 | 484 | .ic-addpeople:before { 485 | content: "\E6A8" 486 | } 487 | 488 | .ic-mark:before { 489 | content: "\E6AF" 490 | } 491 | 492 | .ic-search-user:before { 493 | content: "\E6B0" 494 | } 495 | 496 | .ic-search-note:before { 497 | content: "\E6B1" 498 | } 499 | 500 | .ic-picture:before { 501 | content: "\E6B2" 502 | } 503 | 504 | .ic-navigation-mode:before { 505 | content: "\E6B5" 506 | } 507 | 508 | .ic-mark-active:before { 509 | content: "\E6B7" 510 | } 511 | 512 | .ic-note-requests:before { 513 | content: "\E6BC" 514 | } 515 | -------------------------------------------------------------------------------- /src/app/theme/scss/libs/_normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in 9 | * IE on Windows Phone and in iOS. 10 | */ 11 | 12 | html { 13 | line-height: 1.15; /* 1 */ 14 | -ms-text-size-adjust: 100%; /* 2 */ 15 | -webkit-text-size-adjust: 100%; /* 2 */ 16 | } 17 | 18 | /* Sections 19 | ========================================================================== */ 20 | 21 | /** 22 | * Remove the margin in all browsers (opinionated). 23 | */ 24 | 25 | body { 26 | margin: 0; 27 | } 28 | 29 | /** 30 | * Add the correct display in IE 9-. 31 | */ 32 | 33 | article, 34 | aside, 35 | footer, 36 | header, 37 | nav, 38 | section { 39 | display: block; 40 | } 41 | 42 | /** 43 | * Correct the font size and margin on `h1` elements within `section` and 44 | * `article` contexts in Chrome, Firefox, and Safari. 45 | */ 46 | 47 | h1 { 48 | font-size: 2em; 49 | margin: 0.67em 0; 50 | } 51 | 52 | /* Grouping content 53 | ========================================================================== */ 54 | 55 | /** 56 | * Add the correct display in IE 9-. 57 | * 1. Add the correct display in IE. 58 | */ 59 | 60 | figcaption, 61 | figure, 62 | main { /* 1 */ 63 | display: block; 64 | } 65 | 66 | /** 67 | * Add the correct margin in IE 8. 68 | */ 69 | 70 | figure { 71 | margin: 1em 40px; 72 | } 73 | 74 | /** 75 | * 1. Add the correct box sizing in Firefox. 76 | * 2. Show the overflow in Edge and IE. 77 | */ 78 | 79 | hr { 80 | box-sizing: content-box; /* 1 */ 81 | height: 0; /* 1 */ 82 | overflow: visible; /* 2 */ 83 | } 84 | 85 | /** 86 | * 1. Correct the inheritance and scaling of font size in all browsers. 87 | * 2. Correct the odd `em` font sizing in all browsers. 88 | */ 89 | 90 | pre { 91 | font-family: monospace, monospace; /* 1 */ 92 | font-size: 1em; /* 2 */ 93 | } 94 | 95 | /* Text-level semantics 96 | ========================================================================== */ 97 | 98 | /** 99 | * 1. Remove the gray background on active links in IE 10. 100 | * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. 101 | */ 102 | 103 | a { 104 | background-color: transparent; /* 1 */ 105 | -webkit-text-decoration-skip: objects; /* 2 */ 106 | } 107 | 108 | /** 109 | * 1. Remove the bottom border in Chrome 57- and Firefox 39-. 110 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 111 | */ 112 | 113 | abbr[title] { 114 | border-bottom: none; /* 1 */ 115 | text-decoration: underline; /* 2 */ 116 | text-decoration: underline dotted; /* 2 */ 117 | } 118 | 119 | /** 120 | * Prevent the duplicate application of `bolder` by the next rule in Safari 6. 121 | */ 122 | 123 | b, 124 | strong { 125 | font-weight: inherit; 126 | } 127 | 128 | /** 129 | * Add the correct font weight in Chrome, Edge, and Safari. 130 | */ 131 | 132 | b, 133 | strong { 134 | font-weight: bolder; 135 | } 136 | 137 | /** 138 | * 1. Correct the inheritance and scaling of font size in all browsers. 139 | * 2. Correct the odd `em` font sizing in all browsers. 140 | */ 141 | 142 | code, 143 | kbd, 144 | samp { 145 | font-family: monospace, monospace; /* 1 */ 146 | font-size: 1em; /* 2 */ 147 | } 148 | 149 | /** 150 | * Add the correct font style in Android 4.3-. 151 | */ 152 | 153 | dfn { 154 | font-style: italic; 155 | } 156 | 157 | /** 158 | * Add the correct background and color in IE 9-. 159 | */ 160 | 161 | mark { 162 | background-color: #ff0; 163 | color: #000; 164 | } 165 | 166 | /** 167 | * Add the correct font size in all browsers. 168 | */ 169 | 170 | small { 171 | font-size: 80%; 172 | } 173 | 174 | /** 175 | * Prevent `sub` and `sup` elements from affecting the line height in 176 | * all browsers. 177 | */ 178 | 179 | sub, 180 | sup { 181 | font-size: 75%; 182 | line-height: 0; 183 | position: relative; 184 | vertical-align: baseline; 185 | } 186 | 187 | sub { 188 | bottom: -0.25em; 189 | } 190 | 191 | sup { 192 | top: -0.5em; 193 | } 194 | 195 | /* Embedded content 196 | ========================================================================== */ 197 | 198 | /** 199 | * Add the correct display in IE 9-. 200 | */ 201 | 202 | audio, 203 | video { 204 | display: inline-block; 205 | } 206 | 207 | /** 208 | * Add the correct display in iOS 4-7. 209 | */ 210 | 211 | audio:not([controls]) { 212 | display: none; 213 | height: 0; 214 | } 215 | 216 | /** 217 | * Remove the border on images inside links in IE 10-. 218 | */ 219 | 220 | img { 221 | border-style: none; 222 | } 223 | 224 | /** 225 | * Hide the overflow in IE. 226 | */ 227 | 228 | svg:not(:root) { 229 | overflow: hidden; 230 | } 231 | 232 | /* Forms 233 | ========================================================================== */ 234 | 235 | /** 236 | * 1. Change the font styles in all browsers (opinionated). 237 | * 2. Remove the margin in Firefox and Safari. 238 | */ 239 | 240 | button, 241 | input, 242 | optgroup, 243 | select, 244 | textarea { 245 | font-family: sans-serif; /* 1 */ 246 | font-size: 100%; /* 1 */ 247 | line-height: 1.15; /* 1 */ 248 | margin: 0; /* 2 */ 249 | } 250 | 251 | /** 252 | * Show the overflow in IE. 253 | * 1. Show the overflow in Edge. 254 | */ 255 | 256 | button, 257 | input { /* 1 */ 258 | overflow: visible; 259 | } 260 | 261 | /** 262 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 263 | * 1. Remove the inheritance of text transform in Firefox. 264 | */ 265 | 266 | button, 267 | select { /* 1 */ 268 | text-transform: none; 269 | } 270 | 271 | /** 272 | * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` 273 | * controls in Android 4. 274 | * 2. Correct the inability to style clickable types in iOS and Safari. 275 | */ 276 | 277 | button, 278 | html [type="button"], /* 1 */ 279 | [type="reset"], 280 | [type="submit"] { 281 | -webkit-appearance: button; /* 2 */ 282 | } 283 | 284 | /** 285 | * Remove the inner border and padding in Firefox. 286 | */ 287 | 288 | button::-moz-focus-inner, 289 | [type="button"]::-moz-focus-inner, 290 | [type="reset"]::-moz-focus-inner, 291 | [type="submit"]::-moz-focus-inner { 292 | border-style: none; 293 | padding: 0; 294 | } 295 | 296 | /** 297 | * Restore the focus styles unset by the previous rule. 298 | */ 299 | 300 | button:-moz-focusring, 301 | [type="button"]:-moz-focusring, 302 | [type="reset"]:-moz-focusring, 303 | [type="submit"]:-moz-focusring { 304 | outline: 1px dotted ButtonText; 305 | } 306 | 307 | /** 308 | * Correct the padding in Firefox. 309 | */ 310 | 311 | fieldset { 312 | padding: 0.35em 0.75em 0.625em; 313 | } 314 | 315 | /** 316 | * 1. Correct the text wrapping in Edge and IE. 317 | * 2. Correct the color inheritance from `fieldset` elements in IE. 318 | * 3. Remove the padding so developers are not caught out when they zero out 319 | * `fieldset` elements in all browsers. 320 | */ 321 | 322 | legend { 323 | box-sizing: border-box; /* 1 */ 324 | color: inherit; /* 2 */ 325 | display: table; /* 1 */ 326 | max-width: 100%; /* 1 */ 327 | padding: 0; /* 3 */ 328 | white-space: normal; /* 1 */ 329 | } 330 | 331 | /** 332 | * 1. Add the correct display in IE 9-. 333 | * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. 334 | */ 335 | 336 | progress { 337 | display: inline-block; /* 1 */ 338 | vertical-align: baseline; /* 2 */ 339 | } 340 | 341 | /** 342 | * Remove the default vertical scrollbar in IE. 343 | */ 344 | 345 | textarea { 346 | overflow: auto; 347 | } 348 | 349 | /** 350 | * 1. Add the correct box sizing in IE 10-. 351 | * 2. Remove the padding in IE 10-. 352 | */ 353 | 354 | [type="checkbox"], 355 | [type="radio"] { 356 | box-sizing: border-box; /* 1 */ 357 | padding: 0; /* 2 */ 358 | } 359 | 360 | /** 361 | * Correct the cursor style of increment and decrement buttons in Chrome. 362 | */ 363 | 364 | [type="number"]::-webkit-inner-spin-button, 365 | [type="number"]::-webkit-outer-spin-button { 366 | height: auto; 367 | } 368 | 369 | /** 370 | * 1. Correct the odd appearance in Chrome and Safari. 371 | * 2. Correct the outline style in Safari. 372 | */ 373 | 374 | [type="search"] { 375 | -webkit-appearance: textfield; /* 1 */ 376 | outline-offset: -2px; /* 2 */ 377 | } 378 | 379 | /** 380 | * Remove the inner padding and cancel buttons in Chrome and Safari on macOS. 381 | */ 382 | 383 | [type="search"]::-webkit-search-cancel-button, 384 | [type="search"]::-webkit-search-decoration { 385 | -webkit-appearance: none; 386 | } 387 | 388 | /** 389 | * 1. Correct the inability to style clickable types in iOS and Safari. 390 | * 2. Change font properties to `inherit` in Safari. 391 | */ 392 | 393 | ::-webkit-file-upload-button { 394 | -webkit-appearance: button; /* 1 */ 395 | font: inherit; /* 2 */ 396 | } 397 | 398 | /* Interactive 399 | ========================================================================== */ 400 | 401 | /* 402 | * Add the correct display in IE 9-. 403 | * 1. Add the correct display in Edge, IE, and Firefox. 404 | */ 405 | 406 | details, /* 1 */ 407 | menu { 408 | display: block; 409 | } 410 | 411 | /* 412 | * Add the correct display in all browsers. 413 | */ 414 | 415 | summary { 416 | display: list-item; 417 | } 418 | 419 | /* Scripting 420 | ========================================================================== */ 421 | 422 | /** 423 | * Add the correct display in IE 9-. 424 | */ 425 | 426 | canvas { 427 | display: inline-block; 428 | } 429 | 430 | /** 431 | * Add the correct display in IE. 432 | */ 433 | 434 | template { 435 | display: none; 436 | } 437 | 438 | /* Hidden 439 | ========================================================================== */ 440 | 441 | /** 442 | * Add the correct display in IE 10-. 443 | */ 444 | 445 | [hidden] { 446 | display: none; 447 | } 448 | --------------------------------------------------------------------------------