<noscript> support for AOS component
This commit is contained in:
parent
8b51506511
commit
296f0ba6a4
1 changed files with 17 additions and 1 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import React from 'react'
|
||||
import AOS from 'aos'
|
||||
import Helmet from 'react-helmet'
|
||||
import 'aos/dist/aos.css'
|
||||
|
||||
export default ({ options }) => {
|
||||
|
|
@ -9,6 +11,20 @@ export default ({ options }) => {
|
|||
easing: 'ease-out-sine',
|
||||
delay: 0
|
||||
}
|
||||
|
||||
AOS.init({ ...defaultOptions, ...options })
|
||||
return null
|
||||
|
||||
return (
|
||||
<Helmet>
|
||||
<noscript>{`
|
||||
<style>
|
||||
/* override AOS css if no JS */
|
||||
[data-aos] {
|
||||
opacity: 1 !important;
|
||||
transform: translate(0) scale(1) !important;
|
||||
}
|
||||
</style>
|
||||
`}</noscript>
|
||||
</Helmet>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue