{"id":13459659,"url":"https://github.com/mrdoob/glsl-sandbox","last_synced_at":"2025-11-13T22:55:10.203Z","repository":{"id":1818213,"uuid":"2742407","full_name":"mrdoob/glsl-sandbox","owner":"mrdoob","description":"Shader editor and gallery.","archived":false,"fork":false,"pushed_at":"2025-03-13T00:26:51.000Z","size":401,"stargazers_count":1607,"open_issues_count":19,"forks_count":269,"subscribers_count":72,"default_branch":"master","last_synced_at":"2025-04-07T16:00:42.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://glslsandbox.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"maltem/zlib-enum","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrdoob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2011-11-09T15:29:49.000Z","updated_at":"2025-04-03T14:40:40.000Z","dependencies_parsed_at":"2025-03-24T14:00:34.043Z","dependency_job_id":"20a4a7c7-b9cb-4135-9d13-f9bab098b5c6","html_url":"https://github.com/mrdoob/glsl-sandbox","commit_stats":{"total_commits":221,"total_committers":20,"mean_commits":11.05,"dds":0.7058823529411764,"last_synced_commit":"a93f1227efc1cab9a8b6ed805010a5d9ed542caf"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdoob%2Fglsl-sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdoob%2Fglsl-sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdoob%2Fglsl-sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrdoob%2Fglsl-sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrdoob","download_url":"https://codeload.github.com/mrdoob/glsl-sandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248941482,"owners_count":21186915,"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-07-31T10:00:24.097Z","updated_at":"2025-11-13T22:55:05.157Z","avatar_url":"https://github.com/mrdoob.png","language":"JavaScript","funding_links":[],"categories":["语言资源库","JavaScript"],"sub_categories":["JavaScript"],"readme":"# glsl-sandbox\n\n## Server development\n\n### Setup\n\n* Fork repository\n* Download repository and create new development branch:\n\n```\n$ git clone git@github.com:\u003cyour user\u003e/glsl-sandbox\n$ cd glsl-sandbox\n$ git checkout -b \u003cfeature name\u003e\n```\n\n* Download and uncompress test data:\n\n```\n$ curl -O https://downloads.zooloo.org/glslsandbox-data.tar.gz\n$ tar xvf glslsandbox-data.tar.gz\n```\n\n* Build server binary needs go compiler:\n\n```\n$ go build ./server/cmd/glslsandbox\n```\n\n* Alternatively you can download and uncompress the binary in the repository directory from https://github.com/mrdoob/glsl-sandbox/releases/latest\n\n* Run server:\n\n```\n$ ./glslsandbox\n```\n\n* The first time it starts it creates an admin user and the credentials are printed.\n\n* The server should be accessible on http://localhost:8888\n\n* Admin interface is on http://localhost:8888/admin\n\n### Template and javascript modifications\n\nThe server reloads templates and assets on each query. This eases the development as you can modify the files and changes will take effect reloading the page.\n\nThere's only one template that is used for both the gallery (index) and admin page. The file is `server/assets/gallery.html` and uses go language templates. You can find more information about its syntax here:\n\n* https://gohugo.io/templates/introduction/\n* https://pkg.go.dev/text/template\n* https://pkg.go.dev/html/template\n\nCurrently the page receives this data:\n\n```go\n// galleryEffect has information about each effect displayed in the gallery.\ntype galleryEffect struct {\n\t// ID is the effect identifyier.\n\tID int\n\t// Version is the latest effect version.\n\tVersion int\n\t// Image holds the thumbnail name.\n\tImage string\n\t// Hidden tells if the effect has been moderated.\n\tHidden bool\n}\n\n// galleryData has information about the current gallery page.\ntype galleryData struct {\n\t// Effects is an array with all the effects for the page.\n\tEffects []galleryEffect\n\t// URL is the path of the gallery. Can be \"/\" or \"/admin\".\n\tURL string\n\t// Page holds the current page number.\n\tPage int\n\t// IsPrevious is true if there is a previous page.\n\tIsPrevious bool\n\t// PreviousPage is the previous page number.\n\tPreviousPage int\n\t// IsNext is true if there is a next page.\n\tIsNext bool\n\t// NextPage is the next page number.\n\tNextPage int\n\t// Admin is true when accessing \"/admin\" path.\n\tAdmin bool\n}\n```\n\nThis is, `galleryData` for the page and `galleryEffect` for each effect. For example, to print all the effect IDs you can use:\n\n```html\n\u003cul\u003e\n{{ range .Effects }}\n    \u003cli\u003e{{ .ID }}\u003c/li\u003e\n{{ end }}\n\u003cul\u003e\n```\n\nThe following directories are accessible from the server and can be modified if needed:\n\n* `server/assets/css` -\u003e `/css`\n* `server/assets/js` -\u003e `/js`\n\nBy default the data files are read from `./data`. This path can be hanged with the environment variable `DATA_PATH`. For example:\n\n```\n$ DATA_PATH=/my/data/directory ./glslsandbox\n```\n\nThe data directory contains the sqlite database (`glslsandbox.db`) and the thumbnails (`thumbs` directory).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdoob%2Fglsl-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrdoob%2Fglsl-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdoob%2Fglsl-sandbox/lists"}