Skip to content

Commit

Permalink
moon and sun svg, no selection and text css
Browse files Browse the repository at this point in the history
  • Loading branch information
freirart committed Apr 30, 2024
1 parent cbd773a commit 260cedd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
10 changes: 10 additions & 0 deletions public/images/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/images/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions src/components/ColorModeSwitch/ColorModeSwitch.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image from 'next/image';

interface ColorModeSwitchProps {
isDarkMode: boolean;
onToggle: Function;
Expand All @@ -11,16 +13,21 @@ export default function ColorModeSwitch({
<div
onClick={() => onToggle()}
className="flex absolute bottom-8 right-8 w-12 h-6 rounded-full
dark:bg-light-blue dark:text-special-black bg-special-black
text-white-blue text-center cursor-pointer"
dark:bg-white-blue bg-special-black cursor-pointer"
>
<span
className={
'h-6 w-6 rounded-full shadow-lg transition-all duration-200 ' +
(isDarkMode ? 'bg-white-blue' : 'ml-6 bg-dark-blue')
`flex justify-center h-6 w-6 rounded-full shadow-lg transition-all
duration-200 select-none` +
(isDarkMode ? ' bg-[#FFE483]' : ' ml-6 bg-dark-blue')
}
>
{isDarkMode ? '🌞' : '🌙'}
<Image
src={`/images/${isDarkMode ? 'sun' : 'moon'}.svg`}
height={18}
width={18}
alt="Sun"
/>
</span>
</div>
);
Expand Down

0 comments on commit 260cedd

Please sign in to comment.