Skip to content

Commit 7e55c31

Browse files
committed
Moved refresh, logout, and support button to footer. Animated coffee button
1 parent 290f71d commit 7e55c31

File tree

8 files changed

+80
-40
lines changed

8 files changed

+80
-40
lines changed

src/app/routes/Dashboard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,7 @@ export const Dashboard: React.FC = () => {
430430
selectedCharacter={characters[selectedCharacterIndex]!}
431431
onCharacterClick={handleCharacterClick}
432432
/>
433-
<RefreshCharacters />
434-
<LogoutButton />
433+
435434
<Grid
436435
container
437436
sx={{

src/components/CoffeeButton.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Box, IconButton, Tooltip } from '@mui/material';
2+
import { LocalCafe } from '@mui/icons-material';
3+
import { useSpring, animated } from '@react-spring/web';
4+
5+
export default function CoffeeButton() {
6+
const props = useSpring({
7+
loop: false,
8+
to: [{ rotateZ: 10 }, { rotateZ: -10 }, { rotateZ: 10 }, { rotateZ: -10 }, { rotateZ: 0 }],
9+
from: { rotateZ: 0 },
10+
config: { tension: 600, friction: 5, duration: 200 },
11+
});
12+
13+
return (
14+
<animated.div style={{ ...props, display: 'inline-block' }}>
15+
<Box>
16+
<Tooltip title="Buy us a Coffee">
17+
<IconButton
18+
href="https://buymeacoffee.com/d2loadouts"
19+
target="_blank"
20+
rel="noopener noreferrer"
21+
sx={{
22+
borderRadius: 4,
23+
mixBlendMode: 'difference',
24+
}}
25+
>
26+
<LocalCafe />
27+
</IconButton>
28+
</Tooltip>
29+
</Box>
30+
</animated.div>
31+
);
32+
}

src/components/Footer.tsx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react';
2-
import { Box, Typography } from '@mui/material';
2+
import { Box, Stack, Typography } from '@mui/material';
3+
import LogoutButton from '@/features/auth/components/LogoutButton';
4+
import RefreshCharacters from './RefreshCharacters';
5+
import CoffeeButton from './CoffeeButton';
36

47
interface FooterProps {
58
emblemUrl: string;
@@ -13,7 +16,7 @@ const Footer: React.FC<FooterProps> = ({ emblemUrl }) => {
1316
bottom: 0,
1417
left: 0,
1518
right: 0,
16-
height: '40px',
19+
height: '5.4%',
1720
backgroundImage: `url(${emblemUrl})`,
1821
backgroundSize: 'cover',
1922
backgroundPosition: 'center',
@@ -36,16 +39,32 @@ const Footer: React.FC<FooterProps> = ({ emblemUrl }) => {
3639
>
3740
<Typography
3841
variant="caption"
42+
textAlign="center"
3943
sx={{
4044
color: 'white',
4145
textAlign: 'center',
4246
position: 'relative',
4347
zIndex: 1,
48+
width: '100%',
4449
}}
4550
>
4651
Built by Dragoni and Rorschach. Destiny 2 and its assets are the property of Bungie. Used
47-
under Bungie's Fan-Created Media and Art guidelines.
52+
under Bungie's Fan-Created Media and Art guidelines. Consider supporting us!
4853
</Typography>
54+
55+
<Stack
56+
direction="row"
57+
alignItems="flex-end"
58+
justifyContent="center"
59+
spacing={2}
60+
sx={{ position: 'absolute', right: 0, zIndex: 1001, width: '20%' }}
61+
>
62+
<Box style={{ width: '50%' }}>
63+
<CoffeeButton />
64+
</Box>
65+
<RefreshCharacters />
66+
<LogoutButton />
67+
</Stack>
4968
</Box>
5069
);
5170
};

src/components/HeaderComponent.tsx

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import {
1212
HeaderStyledLink,
1313
Header,
1414
} from '../styled';
15+
import LogoutButton from '@/features/auth/components/LogoutButton';
16+
import RefreshCharacters from './RefreshCharacters';
17+
import { Tooltip } from '@mui/material';
18+
import CoffeeButton from './CoffeeButton';
1519

1620
interface HeaderComponentProps {
1721
emblemUrl: string;
@@ -54,22 +58,6 @@ const HeaderComponent: React.FC<HeaderComponentProps> = ({
5458
))}
5559
</HeaderButtonContainer>
5660
</HeaderBottomContainer>
57-
<HeaderLinksContainer>
58-
<HeaderStyledLink
59-
href="https://buymeacoffee.com/d2loadouts"
60-
target="_blank"
61-
rel="noopener noreferrer"
62-
>
63-
Coffee
64-
</HeaderStyledLink>
65-
<HeaderStyledLink
66-
href="https://patreon.com/d2loadouts"
67-
target="_blank"
68-
rel="noopener noreferrer"
69-
>
70-
Patreon
71-
</HeaderStyledLink>
72-
</HeaderLinksContainer>
7361
</Header>
7462
);
7563
};

src/components/RefreshCharacters.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export default function RefreshCharacters() {
1717
return (
1818
<Box
1919
sx={{
20-
position: 'absolute',
21-
top: '1%',
22-
right: '3%',
23-
zIndex: 9999,
2420
mixBlendMode: 'difference',
2521
}}
2622
>
@@ -32,9 +28,10 @@ export default function RefreshCharacters() {
3228
onClick={onRefreshClick}
3329
sx={{
3430
borderRadius: 4,
31+
mixBlendMode: 'difference',
3532
}}
3633
>
37-
<Refresh color="inherit" fontSize="large" />
34+
<Refresh color="inherit" />
3835
</IconButton>
3936
</Tooltip>
4037
)}

src/features/auth/components/LogoutButton.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ export default function LogoutButton() {
1313
return (
1414
<Box
1515
sx={{
16-
position: 'absolute',
17-
top: '1%',
18-
right: '0',
19-
zIndex: 9999,
2016
mixBlendMode: 'difference',
2117
}}
2218
>
@@ -25,9 +21,10 @@ export default function LogoutButton() {
2521
onClick={onLogoutClick}
2622
sx={{
2723
borderRadius: 4,
24+
mixBlendMode: 'difference',
2825
}}
2926
>
30-
<Logout color="inherit" fontSize="large" />
27+
<Logout color="inherit" />
3128
</IconButton>
3229
</Tooltip>
3330
</Box>

src/styled/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,18 @@ export const HeaderCharacterText = styled('div')<{ isSelected: boolean }>(({ isS
8383
export const HeaderLinksContainer = styled('div')({
8484
position: 'absolute',
8585
right: '20px',
86-
bottom: '-2px',
86+
top: '6%',
8787
display: 'flex',
88-
gap: '20px',
88+
gap: '12px',
8989
alignItems: 'flex-end',
9090
});
9191

9292
export const HeaderStyledLink = styled('a')({
9393
...sharedTextStyles,
94-
color: 'rgba(255, 255, 255, 0.6)',
94+
color: 'rgba(255, 255, 255, 0.9)',
9595
textDecoration: 'none',
9696
opacity: 0.6,
97+
mixBlendMode: 'difference',
9798
'&:hover': {
9899
...sharedTextStyles['&:hover'],
99100
color: 'white',

vite.config.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
import { defineConfig } from "vite";
2-
import react from "@vitejs/plugin-react";
3-
import fs from "fs";
1+
import { defineConfig } from 'vite';
2+
import * as path from 'path';
3+
import react from '@vitejs/plugin-react';
4+
import fs from 'fs';
45

56
export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
6-
if (command === "serve") {
7+
if (command === 'serve') {
78
return {
89
plugins: [react()],
910
server: {
1011
https: {
11-
key: fs.readFileSync("./certs/localhost.key"),
12-
cert: fs.readFileSync("./certs/localhost.crt"),
12+
key: fs.readFileSync('./certs/localhost.key'),
13+
cert: fs.readFileSync('./certs/localhost.crt'),
1314
},
1415
},
16+
resolve: {
17+
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
18+
},
1519
};
1620
} else {
1721
return {
1822
plugins: [react()],
23+
resolve: {
24+
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
25+
},
1926
};
2027
}
2128
});

0 commit comments

Comments
 (0)