@@ -24,9 +24,11 @@ import useScript from '@/components/useScript'
24
24
25
25
const Home = ( { bio, avatar_url, blog, email, randomE } ) => {
26
26
const recaptchaRef = createRef ( )
27
- const [ showMoreOptions , setShowMoreOptions ] = useState ( false )
27
+
28
+ const [ isLoadPet , setIsLoadPet ] = useState ( 0 )
28
29
const [ showHuman , setShowHuman ] = useState ( false )
29
30
const [ errorCaptcha , setErrorCaptcha ] = useState ( false )
31
+ const [ showMoreOptions , setShowMoreOptions ] = useState ( false )
30
32
31
33
useEffect ( ( ) => {
32
34
ReactGA . initialize ( process . env . TRACKING_ID )
@@ -42,7 +44,8 @@ const Home = ({ bio, avatar_url, blog, email, randomE }) => {
42
44
useEffect ( ( ) => {
43
45
const DEFAULT_XML = window ?. location ?. origin + '/pets/neko.xml'
44
46
45
- if ( statusScript === 'ready' ) {
47
+ if ( statusScript === 'ready' && isLoadPet < 2 ) {
48
+ setIsLoadPet ( old => old + 1 )
46
49
// eslint-disable-next-line no-undef, new-cap
47
50
new eSheep ( { allowPets : 'none' , allowPopup : 'no' } ) . Start ( DEFAULT_XML )
48
51
}
@@ -86,7 +89,7 @@ const Home = ({ bio, avatar_url, blog, email, randomE }) => {
86
89
*/ }
87
90
< div
88
91
style = { { '--bg-url' : `url(${ randomE } )` } }
89
- className = "bg-cover bg-[image:var(--bg-url)] absolute inset-0"
92
+ className = "bg-cover bg-[image:var(--bg-url)] absolute inset-0 blur-sm "
90
93
/>
91
94
92
95
< div className = "flex flex-col h-screen" >
@@ -103,7 +106,7 @@ const Home = ({ bio, avatar_url, blog, email, randomE }) => {
103
106
src = { avatar_url }
104
107
alt = ""
105
108
/>
106
- < span className = "absolute bottom-0 right-0 block transform translate-x-1/2 border-2 border-white rounded-full" >
109
+ < span className = "absolute bottom-0 right-0 block transform translate-x-1/2 translate-y-1/2 border-2 border-white rounded-full md:translate-y-0 " >
107
110
< span className = { classNames ( 'block w-4 h-4 rounded-full' , isOnline ( ) ? 'bg-green-400' : 'bg-gray-300' ) } />
108
111
</ span >
109
112
</ span >
@@ -197,12 +200,11 @@ const Home = ({ bio, avatar_url, blog, email, randomE }) => {
197
200
</ Transition >
198
201
199
202
</ div >
203
+ < AlertRobotComponent errorCaptcha = { errorCaptcha } />
200
204
</ div >
201
205
202
206
< div className = "absolute bottom-1 left-0 w-full h-7 bg-zz-top border-0 bg-[length:1rem]" />
203
207
204
- < AlertRobotComponent errorCaptcha = { errorCaptcha } />
205
-
206
208
</ div >
207
209
208
210
</ div >
@@ -218,7 +220,7 @@ export async function getStaticProps () {
218
220
219
221
const unsplash = createApi ( { accessKey : process . env . KEY_UNSPLASH } )
220
222
const result = await unsplash . search . getPhotos ( {
221
- query : randomElement ( [ 'dev' , 'nodejs' , 'python' , 'php' ] ) ,
223
+ query : randomElement ( [ 'dev' , 'nodejs' , 'python' , 'php' , 'code' ] ) ,
222
224
orderBy : 'relevant' ,
223
225
orientation : 'landscape'
224
226
} )
0 commit comments