feat(ui): perbaiki styling form komentar modern dan tambahkan social share bar
This commit is contained in:
+2
-2
@@ -5,9 +5,9 @@ if ( post_password_required() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div id="comments" class="comments-area card-style" style="padding: 30px; margin-top: 30px;">
|
||||
<div id="comments" class="comments-area card-style">
|
||||
<?php if ( have_comments() ) : ?>
|
||||
<h3 class="comments-title" style="margin-bottom: 20px;">
|
||||
<h3 class="comments-title">
|
||||
<?php
|
||||
$comment_count = get_comments_number();
|
||||
echo esc_html( sprintf( _n( '%d Tanggapan', '%d Tanggapan', $comment_count, 'edukarsa' ), $comment_count ) );
|
||||
|
||||
+29
-1
@@ -76,6 +76,35 @@ function edukarsa_register_sidebars() {
|
||||
}
|
||||
add_action( 'widgets_init', 'edukarsa_register_sidebars' );
|
||||
|
||||
// Helper Tombol Berbagi Media Sosial Native (Post & Page)
|
||||
function edukarsa_social_share() {
|
||||
$share_url = rawurlencode( get_permalink() );
|
||||
$share_title = rawurlencode( get_the_title() );
|
||||
?>
|
||||
<div class="edukarsa-share-box">
|
||||
<span class="share-box-title"><?php esc_html_e( 'Bagikan Halaman Ini:', 'edukarsa' ); ?></span>
|
||||
<div class="share-btn-group">
|
||||
<a href="https://wa.me/?text=<?php echo $share_title . '%20' . $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-wa" title="WhatsApp">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><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>WhatsApp</span>
|
||||
</a>
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-fb" title="Facebook">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>
|
||||
<span>Facebook</span>
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/tweet?text=<?php echo $share_title; ?>&url=<?php echo $share_url; ?>" target="_blank" rel="noopener" class="share-pill share-pill-tw" title="X (Twitter)">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
||||
<span>X / Twitter</span>
|
||||
</a>
|
||||
<button type="button" class="share-pill share-pill-copy" onclick="navigator.clipboard.writeText('<?php echo esc_js( get_permalink() ); ?>'); alert('<?php echo esc_js( __( 'Tautan berhasil disalin ke clipboard!', 'edukarsa' ) ); ?>');">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
||||
<span>Salin Link</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function edukarsa_enqueue_scripts() {
|
||||
wp_enqueue_style( 'edukarsa-style', get_stylesheet_uri(), array(), time() );
|
||||
|
||||
@@ -87,7 +116,6 @@ function edukarsa_enqueue_scripts() {
|
||||
wp_enqueue_script( 'edukarsa-global-js', get_template_directory_uri() . '/assets/edukarsa.js', array(), time(), true );
|
||||
}
|
||||
|
||||
// Memuat API Google Translate dengan dependensi ke edukarsa-global-js
|
||||
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) {
|
||||
wp_enqueue_script(
|
||||
'google-translate-api',
|
||||
|
||||
@@ -35,6 +35,8 @@ get_header();
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php edukarsa_social_share(); ?>
|
||||
</article>
|
||||
|
||||
<?php
|
||||
|
||||
+4
-1
@@ -49,11 +49,15 @@ get_header();
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
<?php if ( has_tag() ) : ?>
|
||||
<div class="single-article-footer">
|
||||
<div class="single-tags-list">
|
||||
<?php the_tags( '<span class="tag-label">' . esc_html__( 'Topik Terkait:', 'edukarsa' ) . '</span> ', ' ', '' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php edukarsa_social_share(); ?>
|
||||
</article>
|
||||
|
||||
<nav class="inter-post-nav">
|
||||
@@ -92,7 +96,6 @@ get_header();
|
||||
comments_template();
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<div class="single-sidebar-column">
|
||||
|
||||
@@ -1019,3 +1019,244 @@ body.edukarsa-popup-open { overflow: hidden; }
|
||||
display: block;
|
||||
stroke: #ffffff;
|
||||
}
|
||||
|
||||
/* 24. MODERN NATIVE COMMENT FORM & COMMENTS LIST */
|
||||
.comments-area {
|
||||
margin-top: 35px;
|
||||
padding: 35px;
|
||||
}
|
||||
.comments-title {
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
color: var(--heading-color);
|
||||
margin-bottom: 24px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 2px solid #f1f5f9;
|
||||
}
|
||||
.comment-respond {
|
||||
margin-top: 25px;
|
||||
}
|
||||
.comment-reply-title {
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
color: var(--heading-color);
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.comment-reply-title small a {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #ef4444;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.comment-notes {
|
||||
font-size: 13.5px;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.comment-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
.comment-form p {
|
||||
margin: 0;
|
||||
}
|
||||
.comment-form label {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--heading-color);
|
||||
margin-bottom: 6px;
|
||||
letter-spacing: 0.2px;
|
||||
}
|
||||
.comment-form .required {
|
||||
color: #ef4444;
|
||||
margin-left: 2px;
|
||||
}
|
||||
.comment-form input[type="text"],
|
||||
.comment-form input[type="email"],
|
||||
.comment-form input[type="url"],
|
||||
.comment-form textarea {
|
||||
width: 100%;
|
||||
padding: 12px 16px;
|
||||
background-color: #f8fafc;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 10px;
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
color: var(--text-color);
|
||||
outline: none;
|
||||
transition: all 0.25s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.comment-form textarea {
|
||||
min-height: 140px;
|
||||
resize: vertical;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.comment-form input[type="text"]:focus,
|
||||
.comment-form input[type="email"]:focus,
|
||||
.comment-form input[type="url"]:focus,
|
||||
.comment-form textarea:focus {
|
||||
background-color: #ffffff;
|
||||
border-color: var(--secondary-color);
|
||||
box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
|
||||
}
|
||||
.comment-form-cookies-consent {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.comment-form-cookies-consent input[type="checkbox"] {
|
||||
margin-top: 4px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
accent-color: var(--primary-color);
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.comment-form-cookies-consent label {
|
||||
display: inline;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.form-submit {
|
||||
margin-top: 8px !important;
|
||||
}
|
||||
.comment-form .submit,
|
||||
#submit {
|
||||
display: inline-block;
|
||||
background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
|
||||
color: #ffffff !important;
|
||||
padding: 12px 34px;
|
||||
border-radius: 50px;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.3px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 4px 14px rgba(11, 74, 142, 0.25);
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
.comment-form .submit:hover,
|
||||
#submit:hover {
|
||||
background: var(--primary-color);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(11, 74, 142, 0.35);
|
||||
}
|
||||
.comment-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 30px;
|
||||
}
|
||||
.comment-list .comment {
|
||||
margin-bottom: 18px;
|
||||
padding: 20px 22px;
|
||||
background: #f8fafc;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
.comment-list .children {
|
||||
list-style: none;
|
||||
padding-left: 24px;
|
||||
margin-top: 15px;
|
||||
border-left: 2px solid #cbd5e1;
|
||||
}
|
||||
.comment-author {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--heading-color);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.comment-author img.avatar {
|
||||
border-radius: 50%;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
}
|
||||
.comment-metadata {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.comment-reply-link {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--secondary-color);
|
||||
padding: 4px 12px;
|
||||
background: #e0f2fe;
|
||||
border-radius: 20px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.comment-reply-link:hover {
|
||||
background: var(--primary-color);
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
/* 25. MODERN SOCIAL SHARE BOX */
|
||||
.edukarsa-share-box {
|
||||
margin-top: 35px;
|
||||
padding: 20px 24px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.share-box-title {
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
color: var(--heading-color);
|
||||
letter-spacing: 0.2px;
|
||||
}
|
||||
.share-btn-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.share-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 50px;
|
||||
font-size: 12.5px;
|
||||
font-weight: 700;
|
||||
color: #ffffff !important;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s ease;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
.share-pill:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
.share-pill svg {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.share-pill-wa { background-color: #25d366; }
|
||||
.share-pill-wa:hover { background-color: #1ebc57; }
|
||||
.share-pill-fb { background-color: #1877f2; }
|
||||
.share-pill-fb:hover { background-color: #0c63d4; }
|
||||
.share-pill-tw { background-color: #0f1419; }
|
||||
.share-pill-tw:hover { background-color: #272c30; }
|
||||
.share-pill-copy { background-color: #475569; }
|
||||
.share-pill-copy:hover { background-color: #334155; }
|
||||
|
||||
Reference in New Issue
Block a user