aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Icons
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Icons')
-rw-r--r--src/components/Icons/Hamburger/Hamburger.module.scss54
-rw-r--r--src/components/Icons/Hamburger/Hamburger.tsx13
-rw-r--r--src/components/Icons/index.tsx3
3 files changed, 70 insertions, 0 deletions
diff --git a/src/components/Icons/Hamburger/Hamburger.module.scss b/src/components/Icons/Hamburger/Hamburger.module.scss
new file mode 100644
index 0000000..1ae01bb
--- /dev/null
+++ b/src/components/Icons/Hamburger/Hamburger.module.scss
@@ -0,0 +1,54 @@
+@use "@styles/abstracts/functions" as fun;
+
+.icon {
+ position: relative;
+
+ &,
+ &::before,
+ &::after {
+ background: var(--color-primary);
+ background-image: linear-gradient(
+ to right,
+ var(--color-primary-light) 0%,
+ var(--color-highlight) 100%
+ );
+ border: fun.convert-px(1) solid var(--color-border);
+ border-radius: fun.convert-px(3);
+ display: block;
+ width: var(--btn-size, fun.convert-px(50));
+ height: fun.convert-px(6);
+ margin: auto;
+ transition: all 0.25s ease-in-out 0s, transform 0.4s ease-in 0s;
+ }
+
+ &::before,
+ &::after {
+ content: "";
+ position: absolute;
+ }
+
+ &::before {
+ bottom: fun.convert-px(15);
+ }
+
+ &::after {
+ top: fun.convert-px(15);
+ }
+
+ &--active {
+ background: transparent;
+ border: transparent;
+
+ &::before {
+ transform-origin: 50% 50%;
+ transform: rotate(45deg);
+ bottom: 0;
+ }
+
+ &::after {
+ transform-origin: 50% 50%;
+ transform: rotate(-45deg);
+ top: 0;
+ }
+ }
+}
diff --git a/src/components/Icons/Hamburger/Hamburger.tsx b/src/components/Icons/Hamburger/Hamburger.tsx
new file mode 100644
index 0000000..3b9e609
--- /dev/null
+++ b/src/components/Icons/Hamburger/Hamburger.tsx
@@ -0,0 +1,13 @@
+import styles from './Hamburger.module.scss';
+
+const HamburgerIcon = ({ isActive }: { isActive: boolean }) => {
+ return (
+ <span
+ className={`${styles.icon}${
+ isActive ? ` ${styles['icon--active']}` : ''
+ }`}
+ ></span>
+ );
+};
+
+export default HamburgerIcon;
diff --git a/src/components/Icons/index.tsx b/src/components/Icons/index.tsx
new file mode 100644
index 0000000..da4e029
--- /dev/null
+++ b/src/components/Icons/index.tsx
@@ -0,0 +1,3 @@
+import HamburgerIcon from './Hamburger/Hamburger';
+
+export { HamburgerIcon };