Adds [peptide_directory] shortcode with card grid, category taxonomy (8 terms), search, pagination, detail modal, and /v1/compounds REST endpoint. Includes 9 new meta fields (half-life, stability, solubility, etc.), admin data tools for migration/re-enrichment, integration hooks for cross-plugin extensibility, dark mode support, and full uninstall cleanup. Refactors AI generator into PSA_OpenRouter + PSA_KB_Builder classes. Adds PHPUnit tests for PostType and Directory classes. Fixes QA findings: dead JS selector, renderError loading state, numeric meta validation, prepared SQL in uninstall. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
622 lines
12 KiB
CSS
Executable File
622 lines
12 KiB
CSS
Executable File
/* ==========================================================================
|
|
Peptide Directory — Card Grid, Filters, and Detail Modal
|
|
Namespace: .psa-dir-* (BEM)
|
|
========================================================================== */
|
|
|
|
/* --- CSS Custom Properties for category badge colors (reusable by other plugins) --- */
|
|
:root {
|
|
--psa-cat-tissue-repair-bg: #d4edda;
|
|
--psa-cat-tissue-repair-fg: #155724;
|
|
--psa-cat-lipid-metabolism-bg: #d1ecf1;
|
|
--psa-cat-lipid-metabolism-fg: #0c5460;
|
|
--psa-cat-aging-research-bg: #e2d5f1;
|
|
--psa-cat-aging-research-fg: #432874;
|
|
--psa-cat-dermatological-bg: #fce4d6;
|
|
--psa-cat-dermatological-fg: #7c4a1a;
|
|
--psa-cat-metabolic-bg: #fff3cd;
|
|
--psa-cat-metabolic-fg: #856404;
|
|
--psa-cat-growth-hormone-bg: #cce5ff;
|
|
--psa-cat-growth-hormone-fg: #004085;
|
|
--psa-cat-immunology-bg: #f5c6cb;
|
|
--psa-cat-immunology-fg: #721c24;
|
|
--psa-cat-endocrine-bg: #c3e6cb;
|
|
--psa-cat-endocrine-fg: #1b5e20;
|
|
}
|
|
|
|
/* --- Wrapper --- */
|
|
.psa-dir-wrap {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 2rem 1rem;
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
|
|
}
|
|
|
|
/* --- Header --- */
|
|
.psa-dir-header {
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.psa-dir-title {
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
color: #1e293b;
|
|
margin: 0 0 0.5rem;
|
|
}
|
|
|
|
.psa-dir-subtitle {
|
|
font-size: 1.05rem;
|
|
color: #64748b;
|
|
margin: 0;
|
|
}
|
|
|
|
/* --- Search --- */
|
|
.psa-dir-search-wrap {
|
|
max-width: 480px;
|
|
margin: 0 auto 1.5rem;
|
|
}
|
|
|
|
.psa-dir-search {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
font-size: 15px;
|
|
border: 2px solid #e2e8f0;
|
|
border-radius: 8px;
|
|
outline: none;
|
|
transition: border-color 0.2s;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.psa-dir-search:focus {
|
|
border-color: #2563eb;
|
|
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
|
|
}
|
|
|
|
/* --- Tabs --- */
|
|
.psa-dir-tabs {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.psa-dir-tab {
|
|
padding: 8px 20px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 6px;
|
|
background: #fff;
|
|
color: #64748b;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.psa-dir-tab:hover {
|
|
background: #f8fafc;
|
|
}
|
|
|
|
.psa-dir-tab--active {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
border-color: #2563eb;
|
|
}
|
|
|
|
/* --- Category Filters --- */
|
|
.psa-dir-filters {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.psa-dir-filter {
|
|
padding: 6px 16px;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 20px;
|
|
background: #fff;
|
|
color: #475569;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.psa-dir-filter:hover {
|
|
border-color: #2563eb;
|
|
color: #2563eb;
|
|
}
|
|
|
|
.psa-dir-filter--active {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
border-color: #2563eb;
|
|
}
|
|
|
|
/* --- Grid --- */
|
|
.psa-dir-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, 1fr);
|
|
gap: 1.25rem;
|
|
}
|
|
|
|
/* --- Card --- */
|
|
.psa-dir-card {
|
|
background: #fff;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 12px;
|
|
padding: 1.25rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.psa-dir-card:hover {
|
|
border-color: #2563eb;
|
|
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
|
|
}
|
|
|
|
.psa-dir-card__header {
|
|
margin-bottom: 0.75rem;
|
|
}
|
|
|
|
.psa-dir-card__title {
|
|
font-size: 1.1rem;
|
|
font-weight: 700;
|
|
color: #1e293b;
|
|
margin: 0 0 0.5rem;
|
|
}
|
|
|
|
.psa-dir-card__badge {
|
|
display: inline-block;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
padding: 2px 10px;
|
|
border-radius: 12px;
|
|
}
|
|
|
|
.psa-dir-card__meta {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
margin-bottom: 1rem;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.psa-dir-card__meta-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.psa-dir-card__meta-label {
|
|
color: #64748b;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.psa-dir-card__meta-value {
|
|
color: #1e293b;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.psa-dir-card__btn {
|
|
width: 100%;
|
|
padding: 10px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
background: #2563eb;
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
margin-top: auto;
|
|
}
|
|
|
|
.psa-dir-card__btn:hover {
|
|
background: #1d4ed8;
|
|
}
|
|
|
|
/* --- Category Badge Colors --- */
|
|
.psa-dir-badge--tissue-repair { background: var(--psa-cat-tissue-repair-bg); color: var(--psa-cat-tissue-repair-fg); }
|
|
.psa-dir-badge--lipid-metabolism { background: var(--psa-cat-lipid-metabolism-bg); color: var(--psa-cat-lipid-metabolism-fg); }
|
|
.psa-dir-badge--aging-research { background: var(--psa-cat-aging-research-bg); color: var(--psa-cat-aging-research-fg); }
|
|
.psa-dir-badge--dermatological { background: var(--psa-cat-dermatological-bg); color: var(--psa-cat-dermatological-fg); }
|
|
.psa-dir-badge--metabolic { background: var(--psa-cat-metabolic-bg); color: var(--psa-cat-metabolic-fg); }
|
|
.psa-dir-badge--growth-hormone { background: var(--psa-cat-growth-hormone-bg); color: var(--psa-cat-growth-hormone-fg); }
|
|
.psa-dir-badge--immunology { background: var(--psa-cat-immunology-bg); color: var(--psa-cat-immunology-fg); }
|
|
.psa-dir-badge--endocrine { background: var(--psa-cat-endocrine-bg); color: var(--psa-cat-endocrine-fg); }
|
|
|
|
/* --- Empty State --- */
|
|
.psa-dir-empty,
|
|
.psa-dir-coming-soon {
|
|
text-align: center;
|
|
padding: 3rem 1rem;
|
|
color: #64748b;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
/* --- Loader --- */
|
|
.psa-dir-loader {
|
|
text-align: center;
|
|
padding: 3rem 1rem;
|
|
}
|
|
|
|
.psa-dir-loader p {
|
|
color: #64748b;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
/* --- Load More --- */
|
|
.psa-dir-load-more-wrap {
|
|
text-align: center;
|
|
margin-top: 2rem;
|
|
}
|
|
|
|
.psa-dir-load-more {
|
|
padding: 12px 32px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
background: #fff;
|
|
color: #2563eb;
|
|
border: 2px solid #2563eb;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.psa-dir-load-more:hover {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
}
|
|
|
|
.psa-dir-load-more:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* --- Error --- */
|
|
.psa-dir-error {
|
|
text-align: center;
|
|
color: #991b1b;
|
|
padding: 2rem;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Detail Modal
|
|
========================================================================== */
|
|
|
|
.psa-dir-modal {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: 99999;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.psa-dir-modal__backdrop {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.psa-dir-modal__content {
|
|
position: relative;
|
|
background: #fff;
|
|
border-radius: 16px;
|
|
padding: 2rem;
|
|
max-width: 700px;
|
|
width: 90%;
|
|
max-height: 85vh;
|
|
overflow-y: auto;
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.psa-dir-modal__close {
|
|
position: absolute;
|
|
top: 12px;
|
|
right: 16px;
|
|
font-size: 28px;
|
|
background: none;
|
|
border: none;
|
|
color: #94a3b8;
|
|
cursor: pointer;
|
|
line-height: 1;
|
|
padding: 4px;
|
|
}
|
|
|
|
.psa-dir-modal__close:hover {
|
|
color: #1e293b;
|
|
}
|
|
|
|
.psa-dir-modal__title {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: #1e293b;
|
|
margin: 0 0 0.5rem;
|
|
padding-right: 2rem;
|
|
}
|
|
|
|
.psa-dir-modal__badges {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.psa-dir-modal__desc {
|
|
font-size: 15px;
|
|
line-height: 1.65;
|
|
color: #475569;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
/* --- Sequence --- */
|
|
.psa-dir-modal__sequence-wrap {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
background: #f1f5f9;
|
|
padding: 12px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.psa-dir-modal__sequence {
|
|
font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
|
|
font-size: 13px;
|
|
word-break: break-all;
|
|
flex: 1;
|
|
color: #334155;
|
|
}
|
|
|
|
.psa-dir-modal__copy {
|
|
padding: 4px 12px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
background: #2563eb;
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.psa-dir-modal__copy:hover {
|
|
background: #1d4ed8;
|
|
}
|
|
|
|
/* --- Data Grid --- */
|
|
.psa-dir-modal__data-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 12px;
|
|
margin-bottom: 1.5rem;
|
|
padding: 1rem;
|
|
background: #f8fafc;
|
|
border-radius: 10px;
|
|
border: 1px solid #e2e8f0;
|
|
}
|
|
|
|
.psa-dir-modal__data-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.psa-dir-modal__data-label {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.3px;
|
|
color: #64748b;
|
|
}
|
|
|
|
.psa-dir-modal__data-value {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: #1e293b;
|
|
}
|
|
|
|
/* --- Modal Sections --- */
|
|
.psa-dir-modal__section {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.psa-dir-modal__section h4 {
|
|
font-size: 15px;
|
|
font-weight: 700;
|
|
color: #1e293b;
|
|
margin: 0 0 0.5rem;
|
|
padding-bottom: 6px;
|
|
border-bottom: 2px solid #2563eb;
|
|
}
|
|
|
|
.psa-dir-modal__section p {
|
|
font-size: 14px;
|
|
line-height: 1.6;
|
|
color: #475569;
|
|
margin: 0 0 0.5rem;
|
|
}
|
|
|
|
/* --- PubChem Link --- */
|
|
.psa-dir-modal__pubchem {
|
|
display: inline-block;
|
|
font-size: 13px;
|
|
color: #2563eb;
|
|
text-decoration: none;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.psa-dir-modal__pubchem:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* --- Full Page Link --- */
|
|
.psa-dir-modal__full-link {
|
|
display: inline-block;
|
|
padding: 10px 24px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
background: #f1f5f9;
|
|
color: #2563eb;
|
|
text-decoration: none;
|
|
border-radius: 8px;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.psa-dir-modal__full-link:hover {
|
|
background: #e2e8f0;
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Responsive
|
|
========================================================================== */
|
|
|
|
/* Tablet: 2 columns */
|
|
@media (max-width: 900px) {
|
|
.psa-dir-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
}
|
|
|
|
/* Mobile: 1 column */
|
|
@media (max-width: 600px) {
|
|
.psa-dir-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.psa-dir-title {
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.psa-dir-modal__content {
|
|
width: 95%;
|
|
padding: 1.25rem;
|
|
max-height: 90vh;
|
|
}
|
|
|
|
.psa-dir-modal__data-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.psa-dir-filters {
|
|
gap: 6px;
|
|
}
|
|
|
|
.psa-dir-filter {
|
|
font-size: 12px;
|
|
padding: 5px 12px;
|
|
}
|
|
}
|
|
|
|
/* ==========================================================================
|
|
Dark Mode Support
|
|
Uses the theme's data-theme="dark" attribute and CSS custom properties.
|
|
========================================================================== */
|
|
|
|
[data-theme="dark"] .psa-dir-wrap {
|
|
color: #e2e8f0;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-title {
|
|
color: #f1f5f9;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-subtitle {
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-search {
|
|
background: #1e293b;
|
|
border-color: #334155;
|
|
color: #f1f5f9;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-tab {
|
|
background: #1e293b;
|
|
border-color: #334155;
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-tab--active {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-filter {
|
|
background: #1e293b;
|
|
border-color: #334155;
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-filter--active {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-card {
|
|
background: #1e293b;
|
|
border-color: #334155;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-card__title {
|
|
color: #f1f5f9;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-card__meta-label {
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-card__meta-value {
|
|
color: #e2e8f0;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__content {
|
|
background: #0f172a;
|
|
color: #e2e8f0;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__title {
|
|
color: #f1f5f9;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__desc {
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__data-grid {
|
|
background: #1e293b;
|
|
border-color: #334155;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__data-label {
|
|
color: #94a3b8;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__data-value {
|
|
color: #e2e8f0;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__sequence-wrap {
|
|
background: #1e293b;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__sequence {
|
|
color: #e2e8f0;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__close {
|
|
color: #64748b;
|
|
}
|
|
|
|
[data-theme="dark"] .psa-dir-modal__close:hover {
|
|
color: #f1f5f9;
|
|
}
|