Skip to content

Commit 73c2633

Browse files
committed
working, basic style
1 parent 0a79514 commit 73c2633

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

src/Components/photoOfTheDay.scss

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
1+
$background-color: #062356;
2+
$text-color: #FFFFF2;
3+
$lighter-orange: #EE8434;
4+
$button-grey: #878888;
5+
$general-font: "Public Sans";
6+
7+
body {
8+
background-color: $background-color;
9+
font-family: $general-font
10+
}
111

212
.photoOfTheDayContainer{
313
display: flex;
414
justify-content: center;
15+
background-color: $background-color;
16+
517
}
618

719
.photo-of-the-day {
820
display: flex;
921
justify-content: center;
10-
width: 100%;
22+
width: auto;
1123
margin: auto;
12-
border: 2px blue solid;
1324
height: 50vh;
25+
object-fit: contain;
26+
margin: 2vw;
27+
1428
}
1529

1630
.explanation {
1731
width: 70%;
1832
margin: auto;
33+
color: $text-color;
34+
padding: 5px;
35+
text-align: center;
1936
}

src/Components/photoOfTheDay.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export default function PhotoOfTheDay () {
88
const [photo, setPhoto] = useState<string>()
99
const [title, setTitle] = useState<string>()
1010
const [explanation,setExplanation] = useState<string>()
11-
//const [photoAddress, setPhotoAddress] = useState("https://api.nasa.gov/planetary/apod?date=2025-05-19&api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy")
11+
1212

1313
const fallBackImageDates = ["2025-05-08" , "2025-05-13", "2025-04-24" , "2025-03-26" , "2025-04-13" , "2025-03-23" , "2025-01-15" , "2024-11-10" , "2024-03-22" , "2023-08-10"]
14-
const photoAddress = "https://api.nasa.gov/planetary/apod?date=2025-05-21&api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy"
14+
const photoAddress = "https://api.nasa.gov/planetary/apod?&api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy"
1515

1616
useEffect (() => {
1717
fetch(photoAddress)
@@ -25,7 +25,7 @@ export default function PhotoOfTheDay () {
2525
else {
2626
const randomFromZeroToNine = Math.floor(Math.random() * 10);
2727
const altPhotoAddress = `https://api.nasa.gov/planetary/apod?date=${fallBackImageDates[randomFromZeroToNine]}&api_key=5s0C1UhCZLh3WVVN2kGzF1kEw76CImpsBBf3AvEy`
28-
//setPhotoAddress(altPhotoAddress);
28+
2929
fetch(altPhotoAddress)
3030
.then(response => response.json())
3131
.then(data => {
@@ -40,11 +40,12 @@ export default function PhotoOfTheDay () {
4040
},[]);
4141

4242
return (
43-
<div>
43+
<div> <link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"></link>
4444
<div className="photoOfTheDayContainer">
4545
<img src={photo} className="photo-of-the-day" width="100%" alt-text={title}/>
4646

4747
</div>
48+
<div className="explanation">Astronomy Photo of the Day</div>
4849
<div className="explanation">
4950
{/* {explanation} */}
5051
</div>

src/index.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
3+
64
-webkit-font-smoothing: antialiased;
75
-moz-osx-font-smoothing: grayscale;
86
}

0 commit comments

Comments
 (0)