Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810 H20
Team 61
Prosjekt 2
Commits
51b9fbd8
Commit
51b9fbd8
authored
Sep 23, 2020
by
haukao
Browse files
Seems the bug was not fixed afterall... It is no
#14
parent
21602e66
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Animations.ts
View file @
51b9fbd8
...
...
@@ -35,14 +35,8 @@ const randomRGB = (specification: Color = Color.RANDOM): string => {
const
greenMult
:
number
=
specification
===
Color
.
GREEN
?
255
:
50
;
const
blueMult
:
number
=
specification
===
Color
.
BLUE
?
255
:
50
;
const
red
:
string
=
toPaddedHexString
(
Math
.
floor
(
Math
.
random
()
*
redMult
),
2
);
const
green
:
string
=
toPaddedHexString
(
Math
.
floor
(
Math
.
random
()
*
greenMult
),
2
);
const
blue
:
string
=
toPaddedHexString
(
Math
.
floor
(
Math
.
random
()
*
blueMult
),
2
);
const
green
:
string
=
toPaddedHexString
(
Math
.
floor
(
Math
.
random
()
*
greenMult
),
2
);
const
blue
:
string
=
toPaddedHexString
(
Math
.
floor
(
Math
.
random
()
*
blueMult
),
2
);
return
red
+
green
+
blue
;
};
...
...
src/App.tsx
View file @
51b9fbd8
...
...
@@ -33,7 +33,7 @@ const App: React.FC = () => {
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
[
favourites
,
setFavourites
]
=
useState
<
number
[]
>
([]);
const
[
theme
,
setTheme
]
=
useState
<
number
>
(
0
);
const
[
userEdit
,
setUserEdit
]
=
useState
<
boolean
>
(
true
)
const
[
userEdit
,
setUserEdit
]
=
useState
<
boolean
>
(
true
)
;
const
[
errorDisplay
,
setErrorDisplay
]
=
useState
<
boolean
>
(
false
);
const
lsm
:
LocalStorageManager
=
new
LocalStorageManager
();
...
...
@@ -79,7 +79,7 @@ const App: React.FC = () => {
setUserEdit
(
false
);
};
/**
/**
* Temporary function as not all the animations are done
* @param specification - the color specification
*/
...
...
@@ -89,7 +89,9 @@ const App: React.FC = () => {
if
(
index
>
1
)
{
index
=
1
;
}
animate
(
index
,
specification
);
if
(
userEdit
||
specification
!==
Color
.
RANDOM
)
{
animate
(
index
,
specification
);
}
setUserEdit
(
false
);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment