Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Prosjekt 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anne Mosvold Ørke
Prosjekt 2
Commits
4eea5d7d
Commit
4eea5d7d
authored
4 years ago
by
Edvard Dønvold Sjøborg
Browse files
Options
Downloads
Patches
Plain Diff
Made the welcome SVG randomly generated
parent
76395d9f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/Components/LandingPage.tsx
+4
-8
4 additions, 8 deletions
frontend/src/Components/LandingPage.tsx
frontend/src/Components/LandingpageSVG.tsx
+36
-0
36 additions, 0 deletions
frontend/src/Components/LandingpageSVG.tsx
with
40 additions
and
8 deletions
frontend/src/Components/LandingPage.tsx
+
4
−
8
View file @
4eea5d7d
...
...
@@ -2,6 +2,7 @@ import React, { ReactElement} from 'react';
import
NavButton
from
'
./NavButton
'
;
import
"
../Style/LandingPage.css
"
import
FavoriteLink
from
"
./FavoriteLink
"
;
import
LandingpageSvg
from
"
./LandingpageSVG
"
;
type
props
=
{
// Typescript definitions for the arguments received via props
}
...
...
@@ -17,6 +18,8 @@ class LandingPage extends React.Component<props, state> {
this
.
state
=
{
favorites
:
[]}
}
componentDidMount
():
void
{
const
favs
=
[];
for
(
let
i
=
1
;
i
<
12
;
i
++
)
{
...
...
@@ -31,14 +34,7 @@ class LandingPage extends React.Component<props, state> {
<
div
className
=
{
'
landing-page
'
}
>
<
h1
className
=
{
'
title
'
}
>
Welcome to the gallery!
</
h1
>
<
div
className
=
{
'
welcome-svg
'
}
>
<
svg
className
=
{
"
SVG
"
}
xmlns
=
"http://www.w3.org/2000/svg"
height
=
"400"
width
=
"400"
>
<
polygon
points
=
"325,250 150,325 75,250 "
fill
=
"blue"
fill-opacity
=
"0.5"
></
polygon
>
<
polygon
points
=
"150,325 325,150 75,150 "
fill
=
"red"
fill-opacity
=
"0.5"
></
polygon
>
<
polygon
points
=
"325,250 250,75 75,150 "
fill
=
"green"
fill-opacity
=
"0.5"
></
polygon
>
<
polygon
points
=
"150,325 325,250 75,250 "
fill
=
"pink"
fill-opacity
=
"0.5"
></
polygon
>
<
polygon
points
=
"75,150 250,325 150,325 "
fill
=
"yellow"
fill-opacity
=
"0.5"
></
polygon
>
<
polygon
points
=
"150,75 75,250 250,325 "
fill
=
"orange"
fill-opacity
=
"0.5"
></
polygon
>
</
svg
>
<
LandingpageSvg
/>
</
div
>
<
p
className
=
{
'
welcome-p
'
}
>
Welcome to this interactive gallery! In here you will find unique art pieces,
consisting of a quote and SVG. If you turn up your volume you may hear some wonderful tunes to
...
...
This diff is collapsed.
Click to expand it.
frontend/src/Components/LandingpageSVG.tsx
0 → 100644
+
36
−
0
View file @
4eea5d7d
import
React
from
'
react
'
;
const
LandingpageSVG
=
()
=>
{
const
SVGpoints
=
[
"
150,75
"
,
"
250,75
"
,
"
325,150
"
,
"
325,250
"
,
"
250,325
"
,
"
150,325
"
,
"
75,250
"
,
"
75,150
"
];
const
pickPoints
=
()
=>
{
let
points
=
[]
while
(
points
.
length
<
3
)
{
let
x
=
SVGpoints
[
Math
.
floor
(
Math
.
random
()
*
SVGpoints
.
length
)];
while
(
points
.
indexOf
(
x
)
!==
-
1
)
{
x
=
SVGpoints
[
Math
.
floor
(
Math
.
random
()
*
SVGpoints
.
length
)];
}
points
.
push
(
x
);
}
return
points
.
join
(
'
'
);
}
return
(
<
div
className
=
{
'
welcome-svg
'
}
>
<
svg
id
=
"SVG"
xmlns
=
"http://www.w3.org/2000/svg"
height
=
"400"
width
=
"400"
>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"blue"
fill-opacity
=
"0.5"
/>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"red"
fill-opacity
=
"0.5"
/>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"green"
fill-opacity
=
"0.5"
/>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"yellow"
fill-opacity
=
"0.5"
/>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"pink"
fill-opacity
=
"0.5"
/>
<
polygon
points
=
{
pickPoints
()
}
fill
=
"orange"
fill-opacity
=
"0.5"
/>
</
svg
>
</
div
>
);
}
export
default
LandingpageSVG
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment