Skip to content

Commit 4028fc9

Browse files
committed
Squashed commit of the following:
commit 03e8dbf Author: Alex <theunknownartisthour@gmail.com> Date: Wed Oct 19 22:04:00 2016 -0700 Run comparison on images for orientation Switch classes based on width and height commit e460515 Author: Alex <theunknownartisthour@gmail.com> Date: Wed Oct 19 21:23:24 2016 -0700 Add minds-img-landscape and minds-img-portrait Add scss stylings for archive view commit 9bb99f5 Author: Alex <theunknownartisthour@gmail.com> Date: Wed Oct 19 19:44:25 2016 -0700 Resize images in archive view Pure css scaling in browsers w/ polyfill support.
1 parent 59e096a commit 4028fc9

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

plugins/archive/app/archive.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,20 @@ minds-archive-theatre{
6464
left: 0;
6565
bottom: 0;
6666
right: 0;
67-
67+
.minds-img-landscape{
68+
img{
69+
width: 100%;
70+
height: auto;
71+
}
72+
}
73+
.minds-img-portrait{
74+
img{
75+
height: 100%;
76+
width: auto;
77+
}
78+
}
6879
img{
69-
max-width:100%;
70-
height:100%;
80+
object-fit: contain;
7181
}
7282
minds-video{
7383
background:#000;

plugins/archive/app/view/views/theatre.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Material } from '../../../../directives/material';
1818
[hidden]="object.container_guid == object.owner_guid || !object.album_children_guids || object.album_children_guids.length <= 1">
1919
keyboard_arrow_left
2020
</i>
21-
<div class="minds-archive-stage" *ngIf="object.subtype == 'image'">
21+
<div class="minds-archive-stage" [ngClass]="{minds-image-landscape: orientation == 'landscape', minds-image-portrait: orientation == 'portrait'}" *ngIf="object.subtype == 'image'">
2222
<img src="/archive/thumbnail/{{object.guid}}/xlarge"/>
2323
</div>
2424
<div class="minds-archive-stage" *ngIf="object.subtype == 'video'">
@@ -44,6 +44,7 @@ import { Material } from '../../../../directives/material';
4444
export class ArchiveTheatre {
4545

4646
object: any = {};
47+
orientation: string;
4748
session = SessionFactory.build();
4849

4950
constructor(public client: Client, public router: Router){
@@ -53,6 +54,14 @@ export class ArchiveTheatre {
5354
if(!value.guid)
5455
return;
5556
this.object = value;
57+
if(this.object.subtype == 'image'){
58+
/*Check image's aspect ratio for landscape or l*/
59+
if(this.object.naturalWidth >= this.object.naturalHeight){
60+
this.orientation = 'landscape';
61+
} else {
62+
this.orientation = 'portrait';
63+
}
64+
}
5665
}
5766

5867
prev(){

0 commit comments

Comments
 (0)