Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style: Navbar improvements #673

Merged
merged 3 commits into from
Sep 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/components/SettingsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {};
const SettingsButton: React.FC<Props> = () => {
const navigate = useNavigate();
return (
<Button variant="none" onClick={() => navigate('/settings')} size="icon">
<Button className="rounded-full hover:bg-primary-light hover:brightness-105" variant="none" onClick={() => navigate('/settings')} size="icon">
<IconMenu2 size={24} />
</Button>
);
Expand Down
16 changes: 13 additions & 3 deletions src/components/SwitchLanguageButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { SwitchLanguageModal } from '../modals/SwitchLanguageModal';
import { languageIcons } from '../I18n';
import { Button } from './Button';
import { cn } from '@/lib/Tailwind';

const SwitchLanguageButton: React.FC = () => {
interface SwitchLanguageButtonProps {
className?: string;
}

const SwitchLanguageButton = ({ className }: SwitchLanguageButtonProps) => {
const [showSwitchLanguage, setShowSwitchLanguage] = useState(false);

const storageLanguage = localStorage.getItem('lernfair-language');
Expand All @@ -12,7 +17,12 @@ const SwitchLanguageButton: React.FC = () => {

return (
<>
<Button onClick={() => setShowSwitchLanguage(true)} variant="none" size="icon">
<Button
className={cn('group rounded-full hover:bg-primary-light hover:brightness-105', className)}
onClick={() => setShowSwitchLanguage(true)}
variant="none"
size="icon"
>
<Icon />
</Button>
<SwitchLanguageModal isOpen={showSwitchLanguage} onIsOpenChange={setShowSwitchLanguage} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/notifications/NotificationAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const NotificationAlert: React.FC = () => {
{count}
</Badge>
)}
<Button variant="none" size="icon">
<IconBell size={24} />
<Button className="group rounded-full hover:bg-primary-light hover:brightness-105" variant="none" size="icon">
<IconBell className="group-hover:animate-bell-ring" size={24} />
</Button>
</div>
</PopoverTrigger>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Welcome: React.FC = () => {
<Button onPress={() => window.open('/impressum', '_blank')} variant={'link'} _text={{ color: 'white' }}>
{t('settings.legal.imprint')}
</Button>
<SwitchLanguageButton />
<SwitchLanguageButton className="hover:bg-primary" />
</Flex>
</Flex>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/web/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
--card-foreground: var(--foreground);

--primary-lighter: 171 24% 94%;
--primary-light: 178.72 23.15% 60.2%;
--primary-light: 187.14 23.6% 65.1%;
--primary: 189 31% 24%;
--primary-dark: 189 28% 18%;
--primary-foreground: 210 40% 98%;
Expand Down
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,20 @@ module.exports = {
'0%': { transform: 'translateY(0)', opacity: '0' },
'10%': { opacity: '1' },
'100%': { transform: 'translateY(-200px)', opacity: '0' },
},
'bell-ring': {
'0%': { transform: 'scaleX(1)' },
'10%, 5%': { transform: 'scale3d(.9,.9,.9) rotate(-5deg)' },
'15%, 25%, 35%, 45%': { transform: 'scale3d(1.1,1.1,1.1) rotate(5deg)' },
'20%, 30%, 40%': { transform: 'scale3d(1.1,1.1,1.1) rotate(-5deg)' },
'50%': { transform: 'scale3d(1.1,1.1,1.1) rotate(-5deg)' },
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
'shine': 'shine 2s infinite',
'bell-ring': 'bell-ring 2s infinite',
},
boxShadow: {
bottomNavigation: '0px 4px 16px rgba(17,17,26,0.1), 0px 8px 24px rgba(17,17,26,0.1),0px 16px 56px rgba(17,17,26,0.1)',
Expand Down
Loading