{"id":23096963,"url":"https://github.com/x8bitrain/react-webgl-fluid","last_synced_at":"2025-08-16T12:32:02.482Z","repository":{"id":43549266,"uuid":"219534240","full_name":"x8BitRain/react-webgl-fluid","owner":"x8BitRain","description":"Pavel Dobryakov's WebGL Fluid Simulation as a React Component","archived":false,"fork":false,"pushed_at":"2022-12-10T07:00:11.000Z","size":577,"stargazers_count":9,"open_issues_count":21,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-29T06:42:44.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://x8bitrain.github.io/react-webgl-fluid","language":"JavaScript","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/x8BitRain.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}},"created_at":"2019-11-04T15:30:39.000Z","updated_at":"2024-05-23T02:09:30.000Z","dependencies_parsed_at":"2023-01-25T23:00:42.977Z","dependency_job_id":null,"html_url":"https://github.com/x8BitRain/react-webgl-fluid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x8BitRain%2Freact-webgl-fluid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x8BitRain%2Freact-webgl-fluid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x8BitRain%2Freact-webgl-fluid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x8BitRain%2Freact-webgl-fluid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x8BitRain","download_url":"https://codeload.github.com/x8BitRain/react-webgl-fluid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230038080,"owners_count":18163245,"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-12-16T22:49:56.346Z","updated_at":"2024-12-16T22:49:57.106Z","avatar_url":"https://github.com/x8BitRain.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-webgl-fluid\n\nhttp://x8bitrain.github.io/react-webgl-fluid\n\nA React implementation of [Pavel Dobryakov's WebGL Fluid Simulation](https://github.com/PavelDoGreat/WebGL-Fluid-Simulation) as a component, not only is it a fun simulation to play with but when tweaked the settings to be less resource intensive and lower resolution, the simulation can be a cool UI element you could add to something like a navbar or page background like this: https://btr.pm/projects/\n\n# How it works\n\nNot a rewrite of the original script but just a basic, easy to use React component that adds a `\u003cscript\u003e` tag containing a modified version of the original when the component mounts, the script then hooks into a `\u003ccanvas\u003e` component generated by React, then it renders the Fluid sim.\n\nYou can edit the simulation settings on line 28 of fluid-init.js [https://github.com/x8BitRain/react-webgl-fluid/blob/master/assets/js/fluid-init.js#L4](https://github.com/x8BitRain/react-webgl-fluid/blob/master/assets/js/fluid-init.js#L28)\n\n\n# Main changes\n\nThe modifications to the original Fluid WebGL script are as follows:\n\n- Removed code that initializes the control panel for changing the sim settings.\n- Absolute paths to .png resources.\n- Name of the canvas element the scripts hooks into from\n`document.getElementsByTagName('canvas')[0];`\nto\n`document.getElementsByClassName('fluid-canvas')[0];`\n- Altered sim configuration to be lower res and density, also background is white now.\n- Inline style as a states so you can change the dimensions of the canvas on the fly with React.\n\n## react-boilerplate\n\nBuild using a simple React boilerplate from Lewagon configured with:\n\n- React, ReactDOM\n- Webpack 4\n- Babel with es2015 and react presets\n- `.js` or `.jsx`\n- main `application.scss` stylesheet is imported in `index.js` as a module to enjoy hot reloading\n\n## Scripts\n\nTo start the local Webpack Dev Server (usually on port `8080`):\n\n```bash\nyarn start\n```\n\nTo lint all JavaScript files in the `src` folder:\n\n```bash\nyarn lint\n```\n\nTo build static HTML and JS files for production or whatever rly)))\n\n```bash\nwebpack -p\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx8bitrain%2Freact-webgl-fluid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx8bitrain%2Freact-webgl-fluid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx8bitrain%2Freact-webgl-fluid/lists"}