Skip to content

Commit

Permalink
background rays and changed the theme color to purple
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodacus committed Dec 7, 2024
1 parent 8067bb6 commit 15bd5b2
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions app/components/ui/BackgroundRays/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
// PurpleRays.jsx
import React, { useEffect, useState } from 'react';
import styles from './styles.module.scss';

const BackgroundRays = () => {
const [theme, setTheme] = useState('dark');

useEffect(() => {
// Initial theme
const currentTheme = document.documentElement.getAttribute('data-theme');
setTheme(currentTheme || 'dark');

// Optional: Watch for theme changes
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.attributeName === 'data-theme') {
const newTheme = document.documentElement.getAttribute('data-theme');
setTheme((existingTheme) => newTheme || existingTheme);
}
});
});

observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['data-theme'],
});

return () => observer.disconnect();
}, []);
return (
<div className={`${styles.rayContainer} `}>
<div className={`${styles.lightRay} ${styles.ray1}`}></div>
Expand Down

0 comments on commit 15bd5b2

Please sign in to comment.