[DEV] big rework in the display

This commit is contained in:
Edouard DUPIN 2020-02-10 23:52:27 +01:00
parent 1b412b84f6
commit af6a6fa9bb
27 changed files with 393 additions and 190 deletions

View File

@ -22,6 +22,7 @@
],
"styles": [
"src/styles.less",
"src/generic_page.less",
"src/theme.color.blue.less",
"src/theme.checkbox.less",
"src/theme.modal.less"
@ -75,6 +76,7 @@
"scripts": [],
"styles": [
"src/styles.less",
"src/generic_page.less",
"src/theme.color.blue.less",
"src/theme.checkbox.less",
"src/theme.modal.less"

View File

@ -1,5 +1,5 @@
<div>
<div class="imgContainer">
<div class="imgContainer-small">
<div *ngIf="cover">
<img src="{{cover}}"/>
</div>
@ -7,11 +7,11 @@
</div>
</div>
<div class="title">
<div class="title-small">
{{name}}
</div>
<!--
<div class="description" *ngIf="description">
<div class="description-small" *ngIf="description">
{{description}}
</div>
-->

View File

@ -1,5 +1,5 @@
.imgContainer {
.imgContainer-small {
text-align: center;
width: 200px;
margin: 0 auto;
@ -19,7 +19,7 @@
}
}
.title {
.title-small {
height: 40px;
width: 200px;
font-size: 17px;
@ -31,7 +31,7 @@
border-radius: 7px;
}
.description {
.description-small {
height: 30px;
font-size: 12px;
overflow:hidden;

View File

@ -1,12 +1,15 @@
<div class="imgContainer">
<div class="imgContainer-small">
<div *ngIf="cover">
<img src="{{cover}}"/>
</div>
<div *ngIf="!cover" class="noImage">
</div>
<div *ngIf="!cover" class="noImage">
</div>
</div>
<div class="saison">
<div class="saison-small">
Saison {{numberSaison}}
</div>
<div class="description-small" *ngIf="count">
{{count}} Episodes
</div>

View File

@ -1,37 +1,33 @@
.imgContainer {
.imgContainer-small {
text-align: center;
width: 200px;
margin: 0 auto;
height: 250px;
width: 100px;
margin: 4px 15px 4px 10px;
height: 100px;
img {
//width: 100%;
max-height: 250px;
max-width: 200px;
max-height: 100px;
max-width: 100px;
}
.noImage {
height: 245px;
width: 195px;
height: 95px;
width: 95px;
//box-shadow: 0px 2px 4px 0 rgba(0, 0, 0, 0.7);
border: solid 1px;
border-color: rgba(0, 0, 0, 0.7);
margin: auto;
}
float: left;
}
.title {
.title-small {
height: 40px;
width: 200px;
font-size: 17px;
overflow:hidden;
//width: 100%;
font-size: 28px;
display:inline-block;
text-align: center;
padding:auto;
background: rgba(256, 256, 256, 0.3);
border-radius: 7px;
font-weight: bold;
}
.description {
.description-small {
height: 30px;
font-size: 12px;
overflow:hidden;

View File

@ -22,10 +22,12 @@ export class ElementSaisonComponent implements OnInit {
// input parameters
@Input() id_saison:number = -1;
error:string = ""
numberSaison:number = -1
error:string = "";
numberSaison:number = -1;
count:number = null;
cover:string = "";
covers:Array<string> = [];
description:string = "";
constructor(private router: Router,
private saisonService: SaisonService) {
@ -37,7 +39,8 @@ export class ElementSaisonComponent implements OnInit {
this.saisonService.get(this.id_saison)
.then(function(response) {
self.error = "";
self.numberSaison = response.number
self.numberSaison = response.number;
self.description = response.description;
if (response.covers == undefined || response.covers == null || response.covers.length == 0) {
self.cover = null;
//self.covers = [];
@ -52,6 +55,13 @@ export class ElementSaisonComponent implements OnInit {
self.numberSaison = -1
self.cover = null;
self.covers = [];
self.description = "";
});
this.saisonService.countVideo(this.id_saison)
.then(function(response) {
self.count = response;
}).catch(function(response) {
self.count = null;
});
}
}

View File

@ -1,13 +1,13 @@
<div>
<div class="imgContainer">
<div class="imgContainer-small">
<div *ngIf="imageSource">
<img src="{{imageSource}}" alt="type image" class="miniature"/>
<img src="{{imageSource}}" alt="type image" class="miniature-small"/>
</div>
</div>
<div class="title">
<div class="title-small">
{{name}}
</div>
<div class="description" *ngIf="description">
<div class="description-small" *ngIf="description">
{{description}}
</div>
</div>

View File

@ -1,25 +1,25 @@
.imgContainer {
.imgContainer-small {
text-align: center;
margin: 15px 0 0 0;
}
img.miniature {
img.miniature-small {
width: 80px;
height: 80px;
//border-radius: 50%;
}
.title {
.title-small {
height: 60px;
font-size: 24px;
overflow:hidden;
vertical-align: middle;
}
.description {
.description-small {
height: 30px;
font-size: 12px;
overflow:hidden;

View File

@ -1,5 +1,5 @@
<div>
<div class="imgContainer">
<div class="videoImgContainer">
<div *ngIf="cover">
<img src="{{cover}}"/>
</div>
@ -7,11 +7,11 @@
</div>
</div>
<div class="title">
<div class="title-small">
{{episode_display}} {{name}}
</div>
<!--
<div class="description" *ngIf="description">
<div class="description-small" *ngIf="description">
{{description}}
</div>
-->

View File

@ -1,5 +1,5 @@
.imgContainer {
.videoImgContainer {
text-align: center;
width: 200px;
margin: 0 auto;
@ -19,7 +19,7 @@
}
}
.title {
.title-small {
height: 40px;
width: 200px;
font-size: 17px;
@ -31,7 +31,7 @@
border-radius: 7px;
}
.description {
.description-small {
height: 30px;
font-size: 12px;
overflow:hidden;

View File

@ -1,12 +1,25 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of saisons" class="item" (click)="onSelectSaison($event, data)" (auxclick)="onSelectSaison($event, data)">
<div class="generic-page">
<div class="title">
{{name}}
</div>
<div class="cover" *ngIf="cover != null" >
<img src="{{cover}}"/>
</div>
<div class="description" *ngIf="description">
{{description}}
</div>
<div class="fill-all colomn_mutiple" *ngIf="saisons.length != 0">
<div class="sub-title">Saisons:</div>
<div *ngFor="let data of saisons" class="item-list" (click)="onSelectSaison($event, data)" (auxclick)="onSelectSaison($event, data)">
<app-element-saison [id_saison]="data"></app-element-saison>
</div>
<div class="clear"></div>
</div>
<div class="fill-all">
<div class="fill-all colomn_mutiple" *ngIf="videos.length != 0">
<div class="sub-title">Videos:</div>
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
<div class="clear"></div>
</div>
</div>

View File

@ -1,33 +0,0 @@
.item {
font-size: 20px;
padding: 1px;
height: 290px;
width: 200px;
margin: 5px;
padding: 0;
overflow: hidden;
line-height: normal;
border: none;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 500;
will-change: box-shadow;
outline: none;
cursor: pointer;
transition-duration: 0.4s;
float:left;
display:block;
&:hover {
box-shadow: 2px 2px 4px 3px rgba(0, 0, 0, 0.7);
}
.material-icons {
vertical-align: middle;
}
.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: ~"translate(-12px,-12px)";
line-height: 24px;
width: 24px;
}
}

View File

@ -25,10 +25,14 @@ export class GroupComponent implements OnInit {
//id_type = -1;
//id_univers = -1;
id_group = -1;
saisons_error = "";
saisons = [];
videos_error = "";
videos = [];
name: string = "";
description: string = "";
cover: string = ""
covers: Array<string> = []
saisons_error: string = "";
saisons: Array<number> = [];
videos_error: string = "";
videos: Array<number> = [];
constructor(private route: ActivatedRoute,
private router: Router,
private locate: Location,
@ -43,6 +47,25 @@ export class GroupComponent implements OnInit {
this.id_group = parseInt(this.route.snapshot.paramMap.get('group_id'));
console.log
let self = this;
this.groupService.get(this.id_group)
.then(function(response) {
self.name = response.name;
self.description = response.description;
if (response.covers == undefined || response.covers == null || response.covers.length == 0) {
self.cover = null;
self.covers = [];
} else {
self.cover = self.groupService.getCoverUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.groupService.getCoverUrl(response.covers[iii]));
}
}
}).catch(function(response) {
self.description = "";
self.name = "???";
self.cover = null;
self.covers = [];
});
console.log("get parameter id: " + this.id_group);
this.groupService.getSaison(this.id_group)
.then(function(response) {

View File

@ -1,7 +1,11 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of data_list" class="item" (click)="onSelectType($event, data.id)" (auxclick)="onSelectType($event, data.id)">
<div class="generic-page">
<div class="title">
Karideo
</div>
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of data_list" class="item-home" (click)="onSelectType($event, data.id)" (auxclick)="onSelectType($event, data.id)">
<app-element-type [id_type]="data.id"></app-element-type>
</div>
<div class="clear"></div>
</div>
</div>

View File

@ -1,18 +1,10 @@
.fill-all{
width:100%;
height:100%;
margin:0;
padding:0;
border:0;
background-color:#0F0;
}
.item {
.item-home {
background-color: rgba(200, 200, 200, 0.5);
font-size: 20px;
height: 190px;
width: 200px;
margin: 1%;
margin: 5px;
padding: 0;
overflow: hidden;
// box-shadow: 0 1px 1.5px 0 rgba(0,0,0,.12),0 1px 1px 0 rgba(0,0,0,.24);

View File

@ -1,7 +1,20 @@
<div class="main-reduce">
<div class="fill-all">
<div class="generic-page">
<div *ngIf="group_name" class="title">
{{group_name}}
</div>
<div class="sub-title-main">
Saison {{name}}
</div>
<div class="cover" *ngIf="cover != null" >
<img src="{{cover}}"/>
</div>
<div class="description" *ngIf="description">
{{description}}
</div>
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
<div class="clear"></div>
</div>
</div>

View File

@ -1,33 +0,0 @@
.item {
font-size: 20px;
padding: 1px;
height: 290px;
width: 200px;
margin: 5px;
padding: 0;
overflow: hidden;
line-height: normal;
border: none;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 500;
will-change: box-shadow;
outline: none;
cursor: pointer;
transition-duration: 0.4s;
float:left;
display:block;
&:hover {
box-shadow: 2px 2px 4px 3px rgba(0, 0, 0, 0.7);
}
.material-icons {
vertical-align: middle;
}
.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: ~"translate(-12px,-12px)";
line-height: 24px;
width: 24px;
}
}

View File

@ -10,6 +10,7 @@ import { Location } from '@angular/common';
import { fadeInAnimation } from '../../_animations/index';
import { SaisonService } from '../../service/saison.service';
import { GroupService } from '../../service/group.service';
import { ArianeService } from '../../service/ariane.service';
import { environment } from 'environments/environment';
@ -22,6 +23,12 @@ import { environment } from 'environments/environment';
})
export class SaisonComponent implements OnInit {
name: string = "";
group_name: string = "";
description: string = "";
group_id: number = null;
cover: string = ""
covers: Array<string> = []
id_saison = -1;
videos_error = "";
videos = [];
@ -29,6 +36,7 @@ export class SaisonComponent implements OnInit {
private router: Router,
private locate: Location,
private saisonService: SaisonService,
private groupService: GroupService,
private arianeService: ArianeService) {
}
@ -37,6 +45,34 @@ export class SaisonComponent implements OnInit {
this.id_saison = parseInt(this.route.snapshot.paramMap.get('saison_id'));
this.arianeService.setSaison(this.id_saison);
let self = this;
this.saisonService.get(this.id_saison)
.then(function(response) {
self.name = response.number;
self.group_id = response.group_id;
self.description = response.description;
if (response.covers == undefined || response.covers == null || response.covers.length == 0) {
self.cover = null;
self.covers = [];
} else {
self.cover = self.groupService.getCoverUrl(response.covers[0]);
for (let iii=0; iii<response.covers.length; iii++) {
self.covers.push(self.groupService.getCoverUrl(response.covers[iii]));
}
}
self.groupService.get(self.group_id)
.then(function(response) {
self.group_name = response.name;
}).catch(function(response) {
self.group_name = "";
});
}).catch(function(response) {
self.description = "";
self.name = "???";
self.group_name = "";
self.group_id = null;
self.cover = null;
self.covers = [];
});
console.log("get parameter id: " + this.id_saison);
this.saisonService.getVideo(this.id_saison)
.then(function(response) {

View File

@ -1,11 +1,23 @@
<div class="main-reduce">
<div class="generic-page">
<div class="title">
{{name}}
</div>
<div class="cover" *ngIf="cover != null" >
<img src="{{cover}}"/>
</div>
<div class="description" *ngIf="description">
{{description}}
</div>
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of groups" class="item" (click)="onSelectGroup($event, data)" (auxclick)="onSelectGroup($event, data)">
<app-element-group [id_type]="type_id" [id_group]="data"></app-element-group>
</div>
<div class="clear"></div>
</div>
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
<div class="clear"></div>
</div>
</div>

View File

@ -1,47 +0,0 @@
.fill-all333{
//margin-left:width/210px/2;
//*-justify-content: center;
//align:center;
background:red;
width:calc(100% / 210px*3);
height:100%;
margin:0;
padding:0;
border:0;
background-color:red;
}
.item {
font-size: 20px;
padding: 1px;
height: 290px;
width: 200px;
margin: 5px;
padding: 0;
overflow: hidden;
line-height: normal;
border: none;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 500;
will-change: box-shadow;
outline: none;
cursor: pointer;
transition-duration: 0.4s;
float:left;
display:block;
&:hover {
box-shadow: 2px 2px 4px 3px rgba(0, 0, 0, 0.7);
}
.material-icons {
vertical-align: middle;
}
.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: ~"translate(-12px,-12px)";
line-height: 24px;
width: 24px;
}
}

View File

@ -23,6 +23,8 @@ import { environment } from 'environments/environment';
export class TypeComponent implements OnInit {
type_id = -1;
name: string = "";
description: string = "";
groups_error = "";
groups = [];
videos_error = "";
@ -46,6 +48,14 @@ export class TypeComponent implements OnInit {
this.type_id = parseInt(this.route.snapshot.paramMap.get('type_id'));
let self = this;
console.log("get parameter id: " + this.type_id);
this.typeService.get(this.type_id)
.then(function(response) {
self.name = response.name;
self.description = response.description;
}).catch(function(response) {
self.name = "???";
self.description = "";
});
this.typeService.getSubGroup(this.type_id)
.then(function(response) {
self.groups_error = "";

View File

@ -1,7 +1,8 @@
<div class="main-reduce">
<div class="fill-all">
<div class="generic-page">
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
<div class="clear"></div>
</div>
</div>

View File

@ -66,7 +66,7 @@ export class GroupService {
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then(function(response) {
let data = response.gets_where([["==", "group_id", _id], ["==", "saison_id", null]], ["id"], ["name"])
let data = response.gets_where([["==", "group_id", _id], ["==", "saison_id", null]], ["id"], ["episode", "name"])
resolve(data);
}).catch(function(response) {
reject(response);

View File

@ -50,6 +50,21 @@ export class SaisonService {
});
});
};
countVideo(_id:number):any {
if (environment.localBdd != true) {
return this.http.get_specific(this.serviceName, _id, "video");
}
let self = this;
return new Promise((resolve, reject) => {
self.bdd.getVideo()
.then(function(response) {
let data = response.gets_where([["==", "saison_id", _id]], ["id"], ["episode", "name"])
resolve(data.length);
}).catch(function(response) {
reject(response);
});
});
};
put(_id:number, _data:any):any {
let ret = this.http.put_specific(this.serviceName, _id, _data);
if (environment.localBdd != true) {

View File

@ -4,7 +4,7 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false,
production: true,
// URL of development API
apiUrl: 'http://192.168.1.157/karideo/api',
frontBaseUrl: 'karideo',

127
front/src/generic_page.less Normal file
View File

@ -0,0 +1,127 @@
.generic-page {
.title {
//background-color: green;
font-size: 45px;
font-weight: bold;
line-height: 60px;
width:100%;
align: center;
height: 50px;
text-align: center;
vertical-align: middle;
margin: 10px 0 10px 0;
text-shadow: 1px 1px 2px white, 0 0 1em white, 0 0 0.2em white;
text-transform: uppercase;
font-family: "Roboto","Helvetica","Arial",sans-serif;
}
.sub-title-main {
font-size: 33px;
font-weight: bold;
line-height: 40px;
width:100%;
align: center;
height: 40px;
text-align: center;
vertical-align: middle;
margin: 10px 0 10px 0;
font-family: "Roboto","Helvetica","Arial",sans-serif;
}
.sub-title {
font-size: 33px;
font-weight: bold;
line-height: 40px;
width:100%;
align: left;
height: 40px;
text-align: left;
vertical-align: middle;
margin: 10px 0 10px 0;
font-family: "Roboto","Helvetica","Arial",sans-serif;
}
.cover {
width: 30%;
margin: 0 auto;
img {
width: 100%;
}
}
.description {
//background-color: orange;
font-size: 24px;
width: ~"calc(100% - 40px * 2 - 14px * 2)";
text-align: left;
vertical-align: middle;
margin: 0 40px 10px 40px;
background: rgba(256, 256, 256, 0.3);
border-radius: 7px;
padding: 14px;
font-family: "Roboto","Helvetica","Arial",sans-serif;
}
.item {
font-size: 20px;
padding: 1px;
height: 290px;
width: 200px;
margin: 5px;
padding: 0;
overflow: hidden;
line-height: normal;
border: none;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 500;
will-change: box-shadow;
outline: none;
cursor: pointer;
transition-duration: 0.4s;
float:left;
//display:inline;
&:hover {
box-shadow: 2px 2px 4px 3px rgba(0, 0, 0, 0.7);
}
.material-icons {
vertical-align: middle;
}
.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: ~"translate(-12px,-12px)";
line-height: 24px;
width: 24px;
}
}
.item-list {
font-size: 20px;
padding: 1px;
height: 110px;
width: 80%;
margin: 5px auto 5px auto;
padding: 5px;
overflow: hidden;
line-height: normal;
border: none;
font-family: "Roboto","Helvetica","Arial",sans-serif;
font-weight: 500;
will-change: box-shadow;
outline: none;
cursor: pointer;
background: rgba(256, 256, 256, 0.3);
border-radius: 7px;
.material-icons {
vertical-align: middle;
}
.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: ~"translate(-12px,-12px)";
line-height: 24px;
width: 24px;
}
}
}

View File

@ -19,6 +19,65 @@
.xmobile{display:block;}
}
@media all and (min-width: 1520px) {
.colomn_mutiple {
width: ~"calc(210px * 7)";
margin: auto;
//height: 20px;
//background-color: red;
}
}
@media all and (min-width: 1310px) and (max-width: 1520px) {
.colomn_mutiple {
width: ~"calc(210px * 6)";
margin: auto;
//height: 20px;
//background-color: green;
}
}
@media all and (min-width: 1100px) and (max-width: 1310px) {
.colomn_mutiple {
width: ~"calc(210px * 5)";
margin: auto;
//height: 20px;
//background-color: blue;
}
}
@media all and (min-width: 890px) and (max-width: 1100px) {
.colomn_mutiple {
width: ~"calc(210px * 4)";
margin: auto;
//height: 20px;
//background-color: purple;
}
}
@media all and (min-width: 680px) and (max-width: 890px) {
.colomn_mutiple {
width: ~"calc(210px * 3)";
margin: auto;
//height: 20px;
//background-color: cyan;
}
}
@media all and (max-width: 680px) {
.colomn_mutiple {
width: ~"calc(210px * 2)";
margin: auto;
//height: 20px;
//background-color: red;
}
}
.clear {
clear: both;
text-align: center;
}
html {
font-size: 24px;