Skip to content

Commit

Permalink
Chang stream cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaireddine committed Mar 26, 2023
1 parent a176f4d commit b1d1940
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 159 deletions.
3 changes: 0 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ function enqueue_external_styles(){
*/
function enqueue_external_scripts() {
wp_enqueue_script( 'bootstrap_jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', array(), null, true );
wp_enqueue_script( 'iframe_jquery', 'https://raw.githubusercontent.com/cmlenz/jquery-iframe-transport/master/jquery.iframe-transport.js', array(), null, true );
wp_enqueue_script( 'bootstrap_popper', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js', array(), '1.14.7', true );
wp_enqueue_script( 'bootstrap_javascript', '//stackpath.bootstrapcdn.com/bootstrap/4.4.0/js/bootstrap.min.js', array(), '4.3.1', true );
wp_enqueue_script( 'slick', 'https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js', array(), null, true );
Expand All @@ -280,8 +279,6 @@ function radio_salam_scripts() {
wp_enqueue_style( 'radio_salam-style', get_stylesheet_uri(), array(), _S_VERSION );
wp_style_add_data( 'radio_salam-style', 'rtl', 'replace' );

wp_enqueue_script( 'radio_salam-play', get_template_directory_uri() . '/js/play.js', array(), _S_VERSION, true );
wp_enqueue_script( 'radio_salam-onair', get_template_directory_uri() . '/js/onair.js', array(), _S_VERSION, true );
wp_enqueue_script( 'radio_salam-script', get_template_directory_uri() . '/js/script.js', array(), _S_VERSION, true );
wp_enqueue_script( 'radio_salam-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );

Expand Down
2 changes: 0 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@
</div>
<?php get_template_part( 'template-parts/content', 'slider' ); ?>
</header>
<audio controls="controls" id="audio-onair" src="https://radiosalam.ice.infomaniak.ch/radiosalam-128.mp3" style="width:270px; height:50px"></audio>

57 changes: 0 additions & 57 deletions js/onair.js

This file was deleted.

69 changes: 0 additions & 69 deletions js/play.js

This file was deleted.

18 changes: 0 additions & 18 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,4 @@ $(document).ready(function () {
autoplaySpeed: 4000,
});

var onAir = $('#audio-onair')[0];
var isPlaying = false;

function togglePlay() {
isPlaying ? onAir.pause() : onAir.play();
}

onAir.onplaying = function () {
isPlaying = true;
};
onAir.onpause = function () {
isPlaying = false;
};

$('#play-onair').click(function (event) {
togglePlay();
$(this).toggleClass("playing")
});
});
24 changes: 23 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ main {
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2.3em;
font-size: 2.2em;
color: #444;
font-weight: 600;
}
Expand Down Expand Up @@ -1017,7 +1017,24 @@ textarea {
color: #f67412;
}

.cover-main-slider {
position: relative;
}

.cover-main-slider .cover-on-air {
z-index: 1;
left: 0;
top: 60px;
width: 100%;
position: absolute;
}

.cover-main-slider .cover-on-air p {
display: none;
}

#main-slider.main-slider {
zoom: 1;
margin-bottom: 0;
position: relative;
}
Expand Down Expand Up @@ -1263,6 +1280,11 @@ textarea {
}

@media (min-width: 1200px) {

.cover-main-slider .cover-on-air {
top: 150px;
}

.main-container {
padding: 80px 0;
}
Expand Down
13 changes: 4 additions & 9 deletions template-parts/content-slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
$the_query = new WP_Query( $args );
?>
<div class="cover-main-slider">
<div class="cover-on-air">
<?php dynamic_sidebar( 'on-air' ); ?>
</div>
<div class="main-slider" id="main-slider">
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="slide-item">
<div class="cover-inner">
<button id="play-onair" class="play-onair">
<span class="material-symbols-outlined">
play_circle
</span>
<span class="material-symbols-outlined">
pause_circle
</span>
</button>
<div class="slide-description">
<div class="slide-city-name" id="slide-city-name">
<?= the_title(); ?>
Expand All @@ -37,7 +32,7 @@
wp_reset_postdata(); ?>
<?php else: ?>
<div class="empty-slide">

<?php dynamic_sidebar( 'on-air' ); ?>
</div>
<?php endif; ?>
</div>
Expand Down

0 comments on commit b1d1940

Please sign in to comment.