Skip to content

Commit bdb7c37

Browse files
authored
Merge pull request #4 from bennu/feat/init
Feat/init
2 parents 3d7fa69 + 5b6254c commit bdb7c37

File tree

6 files changed

+621
-0
lines changed

6 files changed

+621
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"@bennu-cl/commons-js": "^0.0.2",
1213
"@emotion/react": "^11.14.0",
1314
"@emotion/styled": "^11.14.0",
1415
"@mui/icons-material": "^7.1.0",

src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import MigrationForm from '@/components/sections/MigrationForm'
1010
import FeaturesSection from '@/components/sections/FeaturesSection'
1111
import CallToAction from '@/components/sections/CallToAction'
1212
import Footer from '@/components/layout/footer'
13+
import { FloatingPasswordButton } from '@/components/common/FloatingPasswordButton'
1314
export default function MigrationLandingPage() {
1415
return (
1516
<ThemeProvider theme={theme}>
@@ -32,6 +33,7 @@ export default function MigrationLandingPage() {
3233
<CallToAction />
3334
</Container>
3435
<Footer />
36+
<FloatingPasswordButton />
3537
</Box>
3638
</ThemeProvider>
3739
)

src/components/common/FloatingIcon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// components/common/FloatingIcon.tsx
2+
'use client'
23
import { styled } from "@mui/material/styles";
34
import { Box } from "@mui/material";
45
import { float } from "@/styles/animations";
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
'use client'
2+
3+
import React, { useState } from 'react'
4+
import { Fab, useTheme, alpha, Tooltip } from '@mui/material'
5+
import { Security as SecurityIcon } from '@mui/icons-material'
6+
import { styled } from '@mui/material/styles'
7+
import { PasswordGenerator } from './PasswordGenerator'
8+
9+
const GlassFloatingButton = styled(Fab)(({ theme }) => ({
10+
position: 'fixed',
11+
bottom: '30px',
12+
right: '30px',
13+
width: '64px',
14+
height: '64px',
15+
backdropFilter: 'blur(20px)',
16+
border: '1px solid',
17+
zIndex: 1000,
18+
animation: 'breathingButton 6s infinite ease-in-out',
19+
20+
'@keyframes breathingButton': {
21+
'0%': {
22+
transform: 'scale(0.95)',
23+
backgroundColor: theme.palette.mode === 'dark'
24+
? alpha(theme.palette.primary.main, 0.4)
25+
: alpha(theme.palette.primary.main, 0.35),
26+
borderColor: theme.palette.mode === 'dark'
27+
? alpha(theme.palette.primary.main, 0.6)
28+
: alpha(theme.palette.primary.main, 0.7),
29+
boxShadow: `0 8px 32px ${alpha(theme.palette.primary.main, 0.3)}`,
30+
color: theme.palette.primary.main
31+
},
32+
'50%': {
33+
transform: 'scale(1.15)',
34+
backgroundColor: theme.palette.mode === 'dark'
35+
? alpha(theme.palette.primary.main, 0.5)
36+
: alpha(theme.palette.primary.main, 0.45),
37+
borderColor: theme.palette.mode === 'dark'
38+
? alpha(theme.palette.primary.main, 0.7)
39+
: alpha(theme.palette.primary.main, 0.8),
40+
boxShadow: `0 20px 56px ${alpha(theme.palette.primary.main, 0.6)}`,
41+
color: theme.palette.primary.main
42+
},
43+
'100%': {
44+
transform: 'scale(0.95)',
45+
backgroundColor: theme.palette.mode === 'dark'
46+
? alpha(theme.palette.primary.main, 0.4)
47+
: alpha(theme.palette.primary.main, 0.35),
48+
borderColor: theme.palette.mode === 'dark'
49+
? alpha(theme.palette.primary.main, 0.6)
50+
: alpha(theme.palette.primary.main, 0.7),
51+
boxShadow: `0 8px 32px ${alpha(theme.palette.primary.main, 0.3)}`,
52+
color: theme.palette.primary.main
53+
}
54+
},
55+
56+
'&:hover': {
57+
animation: 'none',
58+
backgroundColor:
59+
theme.palette.mode === 'dark'
60+
? alpha(theme.palette.primary.main, 0.5)
61+
: alpha(theme.palette.primary.main, 0.45),
62+
borderColor:
63+
theme.palette.mode === 'dark'
64+
? alpha(theme.palette.primary.main, 0.7)
65+
: alpha(theme.palette.primary.main, 0.8),
66+
boxShadow: `0 16px 48px ${alpha(theme.palette.primary.main, 0.4)}`,
67+
transform: 'translateY(-2px) scale(1.1)',
68+
color: theme.palette.primary.main
69+
},
70+
71+
'&:active': {
72+
transform: 'translateY(0px) scale(1.0)'
73+
},
74+
75+
'& .MuiSvgIcon-root': {
76+
fontSize: '28px',
77+
filter: 'drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1))',
78+
transition: 'inherit'
79+
},
80+
81+
'@media (max-width: 600px)': {
82+
width: '56px',
83+
height: '56px',
84+
bottom: '20px',
85+
right: '20px',
86+
'& .MuiSvgIcon-root': {
87+
fontSize: '24px'
88+
}
89+
}
90+
}))
91+
92+
93+
export const FloatingPasswordButton: React.FC = () => {
94+
const theme = useTheme()
95+
const [isGeneratorOpen, setIsGeneratorOpen] = useState(false)
96+
97+
const handleClick = () => {
98+
setIsGeneratorOpen(true)
99+
}
100+
101+
const handleClose = () => {
102+
setIsGeneratorOpen(false)
103+
}
104+
105+
return (
106+
<>
107+
<Tooltip title="Generate 2FA Code" placement="left" arrow>
108+
<GlassFloatingButton
109+
onClick={handleClick}
110+
aria-label="Generate 2FA code"
111+
>
112+
<SecurityIcon />
113+
</GlassFloatingButton>
114+
</Tooltip>
115+
116+
<PasswordGenerator open={isGeneratorOpen} onClose={handleClose} />
117+
</>
118+
)
119+
}

src/components/common/GradientButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// components/common/GradientButton.tsx
2+
'use client'
23
import { styled } from '@mui/material/styles'
34
import { Button } from '@mui/material'
45

0 commit comments

Comments
 (0)