-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb14cdb
commit 429e65f
Showing
5 changed files
with
57 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
#root { | ||
background: whitesmoke; | ||
} | ||
|
||
.App { | ||
padding: 25px 15px 25px 15px; | ||
border: 2px solid gray; | ||
min-height: 250px; | ||
padding: 25px 15px 25px 15px; | ||
border: 2px solid gray; | ||
min-height: 250px; | ||
} | ||
|
||
.App-header { | ||
background-color: #222; | ||
height: 150px; | ||
padding: 20px; | ||
color: white; | ||
font-size: 42px; | ||
text-align: center; | ||
background-color: #222; | ||
height: 150px; | ||
padding: 20px; | ||
color: white; | ||
font-size: 42px; | ||
text-align: center; | ||
} | ||
|
||
.App-header-description { | ||
font-size: 18px; | ||
font-size: 18px; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
50 changes: 15 additions & 35 deletions
50
lab2/src/components/BackgroundColorPicker/BackgroundColorPicker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,20 @@ | ||
import React, { Component } from "react"; | ||
import colors from "./colors"; | ||
import "./BackgroundColorPicker.css"; | ||
|
||
const BackgroundColorPicker = ({ onChange }) => { | ||
const colors = [ | ||
{ | ||
hex: "lavender", | ||
name: "lavender", | ||
}, | ||
{ | ||
hex: "gold", | ||
name: "gold", | ||
}, | ||
{ | ||
hex: "#f48c42", | ||
name: "🎃", | ||
}, | ||
{ | ||
hex: "rebeccapurple", | ||
name: "Beautiful purple", | ||
}, | ||
]; | ||
|
||
return ( | ||
<div className="BackgroundColorPicker"> | ||
<h5>Välj bakgrundsfärg</h5> | ||
<select className="custom-select" onChange={onChange}> | ||
{colors.map((color, index) => { | ||
return ( | ||
<option key={index} value={color.hex}> | ||
{color.name} | ||
</option> | ||
); | ||
})} | ||
</select> | ||
</div> | ||
); | ||
}; | ||
const BackgroundColorPicker = ({ onChange }) => ( | ||
<div className="BackgroundColorPicker"> | ||
<h5>Välj bakgrundsfärg</h5> | ||
<select className="custom-select" onChange={onChange}> | ||
{colors.map((color) => { | ||
return ( | ||
<option key={`color-${color.name}`} value={color.hex}> | ||
{color.name} | ||
</option> | ||
); | ||
})} | ||
</select> | ||
</div> | ||
); | ||
|
||
export default BackgroundColorPicker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const colors = [ | ||
{ | ||
hex: "lavender", | ||
name: "lavender", | ||
}, | ||
{ | ||
hex: "gold", | ||
name: "gold", | ||
}, | ||
{ | ||
hex: "#f48c42", | ||
name: "🎃", | ||
}, | ||
{ | ||
hex: "rebeccapurple", | ||
name: "Beautiful purple", | ||
}, | ||
]; | ||
|
||
export default colors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
background: whitesmoke; | ||
} |