{"id":18296447,"url":"https://github.com/benderpan/simple_egui_web_example","last_synced_at":"2025-04-09T08:43:20.048Z","repository":{"id":116268261,"uuid":"463437806","full_name":"BenDerPan/simple_egui_web_example","owner":"BenDerPan","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-25T07:25:36.000Z","size":362,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T02:46:10.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenDerPan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-25T07:25:34.000Z","updated_at":"2022-02-25T07:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b99dd3e-f2fc-4f73-83d5-c1dcdfecace3","html_url":"https://github.com/BenDerPan/simple_egui_web_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"emilk/eframe_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenDerPan%2Fsimple_egui_web_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenDerPan%2Fsimple_egui_web_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenDerPan%2Fsimple_egui_web_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenDerPan%2Fsimple_egui_web_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenDerPan","download_url":"https://codeload.github.com/BenDerPan/simple_egui_web_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008555,"owners_count":21032553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T14:41:03.226Z","updated_at":"2025-04-09T08:43:20.029Z","avatar_url":"https://github.com/BenDerPan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eframe template\n\n[![dependency status](https://deps.rs/repo/github/emilk/eframe_template/status.svg)](https://deps.rs/repo/github/emilk/eframe_template)\n[![Build Status](https://github.com/emilk/eframe_template/workflows/CI/badge.svg)](https://github.com/emilk/eframe_template/actions?workflow=CI)\n\nThis is a template repo for [eframe](https://github.com/emilk/egui/tree/master/eframe), a framework for writing apps using [egui](https://github.com/emilk/egui/).\n\nThe goal is for this to be the simplest way to get started writing a GUI app in Rust.\n\nYou can compile your app natively or for the web, and share it using Github Pages.\n\n## Getting started\n\nStart by clicking \"Use this template\" at https://github.com/emilk/eframe_template/ or follow [these instructions](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template).\n\nChange the name of the crate: Chose a good name for your project, and change the name to it in:\n* `Cargo.toml`\n    * Update the `name` and `authors`\n* `main.rs`\n* `docs/index.html`\n    * Change the `\u003ctitle\u003e`\n    * Change the `\u003cscript src=…` line from `eframe_template.js` to `your_crate.js`\n    * Change the `wasm_bindgen(…` line from `eframe_template_bg.wasm` to `your_crate_bg.wasm` (note the `_bg`!)\n* `docs/sw.js`\n    * Change the `'./eframe_template.js'` to `./your_crate.js` (in `filesToCache` array)\n    * Change the `'./eframe_template_bg.wasm'` to `./your_crate_bg.wasm` (in `filesToCache` array)\n* Remove the web build of the old name: `rm docs/eframe_template*`\n\n### Learning about egui\n\n`src/app.rs` contains a simple example app. This is just to give some inspiration - most of it can be removed if you like.\n\nThe official egui docs are at \u003chttps://docs.rs/egui\u003e. If you prefer watching a video introduction, check out \u003chttps://www.youtube.com/watch?v=NtUkr_z7l84\u003e. For inspiration, check out the [the egui web demo](https://emilk.github.io/egui/index.html) and follow the links in it to its source code.\n\n### Testing locally\n\nMake sure you are using the latest version of stable rust by running `rustup update`.\n\n`cargo run --release`\n\nOn Linux you need to first run:\n\n`sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev`\n\nOn Fedora Rawhide you need to run:\n\n`dnf install clang clang-devel clang-tools-extra speech-dispatcher-devel libxkbcommon-devel pkg-config openssl-devel libxcb-devel`\n\nFor running the `build_web.sh` script you also need to install `jq` and `binaryen` with your packet manager of choice.\n\n### Compiling for the web\n\nMake sure you are using the latest version of stable rust by running `rustup update`.\n\nYou can compile your app to [WASM](https://en.wikipedia.org/wiki/WebAssembly) and publish it as a web page. For this you need to set up some tools. There are a few simple scripts that help you with this:\n\n``` sh\n./setup_web.sh\n./build_web.sh\n./start_server.sh\nopen http://127.0.0.1:8080/\n```\n\n* `setup_web.sh` installs the tools required to build for web\n* `build_web.sh` compiles your code to wasm and puts it in the `docs/` folder (see below)\n* `start_server.sh` starts a local HTTP server so you can test before you publish\n* Open http://127.0.0.1:8080/ in a web browser to view\n\nThe finished web app is found in the `docs/` folder (this is so that you can easily share it with [GitHub Pages](https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site)). It consists of three files:\n\n* `index.html`: A few lines of HTML, CSS and JS that loads your app. **You need to edit this** (once) to replace `eframe_template` with the name of your crate!\n* `your_crate_bg.wasm`: What the Rust code compiles to.\n* `your_crate.js`: Auto-generated binding between Rust and JS.\n\nYou can test the template app at \u003chttps://emilk.github.io/eframe_template/\u003e.\n\n## Updating egui\n\nAs of 2022, egui is in active development with frequent releases with breaking changes. [eframe_template](https://github.com/emilk/eframe_template/) will be updated in lock-step to always use the latest version of egui.\n\nWhen updating `egui` and `eframe` it is recommended you do so one version at the time, and read about the changes in [the egui changelog](https://github.com/emilk/egui/blob/master/CHANGELOG.md) and [eframe changelog](https://github.com/emilk/egui/blob/master/eframe/CHANGELOG.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderpan%2Fsimple_egui_web_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenderpan%2Fsimple_egui_web_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderpan%2Fsimple_egui_web_example/lists"}