Skip to content

Commit

Permalink
v1.0.09
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Aug 31, 2022
1 parent 32e2854 commit 49964f9
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 11 deletions.
5 changes: 5 additions & 0 deletions Stream/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@
$sql[$count][0] = '1.0.08';
$sql[$count][1] = "
";

//v1.0.09
$sql[$count][0] = '1.0.09';
$sql[$count][1] = "
";
4 changes: 4 additions & 0 deletions Stream/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v1.0.09
-------
Changed the images in posts to a masonry-style layout

v1.0.08
-------
Tweaked the aspect ratio of images so less of the image is cropped
Expand Down
17 changes: 15 additions & 2 deletions Stream/css/module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,22 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
.columns-1 {
columns: 1;
}

@media (min-width:640px){
.sm\:h-80 {
height: 20rem;
.sm\:columns-2 {
columns: 2;
}
}

@media (min-width:1000px){
.lg\:columns-3 {
columns: 3;
}

.lg\:columns-4 {
columns: 4;
}
}
2 changes: 1 addition & 1 deletion Stream/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'stream.php';
$type = 'Additional';
$category = 'Other';
$version = '1.0.08';
$version = '1.0.09';
$author = 'Sanda Kuipers, Harry Merrett & Ross Parker';
$url = 'https://gibbonedu.org';

Expand Down
41 changes: 34 additions & 7 deletions Stream/templates/streamPosts.twig.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
For info about editing, see: https://twig.symfony.com/doc/2.x/
-->#}
{% for post in stream %}

<div class="flex bg-white p-4 sm:px-5 sm:py-6 font-sans border-b }}">

<aside class="w-8 sm:w-12 mr-3 sm:mr-4 ">
Expand All @@ -30,14 +31,25 @@
</div>

{% if post.attachments %}
<div class="image-container flex flex-wrap justify-start mt-2 -m-1">

{% if post.attachments|length == 1 %}
{% set postClass = 'columns-1' %}
{% elseif post.attachments|length % 2 == 0 %}
{% set postClass = post.attachments|length > 6 ? 'columns-1 sm:columns-2 lg:columns-4' : 'columns-1 sm:columns-2' %}
{% else %}
{% set postClass = post.attachments|length > 6 ? 'columns-1 sm:columns-2 lg:columns-3' : 'columns-1 sm:columns-2' %}
{% endif %}

<div class="image-container mt-6 {{ postClass }}" style="column-fill: balance;">
{% for attachment in post.attachments %}
<figure class="{{ loop.length % 3 == 0 ? 'w-1/3 h-32 sm:h-56' : loop.length % 2 == 1 and loop.index == 1 ? 'w-full h-40 sm:h-80' : 'w-1/2 h-32 sm:h-56' }} p-1" style="line-height: 0;">

{% if attachment.type == 'Image' %}
<a class="block w-full h-full rounded-sm overflow-hidden bg-no-repeat bg-cover bg-center" href="{{ absoluteURL }}/{{ attachment.attachment }}" data-caption="{{ post.post|striptags }}" style="background-image:url('{{ absoluteURL }}/{{ attachment.thumbnail }}')">
</a>
<a class="block w-full h-full" href="{{ absoluteURL }}/{{ attachment.attachment }}" data-caption="{{ post.post|striptags }}">

<img class="image-item w-full rounded-sm mb-3" src="{{ absoluteURL }}/{{ attachment.attachment }}" data-caption="{{ post.post|striptags }}" style="break-inside: avoid;">
</a>
{% endif %}
</figure>

{% endfor %}

</div>
Expand All @@ -49,9 +61,24 @@
</div>
{% endfor %}
<style>
.columns-1 {
columns: 1;
}

@media (min-width:640px){
.sm\:h-80 {
height: 20rem;
.sm\:columns-2 {
columns: 2;
}
}

@media (min-width:1000px){
.lg\:columns-3 {
columns: 3;
}

.lg\:columns-4 {
columns: 4;
}
}

</style>
2 changes: 1 addition & 1 deletion Stream/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
/**
* Sets version information.
*/
$moduleVersion = '1.0.08';
$moduleVersion = '1.0.09';

0 comments on commit 49964f9

Please sign in to comment.