Skip to content

sprout2000/leafview

Repository files navigation

leaves LeafView

GitHub license GitHub contributors

Minimalist image viewer based on Leaflet.js and Electron.

2023-07-13-171541

Image by Joe from Pixabay.

👍 Features

  • Pan & Wheel Zoom
  • Browse the images in a folder
  • Grid view
  • Available in 16 languages
  • Auto update (only on macOS)
2023-07-13-171712

📥 Download

You can download the latest version of LeafView from the releases page here:
https://github.com/sprout2000/leafview/releases

How to build by yourself?

# 1. Clone this repo.
$ git clone https://github.com/sprout2000/leafview.git

# 2. Install dependencies
$ cd leafview
$ npm install

# 3. Build & Package
$ npm run build && npm run package

And then, you will find the installer in the "release" directory.

Note: You will need to have Node.js and Git installed.

📗 Usage

⌨️ Keyboard Shortcuts

Key Function
J, Ctrl+N, CmdOrCtrl+ Next Image
K, Ctrl+P, CmdOrCtrl+ Previous Image
+ Zoom In
- Zoom Out
0 Reset Zoom
Pan
Fn+Delete or Del Move to Trash
H, Ctrl+G Toggle Grid View
Ctrl+Shift+T Toggle Menubar (Windows / Linux)

🖱️ Mouse Operations

Mouse Function
Drag Pan
Wheel Zoom in/out
Double click Reset zoom
Right click Show the context menu when available

🌐 Supported Languages

Language Code
اللغة العربية ar
Čeština cs
Deutsch de
English en
Español es
Français fr
Magyar hu
Italiano it
日本語 ja
Polski pl
Português pt
Русский ru
Türkçe tr
Українська uk
简体中文 zh_CN
繁体中文 zh_TW

🍻 Contributing

You can easily contribute to this repository by providing translation files.

  1. Create {your_LANG}.json in src/locales.
  src
  ├── @types
  ├── createMenu.ts
  ├── locales
+ │   ├── cs.json
  │   ├── en.json
  │   └── ja.json
  ├── main.ts
  ├── preload.ts
  ├── setLocales.ts
  └── web
  1. Add your locale to src/@types/Locale.d.ts, src/createMenu.ts and src/setLocales.ts.
  • src/@types/Locale.d.ts
  type Code =
+   | "cs"
    | "en"
    | "ja";
  • src/createMenu.ts
  const localeList: Locale[] = [
+   { code: "cs", value: "Čeština" },
    { code: "en", value: "English" },
    { code: "ja", value: "日本語" },
  ];
  • src/setLocales.ts
+ import cs from "./locales/cs.json";
  import en from "./locales/en.json";
  import ja from "./locales/ja.json";

  export const setLocales = (locale: string) => {
    i18next.init({
      lng: locale,
      fallbackLng: "en",
      resources: {
+       cs: { translation: cs },
        en: { translation: en },
        ja: { translation: ja },
      },
    });
  };
  1. And then please send a pull request to this repository.

🎉 Contributors

Thanks go to these wonderful people 🙂:

©️ Copyright

Copyright (c) 2020-2024 sprout2000