Skip to content

Commit

Permalink
chore: animate icon links in demo site
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaup committed Jan 25, 2025
1 parent fa733e4 commit cec16cb
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { ToastContainer } from "react-toastify";
import styled from "styled-components";
import { DopeHeader } from "./components/DopeHeader";
import { DopeMascot } from "./components/DopeMascot";
import { GHIcon } from "./components/GHIcon";
import { InfoModal } from "./components/InfoModal";
import KeyValueForm from "./components/KeyValueForm";
import MapVisualizer from "./components/MapVisualizer";
import { useWindowSize } from "@uidotdev/usehooks";
import { IconLinks } from "./components/IconLinks";

const AppWrapper = styled.div`
max-width: 1200px;
Expand Down Expand Up @@ -62,12 +62,12 @@ function App() {
)}
<DopeHeader />
</div>
{windowSize.width > 768 && <GHIcon />}
{windowSize.width > 768 && <IconLinks />}
</HeaderRow>
</HeaderWrapperContainer>
<KeyValueForm />
<MapVisualizer />
{windowSize.width <= 768 && <GHIcon />}
{windowSize.width <= 768 && <IconLinks />}
<ToastContainer
aria-label={"toast"}
position="bottom-right"
Expand Down
7 changes: 0 additions & 7 deletions docs/src/components/GHIcon.tsx

This file was deleted.

69 changes: 69 additions & 0 deletions docs/src/components/IconLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import styled from "styled-components";
import { DopeColors } from "../constants";

const Container = styled.div`
display: flex;
flexdirection: row;
`;

const GH = styled.i`
@keyframes colorPulse {
0% {
color: ${DopeColors.pink};
}
50% {
color: ${DopeColors.green};
}
100% {
color: ${DopeColors.pink};
}
}
color: ${DopeColors.black};
transition: transform 0.3s ease, color 1.2s ease;
&:hover {
transform: scale(1.2) rotate(8deg);
animation: colorPulse 1.2s infinite;
}
`;

const LI = styled.i`
@keyframes colorPulse {
0% {
color: ${DopeColors.pink};
}
50% {
color: ${DopeColors.blue};
}
100% {
color: ${DopeColors.pink};
}
}
color: ${DopeColors.black};
transition: transform 0.3s ease, color 1.2s ease;
&:hover {
transform: scale(1.2) rotate(8deg);
animation: colorPulse 1.2s infinite;
}
`;

const Separator = styled.div`
width: 16px;
`;

export function IconLinks() {
return (
<Container>
<a href="https://www.linkedin.com/in/johnhaup" target="_blank">
<LI className="fab fa-linkedin header-icon" />
</a>
<Separator />
<a href="https://github.com/johnhaup/dope-map" target="_blank">
<GH className="fab fa-github header-icon" />
</a>
</Container>
);
}

0 comments on commit cec16cb

Please sign in to comment.