-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use flickity to display panoramas (#334)
* Flickity * style carousel * Update src/meshapi/templates/widgets/panorama_viewer.html Co-authored-by: james-otten <[email protected]> * Delete virtualbox address * pin flickity to 3.0.0 * Revert "pin flickity to 3.0.0" This reverts commit 52124a0. * Update panorama_viewer.html --------- Co-authored-by: james-otten <[email protected]>
- Loading branch information
1 parent
3f36769
commit b59a662
Showing
3 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.main-carousel { | ||
width:100%; | ||
min-height:fit-content; | ||
max-height:300px; | ||
} | ||
.carousel-cell { | ||
width: 100%; /* full width */ | ||
height: 200px; | ||
/* center images in cells with flexbox */ | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-right: 10px; | ||
} | ||
|
||
.carousel-cell img { | ||
display: block; | ||
} | ||
|
||
.no-panos { | ||
display:flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 5px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<div style='display:flex; flex-direction: row; width:100%; overflow-x:auto; max-height:300px; padding-left: 10px;'> | ||
{% for panorama in widget.value %} | ||
<a href="{{ panorama }}" target="_blank"><img src="{{ panorama }}" style="margin-right:10px"/></a> | ||
{% endfor %} | ||
<!--https://flickity.metafizzy.co/--> | ||
<!--integrity generated with https://www.srihash.org/--> | ||
<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js" integrity="sha384-6ma6pGRLjeu6PkX+yOaR0dUGt6OQl9evbv3H2kdLWwIXtUztaQrWUlbRBPVpDH4B" crossorigin="anonymous"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css"> | ||
|
||
<div class="main-carousel" data-flickity='{ "wrapAround": true }'> | ||
{% if widget.value|length == 0 %} | ||
<div class="no-panos"> | ||
<p>There are no panoramas.</p> | ||
</div> | ||
{% endif %} | ||
{% for panorama in widget.value %} | ||
<div class="carousel-cell"> | ||
<a href="{{ panorama }}" target="_blank"><img src="{{ panorama }}"/></a> | ||
</div> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters