Skip to content

Commit b4d1b1f

Browse files
committed
next/latex: start working on the latex landing page ...
1 parent 32c4a51 commit b4d1b1f

File tree

10 files changed

+55
-16
lines changed

10 files changed

+55
-16
lines changed

src/packages/frontend/account/dark-mode.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import { AccountStore } from "./store";
1010

1111
export const DARK_MODE_KEYS = ["brightness", "contrast", "sepia"] as const;
1212

13-
// Icon unicode character for dark mode toggle (◑ - circle with right half black)
14-
export const DARK_MODE_ICON = 0x25d1;
15-
1613
type Config = Record<(typeof DARK_MODE_KEYS)[number], number>;
1714

1815
export const DARK_MODE_MINS: Config = {

src/packages/frontend/account/other-settings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*/
55

66
import { Button, Card, Slider } from "antd";
7-
import { debounce } from "lodash";
87
import { Map } from "immutable";
8+
import { debounce } from "lodash";
99
import { useMemo } from "react";
10-
import { defineMessages, FormattedMessage, useIntl } from "react-intl";
10+
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
1111

1212
import { Checkbox, Panel } from "@cocalc/frontend/antd-bootstrap";
1313
import { Rendered, redux, useTypedRedux } from "@cocalc/frontend/app-framework";
@@ -41,15 +41,15 @@ import {
4141
import { NewFilenameFamilies } from "@cocalc/frontend/project/utils";
4242
import track from "@cocalc/frontend/user-tracking";
4343
import { webapp_client } from "@cocalc/frontend/webapp-client";
44+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
4445
import { DEFAULT_NEW_FILENAMES, NEW_FILENAMES } from "@cocalc/util/db-schema";
46+
import { DARK_MODE_DEFAULTS } from "@cocalc/util/db-schema/accounts";
4547
import { OTHER_SETTINGS_REPLY_ENGLISH_KEY } from "@cocalc/util/i18n/const";
4648
import {
47-
DARK_MODE_ICON,
4849
DARK_MODE_KEYS,
4950
DARK_MODE_MINS,
5051
get_dark_mode_config,
5152
} from "./dark-mode";
52-
import { DARK_MODE_DEFAULTS } from "@cocalc/util/db-schema/accounts";
5353
import { I18NSelector, I18N_MESSAGE, I18N_TITLE } from "./i18n-selector";
5454
import Messages from "./messages";
5555
import Tours from "./tours";

src/packages/frontend/frame-editors/frame-tree/commands/generic-commands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { debounce } from "lodash";
1010
import { useEffect, useRef } from "react";
1111
import { defineMessage, IntlShape, useIntl } from "react-intl";
1212

13-
import { DARK_MODE_ICON } from "@cocalc/frontend/account/dark-mode";
1413
import { set_account_table } from "@cocalc/frontend/account/util";
1514
import { redux } from "@cocalc/frontend/app-framework";
1615
import { Icon } from "@cocalc/frontend/components";
@@ -30,6 +29,7 @@ import { isSupportedExtension } from "@cocalc/frontend/project/page/home-page/ai
3029
import { AI_GENERATE_DOC_TAG } from "@cocalc/frontend/project/page/home-page/ai-generate-utils";
3130
import openSupportTab from "@cocalc/frontend/support/open";
3231
import userTracking from "@cocalc/frontend/user-tracking";
32+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
3333
import { filename_extension } from "@cocalc/util/misc";
3434
import { addCommands } from "./commands";
3535
import { SEARCH_COMMANDS } from "./const";

src/packages/frontend/frame-editors/latex-editor/output-control-build.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import type { MenuProps } from "antd";
1212
import { Dropdown } from "antd";
1313
import { useIntl } from "react-intl";
1414

15-
import { Button as BSButton } from "@cocalc/frontend/antd-bootstrap";
16-
import { DARK_MODE_ICON } from "@cocalc/frontend/account/dark-mode";
1715
import { set_account_table } from "@cocalc/frontend/account/util";
16+
import { Button as BSButton } from "@cocalc/frontend/antd-bootstrap";
1817
import { useRedux, useTypedRedux } from "@cocalc/frontend/app-framework";
1918
import { Icon } from "@cocalc/frontend/components";
2019
import { COMMANDS } from "@cocalc/frontend/frame-editors/frame-tree/commands";
@@ -24,6 +23,7 @@ import {
2423
BUILD_ON_SAVE_LABEL,
2524
} from "@cocalc/frontend/frame-editors/frame-tree/commands/generic-commands";
2625
import { editor, IntlMessage } from "@cocalc/frontend/i18n";
26+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
2727

2828
import { Actions } from "./actions";
2929

src/packages/next/components/landing/info.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface Props {
2323
belowWide?: boolean;
2424
caption?: ReactNode;
2525
children: ReactNode;
26-
icon?: IconName;
26+
icon?: IconName | JSX.Element;
2727
image?: string | StaticImageData;
2828
imageComponent?: ReactNode; // if set, this replaces the image!
2929
level?: TitleProps["level"];
@@ -130,9 +130,9 @@ export default function Info({
130130
...textStyle,
131131
}}
132132
>
133-
{icon && (
133+
{icon != null && (
134134
<span style={{ fontSize: "24pt", marginRight: "5px" }}>
135-
<Icon name={icon} />{" "}
135+
{typeof icon === "string" ? <Icon name={icon} /> : icon}{" "}
136136
</span>
137137
)}
138138
{title}

src/packages/next/pages/features/latex-editor.tsx

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import { Descriptions, Layout } from "antd";
77

88
import { Icon } from "@cocalc/frontend/components/icon";
9+
import { DARK_MODE_ICON } from "@cocalc/util/consts/ui";
10+
911
import Backups from "components/landing/backups";
1012
import Code from "components/landing/code";
1113
import Collaboration from "components/landing/collaboration";
@@ -21,15 +23,18 @@ import Publishing from "components/landing/publishing";
2123
import SignIn from "components/landing/sign-in";
2224
import { Paragraph, Text, Title } from "components/misc";
2325
import A from "components/misc/A";
26+
2427
import { Customize } from "lib/customize";
2528
import withCustomize from "lib/with-customize";
29+
2630
import LatexCollab from "public/features/cocalc-latex-concurrent-editing.png";
27-
import LatexEditorImage from "public/features/cocalc-latex-editor-2019.png";
2831
import Sidechat from "public/features/cocalc-latex-side-chat-v2.png";
2932
import Pythontex from "public/features/cocalc-pythontex.png";
3033
import Sagetex from "public/features/cocalc-sagetex.png";
3134
import AIFormula from "public/features/latex-ai-formula.png";
3235
import CustomCommand from "public/features/latex-custom-command-02.png";
36+
import LatexDarkMode from "public/features/latex-editor-darkmode-20251003.png";
37+
import LatexEditorImage from "public/features/latex-editor-main-20251003.png";
3338
import Knitr from "public/features/latex-editor-rnw-01.png";
3439
import LatexTimetravel from "public/features/latex-editor-timetravel-01.png";
3540
import Logo from "public/features/latex-logo.svg";
@@ -49,11 +54,11 @@ export default function LatexEditor({ customize }) {
4954
subtitle={
5055
<>
5156
Focus on writing LaTeX. CoCalc takes care of everything else.
52-
<hr />
57+
{/*<hr />
5358
<A href="https://about.cocalc.com/2023/01/13/cocalcs-online-latex-editor/">
5459
Learn much more about LaTeX in CoCalc from this new blog
5560
post...
56-
</A>
61+
</A> */}
5762
</>
5863
}
5964
image={LatexEditorImage}
@@ -481,6 +486,40 @@ export default function LatexEditor({ customize }) {
481486
</Paragraph>
482487
</Info>
483488

489+
<Info
490+
anchor="a-darkmode"
491+
icon={
492+
<Icon style={{ fontSize: "40px" }} unicode={DARK_MODE_ICON} />
493+
}
494+
title={"Dark Mode with PDF Support"}
495+
image={LatexDarkMode}
496+
>
497+
<Paragraph>
498+
If you like working in{" "}
499+
<span
500+
style={{
501+
background: "black",
502+
color: "white",
503+
padding: "2px 5px",
504+
}}
505+
>
506+
Dark Mode
507+
</span>
508+
, feel welcome to CoCalc as well!
509+
</Paragraph>
510+
<Paragraph>
511+
{" "}
512+
The <LaTeX /> editor not only supports the usual dark mode
513+
funcionality, but also styling the PDF. This means despite that
514+
your resulting PDF will be on a white page, you see it with a dark
515+
page and bright font characters.{" "}
516+
</Paragraph>
517+
<Paragraph>
518+
There is also a button to quickly disable the PDF dark mode, to
519+
double check the actual output.
520+
</Paragraph>
521+
</Info>
522+
484523
<Info
485524
anchor="a-timetravel"
486525
title="TimeTravel"
-275 KB
Binary file not shown.
519 KB
Loading
458 KB
Loading

src/packages/util/consts/ui.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ export const DOC_AI = "https://doc.cocalc.com/ai.html";
2828
// to all legal requirements. We thus don't use their trademark
2929
// anywhere in our frontend.
3030
export const R_IDE = "R IDE";
31+
32+
// Icon unicode character for dark mode toggle (◑ - circle with right half black)
33+
export const DARK_MODE_ICON = 0x25d1;

0 commit comments

Comments
 (0)