Skip to content

Commit

Permalink
Merge branch 'feature/ken-burns' of https://github.com/damongolding/i…
Browse files Browse the repository at this point in the history
…mmich-kiosk into feature/ken-burns
  • Loading branch information
damongolding committed Oct 20, 2024
2 parents b131f22 + 537df27 commit c68d41f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/views_home.templ
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,27 @@ func imageSmartZoomKeyframes(zoomAmount int) string {
from {
transform: scale3d(1,1,1);
transform-origin: center;
object-position: center;
}
to {
transform: scale3d(%.2f,%.2f,%.2f);
transform-origin: inherit;
object-position: inherit;
}
}
@keyframes image-smart-zoom-out {
from {
transform: scale3d(%.2f,%.2f,%.2f);
transform-origin: inherit;
object-position: inherit;
}
to {
transform: scale3d(1,1,1);
transform-origin: center;
object-position: center;
}
}
</style>`, zoom, zoom, zoom, zoom, zoom, zoom)
Expand Down
1 change: 1 addition & 0 deletions views/views_image.templ
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ templ RenderImageWithContainFit(ImageData, imageFit string) {

css transformOrigin(value string) {
transform-origin: { value };
object-position: { value };
}

// smartZoom calculates the transform origin for an image based on detected faces.
Expand Down

0 comments on commit c68d41f

Please sign in to comment.