Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,58 @@ svg#svg574 .province-layer path:hover {
cursor: not-allowed;
}

.share-buttons {
display: flex;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin-top: 12px;
margin-bottom: 16px;
}

.share-fb-button,
.share-gh-button {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
min-width: 100px;
min-height: 30px;
padding: 3px 8px;
border: none;
border-radius: 10px;
font-weight: 600;
letter-spacing: .01em;
cursor: pointer;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.share-fb-button {
color: white;
background: #4267b3;
margin-bottom: 20px;
background: linear-gradient(135deg, #4267b3, #2d4e91);
margin: 0;
}

.share-fb-button:hover {
cursor: pointer;
background-color: #2d487d;
background: linear-gradient(135deg, #365899, #243d78);
}

.share-fb-button svg {
margin-right: 4px;
.share-fb-button svg,
.share-gh-button svg {
width: 20px;
height: 20px;
}

.share-gh-button {
background: #ffffff;
color: #0b1a2c;
border: 1px solid #c8d8ef;
}

.share-gh-button:hover {
background: #f2f6fc;
}

.about {
Expand Down Expand Up @@ -281,4 +320,4 @@ svg#svg574 .province-layer path:hover {
to {
transform: translateY(0%);
}
}
}
18 changes: 18 additions & 0 deletions src/components/GithubIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';

function GithubIcon () {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
viewBox="0 0 24 24"
fill="currentColor"
aria-hidden="true"
>
<path d="M12 .5C5.65.5.5 5.65.5 12c0 5.1 3.3 9.42 7.9 10.95.58.1.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.21.7-3.89-1.55-3.89-1.55-.53-1.33-1.29-1.69-1.29-1.69-1.06-.72.08-.71.08-.71 1.17.08 1.78 1.2 1.78 1.2 1.04 1.78 2.74 1.27 3.4.97.1-.75.41-1.27.74-1.56-2.56-.29-5.26-1.28-5.26-5.68 0-1.25.45-2.27 1.19-3.07-.12-.29-.52-1.46.11-3.05 0 0 .98-.31 3.21 1.17a11.2 11.2 0 0 1 5.84 0c2.23-1.48 3.21-1.17 3.21-1.17.63 1.59.23 2.76.11 3.05.74.8 1.18 1.82 1.18 3.07 0 4.41-2.7 5.38-5.28 5.66.43.37.82 1.1.82 2.22 0 1.6-.02 2.89-.02 3.28 0 .31.21.67.8.55A10.51 10.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z" />
</svg>
);
}

export default GithubIcon;
23 changes: 17 additions & 6 deletions src/pages/MapPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { toJpeg } from 'html-to-image';

import Map from './Map';
import FacebookLogo from '../components/FacebookLogo';
import GithubIcon from '../components/GithubIcon';
import { FB_SHARE_URL } from '../utils/constants';
import '.././App.css';

Expand Down Expand Up @@ -41,6 +42,10 @@ function MapPage () {
const navUrl = FB_SHARE_URL + window.location.href;
window.open(navUrl, 'mywindow', 'width=350,height=250');
}, [location.search]);

const handleGithubOpen = useCallback(() => {
window.open('https://github.com/OSSPhilippines/philippines-travel-level-map', '_blank');
}, []);

const handleReset = () => {
if (noProvinceSelected) {return;}
Expand All @@ -64,14 +69,20 @@ function MapPage () {
</section>

<section><i><small>To save your progress, simply save the URL.</small></i></section>

<button className='share-fb-button' onClick={handleFacebookShare}>
<FacebookLogo />
Share
</button>
</section>
</section>

<section className='share-buttons'>
<button className='share-fb-button' onClick={handleFacebookShare}>
<FacebookLogo />
Share
</button>
<button className='share-gh-button' onClick={handleGithubOpen}>
<GithubIcon />
Star on GitHub
</button>
</section>

<div className='flag-counter'>
<a href='https://info.flagcounter.com/s6dX'>
<img src='https://s11.flagcounter.com/count2/s6dX/bg_FFFFFF/txt_000000/border_CCCCCC/columns_4/maxflags_16/viewers_3/labels_0/pageviews_1/flags_0/percent_0/' alt='Flag Counter' border='0'/>
Expand All @@ -83,4 +94,4 @@ function MapPage () {
);
}

export default MapPage;
export default MapPage;