socialnetworknews-web

A open-source Paper.li clone
git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-web.git
Log | Files | Refs | README | LICENSE

commit fd958941243711d9a924104a8a6e0ff39444b52a
parent 4076a8f8bccd7e63f1d247841b39b44aadfb5776
Author: MTRNord <mtrnord1@gmail.com>
Date:   Mon,  2 Apr 2018 18:37:39 +0200

Cleanup code

Diffstat:
Msrc/app/app.component.scss | 91-------------------------------------------------------------------------------
Msrc/app/app.module.ts | 2--
Dsrc/app/card/card.component.html | 36------------------------------------
Dsrc/app/card/card.component.scss | 133-------------------------------------------------------------------------------
Dsrc/app/card/card.component.spec.ts | 25-------------------------
Dsrc/app/card/card.component.ts | 36------------------------------------
Msrc/app/main/main.component.html | 4++--
Msrc/app/main/main.component.scss | 12++++++++++++
Msrc/index.html | 3+--
Msrc/styles.scss | 16++++------------
10 files changed, 19 insertions(+), 339 deletions(-)

diff --git a/src/app/app.component.scss b/src/app/app.component.scss @@ -88,94 +88,3 @@ nav { justify-content: space-between; } } - -/* -a { - text-decoration: none; - color: inherit; -} - -/* HEADER *//* -header { - position: fixed; - left: 0; - right: 0; - top: 0; - height: 66px; - - line-height: 66px; - color: #fff; - - background-color: $header-bg; - z-index: 10000; -} - -.header__logo { - font-weight: 700; - padding: 0 25px; - float: left; -} - -/* MENU *//* -.menu { - float: left; - - a { - padding: 0 10px; - } - - a:hover { - color: #c5cae9; - } -} - -/* RESPONSIVE *//* -@media only screen and (max-width: 768px) { - header { - position: static; - } - - .header__icon { - position: relative; - display: block; - float: left; - width: 50px; - height: 66px; - - cursor: pointer; - - &:after { - content: ''; - position: absolute; - display: block; - width: 1rem; - height: 0; - top: 16px; - left: 15px; - } - } - - .menu { - position: absolute; - left: 0; - top: 0; - bottom: 0; - background-color: darken($header-bg, 5); - /* overflow-y: scroll; - -webkit-overflow-scrolling: touch;*/ -/* - width: $menu-width; - - transform: translateX($menu-width * -1); - a { - display: block; - height: 40px; - - text-align: center; - line-height: 40px; - - border-bottom: 1px solid $header-bg; - } - } -} -*/ diff --git a/src/app/app.module.ts b/src/app/app.module.ts @@ -22,7 +22,6 @@ import { ApiService } from './api.service'; import * as Raven from 'raven-js'; import {ToastrModule} from 'ngx-toastr'; -import { CardComponent } from './card/card.component'; import {NgHttpLoaderModule} from 'ng-http-loader/ng-http-loader.module'; import {Lightbox} from './utils/lightbox'; import {LinkifyPipe} from './utils/linkifier'; @@ -54,7 +53,6 @@ export class RavenErrorHandler implements ErrorHandler { TweetListComponent, PapersListComponent, SpinnerComponent, - CardComponent, LinkifyPipe, LoginComponent, CallbackTwitterComponent, diff --git a/src/app/card/card.component.html b/src/app/card/card.component.html @@ -1,36 +0,0 @@ -<article> - <div class="ribbon ribbon-top-left" *ngIf="retweet == true" style="max-width: 22rem"> - <span> - <i class="fa fa-retweet"></i> - </span> - </div> - <!--<a href="{{item.tweet_link}}">--> - <div style="z-index: 2;"> - <a (click)="goTo(lightboxItem)" > - <img *ngIf="image" [src]="image" class="thumbnail"> - </a> - - <!-- lightbox container hidden with CSS --> - <a (click)="hide(lightboxItem)" class="lightbox" #lightboxItem> - <div class="img-wrapper"> - <img *ngIf="image" [src]="image"> - </div> - </a> - - <div class="text"> - <h3 *ngIf="title && link"> - <a *ngIf="link" routerLink="{{link}}">{{title}}</a> - </h3> - <h3 *ngIf="title && !link"> - {{title}} - </h3> - <p *ngIf="text">{{text}}</p> - <ul *ngIf="created_at != null || favs != null || retweets != null"> - <li><i class="fa fa-clock-o">&nbsp;</i>{{created_at.toLocaleString()}}</li>&nbsp; - <li><i class="fa fa-heart">&nbsp;</i>{{favs.toLocaleString()}}</li>&nbsp; - <li><i class="fa fa-retweet">&nbsp;</i>{{retweets.toLocaleString()}}</li>&nbsp; - </ul> - </div> - </div> - <!--</a>--> -</article> diff --git a/src/app/card/card.component.scss b/src/app/card/card.component.scss @@ -1,133 +0,0 @@ -article { - border: 1px solid #ccc; - box-shadow: 2px 2px 6px 0 rgba(0,0,0,0.3); - text-align: center; - position: relative; -} -.thumbnail { - max-width: 100%; - display: block; -} - -article > div > not(.card-ribbon){ - position: relative; - display: inline-block; -/* if you need ie6/7 support */ - *display: inline; - zoom: 1; -} - -.text { - padding: 0 20px 0 20px; -} -.text > ul { - padding: 10px; - text-align: center; - margin-bottom: 0; - font-size: .9rem; - width: 100%; - li { - display: inline; - } -} - - -/* Made by https://codepen.io/gschier/pen/HCoqh */ - -.lightbox { - /** Default lightbox to hidden */ - display: none; - - /** Position and style */ - position: fixed; - z-index: 999; - width: 100%; - height: 100%; - text-align: center; - top: 0; - left: 0; - background: rgba(0,0,0,0.8); -} - -.lightbox > .img-wrapper { - width: 50%; - height: 50%; - overflow: auto; - margin: auto; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; -} - -.lightbox > .img-wrapper img { - /** Pad the lightbox image */ - max-width: 90%; - max-height: 80%; - //margin-top: 2%; - position: relative; -} - -.lightbox:target { - /** Remove default browser outline */ - outline: none; - - /** Unhide lightbox **/ - display: block; -} - -/* The ribbons by https://codepen.io/nxworld/pen/oLdoWb*/ -/* common */ -.ribbon { - width: 150px; - height: 150px; - overflow: hidden; - position: absolute; - z-index: 1; -} -.ribbon::before, -.ribbon::after { - position: absolute; - z-index: -1; - content: ''; - display: block; - border: 5px solid #2980b9; -} -.ribbon span { - position: absolute; - display: block; - width: 225px; - padding: 8px 0; - background-color: #1da1f2; - box-shadow: 0 5px 10px rgba(0,0,0,.1); - color: #fff; - font: 700 18px/1 'Lato', sans-serif; - text-shadow: 0 1px 1px rgba(0,0,0,.2); - text-transform: uppercase; - text-align: center; -} - -/* top left*/ -.ribbon-top-left { - top: -10px; - left: -10px; -} -.ribbon-top-left::before, -.ribbon-top-left::after { - border-top-color: transparent; - border-left-color: transparent; -} -.ribbon-top-left::before { - top: 0; - right: 17px; -} -.ribbon-top-left::after { - bottom: 17px; - left: 0; -} -.ribbon-top-left span { - right: -25px; - top: 30px; - transform: rotate(-45deg); -} diff --git a/src/app/card/card.component.spec.ts b/src/app/card/card.component.spec.ts @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CardComponent } from './card.component'; - -describe('CardComponent', () => { - let component: CardComponent; - let fixture: ComponentFixture<CardComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CardComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/card/card.component.ts b/src/app/card/card.component.ts @@ -1,36 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {NavigationEnd, Router} from '@angular/router'; - -@Component({ - selector: 'app-card', - templateUrl: './card.component.html', - styleUrls: ['./card.component.scss'] -}) -export class CardComponent { - @Input() title; - @Input() image; - @Input() link; - @Input() text; - @Input() retweet?; - @Input() retweets?; - @Input() favs?; - @Input() created_at?; - - currentUrl: string; - - constructor(private router: Router) { - router.events.subscribe((value) => { - if (value instanceof NavigationEnd ) { - this.currentUrl = value.url; - } - }); - } - - hide(el) { - el.style.display = ''; - } - - goTo(el): void { - el.style.display = 'block'; - } -} diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html @@ -13,10 +13,10 @@ --> <!--Main Layout--> -<main class="text-center py-5"> +<main> <div class="container"> - <p align="justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </main> diff --git a/src/app/main/main.component.scss b/src/app/main/main.component.scss @@ -0,0 +1,12 @@ +.container { + margin-left: auto; + margin-right: auto; + padding-left: 15px; + padding-right: 15px; +} + +@media (min-width: 992px) { + .container { + width: 970px; + } +} diff --git a/src/index.html b/src/index.html @@ -8,9 +8,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="manifest" href="/manifest.json" /> - <link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet"> </head> -<body style="font-family: 'Lora', serif !important;"> +<body> <app-root></app-root> </body> </html> diff --git a/src/styles.scss b/src/styles.scss @@ -1,17 +1,9 @@ /* You can add global styles to this file, and also import other style files */ -html { overflow:auto; } - +@import url('https://fonts.googleapis.com/css?family=Lora'); @import "~@angular/material/prebuilt-themes/indigo-pink.css"; -.container { - margin-left: auto; - margin-right: auto; - padding-left: 15px; - padding-right: 15px; -} +html { overflow:auto; } -@media (min-width: 992px) { - .container { - width: 970px; - } +html, body { + font-family: 'Lora', serif; }