File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ import Counter from "./components/Hooks/useStateHook/Counter";
4
4
import Form from "./project/Form" ;
5
5
import ThemeToggler from "./project/ThemeToggler" ;
6
6
import HandlingForm from "./components/Hooks/useRefHook/HandlingForm" ;
7
-
8
7
// TRY IT YOURSELF COMPONENTS
9
8
import FormDetails from "./tryityourself/Akash/FormDetails" ;
10
- import RandomBg from "./tryityourself/Akash/RandomBg " ;
9
+ import RandomBackground from "./tryityourself/Akash/RandomBackground " ;
11
10
12
11
const App = ( ) => {
13
- return < RandomBg /> ;
12
+ return < RandomBackground /> ;
14
13
} ;
15
14
16
15
export default App ;
Original file line number Diff line number Diff line change 1
1
@import "tailwindcss" ;
2
2
@import "./components/Hooks/useRefHook/HandlingForm.style.css" ;
3
3
@import "./tryityourself/Akash/FormDetails.style.css" ;
4
- @import "./tryityourself/Akash/RandomBg .style.css" ;
4
+ @import "./tryityourself/Akash/RandomBackground .style.css" ;
Original file line number Diff line number Diff line change 1
1
import React , { useState , useEffect } from "react" ;
2
2
3
- const RandomBg = ( ) => {
4
- const [ rbg , setRbg ] = useState ( ) ;
3
+ const RandomBackground = ( ) => {
4
+ const [ randomSplash , setRandomSplash ] = useState ( ) ;
5
5
6
6
// FUNCTION FOR COLOR CHANGE (took help for the math.random() part)
7
- const ChangeBg = ( ) => {
7
+ const ChangeBackground = ( ) => {
8
8
const randomColors = "#" + Math . random ( ) . toString ( 16 ) . slice ( 2 , 8 ) ;
9
- setRbg ( randomColors ) ;
9
+ setRandomSplash ( randomColors ) ;
10
10
} ;
11
11
12
12
// USE EFFECT TO CHANGE BACKGROUND AT INTERVALS (took help for implying setInterval inside useEffect )
13
13
useEffect ( ( ) => {
14
- const interval = setInterval ( ChangeBg , 1500 ) ;
14
+ const interval = setInterval ( ChangeBackground , 1500 ) ;
15
15
} , [ ] ) ;
16
16
17
17
return (
18
- < div className = "random-bg" style = { { backgroundColor : rbg } } >
18
+ < div className = "random-bg" style = { { backgroundColor : randomSplash } } >
19
19
< div className = "text" > Random Background Color</ div >
20
20
</ div >
21
21
) ;
22
22
} ;
23
- export default RandomBg ;
23
+ export default RandomBackground ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments