aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/landing/sections/Software.tsx
blob: 78971773d19284691430f7e554a5bbedfc59bbd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/*
 * Copyright (c) 2024 Kristóf Marussy <kristof@marussy.com>
 *
 * SPDX-License-Identifier: MIT AND CC-BY-4.0
 *
 * Code in this file is MIT licensed, while content is CC-BY-4.0 licensed.
 */

import Link from '@docusaurus/Link';
import { useColorMode } from '@docusaurus/theme-common';
import useIsBrowser from '@docusaurus/useIsBrowser';
import clsx from 'clsx';

import {
  CodebergIcon,
  GithubIcon,
  GitlabIcon,
} from '@site/src/components/icons';
import Elsewhere from '@site/src/components/landing/Elsewhere';
import Section from '@site/src/components/landing/Section';

import styles from './Software.module.css';
import FerdiumLogo from './ferdium.svg';
import refineryBackground from './refinery-background.png?placeholder=true&sizes[]=767&sizes[]=997&sizes[]=1534&sizes[]=1920&rl';
import RefineryLogo from './refinery-logo.svg';
import refineryScreenshotDark from './refinery-screenshot-dark.png?placeholder=true&sizes[]=997&sizes[]=1920&format=png&rl';
import refineryScreenshotLight from './refinery-screenshot-light.png?placeholder=true&sizes[]=997&sizes[]=1920&format=png&rl';

function ScreenshotImage() {
  // Force re-render in browser.
  // https://github.com/facebook/docusaurus/blob/e012e0315862b2ca02cad40c58d11d31c319ff75/packages/docusaurus-theme-classic/src/theme/CodeBlock/index.tsx#L32-L36
  const isBrowser = useIsBrowser();
  const { colorMode } = useColorMode();
  const refineryScreenshot =
    colorMode === 'dark' ? refineryScreenshotLight : refineryScreenshotDark;

  const screenshot = (
    <img
      src={refineryScreenshot.src}
      srcSet={refineryScreenshot.srcSet}
      width={refineryScreenshot.width}
      height={refineryScreenshot.height}
      sizes="(min-width: 1440px) 767px, (min-width: 1384px) 659px, (min-width: 997px) calc(60vw - 64px), calc(100vw - 32px)"
      loading="lazy"
      alt=""
      className={styles.screenshot}
    />
  );

  return isBrowser ? screenshot : <noscript>{screenshot}</noscript>;
}

function Screenshot() {
  return (
    <div
      className={clsx(
        styles.software,
        styles['software--interactive'],
        styles['software--screenshot'],
      )}
      style={{
        aspectRatio:
          refineryScreenshotDark.width / refineryScreenshotDark.height,
      }}
    >
      <div className={clsx(styles.content, styles['content--screenshot'])}>
        <div
          className={clsx(
            styles.screenshot__backdrop,
            styles['screenshot__backdrop--light'],
          )}
          style={{
            aspectRatio:
              refineryScreenshotDark.width / refineryScreenshotDark.height,
            backgroundImage: `url(${refineryScreenshotDark.placeholder})`,
          }}
        />
        <div
          className={clsx(
            styles.screenshot__backdrop,
            styles['screenshot__backdrop--dark'],
          )}
          style={{
            aspectRatio:
              refineryScreenshotLight.width / refineryScreenshotLight.height,
            backgroundImage: `url(${refineryScreenshotLight.placeholder})`,
          }}
        />
        <ScreenshotImage />
        <div
          className={clsx(
            styles.overlay,
            styles['overlay--screenshot'],
            styles.description,
          )}
        >
          <p>
            <Link
              href="https://refinery.services"
              className={styles.screenshot__link}
            >
              Try Refinery in your browser
            </Link>
          </p>
        </div>
      </div>
    </div>
  );
}

export default function Software() {
  return (
    <div className={styles.wrapper}>
      <Section id="software" title="Software">
        <div className="container">
          <div className={styles['software-grid']}>
            <div
              className={clsx(
                styles.software,
                styles['software--interactive'],
                styles['software--refinery'],
              )}
            >
              <div
                className={clsx(styles.content, styles['content--refinery'])}
                style={{
                  backgroundImage: `url(${refineryBackground.placeholder})`,
                }}
              >
                <img
                  src={refineryBackground.src}
                  srcSet={refineryBackground.srcSet}
                  width={refineryBackground.width}
                  height={refineryBackground.height}
                  sizes="(min-width: 1440px) 767px, (min-width: 1384px) 659px, (min-width: 997px) calc(60vw - 64px), calc(100vw - 32px)"
                  loading="lazy"
                  alt=""
                  className={styles.refinery__background}
                />
                <h3 className={styles.refinery__heading}>
                  <RefineryLogo className={styles.refinery__logo} />
                  <Link
                    href="https://refinery.tools"
                    className={styles['cover-link']}
                  >
                    Refinery
                  </Link>
                </h3>
                <div className={styles.overlay}>
                  <div className={styles.description}>
                    <p>
                      I am a developer and maintainer of Refinery, an efficient{' '}
                      <b>graph solver</b> for generating{' '}
                      <b>well-formed models</b> and reasoning about{' '}
                      <b>interconnected systems.</b>
                    </p>
                  </div>
                  <div className={styles.refinery__buttons}>
                    <Link
                      href="https://refinery.services"
                      className={clsx(
                        'button',
                        'button--primary',
                        styles.button,
                      )}
                    >
                      Try now
                    </Link>
                    <Link
                      href="https://refinery.tools/learn/"
                      className={clsx(
                        'button',
                        'button--secondary',
                        styles.button,
                      )}
                    >
                      Read docs
                    </Link>
                  </div>
                </div>
              </div>
            </div>
            <Screenshot />
            <div
              className={clsx(
                styles.software,
                styles['software--interactive'],
                styles['software--ferdium'],
              )}
            >
              <div className={styles.ferdium__icon}>
                <FerdiumLogo
                  className={styles.ferdium__logo}
                  aria-hidden="true"
                />
              </div>
              <div
                className={clsx(styles.ferdium__content, styles.description)}
              >
                <p>
                  I also contributed to <b>Ferdium,</b> a desktop app that
                  combines and organizes <b>messaging apps</b> to take back{' '}
                  <b>user freedom.</b>{' '}
                  <Link
                    href="https://ferdium.org/"
                    className={styles['cover-link']}
                  >
                    Give it a spin!
                  </Link>
                </p>
              </div>
            </div>
            <div
              className={clsx(
                styles.software,
                styles['software--hosted'],
                styles.description,
              )}
            >
              <p>
                I host some{' '}
                <Link href="https://git.marussy.com">Git repositories</Link> and{' '}
                <Link href="https://jenkins.marussy.com">Jenkins CI</Link> to
                publish my own code and mirror software I contribute to or use.
              </p>
              <p>
                Take a look at the mirrors of{' '}
                <Link href="https://git.marussy.com/firejail/">Firejail</Link>{' '}
                and <Link href="https://git.marussy.com/sway/">sway</Link>. Here
                are my{' '}
                <Link href="https://git.marussy.com/gitmirror/">scripts</Link>{' '}
                for mirroring.
              </p>
            </div>
          </div>
          <Elsewhere
            label="See my other repositories at"
            links={[
              {
                href: 'https://github.com/kris7t/',
                icon: <GithubIcon />,
              },
              {
                href: 'https://gitlab.com/kris7t',
                icon: <GitlabIcon />,
              },
              {
                href: 'https://codeberg.org/marussy',
                icon: <CodebergIcon />,
              },
            ]}
          />
        </div>
      </Section>
    </div>
  );
}