Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dragoni7/d2loadouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Rorschach7552 committed Sep 19, 2024
2 parents 9472edd + 06cf201 commit 18ac2b9
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 40 deletions.
3 changes: 1 addition & 2 deletions src/app/routes/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ export const Dashboard: React.FC = () => {
selectedCharacter={characters[selectedCharacterIndex]!}
onCharacterClick={handleCharacterClick}
/>
<RefreshCharacters />
<LogoutButton />

<Grid
container
sx={{
Expand Down
32 changes: 32 additions & 0 deletions src/components/CoffeeButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Box, IconButton, Tooltip } from '@mui/material';
import { LocalCafe } from '@mui/icons-material';
import { useSpring, animated } from '@react-spring/web';

export default function CoffeeButton() {
const props = useSpring({
loop: false,
to: [{ rotateZ: 10 }, { rotateZ: -10 }, { rotateZ: 10 }, { rotateZ: -10 }, { rotateZ: 0 }],
from: { rotateZ: 0 },
config: { tension: 600, friction: 5, duration: 200 },
});

return (
<animated.div style={{ ...props, display: 'inline-block' }}>
<Box>
<Tooltip title="Buy us a Coffee">
<IconButton
href="https://buymeacoffee.com/d2loadouts"
target="_blank"
rel="noopener noreferrer"
sx={{
borderRadius: 4,
mixBlendMode: 'difference',
}}
>
<LocalCafe />
</IconButton>
</Tooltip>
</Box>
</animated.div>
);
}
25 changes: 22 additions & 3 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React from 'react';
import { Box, Typography } from '@mui/material';
import { Box, Stack, Typography } from '@mui/material';
import LogoutButton from '@/features/auth/components/LogoutButton';
import RefreshCharacters from './RefreshCharacters';
import CoffeeButton from './CoffeeButton';

interface FooterProps {
emblemUrl: string;
Expand All @@ -13,7 +16,7 @@ const Footer: React.FC<FooterProps> = ({ emblemUrl }) => {
bottom: 0,
left: 0,
right: 0,
height: '40px',
height: '5.4%',
backgroundImage: `url(${emblemUrl})`,
backgroundSize: 'cover',
backgroundPosition: 'center',
Expand All @@ -36,16 +39,32 @@ const Footer: React.FC<FooterProps> = ({ emblemUrl }) => {
>
<Typography
variant="caption"
textAlign="center"
sx={{
color: 'white',
textAlign: 'center',
position: 'relative',
zIndex: 1,
width: '100%',
}}
>
Built by Dragoni and Rorschach. Destiny 2 and its assets are the property of Bungie. Used
under Bungie's Fan-Created Media and Art guidelines.
under Bungie's Fan-Created Media and Art guidelines. Consider supporting us!
</Typography>

<Stack
direction="row"
alignItems="flex-end"
justifyContent="center"
spacing={2}
sx={{ position: 'absolute', right: 0, zIndex: 1001, width: '20%' }}
>
<Box style={{ width: '50%' }}>
<CoffeeButton />
</Box>
<RefreshCharacters />
<LogoutButton />
</Stack>
</Box>
);
};
Expand Down
20 changes: 4 additions & 16 deletions src/components/HeaderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import {
HeaderStyledLink,
Header,
} from '../styled';
import LogoutButton from '@/features/auth/components/LogoutButton';
import RefreshCharacters from './RefreshCharacters';
import { Tooltip } from '@mui/material';
import CoffeeButton from './CoffeeButton';

interface HeaderComponentProps {
emblemUrl: string;
Expand Down Expand Up @@ -54,22 +58,6 @@ const HeaderComponent: React.FC<HeaderComponentProps> = ({
))}
</HeaderButtonContainer>
</HeaderBottomContainer>
<HeaderLinksContainer>
<HeaderStyledLink
href="https://buymeacoffee.com/d2loadouts"
target="_blank"
rel="noopener noreferrer"
>
Coffee
</HeaderStyledLink>
<HeaderStyledLink
href="https://patreon.com/d2loadouts"
target="_blank"
rel="noopener noreferrer"
>
Patreon
</HeaderStyledLink>
</HeaderLinksContainer>
</Header>
);
};
Expand Down
7 changes: 2 additions & 5 deletions src/components/RefreshCharacters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export default function RefreshCharacters() {
return (
<Box
sx={{
position: 'absolute',
top: '1%',
right: '3%',
zIndex: 9999,
mixBlendMode: 'difference',
}}
>
Expand All @@ -32,9 +28,10 @@ export default function RefreshCharacters() {
onClick={onRefreshClick}
sx={{
borderRadius: 4,
mixBlendMode: 'difference',
}}
>
<Refresh color="inherit" fontSize="large" />
<Refresh color="inherit" />
</IconButton>
</Tooltip>
)}
Expand Down
7 changes: 2 additions & 5 deletions src/features/auth/components/LogoutButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export default function LogoutButton() {
return (
<Box
sx={{
position: 'absolute',
top: '1%',
right: '0',
zIndex: 9999,
mixBlendMode: 'difference',
}}
>
Expand All @@ -25,9 +21,10 @@ export default function LogoutButton() {
onClick={onLogoutClick}
sx={{
borderRadius: 4,
mixBlendMode: 'difference',
}}
>
<Logout color="inherit" fontSize="large" />
<Logout color="inherit" />
</IconButton>
</Tooltip>
</Box>
Expand Down
7 changes: 4 additions & 3 deletions src/styled/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,18 @@ export const HeaderCharacterText = styled('div')<{ isSelected: boolean }>(({ isS
export const HeaderLinksContainer = styled('div')({
position: 'absolute',
right: '20px',
bottom: '-2px',
top: '6%',
display: 'flex',
gap: '20px',
gap: '12px',
alignItems: 'flex-end',
});

export const HeaderStyledLink = styled('a')({
...sharedTextStyles,
color: 'rgba(255, 255, 255, 0.6)',
color: 'rgba(255, 255, 255, 0.9)',
textDecoration: 'none',
opacity: 0.6,
mixBlendMode: 'difference',
'&:hover': {
...sharedTextStyles['&:hover'],
color: 'white',
Expand Down
19 changes: 13 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import fs from "fs";
import { defineConfig } from 'vite';
import * as path from 'path';
import react from '@vitejs/plugin-react';
import fs from 'fs';

export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
if (command === "serve") {
if (command === 'serve') {
return {
plugins: [react()],
server: {
https: {
key: fs.readFileSync("./certs/localhost.key"),
cert: fs.readFileSync("./certs/localhost.crt"),
key: fs.readFileSync('./certs/localhost.key'),
cert: fs.readFileSync('./certs/localhost.crt'),
},
},
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
},
};
} else {
return {
plugins: [react()],
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
},
};
}
});

0 comments on commit 18ac2b9

Please sign in to comment.