Skip to content

Commit

Permalink
Merge pull request #817 from templaza/v3
Browse files Browse the repository at this point in the history
Version 3.1.6
  • Loading branch information
sonvnn authored Sep 27, 2024
2 parents 97e8cad + 7d4ee4f commit ccd9ae0
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 32 deletions.
56 changes: 56 additions & 0 deletions assets/vendor/astroid/scss/utilities/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,62 @@
}
}

.as-effect-unveil {
position: relative;
overflow: hidden;
img {
transition: opacity 0.35s, transform 0.35s, filter 0.35s;
}
&:before {
position: absolute;
top: 0;
left: 0;
width: 50%;
height: 130%;
border-right: 1px solid rgba(255, 255, 255, 0);
content: "";
opacity: 0.5;
transform-origin: top right;
transition: opacity 0.35s, transform 0.35s;
background: rgba(0, 0, 0, 0.1);
z-index: 1
}
&:after {
position: absolute;
top: 0;
left: 50%;
width: 50%;
height: 130%;
border-left: 1px solid rgba(255, 255, 255, 0);
content: "";
opacity: 0.5;
transform-origin: top left;
transition: opacity 0.35s, transform 0.35s;
background: rgba(0, 0, 0, 0.1);
z-index: 1
}
&:hover {
&:before {
border-radius: 0 0 120%;
border-right-color: rgba(255, 255, 255, 0.75);
transform: rotate(35deg);
}
&:after {
border-radius: 0 0 0 120%;
border-left-color: rgba(255, 255, 255, 0.75);
transform: rotate(-35deg);
}
img {
opacity: 0.9;
filter: brightness(100%) contrast(113%) saturate(159%) blur(0.2px) hue-rotate(0deg);
-webkit-transform: scale3d(1.05, 1.05, 1);
-moz-transform: scale3d(1.05, 1.05, 1);
-ms-transform: scale3d(1.05, 1.05, 1);
transform: scale3d(1.05, 1.05, 1);
}
}
}

@-webkit-keyframes fadeInOpacity {
0% {
opacity: 0;
Expand Down
1 change: 1 addition & 0 deletions assets/vendor/astroid/scss/widgets/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
border: none;
}
.card-img-overlay {
pointer-events: none;
top: auto;
}
}
2 changes: 1 addition & 1 deletion astroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<libraryname>astroid</libraryname>
<author>Astroid Framework Team</author>
<creationDate>September 2024</creationDate>
<version>3.1.5</version>
<version>3.1.6</version>
<url>https://astroidframe.work/</url>
<copyright>Copyright (C) 2024 TemPlaza, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
Expand Down
4 changes: 2 additions & 2 deletions astroid_framework.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<updates>
<update>
<name>Astroid Framework</name>
<version>3.1.5</version>
<version>3.1.6</version>
<infourl title="Astroid Framework">https://astroidframe.work/</infourl>
<element>astroid</element>
<type>library</type>
<client>0</client>
<downloads>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.1.5/astroid-framework-3.1.5.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/templaza/astroid-framework/releases/download/v3.1.6/astroid-framework-3.1.6.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
4 changes: 3 additions & 1 deletion framework/elements/grid/grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@

$media = '';
if ($grid_params->get('type', '') == 'image' && $grid_params->get('image', '')) {
$media = '<div class="as-image-cover position-relative overflow-hidden' . ($layout == 'overlay' ? ' astroid-image-overlay-cover' : '') . $image_border_radius . $hover_effect . $transition . ($media_position == 'bottom' ? ' order-2 ' : '') . '">';
$media = '<div class="as-image-cover position-relative overflow-hidden' . $image_border_radius . $hover_effect . $transition . ($media_position == 'bottom' ? ' order-2 ' : '') . '">';
$media .= $layout == 'overlay' ? '<div class="as-image-cover astroid-image-overlay-cover">' : '';
$media .= '<img class="' . ($image_fullwidth ? 'w-100' : '') . ($enable_image_cover || $media_position == 'left' || $media_position == 'right' ? ' object-fit-cover h-100' : '') . ($params->get('card_style', '') == 'none' ? '' : ' card-img-'. $media_position) .'" src="'. Astroid\Helper\Media::getPath() . '/' . $grid_params->get('image', '').'" alt="'.$grid_params->get('title', '').'">';
$media .= $layout == 'overlay' ? '</div>' : '';
$media .= '</div>';
if ( !empty($grid_params->get('link', '')) ) {
$media = '<a href="'. $grid_params->get('link', '') . '"'.$link_target.' class="'.($media_position == 'bottom' ? 'order-2 ' : '').'">'. $media .'</a>';
Expand Down
1 change: 1 addition & 0 deletions framework/elements/grid/grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@
<option value="">TPL_ASTROID_DEFAULT</option>
<option value="light-up">ASTROID_WIDGET_EFFECT_LIGHT_UP</option>
<option value="flash">ASTROID_WIDGET_EFFECT_FLASH</option>
<option value="unveil">ASTROID_WIDGET_EFFECT_UNVEIL</option>
</field>
<field astroidgroup="image_options" name="hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down
1 change: 1 addition & 0 deletions framework/elements/image/image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<option value="">TPL_ASTROID_DEFAULT</option>
<option value="light-up">ASTROID_WIDGET_EFFECT_LIGHT_UP</option>
<option value="flash">ASTROID_WIDGET_EFFECT_FLASH</option>
<option value="unveil">ASTROID_WIDGET_EFFECT_UNVEIL</option>
</field>
<field astroidgroup="widget_styles" name="hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down
1 change: 1 addition & 0 deletions framework/elements/imagegroup/imagegroup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
<option value="">TPL_ASTROID_DEFAULT</option>
<option value="light-up">ASTROID_WIDGET_EFFECT_LIGHT_UP</option>
<option value="flash">ASTROID_WIDGET_EFFECT_FLASH</option>
<option value="unveil">ASTROID_WIDGET_EFFECT_UNVEIL</option>
</field>
<field astroidgroup="widget_styles" name="hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down
34 changes: 33 additions & 1 deletion framework/elements/testimonials/testimonials.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,30 @@

$overlay_text_color = $params->get('overlay_text_color', '');
$overlay_text_color = $overlay_text_color !== '' ? ' ' . $overlay_text_color : '';

$enable_rating = $params->get('enable_rating', 0);

// Alignment
$text_alignment = $params->get('text_alignment','');
$text_alignment_breakpoint = $params->get('text_alignment_breakpoint','');
$text_alignment_fallback = $params->get('text_alignment_fallback','');
if ($text_alignment) {
$alignment = ' justify-content' . ($text_alignment_breakpoint ? '-' . $text_alignment_breakpoint : '') . '-' . $text_alignment . ($text_alignment_fallback ? ' justify-content-' . $text_alignment_fallback : '');
} else {
$alignment = '';
}
echo '<div class="astroid-grid '.($enable_slider ? 'astroid-slick opacity-0' . $nav_position : $row_column_cls).$gutter_cls.$overlay_text_color.'">';
foreach ($testimonials as $key => $testimonial) {
$testimonial_params = Helper::loadParams($testimonial->params);
$avatar = $testimonial_params->get('avatar', '');
$rating = $testimonial_params->get('rating', 5);
$media = '';
if ($avatar) {
$media = '<div class="as-author-avatar d-inline-block position-relative overflow-hidden' . $image_border_radius . $box_shadow . $hover_effect . $transition . '">';
$media .= '<img class="' . ($avatar_position == 'left' || $avatar_position == 'right' ? 'object-fit-cover w-100 h-100 ' : '') .'" src="'. Astroid\Helper\Media::getPath() . '/' . $avatar .'" alt="'.$testimonial_params->get('title', '').'">';
$media .= '</div>';
}


echo '<div id="testimonial-'. $testimonial -> id .'"><div class="card' . $card_style . $box_shadow . $box_shadow_hover .$bd_radius . $card_hover_transition . ($enable_grid_match ? ' h-100' : '') . '">';
if ($avatar_position == 'left' || $avatar_position == 'right') {
echo '<div class="row g-0">';
Expand All @@ -243,6 +255,21 @@
if ($avatar_position == 'bottom') {
echo $media;
}
if (!empty($enable_rating)) {
echo '<div class="as-rating-block row row-cols-auto gx-2'.$alignment.'">';
for ($i = 0; $i < 5 ; $i++) {
if ($i < $rating) {
if ($rating - $i >= 1) {
echo '<div class="as-star"><i class="fa-solid fa-star"></i></div>';
} else {
echo '<div class="as-star"><i class="fa-solid fa-star-half-stroke"></i></div>';
}
} else {
echo '<div class="as-star"><i class="fa-regular fa-star"></i></div>';
}
}
echo '</div>';
}
if (!empty($testimonial_params->get('designation', '')) && $designation_position == 'before') {
echo '<div class="as-author-designation">' . $testimonial_params->get('designation', '') . '</div>';
}
Expand Down Expand Up @@ -310,4 +337,9 @@
}
if (!empty($dot_alignment)) {
$element->style->child('.astroid-slick .slick-dots')->addCss('text-align', $dot_alignment);
}
if (!empty($enable_rating)) {
$rating_color = Style::getColor($params->get('rating_color', ''));
$element->style->child('.as-rating-block')->addCss('color', $rating_color['light']);
$element->style_dark->child('.as-rating-block')->addCss('color', $rating_color['dark']);
}
5 changes: 5 additions & 0 deletions framework/elements/testimonials/testimonials.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<field type="astroidgroup" name="name_options" title="ASTROID_WIDGET_NAME_OPTIONS_LABEL"/>
<field type="astroidgroup" name="designation_options" title="ASTROID_WIDGET_TESTIMONIALS_DESIGNATION_POSITION_LABEL"/>
<field type="astroidgroup" name="content_options" title="ASTROID_WIDGET_MESSAGE_OPTIONS_LABEL"/>
<field type="astroidgroup" name="rating_options" title="ASTROID_WIDGET_RATING_OPTIONS_LABEL"/>
<field astroidgroup="general" name="testimonials" type="astroidsubform" label="ASTROID_WIDGET_TESTIMONIALS_LABEL">
<form>
<fields>
Expand All @@ -25,6 +26,7 @@
<field ngShow="[link]!=''" type="astroidtext" label="ASTROID_WIDGET_LINK_TEXT_LABEL" name="link_title" hint="astroidframe.work"/>
<field name="avatar" type="astroidmedia" label="ASTROID_WIDGET_AVATAR_LABEL"/>
<field type="astroideditor" label="ASTROID_WIDGET_MESSAGE_LABEL" name="message"/>
<field name="rating" type="astroidrange" min="0" max="5" step="0.5" default="5" label="ASTROID_RATING" postfix="stars" />
</fieldset>
</fields>
</form>
Expand Down Expand Up @@ -402,6 +404,7 @@
<option value="">TPL_ASTROID_DEFAULT</option>
<option value="light-up">ASTROID_WIDGET_EFFECT_LIGHT_UP</option>
<option value="flash">ASTROID_WIDGET_EFFECT_FLASH</option>
<option value="unveil">ASTROID_WIDGET_EFFECT_UNVEIL</option>
</field>
<field astroidgroup="avatar_options" name="hover_transition" type="astroidlist" label="ASTROID_WIDGET_HOVER_TRANSITION_LABEL" default="">
<option value="">TPL_ASTROID_DEFAULT</option>
Expand Down Expand Up @@ -455,6 +458,8 @@

<field astroidgroup="content_options" name="content_font_style" label="ASTROID_WIDGET_FONT_STYLES_LABEL" type="astroidtypography" columns="1" preview="false"/>
<field astroidgroup="content_options" name="content_margin" type="astroidspacing" label="ASTROID_WIDGET_MARGIN_LABEL" />
<field astroidgroup="rating_options" name="enable_rating" type="astroidradio" astroid-switch="true" default="0" label="ASTROID_WIDGET_ENABLE_RATING"/>
<field astroidgroup="rating_options" name="rating_color" type="astroidcolor" label="ASTROID_WIDGET_RATING_COLOR"/>
</fieldset>
<fieldset name="assignment-settings" label="TPL_ASTROID_ASSIGNMENT_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields" articleData="false">
<field type="astroidlist" name="assignment_type" label="ASTROID_WIDGET_ASSIGN" default="1">
Expand Down
Loading

0 comments on commit ccd9ae0

Please sign in to comment.