mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 23:43:45 +02:00
fix: AbortController not found, resize text in Box
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
8a5970107f
commit
fdb6083c6b
@@ -44,14 +44,14 @@ const StickyBoxedTitle: React.FC<IBoxedTitleProps> = (props) => {
|
|||||||
<SC.StickyBox>
|
<SC.StickyBox>
|
||||||
{props.above}
|
{props.above}
|
||||||
|
|
||||||
<SC.Title
|
<SC.StickyTitle
|
||||||
className={cx({
|
className={cx({
|
||||||
"has-content-above": props.above,
|
"has-content-above": props.above,
|
||||||
"has-content-below": props.content,
|
"has-content-below": props.content,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</SC.Title>
|
</SC.StickyTitle>
|
||||||
|
|
||||||
{props.content}
|
{props.content}
|
||||||
</SC.StickyBox>
|
</SC.StickyBox>
|
||||||
@@ -83,7 +83,6 @@ export class HeaderBarebone extends Component<IHeaderBareboneProps, HeaderBarebo
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.tick = this.tick.bind(this)
|
this.tick = this.tick.bind(this)
|
||||||
this.controller = new AbortController()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tick() {
|
tick() {
|
||||||
@@ -95,6 +94,7 @@ export class HeaderBarebone extends Component<IHeaderBareboneProps, HeaderBarebo
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.controller = new AbortController()
|
||||||
document.addEventListener('scroll', debounce(this.tick), { passive: true, signal: this.controller.signal })
|
document.addEventListener('scroll', debounce(this.tick), { passive: true, signal: this.controller.signal })
|
||||||
this.tick()
|
this.tick()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,11 +133,12 @@ export const StickyBox = styled.div`
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
top: 0;
|
||||||
background: ${(props) => transparentize(0.3, props.theme.main.background)};
|
background: ${(props) => transparentize(0.3, props.theme.main.background)};
|
||||||
padding: 16px;
|
padding: 0px 0px 16px 30px;
|
||||||
backdrop-filter: blur(14px);
|
backdrop-filter: blur(14px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
font-size: 16px
|
||||||
|
|
||||||
@media screen and (max-width: 1200px) {
|
@media screen and (max-width: 1200px) {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -183,6 +184,15 @@ export const Title = styled.h1`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const StickyTitle = styled.h1`
|
||||||
|
${title};
|
||||||
|
font-size: 20px;
|
||||||
|
|
||||||
|
&.has-content-below {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
px;
|
||||||
|
`
|
||||||
|
|
||||||
export const SingleTitle = styled(Title)`
|
export const SingleTitle = styled(Title)`
|
||||||
${title};
|
${title};
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
Reference in New Issue
Block a user