Commit 21c0e06f authored by 神楽坂玲奈's avatar 神楽坂玲奈

社区热帖

parent b5d2229e
...@@ -64,14 +64,10 @@ md-card-content { ...@@ -64,14 +64,10 @@ md-card-content {
[md-card-avatar] { [md-card-avatar] {
width: 128px; width: 128px;
height: 72px; height: 72px;
background-size: cover; object-fit: cover;
border-radius: initial; border-radius: initial;
} }
#avatar {
background-size: cover;
}
[fontSet] { [fontSet] {
font-size: 24px; font-size: 24px;
} }
......
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
<md-icon>remove_red_eye</md-icon> <md-icon>remove_red_eye</md-icon>
<br>观战</a></md-grid-tile> <br>观战</a></md-grid-tile>
<!--<md-grid-tile>--> <!--<md-grid-tile>-->
<!--<button md-raised-button (click)="ygopro.watch_replay()">--> <!--<button md-raised-button (click)="ygopro.watch_replay()">-->
<!--<md-icon>history</md-icon>--> <!--<md-icon>history</md-icon>-->
<!--<br>观看录像--> <!--<br>观看录像-->
<!--</button>--> <!--</button>-->
<!--</md-grid-tile>--> <!--</md-grid-tile>-->
<md-grid-tile> <md-grid-tile>
<button md-raised-button (click)="ygopro.edit_deck()"> <button md-raised-button (click)="ygopro.edit_deck()">
...@@ -78,14 +78,38 @@ ...@@ -78,14 +78,38 @@
<md-card *ngFor="let item of ygopro.news" class="example-card"> <md-card *ngFor="let item of ygopro.news" class="example-card">
<a [href]="item.url" target="_blank"> <a [href]="item.url" target="_blank">
<md-card-header> <md-card-header>
<div *ngIf="item.image" md-card-avatar [style.background-image]="'url(' + item.image + ')'"></div> <img *ngIf="item.image" md-card-avatar [src]="item.image">
<md-card-title>{{item.title}}</md-card-title> <md-card-title>{{item.title}}</md-card-title>
<md-card-subtitle>{{item.updated_at | date:"mediumDate"}}</md-card-subtitle> <md-card-subtitle>{{item.updated_at | date:"mediumDate"}}</md-card-subtitle>
</md-card-header> </md-card-header>
</a> </a>
</md-card>
<!--<md-card *ngFor="let item of ygopro.topics | async">-->
<!--<a [href]="item.url" target="_blank">-->
<!--<md-card-header>-->
<!--<img *ngIf="item.image_url" md-card-avatar [src]="item.image_url">-->
<!--<md-card-title>{{item.title}}</md-card-title>-->
<!--<md-card-subtitle>by {{item.last_poster_username}} / {{item.last_posted_at | date:"mediumDate"}}</md-card-subtitle>-->
<!--</md-card-header>-->
<!--</a>-->
<!---->
<!--<md-card-header>-->
<!--<img [src]="item.created_by.avatar_url" md-card-avatar class="example-header-image">-->
<!--<md-card-title>{{item.title}}</md-card-title>-->
<!--&lt;!&ndash;<md-card-subtitle>Dog Breed</md-card-subtitle>&ndash;&gt;-->
<!--</md-card-header>-->
<!--<img md-card-image [src]="item.image_url">-->
<!--<md-card-content>--> <!--<md-card-content>-->
<!--<img src="https://material.angular.io/assets/img/examples/shiba2.jpg">--> <!--&lt;!&ndash;<p [innerHTML]="item.description">&ndash;&gt;-->
<!--<p>{{item.text}}</p>--> <!--&lt;!&ndash;The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.&ndash;&gt;-->
<!--&lt;!&ndash;A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally&ndash;&gt;-->
<!--&lt;!&ndash;bred for hunting.&ndash;&gt;-->
<!--&lt;!&ndash;</p>&ndash;&gt;-->
<!--</md-card-content>--> <!--</md-card-content>-->
</md-card> <!--<md-card-actions>-->
<!--<button md-button>LIKE</button>-->
<!--<button md-button>SHARE</button>-->
<!--</md-card-actions>-->
<!--</md-card>-->
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { fromPairs } from 'lodash'; import { fromPairs } from 'lodash';
import { TextDecoder, TextEncoder } from 'text-encoding';
import { User } from './ygopro.service'; import { User } from './ygopro.service';
@Injectable() @Injectable()
......
...@@ -71,6 +71,7 @@ export class YGOProService { ...@@ -71,6 +71,7 @@ export class YGOProService {
news: News[]; news: News[];
windbot: string[]; windbot: string[];
topics: Observable<any>;
readonly default_options: Options = { readonly default_options: Options = {
mode: 1, mode: 1,
...@@ -110,6 +111,16 @@ export class YGOProService { ...@@ -110,6 +111,16 @@ export class YGOProService {
const app = apps.find(app => app.id === 'ygopro'); const app = apps.find(app => app.id === 'ygopro');
this.news = app.news['zh-CN']; this.news = app.news['zh-CN'];
this.windbot = (<YGOProData>app.data).windbot['zh-CN']; this.windbot = (<YGOProData>app.data).windbot['zh-CN'];
// this.topics = this.http.get('https://ygobbs.com/top.json').flatMap(response => promisify(parseString)(response.text())).map(doc => {
// console.log(doc['rss'].channel[0].item)
// return doc['rss'].channel[0].item;
// });
this.topics = this.http.get('https://ygobbs.com/top/quarterly.json').map(response => response.json().topic_list.topics.map(topic => ({
...topic,
url: new URL(`/t/${topic.slug}/${topic.id}`, 'https://ygobbs.com').toString(),
image_url: topic.image_url && new URL(topic.image_url, 'https://ygobbs.com').toString()
})));
} }
create_room(room: Room, host_password: string) { create_room(room: Room, host_password: string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment