Commit 1f76c475 authored by Henrique Marques's avatar Henrique Marques
Browse files

Merge branch 'develop'

......@@ -77,6 +77,14 @@ jQuery(document).ready(function(){
jQuery('#modal-art,#modal-art-wrapper').css({ 'display' : 'none' });
});
$('.featured-card .play-button').click(function(){
let $parent = $(this).parents('.featured-card');
let $iframe = $parent.find('iframe');
$parent.addClass('play');
$iframe.attr('src', $iframe.attr('src') + '&autoplay=1');
})
});
window.downloadFile = function (sUrl) {
......
......@@ -10,6 +10,27 @@
}
&.has-image{
.play-button{
font-size: 60px;
position: absolute;
left: 50%;
top: 50%;
font-size: 100px;
color: white;
transform: translate(-50%, -50%);
cursor: pointer;
}
.iframe-wrapper{
opacity: 0;
transition: all .6s;
top: 0px;
@include mobile { display: none; }
@include desktop{ position: absolute; }
}
@include desktop{
.featured-card--infos{
max-width: 50%;
......@@ -23,10 +44,38 @@
top: 50%;
transform: translateY(-50%);
right: 0;
transition: all .6s;
}
}
&.play{
.play-button{ display: none; }
.iframe-wrapper{
opacity: 1;
z-index: 100;
@include mobile { display: block; }
}
@include desktop{
.featured-card--image { max-width: 53%; }
}
.featured-card--image img{ opacity: 0; }
@include mobile{
.featured-card--image img{ position: absolute; }
}
}
}
&.has-embed{
.play-button{ display: block; }
@include mobile{
.featured-card--image { position: relative; }
}
}
&--title{
font-family: Oswald;
......
......@@ -143,4 +143,17 @@ body{
flex: 0 0 100%;
max-width: 100%;
}
}
.iframe-wrapper{
padding-top: 56%;
width: 100%;
position: relative;
iframe{
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
}
\ No newline at end of file
......@@ -9051,6 +9051,35 @@ body .em-calendar td ul li a {
}
}
.featured-card.has-image .play-button {
font-size: 60px;
position: absolute;
left: 50%;
top: 50%;
font-size: 100px;
color: white;
transform: translate(-50%, -50%);
cursor: pointer;
}
.featured-card.has-image .iframe-wrapper {
opacity: 0;
transition: all .6s;
top: 0px;
}
@media (max-width: 767px) {
.featured-card.has-image .iframe-wrapper {
display: none;
}
}
@media (min-width: 1025px) {
.featured-card.has-image .iframe-wrapper {
position: absolute;
}
}
@media (min-width: 1025px) {
.featured-card.has-image .featured-card--infos {
max-width: 50%;
......@@ -9063,6 +9092,48 @@ body .em-calendar td ul li a {
top: 50%;
transform: translateY(-50%);
right: 0;
transition: all .6s;
}
}
.featured-card.has-image.play .play-button {
display: none;
}
.featured-card.has-image.play .iframe-wrapper {
opacity: 1;
z-index: 100;
}
@media (max-width: 767px) {
.featured-card.has-image.play .iframe-wrapper {
display: block;
}
}
@media (min-width: 1025px) {
.featured-card.has-image.play .featured-card--image {
max-width: 53%;
}
}
.featured-card.has-image.play .featured-card--image img {
opacity: 0;
}
@media (max-width: 767px) {
.featured-card.has-image.play .featured-card--image img {
position: absolute;
}
}
.featured-card.has-embed .play-button {
display: block;
}
@media (max-width: 767px) {
.featured-card.has-embed .featured-card--image {
position: relative;
}
}
......@@ -10278,3 +10349,16 @@ body {
max-width: 100%;
}
}
.iframe-wrapper {
padding-top: 56%;
width: 100%;
position: relative;
}
.iframe-wrapper iframe {
position: absolute;
top: 0;
width: 100%;
height: 100%;
}
......@@ -11483,6 +11483,14 @@ jQuery(document).ready(function () {
$('#modal-art .close-button').click(function (e) {
jQuery('#modal-art,#modal-art-wrapper').css({ 'display': 'none' });
});
$('.featured-card .play-button').click(function () {
var $parent = $(this).parents('.featured-card');
var $iframe = $parent.find('iframe');
$parent.addClass('play');
$iframe.attr('src', $iframe.attr('src') + '&autoplay=1');
});
});
 
window.downloadFile = function (sUrl) {
......@@ -27,24 +27,19 @@ add_action('cmb2_admin_init', function() {
));
$cmb_arte = new_cmb2_box(array(
'id' => 'arte_metabox',
'title' => "Opções da arte",
'object_types' => array('arte'), // arte type
$cmb_post = new_cmb2_box(array(
'id' => 'post_metabox',
'title' => "Opções do post",
'object_types' => array('post'), // post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
));
$cmb_arte->add_field(array(
'name' => 'Tipo de Arte',
'id' => 'arte_tipo',
'type' => 'radio_inline',
'options' => [
'video' => "Vídeo",
'audio' => "Áudio",
'texto' => "Texto",
]
$cmb_post->add_field(array(
'name' => 'Vídeo embed',
'id' => 'post_video',
'type' => 'oembed',
));
// $cmb_post = new_cmb2_box(array(
......
<div class="featured-card <?= has_post_thumbnail() ? 'has-image' : '' ?>">
<?php
$embed_url = wp_oembed_get(esc_url(get_post_meta(get_the_ID(), 'post_video', true )));
?>
<div class="featured-card <?= (has_post_thumbnail() ? 'has-image ' : ' ') . (!empty($embed_url) ? 'has-embed' : '') ?>">
<div class="featured-card--infos">
<small class="featured-card--category"><?php the_category(', ') ?> // <?php the_date('d.m.Y') ?> // por <?php the_meta_author() ?></small>
<a href="<?php the_permalink() ?>">
<h2 class="featured-card--title"><?php the_title() ?></h2>
<div class="featured-card--excerpt"><?php the_excerpt() ?></div>
</a>
<div class="featured-card--infos">
<small class="featured-card--category"><?php the_category(', ') ?> // <?php the_date('d.m.Y') ?> // por <?php the_meta_author() ?></small>
<a href="<?php the_permalink() ?>">
<h2 class="featured-card--title"><?php the_title() ?></h2>
<div class="featured-card--excerpt"><?php the_excerpt() ?></div>
</a>
<a href="<?php the_permalink() ?>" class="button outline">Leia na Íntegra</a>
</div>
<a href="<?php the_permalink() ?>" class="button outline">Leia na Íntegra</a>
</div>
<div class="featured-card--image">
<div class="iframe-wrapper">
<?= $embed_url ?>
</div>
<i class="fa fa-play-circle play-button"></i>
<img src="<?= images\url('full'); ?>" alt="">
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment