1
0
mirror of https://github.com/NicolasConstant/sengi synced 2025-01-22 06:34:24 +01:00

add open image link

This commit is contained in:
Nicolas Constant 2019-06-15 19:26:21 -04:00
parent 9feddaf819
commit 2e0f7cb5a5
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 47 additions and 14 deletions

View File

@ -1,5 +1,7 @@
<div class="media-viewer-canvas" (click)="close()"> <div class="media-viewer-canvas noselect">
<button class="media-viewer-canvas__close media-viewer-canvas__button" title="close"> <div class="background__close" (click)="close()"></div>
<button class="media-viewer-canvas__close media-viewer-canvas__button" title="close" (click)="close()">
<fa-icon [icon]="faTimes"></fa-icon> <fa-icon [icon]="faTimes"></fa-icon>
</button> </button>
@ -13,16 +15,17 @@
<fa-icon [icon]="faAngleRight"></fa-icon> <fa-icon [icon]="faAngleRight"></fa-icon>
</button> </button>
<div *ngFor="let att of attachments" class="media-viewer-canvas__attachement" [ngClass]="{ 'collapsed': currentIndex !== att.index }"> <div *ngFor="let att of attachments" class="media-viewer-canvas__attachement"
<img *ngIf="att.type === 'image'" [ngClass]="{ 'collapsed': currentIndex !== att.index }">
src="{{att.url}}" class="media-viewer-canvas__image" (click)="blockClick($event)" /> <a href="{{att.url}}" target="_blank" title="open image">
<img *ngIf="att.type === 'image'" src="{{att.url}}" class="media-viewer-canvas__image" />
</a>
<video *ngIf="att.type === 'gifv'" <video *ngIf="att.type === 'gifv'" class="media-viewer-canvas__image" role="application" loop autoplay>
class="media-viewer-canvas__image" role="application" loop autoplay (click)="blockClick($event)">
<source src="{{att.url}}" type="video/mp4"> <source src="{{att.url}}" type="video/mp4">
</video> </video>
<video *ngIf="att.type === 'video'" <video *ngIf="att.type === 'video'" class="media-viewer-canvas__image" role="application" loop autoplay
class="media-viewer-canvas__image" role="application" loop autoplay controls="controls" (click)="blockClick($event)"> controls="controls">
<source src="{{att.url}}" type="video/mp4"> <source src="{{att.url}}" type="video/mp4">
</video> </video>
</div> </div>

View File

@ -1,12 +1,13 @@
@import "variables"; @import "variables";
@import "commons";
@import "mixins"; @import "mixins";
.media-viewer-canvas { .media-viewer-canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.8); // background-color: rgba(0, 0, 0, 0.8);
overflow: hidden; overflow: hidden;
position: relative; position: relative;
&__button { &__button {
@include clearButton; @include clearButton;
@ -61,11 +62,13 @@
} }
&__attachement { &__attachement {
max-width: 100%; // max-width: 100%;
height: 100vh; // height: 100vh;
} }
&__image { &__image {
z-index: 10;
@media screen and (min-width: $screen-break) { @media screen and (min-width: $screen-break) {
max-width: 85%; max-width: 85%;
} }
@ -89,6 +92,16 @@
} }
} }
.background__close {
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
z-index: 0;
background-color: rgba(0, 0, 0, 0.8);
}
.collapsed { .collapsed {
height: 0; height: 0;
} }

View File

@ -1,7 +1,7 @@
.waiting-icon { .waiting-icon {
width: 40px; width: 40px;
display: block; display: block;
margin: 5px auto; margin: 5px auto;
} }
.flexcroll { .flexcroll {
@ -12,9 +12,11 @@
scrollbar-darkshadow-color: #08090d; scrollbar-darkshadow-color: #08090d;
scrollbar-track-color: #08090d; scrollbar-track-color: #08090d;
scrollbar-arrow-color: #08090d; scrollbar-arrow-color: #08090d;
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 7px; width: 7px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px; border-radius: 0px;
@ -35,4 +37,19 @@
width: 20px; width: 20px;
height: 20px; height: 20px;
vertical-align: middle; vertical-align: middle;
}
.noselect {
-webkit-touch-callout: none;
/* iOS Safari */
-webkit-user-select: none;
/* Safari */
-khtml-user-select: none;
/* Konqueror HTML */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
user-select: none;
/* Non-prefixed version, currently supported by Chrome and Opera */
} }