CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/landing/util.ts
Views: 923
1
import { join } from "path";
2
3
import { COLORS } from "@cocalc/util/theme";
4
import { CSS } from "components/misc";
5
import basePath from "lib/base-path";
6
7
export function MediaURL(url) {
8
if (typeof url != "string") {
9
// e.g., a module import destined for the optimized next Image component.
10
return url;
11
}
12
if (url.includes("://")) {
13
return url;
14
}
15
return join(basePath, url);
16
}
17
18
// slight shadow with rounded corners
19
export const SHADOW: CSS = {
20
boxShadow: "2px 2px 4px rgb(0 0 0 / 25%), 0 2px 4px rgb(0 0 0 / 22%)",
21
border: `1px solid ${COLORS.GRAY_LL}`,
22
borderRadius: "5px",
23
} as const;
24
25