Move species image into right column detail card with attribution
This commit is contained in:
@@ -1165,32 +1165,19 @@ td.placeholder {
|
|||||||
color: #e65100;
|
color: #e65100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Species header: title left, image right */
|
/* Species / cultivar images inside detail cards */
|
||||||
|
|
||||||
.species-header {
|
.image-card-body {
|
||||||
display: flex;
|
padding: 0.75rem;
|
||||||
align-items: flex-start;
|
text-align: center;
|
||||||
gap: 2rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.species-header-text {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Species / cultivar images */
|
|
||||||
|
|
||||||
.species-image-wrap {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.species-image {
|
.species-image {
|
||||||
max-width: 280px;
|
max-width: 100%;
|
||||||
max-height: 260px;
|
max-height: 300px;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -554,37 +554,9 @@ pub fn SpeciesDetail(slug: String) -> Element {
|
|||||||
.or_else(|| s.primary_image_key.clone());
|
.or_else(|| s.primary_image_key.clone());
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div { class: "species-header",
|
h1 { em { "{s.name_scientific}" } }
|
||||||
div { class: "species-header-text",
|
if common_name != s.name_scientific {
|
||||||
h1 { em { "{s.name_scientific}" } }
|
p { class: "name-common", "{common_name}" }
|
||||||
if common_name != s.name_scientific {
|
|
||||||
p { class: "name-common", "{common_name}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if let Some(ref key) = img_key {
|
|
||||||
div { class: "species-image-wrap",
|
|
||||||
img { class: "species-image", src: "/img/{key}", alt: "{s.name_scientific}" }
|
|
||||||
if let Some(ref img) = primary_img {
|
|
||||||
div { class: "image-attribution",
|
|
||||||
if let Some(ref caption) = img.caption {
|
|
||||||
span { "{caption}" }
|
|
||||||
}
|
|
||||||
if let Some(ref lic) = img.license {
|
|
||||||
if img.caption.is_some() {
|
|
||||||
" | "
|
|
||||||
}
|
|
||||||
span { "{lic}" }
|
|
||||||
}
|
|
||||||
if let Some(ref url) = img.source_url {
|
|
||||||
if img.caption.is_some() || img.license.is_some() {
|
|
||||||
" | "
|
|
||||||
}
|
|
||||||
a { href: "{url}", target: "_blank", class: "attribution-link", "Source" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div { class: "detail-row",
|
div { class: "detail-row",
|
||||||
@@ -690,6 +662,35 @@ pub fn SpeciesDetail(slug: String) -> Element {
|
|||||||
// === RIGHT COLUMN ===
|
// === RIGHT COLUMN ===
|
||||||
div { class: "detail-col",
|
div { class: "detail-col",
|
||||||
|
|
||||||
|
// Image card
|
||||||
|
if let Some(ref key) = img_key {
|
||||||
|
div { class: "detail-card",
|
||||||
|
div { class: "detail-card-header", "Image" }
|
||||||
|
div { class: "image-card-body",
|
||||||
|
img { class: "species-image", src: "/img/{key}", alt: "{s.name_scientific}" }
|
||||||
|
if let Some(ref img) = primary_img {
|
||||||
|
div { class: "image-attribution",
|
||||||
|
if let Some(ref caption) = img.caption {
|
||||||
|
span { "{caption}" }
|
||||||
|
}
|
||||||
|
if let Some(ref lic) = img.license {
|
||||||
|
if img.caption.is_some() {
|
||||||
|
" | "
|
||||||
|
}
|
||||||
|
span { "{lic}" }
|
||||||
|
}
|
||||||
|
if let Some(ref url) = img.source_url {
|
||||||
|
if img.caption.is_some() || img.license.is_some() {
|
||||||
|
" | "
|
||||||
|
}
|
||||||
|
a { href: "{url}", target: "_blank", class: "attribution-link", "Source" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Card 4: Growing Requirements
|
// Card 4: Growing Requirements
|
||||||
div { class: "detail-card",
|
div { class: "detail-card",
|
||||||
div { class: "detail-card-header", "Growing Requirements" }
|
div { class: "detail-card-header", "Growing Requirements" }
|
||||||
|
|||||||
Reference in New Issue
Block a user