diff --git a/assets/edukarsa.js b/assets/edukarsa.js new file mode 100644 index 0000000..bea8a38 --- /dev/null +++ b/assets/edukarsa.js @@ -0,0 +1,69 @@ +document.addEventListener("DOMContentLoaded", function() { + // Menu Toggle + 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"); + }); + } + + // Back to Top + 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" }); + }); + } + + // Accessibility Panel + const a11yTrigger = document.getElementById("a11y-trigger"); + const a11yPanel = document.getElementById("a11y-panel"); + const a11yClose = document.getElementById("a11y-close"); + if (a11yTrigger && a11yPanel) { + a11yTrigger.addEventListener("click", function() { a11yPanel.classList.toggle("active"); }); + if (a11yClose) { a11yClose.addEventListener("click", function() { a11yPanel.classList.remove("active"); }); } + + const fontLevels = ['', 'a11y-font-lg', 'a11y-font-xl']; + let currentFontIdx = parseInt(localStorage.getItem('edukarsa_a11y_font') || '0', 10); + function applyA11y() { + fontLevels.forEach(function(c) { if (c) document.body.classList.remove(c); }); + if (fontLevels[currentFontIdx]) { document.body.classList.add(fontLevels[currentFontIdx]); } + if (localStorage.getItem('edukarsa_a11y_contrast') === '1') { document.body.classList.add('a11y-high-contrast'); } else { document.body.classList.remove('a11y-high-contrast'); } + if (localStorage.getItem('edukarsa_a11y_grayscale') === '1') { document.body.classList.add('a11y-grayscale'); } else { document.body.classList.remove('a11y-grayscale'); } + if (localStorage.getItem('edukarsa_a11y_links') === '1') { document.body.classList.add('a11y-underline-links'); } else { document.body.classList.remove('a11y-underline-links'); } + } + applyA11y(); + + document.getElementById("a11y-font-inc")?.addEventListener("click", function() { if (currentFontIdx < fontLevels.length - 1) currentFontIdx++; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); }); + document.getElementById("a11y-font-dec")?.addEventListener("click", function() { if (currentFontIdx > 0) currentFontIdx--; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); }); + document.getElementById("a11y-font-reset")?.addEventListener("click", function() { currentFontIdx = 0; localStorage.setItem('edukarsa_a11y_font', currentFontIdx); applyA11y(); }); + document.getElementById("a11y-contrast")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_contrast') === '1'; localStorage.setItem('edukarsa_a11y_contrast', active ? '0' : '1'); applyA11y(); }); + document.getElementById("a11y-grayscale")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_grayscale') === '1'; localStorage.setItem('edukarsa_a11y_grayscale', active ? '0' : '1'); applyA11y(); }); + document.getElementById("a11y-links")?.addEventListener("click", function() { const active = localStorage.getItem('edukarsa_a11y_links') === '1'; localStorage.setItem('edukarsa_a11y_links', active ? '0' : '1'); applyA11y(); }); + document.getElementById("a11y-reset-all")?.addEventListener("click", function() { + currentFontIdx = 0; + localStorage.removeItem('edukarsa_a11y_font'); + localStorage.removeItem('edukarsa_a11y_contrast'); + localStorage.removeItem('edukarsa_a11y_grayscale'); + localStorage.removeItem('edukarsa_a11y_links'); + applyA11y(); + }); + } + + // Homepage Hero Slider Scroll + const slider = document.getElementById('hero-slider-wrapper'); + if (slider && slider.children.length > 1) { + setInterval(function() { + if (slider.scrollLeft + slider.clientWidth >= slider.scrollWidth - 10) { + slider.scrollTo({ left: 0, behavior: 'smooth' }); + } else { + slider.scrollBy({ left: slider.clientWidth, behavior: 'smooth' }); + } + }, 4000); + } +}); diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..4646602 --- /dev/null +++ b/comments.php @@ -0,0 +1,41 @@ + +
Masukkan URL tujuan jika pengunjung mengklik gambar slider ini (opsional).
'; - echo ''; -} - -function edukarsa_slider_save_meta( $post_id ) { - if ( ! isset( $_POST['edukarsa_slider_meta_nonce'] ) || ! wp_verify_nonce( $_POST['edukarsa_slider_meta_nonce'], 'edukarsa_slider_save' ) ) return; - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; - if ( isset( $_POST['slider_link'] ) ) { update_post_meta( $post_id, '_slider_link', sanitize_text_field( $_POST['slider_link'] ) ); } -} -add_action( 'save_post', 'edukarsa_slider_save_meta' ); - -// --- REGISTRASI CPT GALERI & TAXONOMY --- -function edukarsa_register_galeri_cpt() { - register_post_type( 'galeri', array( - 'labels' => array( - 'name' => 'Galeri Fasilitas', - 'singular_name' => 'Galeri', - 'add_new_item' => 'Tambah Foto Galeri', - 'all_items' => 'Semua Foto Galeri' - ), - 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), - 'public' => true, - 'show_ui' => true, - 'show_in_menu' => false, - 'menu_icon' => 'dashicons-format-gallery' - )); - - register_taxonomy( 'kategori_galeri', 'galeri', array( - 'labels' => array('name' => 'Kategori Galeri', 'singular_name' => 'Kategori', 'add_new_item' => 'Tambah Kategori'), - 'hierarchical' => true, - 'public' => true, - 'show_ui' => true, - 'show_admin_column' => true, - 'show_in_menu' => false - )); -} -add_action( 'init', 'edukarsa_register_galeri_cpt', 0 ); - -// --- NOTIFIKASI PANDUAN RESOLUSI SLIDER --- -function edukarsa_slider_admin_notice() { - $screen = get_current_screen(); - if ( isset($screen->post_type) && $screen->post_type === 'slider' ) { - echo '💡 Panduan Resolusi Gambar: Untuk tampilan terbaik tanpa pecah, gunakan gambar beresolusi 1920x1080 piksel (16:9) pada kotak Gambar Unggulan (Featured Image) di sisi kanan bawah.
-' . esc_html__( 'Pendaftaran Mahasiswa / Siswa Baru Telah Dibuka!', 'edukarsa' ) . '
diff --git a/functions.php b/functions.php index 9b50e0e..23aecc4 100644 --- a/functions.php +++ b/functions.php @@ -1,18 +1,28 @@ + >
@@ -7,128 +9,66 @@
+ +
+ ++ 48, + 'style' => 'ol', + 'short_ping' => true, + ) ); + ?> +
+ + '« ' . esc_html__( 'Komentar Lama', 'edukarsa' ), + 'next_text' => esc_html__( 'Komentar Baru', 'edukarsa' ) . ' »', + ) ); ?> + + + + + + + + +