theme changes

This commit is contained in:
gustavooth
2026-07-26 20:47:44 -03:00
parent b9b8307088
commit 5891467266
7 changed files with 181 additions and 32 deletions
+9
View File
@@ -38,3 +38,12 @@ fi
echo "[wpcli] Activating Query Monitor plugin..." echo "[wpcli] Activating Query Monitor plugin..."
wp plugin activate query-monitor --path=/var/www/html wp plugin activate query-monitor --path=/var/www/html
echo "[wpcli] Activating Gustavo Portfolio Core dependencies..."
wp plugin activate fluentform fluent-crm fluent-smtp --path=/var/www/html
echo "[wpcli] Activating Gustavo Portfolio Core plugin..."
wp plugin activate gustavoo-portfolio-core --path=/var/www/html
echo "[wpcli] Activating Gustavo Portfolio theme..."
wp theme activate gustavoo-portfolio --path=/var/www/html
@@ -2684,6 +2684,79 @@ p:last-child {
.menu-drawer-close { display: none; } .menu-drawer-close { display: none; }
.header-search {
position: relative;
flex: 0 0 auto;
}
.header-search__toggle {
display: flex;
width: 42px;
height: 42px;
align-items: center;
justify-content: center;
color: var(--color-text);
background: rgba(255, 255, 255, 0.035);
border: 1px solid var(--color-line-soft);
border-radius: 12px;
}
.header-search__toggle:hover,
.header-search__toggle[aria-expanded="true"] {
color: var(--color-brand-strong);
border-color: var(--color-brand);
}
.header-search__panel {
position: absolute;
top: calc(100% + 10px);
right: 0;
z-index: 60;
display: flex;
width: 400px;
align-items: center;
gap: 8px;
padding: 12px;
background: var(--color-bg-alt);
border: 1px solid var(--color-line-soft);
border-radius: 12px;
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.header-search__panel[hidden] { display: none; }
.header-search__panel .search-form { flex: 1; }
.header-search__close {
display: none;
width: 34px;
height: 34px;
flex: 0 0 auto;
align-items: center;
justify-content: center;
color: var(--color-text-soft);
background: transparent;
border: none;
}
@media (max-width: 920px) {
.header-search__panel {
position: fixed;
top: var(--header-height);
right: 0;
left: 0;
z-index: 1002;
width: auto;
padding: 14px var(--gutter);
border-radius: 0;
border-width: 0 0 1px;
}
.header-search__close { display: flex; }
.header-search__panel .search-form__submit span:not([aria-hidden]) { display: none; }
.header-search__panel .search-form__submit { min-width: 44px; padding: 10px; }
}
/* /*
* WordPress inserts its native Customizer shortcut just outside the left edge * WordPress inserts its native Customizer shortcut just outside the left edge
* of a partial by default. The preview iframe clips that area behind the * of a partial by default. The preview iframe clips that area behind the
@@ -3863,7 +3936,7 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
.latest-news-card__excerpt { color: var(--color-text-soft); } .latest-news-card__excerpt { color: var(--color-text-soft); }
.latest-news-list { .latest-news-list {
width: min(100%, 720px); width: min(100%, 1080px);
margin-top: clamp(64px, 8vw, 100px); margin-top: clamp(64px, 8vw, 100px);
} }
@@ -3884,14 +3957,14 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
border-radius: 4px; border-radius: 4px;
} }
.latest-news-list__items { display: grid; gap: 28px; } .latest-news-list__items { display: grid; gap: 40px; }
.latest-news-list__item { .latest-news-list__item {
display: grid; display: grid;
min-width: 0; min-width: 0;
align-items: center; align-items: center;
gap: 17px; gap: 28px;
grid-template-columns: 120px minmax(0, 1fr); grid-template-columns: 340px minmax(0, 1fr);
} }
.latest-news-list__image { .latest-news-list__image {
@@ -3910,23 +3983,24 @@ a.entry-category-badge:hover { color: #052b28; background: var(--color-brand-str
} }
.latest-news-list__item:hover .latest-news-list__image img { transform: scale(1.05); } .latest-news-list__item:hover .latest-news-list__image img { transform: scale(1.05); }
.latest-news-list__body .latest-news-card__category { margin-bottom: 8px; } .latest-news-list__body .latest-news-card__category { margin-bottom: 14px; font-size: 0.95rem; }
.latest-news-list__body h3 { .latest-news-list__body h3 {
margin: 0 0 7px; margin: 0 0 14px;
color: var(--color-text); color: var(--color-text);
font-size: clamp(0.94rem, 1.4vw, 1.08rem); font-size: clamp(1.5rem, 2.6vw, 2.1rem);
line-height: 1.28; line-height: 1.24;
} }
.latest-news-list__body h3 a { color: inherit; text-decoration: none; } .latest-news-list__body h3 a { color: inherit; text-decoration: none; }
.latest-news-list__body h3 a:hover { color: var(--color-brand-strong); } .latest-news-list__body h3 a:hover { color: var(--color-brand-strong); }
.latest-news-list__body time { color: var(--color-text-muted); font-size: 0.76rem; } .latest-news-list__body time { color: var(--color-text-muted); font-size: 1rem; }
@media (max-width: 560px) { @media (max-width: 760px) {
.latest-news-list { margin-top: 58px; } .latest-news-list { margin-top: 58px; }
.latest-news-list__heading { margin-bottom: 28px; } .latest-news-list__heading { margin-bottom: 28px; }
.latest-news-list__item { gap: 13px; grid-template-columns: 92px minmax(0, 1fr); } .latest-news-list__item { gap: 16px; grid-template-columns: 1fr; }
.latest-news-list__body h3 { font-size: clamp(1.2rem, 5vw, 1.5rem); }
} }
/* Editorial page header order: site header, categories, then page heading. */ /* Editorial page header order: site header, categories, then page heading. */
@@ -177,6 +177,62 @@
desktopQuery.addEventListener("change", handleDesktop); desktopQuery.addEventListener("change", handleDesktop);
} }
const searchToggle = document.querySelector(".header-search__toggle");
const searchPanel = document.querySelector(".header-search__panel");
if (searchToggle && searchPanel) {
const searchClose = searchPanel.querySelector(".header-search__close");
const searchField = searchPanel.querySelector(".search-form__field, .search-field");
const closeSearch = (restoreFocus) => {
searchToggle.setAttribute("aria-expanded", "false");
searchPanel.hidden = true;
if (restoreFocus) {
searchToggle.focus();
}
};
const openSearch = () => {
searchToggle.setAttribute("aria-expanded", "true");
searchPanel.hidden = false;
if (searchField) {
window.requestAnimationFrame(() => searchField.focus());
}
};
searchToggle.addEventListener("click", function () {
if (searchToggle.getAttribute("aria-expanded") === "true") {
closeSearch(false);
} else {
openSearch();
}
});
if (searchClose) {
searchClose.addEventListener("click", function () {
closeSearch(true);
});
}
document.addEventListener("click", function (event) {
if (searchToggle.getAttribute("aria-expanded") !== "true") {
return;
}
if (!event.target.closest(".header-search")) {
closeSearch(false);
}
});
document.addEventListener("keydown", function (event) {
if (event.key === "Escape" && searchToggle.getAttribute("aria-expanded") === "true") {
closeSearch(true);
}
});
}
if (window.location.hash.length > 1) { if (window.location.hash.length > 1) {
const hashId = decodeURIComponent(window.location.hash.slice(1)); const hashId = decodeURIComponent(window.location.hash.slice(1));
const hashTarget = document.getElementById(hashId); const hashTarget = document.getElementById(hashId);
@@ -61,6 +61,20 @@ $gustavoo_primary_shortcut_attr = is_customize_preview() ? ' data-customize-part
<?php endif; ?> <?php endif; ?>
</nav> </nav>
<?php if ( $gustavoo_is_editorial_page ) : ?>
<div class="header-search">
<button class="header-search__toggle" type="button" aria-expanded="false" aria-controls="header-search-panel" aria-label="<?php esc_attr_e( 'Pesquisar', 'gustavoo-portfolio' ); ?>">
<svg aria-hidden="true" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
</button>
<div class="header-search__panel" id="header-search-panel" hidden>
<?php get_search_form(); ?>
<button class="header-search__close" type="button" data-search-close aria-label="<?php esc_attr_e( 'Fechar busca', 'gustavoo-portfolio' ); ?>">
<svg aria-hidden="true" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
</div>
<?php endif; ?>
</div> </div>
</header> </header>
@@ -532,24 +532,19 @@ function gustavoo_portfolio_reading_time( $post_id = null ) {
* @return void * @return void
*/ */
function gustavoo_portfolio_entry_terms() { function gustavoo_portfolio_entry_terms() {
$categories = get_the_category_list( esc_html_x( ', ', 'category list separator', 'gustavoo-portfolio' ) );
$tags = get_the_tag_list( '', esc_html_x( ', ', 'tag list separator', 'gustavoo-portfolio' ) ); $tags = get_the_tag_list( '', esc_html_x( ', ', 'tag list separator', 'gustavoo-portfolio' ) );
if ( $categories ) { if ( ! $tags ) {
printf( return false;
'<div class="entry-terms entry-terms--categories"><span>%1$s</span> %2$s</div>',
esc_html__( 'Categorias:', 'gustavoo-portfolio' ),
wp_kses_post( $categories )
);
} }
if ( $tags ) {
printf( printf(
'<div class="entry-terms entry-terms--tags"><span>%1$s</span> %2$s</div>', '<div class="entry-terms entry-terms--tags"><span>%1$s</span> %2$s</div>',
esc_html__( 'Tags:', 'gustavoo-portfolio' ), esc_html__( 'Tags:', 'gustavoo-portfolio' ),
wp_kses_post( $tags ) wp_kses_post( $tags )
); );
}
return true;
} }
/** /**
@@ -62,9 +62,11 @@ get_header();
?> ?>
</div> </div>
<?php if ( get_the_tag_list() ) : ?>
<footer class="entry-footer"> <footer class="entry-footer">
<?php gustavoo_portfolio_entry_terms(); ?> <?php gustavoo_portfolio_entry_terms(); ?>
</footer> </footer>
<?php endif; ?>
<?php <?php
$gustavoo_categories = get_the_category(); $gustavoo_categories = get_the_category();
@@ -9,7 +9,7 @@ $gustavoo_args = isset( $args ) && is_array( $args ) ? $args : array();
$gustavoo_query_args = array( $gustavoo_query_args = array(
'post_type' => 'post', 'post_type' => 'post',
'post_status' => 'publish', 'post_status' => 'publish',
'posts_per_page' => 4, 'posts_per_page' => 10,
'post__not_in' => array_map( 'absint', $gustavoo_args['exclude'] ?? array() ), 'post__not_in' => array_map( 'absint', $gustavoo_args['exclude'] ?? array() ),
'ignore_sticky_posts' => true, 'ignore_sticky_posts' => true,
'orderby' => 'date', 'orderby' => 'date',
@@ -26,8 +26,7 @@ if ( ! $gustavoo_latest_posts->have_posts() ) {
return; return;
} }
?> ?>
<section class="latest-news-list" aria-labelledby="latest-news-list-title"> <section class="latest-news-list" aria-label="<?php esc_attr_e( 'Últimas notícias', 'gustavoo-portfolio' ); ?>">
<h2 id="latest-news-list-title" class="latest-news-list__heading"><?php esc_html_e( 'Últimas notícias', 'gustavoo-portfolio' ); ?></h2>
<div class="latest-news-list__items"> <div class="latest-news-list__items">
<?php while ( $gustavoo_latest_posts->have_posts() ) : $gustavoo_latest_posts->the_post(); ?> <?php while ( $gustavoo_latest_posts->have_posts() ) : $gustavoo_latest_posts->the_post(); ?>
<?php $gustavoo_categories = get_the_category(); $gustavoo_category = $gustavoo_categories ? $gustavoo_categories[0] : null; $gustavoo_image_url = gustavoo_portfolio_get_news_image_url(); ?> <?php $gustavoo_categories = get_the_category(); $gustavoo_category = $gustavoo_categories ? $gustavoo_categories[0] : null; $gustavoo_image_url = gustavoo_portfolio_get_news_image_url(); ?>