0
0
Fork 0

Focal points (#6520)

* Add focus param to media API, center thumbnails on focus point

* Add UI for setting a focal point

* Improve focal point icon on upload item

* Use focal point in upload preview

* Add focalPoint property to ActivityPub

* Don't show focal point button for non-image attachments
This commit is contained in:
Eugen Rochko 2018-02-22 00:35:46 +01:00 committed by GitHub
parent d3a62d2637
commit 90f12f2e5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 307 additions and 30 deletions

View file

@ -433,6 +433,34 @@
min-width: 40%;
margin: 5px;
&__actions {
background: linear-gradient(180deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent);
display: flex;
align-items: flex-start;
justify-content: space-between;
opacity: 0;
transition: opacity .1s ease;
.icon-button {
flex: 0 1 auto;
color: $ui-secondary-color;
font-size: 14px;
font-weight: 500;
padding: 10px;
font-family: inherit;
&:hover,
&:focus,
&:active {
color: lighten($ui-secondary-color, 4%);
}
}
&.active {
opacity: 1;
}
}
&-description {
position: absolute;
z-index: 2;
@ -470,10 +498,6 @@
opacity: 1;
}
}
.icon-button {
mix-blend-mode: difference;
}
}
.compose-form__upload-thumbnail {
@ -481,8 +505,9 @@
background-position: center;
background-size: cover;
background-repeat: no-repeat;
height: 100px;
height: 140px;
width: 100%;
overflow: hidden;
}
}
@ -4133,8 +4158,12 @@ a.status-card {
&,
img {
width: 100%;
height: 100%;
}
img {
position: relative;
object-fit: cover;
height: auto;
}
}
@ -4842,3 +4871,31 @@ noscript {
margin-bottom: 0;
}
}
.focal-point {
position: relative;
cursor: pointer;
overflow: hidden;
&.dragging {
cursor: move;
}
&__reticle {
position: absolute;
width: 100px;
height: 100px;
transform: translate(-50%, -50%);
background: url('../images/reticle.png') no-repeat 0 0;
border-radius: 50%;
box-shadow: 0 0 0 9999em rgba($base-shadow-color, 0.35);
}
&__overlay {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
}