mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 22:51:09 -07:00
Improve sponsor title visibility
This commit is contained in:
+17
-5
@@ -132,9 +132,15 @@
|
|||||||
backdrop-filter: blur(6px);
|
backdrop-filter: blur(6px);
|
||||||
}
|
}
|
||||||
.sidesponsor img {
|
.sidesponsor img {
|
||||||
height: auto;
|
height: 45%;
|
||||||
width: 60%;
|
max-height: 150px;
|
||||||
|
min-height: 95px;
|
||||||
|
width: auto;
|
||||||
|
max-width: 78%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
object-fit: contain;
|
||||||
|
align-self: center;
|
||||||
|
flex: 0 0 auto;
|
||||||
transition-property: all;
|
transition-property: all;
|
||||||
transition-timing-function: cubic-bezier(.4,0,.2,1);
|
transition-timing-function: cubic-bezier(.4,0,.2,1);
|
||||||
transition-duration: .3s;
|
transition-duration: .3s;
|
||||||
@@ -166,9 +172,15 @@
|
|||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: 2rem;
|
font-size: var(--sponsor-title-font-size, clamp(1.28rem, 7.2cqw, 1.75rem));
|
||||||
line-height: 1.08;
|
line-height: 1.08;
|
||||||
color: var(--sponsor-fg);
|
color: var(--sponsor-fg);
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
text-align: center;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
.sidesponsor .sponsor-title.sponsor-title--long {
|
||||||
|
line-height: 1.02;
|
||||||
}
|
}
|
||||||
.sidesponsor:hover .sponsor-title{
|
.sidesponsor:hover .sponsor-title{
|
||||||
grid-area: sponsor-title;
|
grid-area: sponsor-title;
|
||||||
@@ -181,8 +193,8 @@
|
|||||||
}
|
}
|
||||||
.sidesponsor .sponsor-description{
|
.sidesponsor .sponsor-description{
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 5px;
|
margin-top: 0;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 0;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
color: var(--sponsor-fg);
|
color: var(--sponsor-fg);
|
||||||
|
|||||||
+16
-3
@@ -95,6 +95,18 @@
|
|||||||
return bsaScriptPromise
|
return bsaScriptPromise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSponsorTitleFontSize(title) {
|
||||||
|
if (title.length > 45) {
|
||||||
|
return "1.25rem"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (title.length > 28) {
|
||||||
|
return "1.35rem"
|
||||||
|
}
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
function setLegacySponsorContent(sponsor, container, nodes) {
|
function setLegacySponsorContent(sponsor, container, nodes) {
|
||||||
nodes.img.src = sponsor.image_url
|
nodes.img.src = sponsor.image_url
|
||||||
nodes.img.alt = sponsor.name
|
nodes.img.alt = sponsor.name
|
||||||
@@ -104,12 +116,13 @@
|
|||||||
nodes.cta.textContent = sponsor.cta
|
nodes.cta.textContent = sponsor.cta
|
||||||
container.style.display = "flex"
|
container.style.display = "flex"
|
||||||
|
|
||||||
if (sponsor.name.length > 45) {
|
nodes.title.classList.toggle("sponsor-title--long", sponsor.name.length > 28)
|
||||||
nodes.title.style.fontSize = "1.6rem"
|
nodes.title.style.fontSize = getSponsorTitleFontSize(sponsor.name)
|
||||||
}
|
|
||||||
|
|
||||||
if (sponsor.description.length > 250) {
|
if (sponsor.description.length > 250) {
|
||||||
nodes.description.style.fontSize = "1.4rem"
|
nodes.description.style.fontSize = "1.4rem"
|
||||||
|
} else {
|
||||||
|
nodes.description.style.fontSize = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user