diff --git a/.eslintignore b/.eslintignore index 1aa89225d..7b8727bd2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1662,6 +1662,9 @@ packages/tools/buildServerDocker.js.map packages/tools/generate-database-types.d.ts packages/tools/generate-database-types.js packages/tools/generate-database-types.js.map +packages/tools/generate-images.d.ts +packages/tools/generate-images.js +packages/tools/generate-images.js.map packages/tools/lerna-add.d.ts packages/tools/lerna-add.js packages/tools/lerna-add.js.map diff --git a/.gitignore b/.gitignore index f3f6a4027..4515606f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1647,6 +1647,9 @@ packages/tools/buildServerDocker.js.map packages/tools/generate-database-types.d.ts packages/tools/generate-database-types.js packages/tools/generate-database-types.js.map +packages/tools/generate-images.d.ts +packages/tools/generate-images.js +packages/tools/generate-images.js.map packages/tools/lerna-add.d.ts packages/tools/lerna-add.js packages/tools/lerna-add.js.map diff --git a/Assets/ImageSources/WebsiteTopImage.png b/Assets/ImageSources/WebsiteTopImage.png new file mode 100644 index 000000000..075874c83 Binary files /dev/null and b/Assets/ImageSources/WebsiteTopImage.png differ diff --git a/Assets/WebsiteAssets/css/site.css b/Assets/WebsiteAssets/css/site.css index 294050a1d..43edcc906 100644 --- a/Assets/WebsiteAssets/css/site.css +++ b/Assets/WebsiteAssets/css/site.css @@ -379,6 +379,10 @@ p, margin-top: 40px; } +#top-section-img img { + width: 100%; +} + .main-content { flex: 1; } diff --git a/Assets/WebsiteAssets/images/home-top-img-2x.png b/Assets/WebsiteAssets/images/home-top-img-2x.png index 075874c83..a1e14a8fa 100644 Binary files a/Assets/WebsiteAssets/images/home-top-img-2x.png and b/Assets/WebsiteAssets/images/home-top-img-2x.png differ diff --git a/Assets/WebsiteAssets/images/home-top-img-2x.webp b/Assets/WebsiteAssets/images/home-top-img-2x.webp new file mode 100644 index 000000000..49974ee51 Binary files /dev/null and b/Assets/WebsiteAssets/images/home-top-img-2x.webp differ diff --git a/Assets/WebsiteAssets/images/home-top-img-4x.webp b/Assets/WebsiteAssets/images/home-top-img-4x.webp new file mode 100644 index 000000000..a8c2612f1 Binary files /dev/null and b/Assets/WebsiteAssets/images/home-top-img-4x.webp differ diff --git a/Assets/WebsiteAssets/images/home-top-img.png b/Assets/WebsiteAssets/images/home-top-img.png index 4d0f63ddd..164e9e40b 100644 Binary files a/Assets/WebsiteAssets/images/home-top-img.png and b/Assets/WebsiteAssets/images/home-top-img.png differ diff --git a/Assets/WebsiteAssets/images/home-top-img.webp b/Assets/WebsiteAssets/images/home-top-img.webp new file mode 100644 index 000000000..3919c4e07 Binary files /dev/null and b/Assets/WebsiteAssets/images/home-top-img.webp differ diff --git a/Assets/WebsiteAssets/templates/front.mustache b/Assets/WebsiteAssets/templates/front.mustache index bc7df66f0..fe158f098 100644 --- a/Assets/WebsiteAssets/templates/front.mustache +++ b/Assets/WebsiteAssets/templates/front.mustache @@ -56,17 +56,19 @@ Sign up with Joplin Cloud {{/showJoplinCloudLinks}}

- + + + + + diff --git a/docs/images/home-top-img-2x.webp b/docs/images/home-top-img-2x.webp new file mode 100644 index 000000000..49974ee51 Binary files /dev/null and b/docs/images/home-top-img-2x.webp differ diff --git a/docs/images/home-top-img-4x.webp b/docs/images/home-top-img-4x.webp new file mode 100644 index 000000000..e69de29bb diff --git a/docs/images/home-top-img.webp b/docs/images/home-top-img.webp new file mode 100644 index 000000000..3919c4e07 Binary files /dev/null and b/docs/images/home-top-img.webp differ diff --git a/packages/tools/generate-images.js b/packages/tools/generate-images.ts similarity index 85% rename from packages/tools/generate-images.js rename to packages/tools/generate-images.ts index 9e06fe0d8..fdd8cf954 100644 --- a/packages/tools/generate-images.js +++ b/packages/tools/generate-images.ts @@ -1,10 +1,24 @@ -const dirname = require('path').dirname; +import * as fs from 'fs-extra'; +import { dirname } from 'path'; +import { execCommand } from './tool-utils'; +import { fileExtension } from '@joplin/lib/path-utils'; const sharp = require('sharp'); -const fs = require('fs-extra'); -const { execCommand } = require('./tool-utils.js'); -const { fileExtension } = require('@joplin/lib/path-utils'); -const sources = [ +interface Source { + id: number; + name: string; +} + +interface Operation { + source: number; + dest: string; + width?: number; + height?: number; + iconWidth?: number; + iconHeight?: number; +} + +const sources: Source[] = [ { id: 1, name: 'Square_1024x1024.png', @@ -33,16 +47,20 @@ const sources = [ id: 7, name: 'RoundedCornersMac_1024x1024.png', }, + { + id: 8, + name: 'WebsiteTopImage.png', + }, ]; -function sourceById(id) { +function sourceById(id: number) { for (const s of sources) { if (s.id === id) return s; } throw new Error(`Invalid source ID: ${id}`); } -const operations = [ +const operations: Operation[] = [ // ============================================================================ // iOS icons @@ -279,6 +297,41 @@ const operations = [ iconWidth: 46, iconHeight: 46, }, + + // ============================================================================ + // Website images + // ============================================================================ + + { + source: 8, + dest: 'Assets/WebsiteAssets/images/home-top-img-4x.webp', + width: 4820, + height: 2938, + }, + { + source: 8, + dest: 'Assets/WebsiteAssets/images/home-top-img-2x.png', + width: 2388, + height: 1456, + }, + { + source: 8, + dest: 'Assets/WebsiteAssets/images/home-top-img-2x.webp', + width: 2388, + height: 1456, + }, + { + source: 8, + dest: 'Assets/WebsiteAssets/images/home-top-img.png', + width: 1205, + height: 734, + }, + { + source: 8, + dest: 'Assets/WebsiteAssets/images/home-top-img.webp', + width: 1205, + height: 734, + }, ]; async function main() { @@ -317,7 +370,13 @@ async function main() { if (destExt === 'jpg') { s.jpeg({ quality: 90 }); } else if (destExt === 'png') { - s.png(); + s.png({ + compressionLevel: 9, + }); + } else if (destExt === 'webp') { + s.webp({ + // quality: 90, + }); } else { throw new Error(`Unsupported extension: ${destExt}`); }