summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-rw-r--r--src/views/Clock.js3
-rw-r--r--src/views/Detail.js10
-rw-r--r--src/views/Gallery.js3
3 files changed, 3 insertions, 13 deletions
diff --git a/src/views/Clock.js b/src/views/Clock.js
index a394b62..fe5039a 100644
--- a/src/views/Clock.js
+++ b/src/views/Clock.js
@@ -3,6 +3,7 @@
*/
import React, { useState, useEffect } from "react";
+import { rand } from "../utils/index.js";
const clock = {
width: "20vw",
@@ -104,5 +105,3 @@ export default function Clock({ utc }) {
// hour transform origin: 40 x 515 // 88 / 533
// minute transform origin: 37 x 622 // 72 x 740
// second transform origin: 11 x 751 // 24 x 980
-
-const rand = (n) => Math.random() * n;
diff --git a/src/views/Detail.js b/src/views/Detail.js
index b1c4dcf..70f4561 100644
--- a/src/views/Detail.js
+++ b/src/views/Detail.js
@@ -7,6 +7,7 @@ import React from "react";
import Gallery from "./Gallery.js";
import Clocks from "./Clocks.js";
import Vimeo from "@u-wave/react-vimeo";
+import { pad } from "../utils/index.js";
export default function Detail({ node, visible, onClose }) {
if (!node) {
@@ -59,12 +60,3 @@ export default function Detail({ node, visible, onClose }) {
</div>
);
}
-
-const pad = (value) => (value < 10 ? "0" + value : value);
-const capitalizeWord = (text = "") =>
- text ? text.charAt(0).toUpperCase() + text.slice(1) : "";
-const capitalize = (text = "") =>
- String(text || "")
- .split(" ")
- .map(capitalizeWord)
- .join(" ");
diff --git a/src/views/Gallery.js b/src/views/Gallery.js
index c2bd62d..ec1b234 100644
--- a/src/views/Gallery.js
+++ b/src/views/Gallery.js
@@ -3,6 +3,7 @@
*/
import React, { useState, useEffect } from "react";
+import { mod } from "../utils/index.js";
export default function Gallery({ images, visible }) {
const hasItems = !!images?.length;
@@ -71,5 +72,3 @@ export default function Gallery({ images, visible }) {
</div>
);
}
-
-const mod = (n, m) => n - m * Math.floor(n / m);