Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .stylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@
"commaSpace": "always",
"commentSpace": "always",
"cssLiteral": "never",
"customProperties": [],
"customProperties": [
"aspect-ratio",
"contain",
"gap",
"mask",
"-webkit-mask",
"text-decoration-thickness",
"text-underline-offset"
],
"depthLimit": false,
"duplicates": true,
"efficient": "always",
"exclude": [],
"extendPref": "@extends",
"globalDupe": true,
"globalDupe": false,
"groupOutputByFile": true,
"indentPref": 4,
"leadingZero": false,
"maxErrors": 0,
"maxWarnings": 0,
"mixed": true,
"mixins": [],
"namingConvention": "lowercase-dash",
"namingConventionStrict": true,
"none": false,
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ src/
│ └── views/ 22 presentational .jsx
│ ├── styl/ Stylus SOURCE (hand-edited); includes/lib.styl
│ ├── css/ GENERATED, GITIGNORED — holds only a README stub
│ ├── fonts/FiraSans/ 8 weights/styles of webfonts
│ └── img/ 3 assets
│ ├── fonts/ Mozilla Headline and Mozilla Text webfonts (woff2)
│ └── img/ footer/ (Firefox logo, Protocol social icons)
├── lib/
│ ├── fetchCache.js withFetch's responses by URL, kept until the page reloads
│ ├── lazyLoad.jsx lazyLoad(() => import(…)): starts loading now, renders loaded code without suspending
Expand Down Expand Up @@ -116,7 +116,7 @@ Errors: `eqeqeq`, `no-var`, `prefer-const`, `no-console`, `no-global-assign`, `n

## Styling: Stylus, outside Vite

`src/components/views/styl/*.styl` → `src/components/views/css/*.css` via the `stylus` CLI (`build:css` / `watch:css`). Vite never sees the Stylus. One `.styl` per component (PascalCase, mirroring the component), plus `Application.styl` (global reset, Fira Sans `@font-face`, body type, ~217 lines) and shared partials `Metric.styl` and `LabelledSelector.styl`.
`src/components/views/styl/*.styl` → `src/components/views/css/*.css` via the `stylus` CLI (`build:css` / `watch:css`). Vite never sees the Stylus. One `.styl` per component (PascalCase, mirroring the component), plus `Application.styl` (global reset, Mozilla Headline and Mozilla Text `@font-face`, body type, ~146 lines) and shared partials `Metric.styl` and `LabelledSelector.styl`.

Shared variables live in `src/components/views/styl/includes/lib.styl` and it is nearly empty — `$base-tablet`, `$base-desktop`, `$link-color-normal = #0070ff`, and a `// TODO: padding/margin spacing.`. Import it per-file with `@import 'includes/lib'`; it is not globally injected. **No mixins file; most colors are hardcoded hex inline** (stylint's `colors` check is off).

Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ built-in method outside the policy ships as-is and throws in older browsers. Tes
`src/components/views/styl/*.styl` compiles to `src/components/views/css/*.css` via the `stylus`
CLI (`npm run build:css` / `watch:css`). Vite never sees the Stylus — this pipeline predates the
build tool and remains fully independent of it. One `.styl` file per component (PascalCase,
mirroring the component), plus `Application.styl` (global reset, Fira Sans `@font-face`, body type,
roughly 217 lines) and shared partials `Metric.styl` and `LabelledSelector.styl`.
mirroring the component), plus `Application.styl` (global reset, Mozilla Headline and Mozilla
Text `@font-face`, body type, roughly 146 lines) and shared partials `Metric.styl` and
`LabelledSelector.styl`.

Shared variables live in `src/components/views/styl/includes/lib.styl`, and it is nearly empty:
`$base-tablet`, `$base-desktop`, `$link-color-normal = #0070ff`, and a `// TODO: padding/margin
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ these architecture docs.
│ └── views/ 22 presentational .jsx files
│ ├── styl/ Stylus source, hand-edited; includes/lib.styl holds shared variables
│ ├── css/ generated from styl/, gitignored — see CONTRIBUTING.md
│ ├── fonts/FiraSans/ 8 weights/styles of webfonts
│ └── img/ 3 assets
│ ├── fonts/ Mozilla Headline and Mozilla Text webfonts (woff2)
│ └── img/ footer/ (Firefox logo, Protocol social icons)
├── lib/
│ ├── fetchCache.js withFetch's responses by URL, kept until the page reloads
│ ├── lazyLoad.jsx starts a dynamic import() now; renders the loaded code without suspending
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<link rel="manifest" href="/manifest.json">
<link rel="icon" type="image/png" sizes="196x196" href="/img/icons/favicon-196.png">
<link rel="shortcut icon" href="/img/icons/favicon.ico">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/img/icons/apple-touch-icon.png">
<meta property="og:image" content="https://data.firefox.com/img/ogimage.png">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
Expand Down
Binary file added public/img/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/icons/favicon-196.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/icons/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"name": "Firefox Public Data Report",
"icons": [
{
"src": "icons/favicon.ico",
"sizes": "32x32 16x16",
"src": "/img/icons/favicon.ico",
"sizes": "48x48 32x32 16x16",
"type": "image/x-icon"
},
{
"src": "icons/favicon-196.png",
"src": "/img/icons/favicon-196.png",
"sizes": "196x196",
"type": "image/png"
}
Expand Down
14 changes: 10 additions & 4 deletions src/components/views/Chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const paletteForUpToElevenPopulations = [
'#000000',
];

// A chart with a single population draws it in Firefox purple over a pale
// purple area.
const singlePopulationColor = '#7543e3';
const singlePopulationAreaColor = '#f1e7f8';

// Generating a palette takes several milliseconds, and the chart renders again
// on every legend hover and focus, so each size is generated only once.
const generatedPalettes = new Map();
Expand Down Expand Up @@ -223,7 +228,7 @@ export default props => {
{ x: 'labelX', text: 'label', frameAnchor: 'top', dy: -((row + 1) * markerLabelRowHeight), className: 'chart-marker-label' }
));

const colors = paletteFor(props.numPopulations);
const colors = props.data.length === 1 ? [singlePopulationColor] : paletteFor(props.numPopulations);

// While a legend entry is hovered or focused, every other population fades
// so that it stands out. A population with no points shown has nothing to
Expand Down Expand Up @@ -266,9 +271,10 @@ export default props => {
);
};

// A chart with a single population is shaded below its line.
// A chart with a single population is shaded below its line. The shading
// is opaque, so it's drawn first to keep the axes and annotations visible.
const maybeArea = props.data.length === 1 ? [
Plot.areaY(linePoints, { x: 'x', y1: minYToShow, y2: 'y', curve: 'catmull-rom', fill: '#0000ff', fillOpacity: .2, className: 'chart-area' }),
Plot.areaY(linePoints, { x: 'x', y1: minYToShow, y2: 'y', curve: 'catmull-rom', fill: singlePopulationAreaColor, className: 'chart-area' }),
] : [];

const options = {
Expand All @@ -285,11 +291,11 @@ export default props => {
y: yOptions,
color: { domain: legend, range: colors },
marks: [
...maybeArea,
Plot.frame({ anchor: 'left', stroke: '#b3b2b2', className: 'chart-axis-line' }),
Plot.frame({ anchor: 'bottom', stroke: '#b3b2b2', className: 'chart-axis-line' }),
Plot.ruleX(markersInRange, { x: 'x', stroke: '#b3b2b2', strokeDasharray: '3,1', className: 'chart-marker' }),
...markerLabelMarks,
...maybeArea,
Plot.line(linePoints, { x: 'x', y: 'y', z: 'population', stroke: 'population', strokeWidth: 1, curve: 'catmull-rom', className: 'chart-line' }),
Plot.dot(loosePoints, { x: 'x', y: 'y', fill: 'population', r: 3, className: 'chart-point' }),
Plot.dot(visiblePoints, Plot.pointer({ x: 'x', y: 'y', fill: 'population', r: 4, maxRadius: hoverRadius, className: 'chart-hover-point' })),
Expand Down
113 changes: 58 additions & 55 deletions src/components/views/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,67 @@ export default class extends React.Component {

render() {
return (
<footer>
<div className="footer-primary">
<a className="footer-logo" href="https://www.mozilla.org/">Mozilla</a>
<footer className="c-footer">
<div>
<nav className="c-footer-primary">
<div className="c-footer-primary-logo">
<a href="https://www.firefox.com/">Firefox</a>
</div>
<div className="c-footer-sections">
<section className="c-footer-section">
<h3 className="c-footer-heading">Mozilla</h3>
<ul className="c-footer-list">
<li><a href="https://www.mozilla.org/">Mozilla.org</a></li>
<li><a href="https://www.mozilla.org/about/">About</a></li>
<li><a href="https://donate.mozilla.org/">Donate</a></li>
<li><a href="https://www.mozilla.org/privacy/principles/">Data Privacy Principles</a></li>
<li>
<ul className="c-footer-links-social">
<li><a className="bluesky" href="https://bsky.app/profile/mozilla.org" translate="no">Bluesky<span> (@mozilla.org)</span></a></li>
<li><a className="instagram" href="https://www.instagram.com/mozilla/">Instagram<span> (@mozilla)</span></a></li>
<li><a className="linkedin" href="https://www.linkedin.com/company/mozilla-corporation/">LinkedIn<span> (@mozilla)</span></a></li>
<li><a className="tiktok" href="https://www.tiktok.com/@mozilla">TikTok<span> (@mozilla)</span></a></li>
<li><a className="spotify" href="https://open.spotify.com/show/0vT7LJMeVDxyQ2ZamHKu08?si=_uDRD6bRR_6M5YZyISGXgA">Spotify<span> (@mozilla)</span></a></li>
</ul>
</li>
</ul>
</section>
<section className="c-footer-section">
<h3 className="c-footer-heading">Firefox</h3>
<ul className="c-footer-list">
<li><a href="https://www.firefox.com/">Download Firefox</a></li>
<li><a href="https://www.firefox.com/firefox/notes/">Release Notes</a></li>
<li><a href="https://support.mozilla.org/">Support</a></li>
<li><a href="https://www.mozilla.org/privacy/firefox/">Firefox Privacy Notice</a></li>
<li>
<ul className="c-footer-links-social">
<li><a className="bluesky" href="https://bsky.app/profile/firefox.com" translate="no">Bluesky<span> (@firefox.com)</span></a></li>
<li><a className="instagram" href="https://www.instagram.com/firefox/">Instagram<span> (@firefox)</span></a></li>
<li><a className="youtube" href="https://www.youtube.com/user/firefoxchannel">YouTube<span> (@firefoxchannel)</span></a></li>
<li><a className="tiktok" href="https://www.tiktok.com/@firefox">TikTok<span> (@firefox)</span></a></li>
</ul>
</li>
</ul>
</section>
</div>
</nav>

<div>
<h3>Mozilla</h3>
<nav>
<ul>
<li><a href="https://www.mozilla.org/about/">About</a></li>
<li><a href="https://www.mozilla.org/contact/">Contact Us</a></li>
<li><a href="https://donate.mozilla.org/">Donate</a></li>
<li className="footer-social">
<ul>
<li><a href="https://twitter.com/mozilla">Twitter <span>(@mozilla)</span></a></li>
<li><a href="https://www.facebook.com/mozilla">Facebook <span>(Mozilla)</span></a></li>
<li>
<a href="https://www.instagram.com/mozillagram/">
Instagram <span>(@mozillagram)</span>
</a>
</li>
</ul>
</li>
<nav className="c-footer-secondary">
<div className="c-footer-legal">
<p className="c-footer-license">
Portions of this content are ©1998–{new Date().getFullYear()} by individual mozilla.org contributors. Content available under a {' '}
<a href="https://www.mozilla.org/foundation/licensing/website-content/">Creative Commons license</a>.
</p>
<ul className="c-footer-terms">
<li><a href="https://www.mozilla.org/privacy/">Privacy</a></li>
<li><a href="https://www.mozilla.org/privacy/websites/#cookies">Cookies</a></li>
<li><a href="https://www.mozilla.org/about/legal/">Legal</a></li>
<li><a href="https://www.mozilla.org/about/legal/fraud-report/">Report Trademark Abuse</a></li>
<li><a href="https://github.com/mozilla/ensemble">Contribute to this site</a></li>
</ul>
</nav>
</div>

<div>
<h3>Firefox</h3>
<nav>
<ul>
<li><a href="https://www.firefox.com/download/">Download Firefox Web browser</a></li>
<li><a href="https://www.firefox.com/">Desktop Browser for Mac, Window, Linux</a></li>
<li><a href="https://www.firefox.com/download/android/">Mobile Browser for Android</a></li>
<li><a href="https://www.firefox.com/download/ios/">Mobile Browser for iOS</a></li>
<li className="footer-social">
<ul>
<li><a href="https://twitter.com/firefox">Twitter <span>(@firefox)</span></a></li>
<li><a href="https://www.facebook.com/Firefox">Facebook <span>(Firefox)</span></a></li>
<li><a href="https://www.youtube.com/firefoxchannel">YouTube <span>(firefoxchannel)</span></a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</nav>
</div>

<div className="footer-secondary">
<ul>
<li><a href="https://www.mozilla.org/privacy/">Privacy</a></li>
<li><a href="https://www.mozilla.org/privacy/websites/#cookies">Cookies</a></li>
<li><a href="https://www.mozilla.org/about/legal/">Legal</a></li>
<li><a href="https://www.mozilla.org/about/legal/fraud-report/">Report Trademark Abuse</a></li>
<li><a href="https://github.com/mozilla/ensemble">Contribute to this site</a></li>
</ul>
<p>Portions of this content are ©1998–{new Date().getFullYear()} by individual mozilla.org contributors. Content available under a {' '}
<a href="https://www.mozilla.org/foundation/licensing/website-content/">Creative Commons license</a>.</p>
</div>

</footer>
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/views/NextButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import './css/NextButton.css';

export default props => (
<div className="next-button">
<Link to={props.to}>{props.text}</Link>
<Link to={props.to}>
{props.text}
<span className="next-button-icon" aria-hidden="true" />
</Link>
</div>
);
Binary file not shown.
Loading
Loading