{"id":26781671,"url":"https://github.com/pixelunion/bc-squid","last_synced_at":"2025-10-17T21:55:28.868Z","repository":{"id":44318367,"uuid":"132650293","full_name":"pixelunion/bc-squid","owner":"pixelunion","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T22:23:03.000Z","size":143,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-03-26T12:58:30.046Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelunion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-08T18:41:18.000Z","updated_at":"2019-11-22T18:46:33.000Z","dependencies_parsed_at":"2023-02-04T20:30:48.968Z","dependency_job_id":null,"html_url":"https://github.com/pixelunion/bc-squid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-squid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-squid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-squid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-squid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelunion","download_url":"https://codeload.github.com/pixelunion/bc-squid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156411,"owners_count":20732397,"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":["library"],"created_at":"2025-03-29T08:17:28.819Z","updated_at":"2025-10-03T19:07:49.139Z","avatar_url":"https://github.com/pixelunion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Squid, the friendly squared-grid layout engine!\n\nSquid arranges elements into a grid, but makes sure that the bottom is flush.\n\n## Example\n\n```\n// Initialize grid\nconst squid = new Squid($('.grid'), {\n  columns: 2,\n  gutter: 10,\n});\n\n// Add items\nsquid.add(...$('.grid-item'));\n\n// Remove items\nsquid.remove($('.grid-item').get(0));\n\n// Render grid\nsquid.layout();\n```\n\n\n## Options\n\n### `columns`\n\nThe number of columns in the grid.\n\n### `gutter`\n\nThe size of the gutter, in pixels. If the number is between 0 and 1, it will act\nas a percentage of the grid's width.\n\n### `getSize` (optional)\n\nA function to calculate the natural size of your elements. Defaults to the\nnatural size of the first img element. Expects an object with `width` and\n`height` properties.\n\n### `getGravity` (optional)\n\nA function to calculate the \"gravity\" of your elements. This affects the\nposition items are inserted into a column. Items with a lower gravity are placed\nabove items with a higher gravity. Expects a number between `-1` and `1`.\n\n### `getResistance` (optional)\n\nA function to calculate the \"resistance\" of your elements. Elements with a\nhigher resistance will be compressed less when trying to resize a column.\nExpects a number between `0` and `1`.\n\nCurrently, the layout engine only takes into account a resistance of `1`, which\nwill lock that element's height. All other elements will be compressed equally.\n\n### `getVisibility` (optional)\n\nA function to calculate the visibility of your elements. Expects either `true`\nor `false`. If this function returns `false` for an item, that item will not be\nlayed-out.\n\n### `firstRenderClassname` (optional)\n\nThe class name to add to the grid after it is rendered for the first time.\n\n### `resizingClassname` (optional)\n\nClass name to add to the grid while it is being resized.\n\n\n## Methods\n\n### `update(options, layout = true)`\n\nChange the grid's options, and optionally re-render it. Any options the\nconstructor can take can be set here.\n\n### `add(...items)`\n\nAdd items to the grid.\n\nSince jQuery wraps DOM elements, we can't compare them directly:\n`$('#item-1') !== $('#item-1')`. It's recommended to add bare DOM elements\ninstead.\n\n### `remove(...items)`\n\nRemove items from the grid.\n\n### `removeAll()`\n\nRemove all items from the grid.\n\n### `layout()`\n\nRe-render the grid.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-squid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelunion%2Fbc-squid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-squid/lists"}