git-embed-feicode/style.css
feibisi 0c4746d0d3 Add site info and avatar display options to repo card
Introduces options to show site information and owner avatar in the repository card, including avatar size selection. Updates PHP, JS, and CSS to support new UI elements, avatar caching, and cache clearing via AJAX. Enhances visual presentation and user customization for embedded repository cards.
2025-07-31 14:45:54 +08:00

526 lines
No EOL
9.2 KiB
CSS

.wp-block-git-embed-feicode-repository {
margin: 1.5em 0;
max-width: 100%;
}
.wp-block-git-embed-feicode-repository.alignleft {
float: left;
margin-right: 1.5em;
max-width: 360px;
}
.wp-block-git-embed-feicode-repository.alignright {
float: right;
margin-left: 1.5em;
max-width: 360px;
}
.wp-block-git-embed-feicode-repository.aligncenter {
margin-left: auto;
margin-right: auto;
max-width: 600px;
}
.wp-block-git-embed-feicode-repository.alignwide {
max-width: 800px;
}
.wp-block-git-embed-feicode-repository.alignfull {
max-width: none;
}
.git-embed-card {
background: #ffffff;
border: 1px solid #d1d5da;
border-radius: 8px;
padding: 20px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.15s ease-in-out;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.git-embed-card:hover {
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
.git-embed-card-minimal {
border: none;
box-shadow: none;
background: #f9f9f9;
}
.git-embed-card-bordered {
border: 2px solid #0073aa;
}
.git-embed-card-shadow {
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
border: none;
}
.git-embed-site-info {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid #e1e4e8;
}
.git-embed-site-favicon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
.git-embed-site-name {
font-size: 12px;
color: #656d76;
font-weight: 500;
}
.git-embed-site-name a {
color: #656d76;
text-decoration: none;
}
.git-embed-site-name a:hover {
color: #0969da;
text-decoration: underline;
}
.git-embed-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 12px;
flex-wrap: wrap;
gap: 12px;
}
.git-embed-title-section {
display: flex;
align-items: flex-start;
gap: 12px;
flex: 1;
min-width: 0;
}
.git-embed-title-content {
flex: 1;
min-width: 0;
}
.git-embed-avatar {
border-radius: 50%;
flex-shrink: 0;
border: 2px solid #e1e4e8;
}
.git-embed-avatar-small {
width: 32px;
height: 32px;
}
.git-embed-avatar-medium {
width: 40px;
height: 40px;
}
.git-embed-avatar-large {
width: 48px;
height: 48px;
}
.git-embed-owner-info {
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
font-size: 12px;
}
.git-embed-owner-type {
background: #f1f8ff;
color: #0969da;
padding: 2px 6px;
border-radius: 12px;
font-size: 10px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.git-embed-owner-link {
color: #656d76;
text-decoration: none;
font-weight: 500;
}
.git-embed-owner-link:hover {
color: #0969da;
text-decoration: underline;
}
.git-embed-title {
margin: 0;
font-size: 18px;
font-weight: 600;
line-height: 1.3;
flex: 1;
min-width: 0;
display: flex;
align-items: center;
gap: 8px;
}
.git-embed-repo-icon {
color: #0073aa;
font-size: 16px;
margin-top: 2px;
flex-shrink: 0;
}
.git-embed-title a {
color: #0969da;
text-decoration: none;
word-break: break-word;
}
.git-embed-title a:hover {
text-decoration: underline;
}
.git-embed-language {
background: #f6f8fa;
border: 1px solid #d1d5da;
border-radius: 12px;
padding: 4px 8px;
font-size: 12px;
font-weight: 500;
color: #656d76;
white-space: nowrap;
display: flex;
align-items: center;
gap: 4px;
}
.git-embed-language .dashicons {
font-size: 14px;
}
.git-embed-description {
color: #656d76;
font-size: 14px;
line-height: 1.5;
margin: 0 0 16px 0;
display: flex;
align-items: flex-start;
gap: 6px;
}
.git-embed-description .dashicons {
margin-top: 2px;
flex-shrink: 0;
color: #0073aa;
}
.git-embed-stats {
display: flex;
gap: 16px;
margin-bottom: 16px;
flex-wrap: wrap;
}
.git-embed-stat {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: #656d76;
font-weight: 500;
}
.git-embed-stat .dashicons {
font-size: 16px;
color: #0073aa;
}
.git-embed-stat-label {
font-weight: 600;
}
.git-embed-stat-value {
font-weight: 500;
}
.git-embed-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.git-embed-button {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
font-size: 12px;
font-weight: 500;
line-height: 1.5;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
border: 1px solid;
transition: all 0.15s ease-in-out;
background: none;
}
.git-embed-button .dashicons {
font-size: 16px;
}
.git-embed-button-primary {
color: #ffffff;
background-color: #2da44e;
border-color: #2da44e;
}
.git-embed-button-primary:hover {
background-color: #2c974b;
border-color: #2c974b;
color: #ffffff;
text-decoration: none;
}
.git-embed-button-secondary {
color: #24292f;
background-color: #f6f8fa;
border-color: #d1d5da;
}
.git-embed-button-secondary:hover {
background-color: #f3f4f6;
border-color: #c7ccd1;
color: #24292f;
text-decoration: none;
}
.git-embed-button-outline {
color: #0073aa;
background-color: transparent;
border-color: #0073aa;
}
.git-embed-button-outline:hover {
background-color: #0073aa;
color: #ffffff;
text-decoration: none;
}
.git-embed-clone-btn:hover .dashicons {
animation: pulse 0.3s ease-in-out;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
.git-embed-placeholder {
border: 2px dashed #c3c4c7;
border-radius: 8px;
padding: 40px 20px;
text-align: center;
background: #f9f9f9;
}
.git-embed-placeholder-content {
max-width: 300px;
margin: 0 auto;
}
.git-embed-placeholder-icon {
font-size: 48px;
display: block;
margin-bottom: 16px;
color: #0073aa;
}
.git-embed-placeholder h3 {
margin: 0 0 8px 0;
color: #1e1e1e;
font-size: 18px;
}
.git-embed-placeholder p {
margin: 0;
color: #757575;
font-size: 14px;
line-height: 1.4;
}
.git-embed-loading {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 40px 20px;
text-align: center;
border: 1px solid #ddd;
border-radius: 8px;
background: #f9f9f9;
}
.git-embed-loading p {
margin: 16px 0 0 0;
color: #757575;
font-size: 14px;
}
.git-embed-error {
background: #f8d7da;
color: #721c24;
padding: 12px 16px;
border-radius: 6px;
border: 1px solid #f1aeb5;
font-size: 14px;
margin: 16px 0;
}
@media (max-width: 768px) {
.git-embed-card {
padding: 16px;
}
.git-embed-site-info {
margin-bottom: 12px;
padding-bottom: 8px;
}
.git-embed-title-section {
gap: 8px;
}
.git-embed-avatar-large {
width: 40px;
height: 40px;
}
.git-embed-avatar-medium {
width: 32px;
height: 32px;
}
.git-embed-owner-info {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.git-embed-header {
flex-direction: column;
align-items: flex-start;
gap: 8px;
}
.git-embed-stats {
gap: 12px;
}
.git-embed-actions {
width: 100%;
}
.git-embed-button {
flex: 1;
justify-content: center;
min-width: 0;
}
.wp-block-git-embed-feicode-repository.alignleft,
.wp-block-git-embed-feicode-repository.alignright {
float: none;
margin-left: auto;
margin-right: auto;
max-width: 100%;
}
}
@media (max-width: 480px) {
.git-embed-title {
font-size: 16px;
}
.git-embed-title-section {
flex-direction: column;
gap: 8px;
}
.git-embed-avatar {
align-self: flex-start;
}
.git-embed-owner-info {
margin-top: 0;
}
.git-embed-actions {
flex-direction: column;
}
.git-embed-stats {
justify-content: space-between;
}
.git-embed-stat {
flex-direction: column;
text-align: center;
gap: 2px;
}
.git-embed-site-info {
justify-content: center;
}
}
.wp-block[data-type="git-embed-feicode/repository"] {
position: relative;
}
.wp-block[data-type="git-embed-feicode/repository"]:not(.is-selected) .git-embed-card {
pointer-events: none;
}
.wp-block[data-type="git-embed-feicode/repository"].is-selected .git-embed-card {
box-shadow: 0 0 0 2px #007cba;
}
.components-panel__body .components-toggle-control .components-form-toggle:disabled {
opacity: 0.3;
}
.components-panel__body .components-select-control:disabled {
opacity: 0.3;
}
.git-embed-card img {
max-width: 100%;
height: auto;
}
.git-embed-site-favicon,
.git-embed-avatar {
image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges;
}
.git-embed-card .git-embed-avatar:hover {
transform: scale(1.05);
transition: transform 0.2s ease-in-out;
}
.git-embed-owner-type:empty {
display: none;
}