Skip to content

Commit

Permalink
Merge pull request #272 from 10up/feature/issue-229-191-player-enhanc…
Browse files Browse the repository at this point in the history
…ements

Feature/issue 229 191 player enhancements
  • Loading branch information
jeffpaul authored Jun 27, 2024
2 parents 95a719e + d6836ab commit b4b0810
Show file tree
Hide file tree
Showing 15 changed files with 2,840 additions and 4,933 deletions.
42 changes: 39 additions & 3 deletions assets/js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default registerBlockType(
type: 'string',
source: 'meta',
meta: 'podcast_explicit',
default: 'no',
},
enclosure: {
type: 'string',
Expand All @@ -89,17 +88,54 @@ export default registerBlockType(
source: 'meta',
meta: 'podcast_episode_type',
},
displayDuration: {
type: 'boolean',
default: false,
},
displayShowTitle: {
type: 'boolean',
default: false,
},
displayEpisodeTitle: {
type: 'boolean',
default: false,
},
displayArt: {
type: 'boolean',
default: false,
},
displayExplicitBadge: {
type: 'boolean',
default: false,
},
displaySeasonNumber: {
type: 'boolean',
default: false,
},
displayEpisodeNumber: {
type: 'boolean',
default: false,
},
displayEpisodeType: {
type: 'boolean',
default: false,
}
},
transforms,

edit: Edit,

save: props => {
const { id, src, caption } = props.attributes;
const {
id,
src,
caption
} = props.attributes;

return (
<figure className={ id ? `podcast-${ id }` : null }>
{ caption && caption.length > 0 && <figcaption className="wp-block-podcasting-podcast__caption">{ caption }</figcaption> }
<audio controls="controls" src={ src } />
{ caption && caption.length > 0 && <figcaption>{ caption }</figcaption> }
</figure>
);
},
Expand Down
1 change: 1 addition & 0 deletions assets/js/blocks/podcast/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './index.scss';
84 changes: 84 additions & 0 deletions assets/js/blocks/podcast/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.wp-block-podcasting-podcast-outer {
border: 1px solid #707070;
border-radius: 4px;
padding: 20px;
}

.wp-block-podcasting-podcast__container {
margin-bottom: 10px;

@media (min-width: 768px) {
display: flex;
}
}

.wp-block-podcasting-podcast__show-art {
margin-bottom: 20px;

@media (min-width: 768px) {
flex-basis: 100px;
margin-bottom: 0;
margin-right: 20px;
}
}

.wp-block-podcasting-podcast__image {
aspect-ratio: 1/1;
height: auto;
position: relative;

& img {
display: block;
height: 100%;
object-fit: cover;
width: 100%;
}
}

.wp-block-podcasting-podcast__show-title {
margin: 0;
}

.wp-block-podcasting-podcast__show-details {
color: #575757;
font-size: 0.875rem;
text-transform: uppercase;

& span {
display: block;
margin-right: 6px;

@media (min-width: 768px) {
display: inline;
}

&::after {

@media (min-width: 768px) {
content: '/';
margin-left: 6px;
}
}

&:last-child {
margin-right: 0;

&::after {
display: none;
}
}
}
}

.wp-block-podcasting-podcast__caption {
margin-bottom: 10px;
}

.wp-block-podcasting-podcast {
margin: 0;

& audio {
display: block;
width: 100%;
}
}
Loading

0 comments on commit b4b0810

Please sign in to comment.