Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.0.1 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: elemental-carousel
---

51 changes: 31 additions & 20 deletions client/css/element-carousel.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
.element-carousel__header {
text-align: center;
padding-top: 4rem;
padding-bottom: 2rem;
}

.element-carousel__title {
font-size: 2.25rem;
line-height: 1.25;
margin: 0 0 2rem;
}

.element-carousel__container {
Expand All @@ -22,7 +14,6 @@
-ms-flex-pack: center;
justify-content: center;
position: relative;
margin: 2rem auto;
}

.element-carousel__frame {
Expand All @@ -32,22 +23,22 @@
overflow: hidden;
white-space: nowrap;
margin: 0 auto;
width: 800px;
width: 100%;
}

.element-carousel__slides {
display: inline-block;
margin: 0;
padding: 0;
width: 100%;
}

.element-carousel__slide {
position: relative;
display: inline-block;
margin: 0;
padding: 0;
width: 800px;
max-width: 100%;
width: 100%;
}

.element-carousel__slide-container {
Expand All @@ -65,36 +56,56 @@
padding: 1rem 2rem;
background-color: rgba(0,0,0,0.35);
white-space: normal;
color: white;
}

.element-carousel__title {
font-weight: bold;
.element-carousel__content .element-carousel__title {
color: white;
gmlnchv marked this conversation as resolved.
Show resolved Hide resolved
}

.element-carousel__caption {
max-width: 30em;
}

/* Media */

.element-carousel__image-container,
.youtube-embed__container {
position: relative;
width: 100%;
height: 100%;
min-height: 350px;
}

.element-carousel__image-container > img {
margin: auto;
display: block;
}

.element-carousel__image-container--stretch > img {
width: 100%;
height: auto;
}

.element-carousel__image-container--fit > img {
width: auto;
height: 350px;
}

.element-carousel__image-container--cover > img {
position: absolute;
top: 0;
left: 0;
width: 100%;
display: block;
min-width: 100%;
min-height: 100%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}

/* Dots */

.element-carousel__dots {}
.element-carousel__dots {
padding: 10px 0 0 0;
text-align: center;
}

.element-carousel__dots li {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dnadesign/silverstripe-youtube-embed": "^0.2.0",
"gorriecoe/silverstripe-link": "^1.2.4",
"silverstripe/vendor-plugin": "^1.0",
"silvershop/silverstripe-hasonefield" : "^3.0.1"
"silvershop/silverstripe-hasonefield" : "^3.0"
},
"extra": {
"installer-name": "silverstripe-elemental-carousel",
Expand Down
2 changes: 1 addition & 1 deletion src/DataObjects/CarouselSlide.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CarouselSlide extends DataObject
'Video' => YoutubeEmbed::class,
'Link' => Link::class
];

private static $owns = [
'Image',
];
Expand Down
1 change: 1 addition & 0 deletions src/Elements/ElementCarousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ElementCarousel extends BaseElement
private static $inline_editable = false;

private static $db = [
'ImageSize' => "Enum('Native, Stretch, Fit, Cover')"
];

private static $has_many = [
Expand Down
2 changes: 1 addition & 1 deletion templates/DNADesign/Elemental/Models/ElementCarousel.ss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="element-carousel__frame">
<ul class="element-carousel__slides">
<% loop $Slides %>
<% include DNADesign\Elemental\Models\ElementCarouselSlide %>
<% include DNADesign\Elemental\Models\ElementCarouselSlide ImageSize=$Up.ImageSize %>
<% end_loop %>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/DNADesign/Elemental/Models/ElementCarouselArrows.ss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span class="element-carousel__prev">
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 501.5 501.5"><g><path fill="#2E435A" d="M302.67 90.877l55.77 55.508L254.575 250.75 358.44 355.116l-55.77 55.506L143.56 250.75z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 501.5 501.5"><g><path d="M302.67 90.877l55.77 55.508L254.575 250.75 358.44 355.116l-55.77 55.506L143.56 250.75z"/></g></svg>
</span>

<span class="element-carousel__next">
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 501.5 501.5"><g><path fill="#2E435A" d="M199.33 410.622l-55.77-55.508L247.425 250.75 143.56 146.384l55.77-55.507L358.44 250.75z"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 501.5 501.5"><g><path d="M199.33 410.622l-55.77-55.508L247.425 250.75 143.56 146.384l55.77-55.507L358.44 250.75z"/></g></svg>
</span>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% if $Title && $ShowTitle || $Caption %>
<div class="element-carousel__content">
<% if $ShowTitle %>
<p class="element-carousel__title">{$Title}</p>
<h3 class="element-carousel__title">{$Title}</h3>
<% end_if %>

<div class="element-carousel__caption">{$Caption}</div>
<div class="element-carousel__caption"><p>{$Caption}</p></div>
</div>
<% end_if %>
4 changes: 2 additions & 2 deletions templates/DNADesign/Elemental/Models/ElementCarouselImage.ss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="element-carousel__image-container">
{$Image.Lazyloaded}
<div class="element-carousel__image-container element-carousel__image-container--{$ImageSize.LowerCase}">
$Image.LazyLoaded
</div>
4 changes: 2 additions & 2 deletions templates/DNADesign/Elemental/Models/ElementCarouselSlide.ss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<li class="element-carousel__slide">
<% if $Link %>
<a href="{$Link.LinkURL}"{$Link.TargetAttr}>
<a href="{$Link.LinkURL}"{$Link.TargetAttr} class="element-carousel__link">
<% end_if %>

<div class="element-carousel__slide-container">
<% if $Image %>
<% include DNADesign\Elemental\Models\ElementCarouselImage %>
<% include DNADesign\Elemental\Models\ElementCarouselImage ImageSize=$ImageSize%>
<% end_if %>

<% if $Video %>
Expand Down