Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit ec2ba7b

Browse files
authored
Patch 0.1.3.1 (#371)
2 parents 1c33382 + f82973e commit ec2ba7b

File tree

6 files changed

+84
-37
lines changed

6 files changed

+84
-37
lines changed

client/assets/jsonBtn.png

822 Bytes
Loading

client/src/components/CountryWeather.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,22 @@ export default function CountryWeather(props: Props) {
4040
<div className='genInfoLocationAndWeather metaDataSection'>
4141
<div className='capital'>
4242
<h6>Capital</h6>
43-
<u>{props.capital}</u>
43+
{props.capital}
4444
</div>
4545
<br />
4646
{/* start of location information */}
4747
<div className='location'>
4848
<h6>Location of Capital</h6>
49-
Latitude:<u>{weather.lat}</u> Longitude: <u>{weather.lon}</u>
49+
Latitude:{weather.lat} Longitude: {weather.lon}
5050
</div>
5151
<br />
5252
{/* start of weather information */}
5353
<div className='weather'>
54-
<h6>Current Weather {props.capital}</h6>
55-
{/* {weather.main} */}
56-
{/* <br /> */}
57-
Currently <u>{weather.temp}°F</u>
54+
<h6>Current Weather In {props.capital}</h6>
55+
56+
Currently {weather.temp}°F
5857
<br />
59-
Feels like <u>{weather.feels_like}°F</u>
58+
Feels like {weather.feels_like}°F
6059
</div>
6160
</div>
6261
)

client/src/pages/Country/[id].tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import getCountryTopic from '../../includes/countryTopicImports/countryTopics'
77
import MarkdownIt from 'markdown-it'
88
import PageNotFound from '../[...pathname]'
99
import download from '../../../assets/downloadBtn.png'
10+
import jsonBtn from '../../../assets/jsonBtn.png'
1011

1112
// USING VITE'S GLOB METHOD TO STORE IMAGES FROM FOLDERS INTO VARIABLES
1213
const simpleCountryMaps = import.meta.glob('../../../assets/simpleMaps/*.png', {
@@ -129,12 +130,6 @@ export default function countryPage(
129130
// set 'alt' attribute for each flag
130131
const flagAltValue = `The Flag of ${state.name}`
131132

132-
// DOWNLOAD BUTTON STUFF
133-
const downloadBtn = document.getElementById('downloadBtn') // targets download button
134-
downloadBtn?.addEventListener('click', () => {
135-
print() // opens browser print dialog
136-
})
137-
138133
// if there is an error when trying to go to load
139134
// data for a country that does not exist,
140135
// return the PageNotFound component
@@ -171,34 +166,34 @@ export default function countryPage(
171166
{/* region & sub region information */}
172167
<div className='genInfoRegionAndSubregion metaDataSection'>
173168
<div className='region'>
174-
<h6>Region</h6> <u>{state.region}</u>
169+
<h6>Region</h6> {state.region}
175170
</div>
176171
<div className='subregion'>
177-
<h6>Subregion</h6> <u>{state.subregion}</u>
172+
<h6>Subregion</h6> {state.subregion}
178173
</div>
179174
</div>
180175

181176
{/* population information */}
182177
<div className='genInfoPopulation metaDataSection'>
183178
<h6>Population</h6>
184-
Approx.<u>{state.population}</u>
179+
Approx.{state.population}
185180
</div>
186181

187182
{/* demonym information */}
188183
<div className='genInfoDemonym metaDataSection'>
189184
<h6>Demonym</h6>
190-
<u>{state.demonym}</u>
185+
{state.demonym}
191186
</div>
192187

193188
{/* iso code information */}
194189
<div className='genInfoISOCodes metaDataSection'>
195190
<div className='alpha2Code'>
196191
<h6>ISO 2 Code</h6>
197-
<u>{state.alpha2Code}</u>
192+
{state.alpha2Code}
198193
</div>
199194
<div className='alpha3Code'>
200195
<h6>ISO 3 Code</h6>
201-
<u>{state.alpha3Code}</u>
196+
{state.alpha3Code}
202197
</div>
203198
</div>
204199

@@ -210,15 +205,15 @@ export default function countryPage(
210205
<div className='genInfoCurrency metaDataSection'>
211206
<div className='currencyName'>
212207
<h6>Currency Name</h6>
213-
<u>{currencyInfo?.name}</u>
208+
{currencyInfo?.name}
214209
</div>
215210
<div className='currencySymbol'>
216211
<h6>Currency Symbol</h6>
217-
<u>{currencyInfo?.symbol}</u>
212+
{currencyInfo?.symbol}
218213
</div>
219214
<div className='currencyCode'>
220215
<h6>Currency Code</h6>
221-
<u>{currencyInfo?.code}</u>
216+
{currencyInfo?.code}
222217
</div>
223218
</div>
224219

@@ -242,9 +237,14 @@ export default function countryPage(
242237

243238
<div className='downloadBtnContainer'>
244239
<a>
245-
<img id='downloadBtn' src={download} alt='Download Button' />
240+
{/* onClick event handler opens browser print dialog */}
241+
<img onClick={print} className='downloadBtn' src={download} alt='Download Button' />
246242
</a>
243+
<a href = {`https://schoolyb.github.io/v1/data/country/${id}.json`}>
244+
<img src={jsonBtn} alt='JSON Button' className='jsonBtn' />
245+
</a>
247246
</div>
247+
248248
</div>
249249

250250
{/* END OF META DATA CONTAINER TEXT */}

client/src/styles/_countryPages.scss

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
#countryEnglishName {
2+
margin-top: .6em;
3+
// margin-bottom: 1em;
4+
letter-spacing: .04em;
5+
font-size: 5em;
6+
}
7+
18
.countryInfo {
29
text-align: center;
310
color: black;
4-
background-color: #89939E;
11+
margin-bottom: 2.5em;
512
border-top: .2em solid black;
6-
border-bottom: .2em solid black;
713

814
}
915

10-
.countryInfo>h1 {
11-
font-size: 3.5em;
12-
}
16+
1317

1418
#countryInfoFlag {
15-
border-radius: 20px;
19+
border-top-left-radius: 20px;
20+
border-top-right-radius: 20px;
21+
1622
}
1723

1824
.topic {
@@ -22,9 +28,11 @@
2228
padding-bottom: 2px;
2329
word-wrap: break-word;
2430
margin-top: 2em;
31+
2532
}
2633
.topic>h3 {
27-
font-size: 40px;
34+
font-size: 3.5em;
35+
margin-bottom: .5em;
2836

2937
}
3038

@@ -41,10 +49,12 @@ color: black;
4149
display: flex;
4250
background-color: #89939E;
4351
flex-direction: column;
44-
width: 25.5%;
52+
width: 20%;
4553
float: right;
4654
border-radius: 25px;
4755
margin-right: .5em;
56+
border: .5em solid black;
57+
4858
}
4959

5060
.overallCountryInfoContainer {
@@ -85,11 +95,12 @@ border-bottom: .2em solid black;
8595

8696
@media only screen and (max-width: 1000px) {
8797
.metaDataContainer {
88-
width: 100%;
98+
width: 25%;
8999
margin-right: 0;
90100
}
91101
.countryInfo {
92102
width: 100%;
103+
font-size: .8em;
93104
}
94105
.countryFlagsAndMaps{
95106
width: 100%;
@@ -99,6 +110,23 @@ border-bottom: .2em solid black;
99110
}
100111
}
101112

113+
114+
@media only screen and (max-width: 600px) {
115+
.metaDataContainer {
116+
width: 100%;
117+
margin-right: 0;
118+
}
119+
.countryInfo {
120+
width: 100%;
121+
font-size: .8em;
122+
}
123+
.countryFlagsAndMaps{
124+
width: 100%;
125+
}
126+
.topic{
127+
width: 100%;
128+
}
129+
}
102130
.downloadBtnContainer{
103131
text-align: center;
104132
margin: auto;
@@ -107,19 +135,30 @@ border-bottom: .2em solid black;
107135
margin: auto;
108136
}
109137

110-
#downloadBtn{
138+
.downloadBtn{
111139
cursor: pointer;
112140
width: 5%;
113141
height:auto;
114142
margin: auto;
115143
margin-top: 1em;
116144
margin-bottom: 1em;
117-
118-
animation: downloadBtnShakeAnimation 1s infinite;
145+
margin-right: 1em;
146+
animation: downloadAndJsonAnimation 1s infinite;
119147

120148
}
149+
.jsonBtn{
150+
cursor: pointer;
151+
width: 7%;
152+
height:auto;
153+
margin: auto;
154+
margin-top: 1em;
155+
margin-bottom: 1em;
156+
157+
animation: downloadAndJsonAnimation 1s infinite;
158+
}
159+
121160

122-
@keyframes downloadBtnShakeAnimation {
161+
@keyframes downloadAndJsonAnimation {
123162
0% {
124163
transform: translateX(0)
125164
}

client/src/styles/_header.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
grid-template-columns: 1fr;
4141
place-items: center;
4242
width: 100%;
43+
4344
}
4445

4546
#nav a {
@@ -50,3 +51,12 @@
5051
font-weight: 300;
5152
}
5253

54+
.rs-icon:hover{
55+
cursor: pointer;
56+
57+
}
58+
59+
.rs-navbar-brand{
60+
// color: #89939e;
61+
62+
}

client/src/styles/main.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
display: flex;
1919
flex-direction: column;
2020
justify-content: space-between;
21-
// min-height: 100vh;
2221
overflow-x: hidden;
2322

2423
}

0 commit comments

Comments
 (0)