feat(core): integrasi navigasi hamburger mobile, single-program template, floating whatsapp, dan back-to-top
This commit is contained in:
+50
-4
@@ -6,13 +6,18 @@ $footer_logo = get_option( 'edukarsa_footer_logo' );
|
||||
if ( empty( $footer_logo ) ) {
|
||||
$footer_logo = get_option( 'edukarsa_header_logo' );
|
||||
}
|
||||
$raw_telp = get_option( 'edukarsa_footer_telp', '' );
|
||||
$wa_clean = preg_replace( '/[^0-9]/', '', $raw_telp );
|
||||
if ( substr( $wa_clean, 0, 1 ) === '0' ) {
|
||||
$wa_clean = '62' . substr( $wa_clean, 1 );
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- MAIN FOOTER -->
|
||||
<footer class="site-footer">
|
||||
<div class="container footer-grid-wrapper">
|
||||
|
||||
<!-- Kolom 1: Identitas & Visi Kampus -->
|
||||
<!-- Kolom 1: Brand & Profil -->
|
||||
<div class="footer-col footer-col-brand">
|
||||
<div class="footer-brand-logo">
|
||||
<?php if ( ! empty( $footer_logo ) ) : ?>
|
||||
@@ -48,7 +53,7 @@ if ( empty( $footer_logo ) ) {
|
||||
</li>
|
||||
<li>
|
||||
<span class="f-icon">📞</span>
|
||||
<a href="tel:<?php echo esc_attr( preg_replace( '/[^0-9+]/', '', get_option( 'edukarsa_footer_telp', '' ) ) ); ?>">
|
||||
<a href="tel:<?php echo esc_attr( $wa_clean ); ?>">
|
||||
<?php echo esc_html( get_option( 'edukarsa_footer_telp', '(021) 000-0000' ) ); ?>
|
||||
</a>
|
||||
</li>
|
||||
@@ -92,7 +97,7 @@ if ( empty( $footer_logo ) ) {
|
||||
|
||||
<?php if ( get_option( 'edukarsa_tampil_ig', 1 ) == 1 && get_option( 'edukarsa_footer_ig' ) ) : ?>
|
||||
<a href="<?php echo esc_url( get_option( 'edukarsa_footer_ig' ) ); ?>" target="_blank" rel="noopener" class="social-btn" title="Instagram">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689-.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -118,7 +123,7 @@ if ( empty( $footer_logo ) ) {
|
||||
|
||||
</div>
|
||||
|
||||
<!-- COPYRIGHT BOTTOM BAR -->
|
||||
<!-- COPYRIGHT BAR -->
|
||||
<div class="footer-bottom-bar">
|
||||
<div class="container footer-bottom-inner">
|
||||
<p class="copyright-text">
|
||||
@@ -131,6 +136,47 @@ if ( empty( $footer_logo ) ) {
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- FLOATING WHATSAPP HOTLINE PPDB -->
|
||||
<?php if ( ! empty( $wa_clean ) ) : ?>
|
||||
<a href="https://wa.me/<?php echo esc_attr( $wa_clean ); ?>?text=Halo%20Admin%20EduKarsa,%20saya%20ingin%20bertanya%20mengenai%20pendaftaran." target="_blank" rel="noopener" class="edukarsa-wa-float" title="Chat WhatsApp Panitia PMB">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="#ffffff"><path d="M12.031 6.172c-3.181 0-5.767 2.586-5.768 5.766-.001 1.298.38 2.27 1.019 3.287l-.711 2.598 2.664-.699c.971.53 1.777.82 2.796.82h.005c3.18 0 5.767-2.586 5.768-5.766 0-3.18-2.587-5.806-5.773-5.806zm3.376 8.214c-.149.42-.767.781-1.072.829-.304.048-.687.069-2.203-.559-1.933-.801-3.178-2.775-3.275-2.905-.095-.129-.778-1.036-.778-1.975 0-.94.492-1.401.667-1.593.175-.192.383-.24.512-.24.129 0 .258.006.371.012.12.006.279-.045.436.334.164.397.558 1.365.607 1.465.049.099.082.217.017.348-.065.131-.098.212-.195.328-.098.115-.205.258-.293.346-.098.098-.201.205-.087.401.115.196.512.846 1.099 1.368.756.673 1.393.882 1.59.98.196.098.312.082.426-.049.115-.131.492-.573.623-.77.131-.196.262-.164.442-.098.18.065 1.147.541 1.344.639.196.098.328.147.377.229.049.082.049.475-.1.895z"/></svg>
|
||||
<span>Tanya PMB</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- TOMBOL BACK TO TOP -->
|
||||
<button id="back-to-top" class="back-to-top-btn" aria-label="Kembali ke atas">▲</button>
|
||||
|
||||
<!-- NATIVE VANILLA SCRIPT: HAMBURGER & BACK-TO-TOP -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// 1. Toggle Mobile Menu Drawer
|
||||
const toggleBtn = document.getElementById("mobile-menu-toggle");
|
||||
const navMenu = document.getElementById("site-navigation");
|
||||
if (toggleBtn && navMenu) {
|
||||
toggleBtn.addEventListener("click", function() {
|
||||
toggleBtn.classList.toggle("active");
|
||||
navMenu.classList.toggle("active");
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Back to Top Smooth Logic
|
||||
const bttBtn = document.getElementById("back-to-top");
|
||||
if (bttBtn) {
|
||||
window.addEventListener("scroll", function() {
|
||||
if (window.scrollY > 350) {
|
||||
bttBtn.classList.add("show");
|
||||
} else {
|
||||
bttBtn.classList.remove("show");
|
||||
}
|
||||
});
|
||||
bttBtn.addEventListener("click", function() {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user