aboutsummaryrefslogtreecommitdiff
path: root/src/web/components/darken
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
commit93dfe2be64e8658839bcfe5356adf35f8cde7075 (patch)
treec60b1e20d569b74dbde85123e1b2bf3590c66244 /src/web/components/darken
initial commit
Diffstat (limited to 'src/web/components/darken')
-rw-r--r--src/web/components/darken/Darken.css14
-rw-r--r--src/web/components/darken/Darken.jsx13
2 files changed, 27 insertions, 0 deletions
diff --git a/src/web/components/darken/Darken.css b/src/web/components/darken/Darken.css
new file mode 100644
index 0000000..bd3b151
--- /dev/null
+++ b/src/web/components/darken/Darken.css
@@ -0,0 +1,14 @@
+.darken {
+ visibility: hidden;
+
+ position: fixed;
+ inset: 0;
+
+ background-color: rgba(0, 0, 0, 0.0);
+ cursor: pointer;
+ transition: background-color var(--transition-time) ease-in-out;
+}
+.darkenActive {
+ visibility: initial;
+ background-color: rgba(0, 0, 0, 0.5);
+} \ No newline at end of file
diff --git a/src/web/components/darken/Darken.jsx b/src/web/components/darken/Darken.jsx
new file mode 100644
index 0000000..7f46365
--- /dev/null
+++ b/src/web/components/darken/Darken.jsx
@@ -0,0 +1,13 @@
+import React from "react";
+import styles from "./Darken.css";
+
+export default function Darken({active, className, ...others}) {
+
+ return (
+ <div
+ className={styles.darken
+ + (active ? " " + styles.darkenActive : "")
+ + (className ? " " + className : "")}
+ {...others} />
+ );
+} \ No newline at end of file