{"id":21625440,"url":"https://github.com/coderius/yii2-smooth-scroll","last_synced_at":"2026-04-18T14:32:17.568Z","repository":{"id":56955742,"uuid":"194418351","full_name":"coderius/yii2-smooth-scroll","owner":"coderius","description":"Yii2 widget wrapper to Smooth Scroll  lightweight script to animate scrolling to anchor links in web page. ","archived":false,"fork":false,"pushed_at":"2019-11-05T10:33:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T19:56:01.416Z","etag":null,"topics":["smooth-scrolling","yii2-widgets"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/coderius.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":"2019-06-29T15:07:39.000Z","updated_at":"2019-11-05T10:33:48.000Z","dependencies_parsed_at":"2022-08-21T08:50:24.065Z","dependency_job_id":null,"html_url":"https://github.com/coderius/yii2-smooth-scroll","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coderius/yii2-smooth-scroll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-smooth-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-smooth-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-smooth-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-smooth-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderius","download_url":"https://codeload.github.com/coderius/yii2-smooth-scroll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderius%2Fyii2-smooth-scroll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31972308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["smooth-scrolling","yii2-widgets"],"created_at":"2024-11-25T01:09:17.093Z","updated_at":"2026-04-18T14:32:17.551Z","avatar_url":"https://github.com/coderius.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Smooth Scroll js plugin widget for Yii2\n=======================================\nThe Smooth Scroll widget is a customized Smooth Scroll script based on [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) and represents a lightweight script to animate scrolling to anchor links in web page.\n\n\nInstallation\n------------\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require coderius/yii2-smooth-scroll\n```\nor\n```\ncomposer require coderius/yii2-smooth-scroll\n```\n\nor add\n\n```json\n\"coderius/yii2-smooth-scroll\" : \"*\"\n```\nto the require section of your application's `composer.json` file.\nAnd run ```composer update```\n\nBasic usage.\n------------\n* In view include widget:\n\nBy default selector 'a[href*=\"#\"]' passed in for the anchor links that should be animated.\n\n```php\n\u003c?php echo coderius\\smoothScroll\\SmoothScroll::widget([]); ?\u003e\n```\nAnd set html link and anchor to scroll:\n```html\n\u003ca href=\"#your-anchor-name\"\u003eText\u003c/a\u003e\n...\n\u003cdiv id=\"your-anchor-name\"\u003e\u003c/div\u003e\n\n```\n\nAdvansed usage.\n---------------\n\nIn section 'beginClientJs' and 'endClientJs' you can set any js code. \n\n```php\n\u003c?php \n    echo coderius\\smoothScroll\\SmoothScroll::widget([\n        // 'selector' =\u003e false,\n        'clientOptions' =\u003e [\n            'speed' =\u003e '1500',\n            'speedAsDuration' =\u003e true,\n            'easing' =\u003e 'easeInQuint',\n            'customEasing' =\u003e new \\yii\\web\\JsExpression(\n                'function (time) {\n                    return time \u003c 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time;\n                }'\n            ),\n            'clip' =\u003e true,\n            // History\n            'updateURL' =\u003e true, // Update the URL on scroll\n\t        'popstate' =\u003e true, // Animate scrolling with the forward/backward browser buttons (requires updateURL to be true)\n            // Custom Events\n\t        'emitEvents' =\u003e true // Emit custom events\n        ],\n        'clientMethods' =\u003e [\n            // Animate scrolling to an anchor.\n            'animateScroll' =\u003e [\n                'anchor' =\u003e \"document.querySelector('#anchor')\",// numbel (y-position to scroll) or dom element\n                // 'toggle' =\u003e 700,\n                'options' =\u003e \"{ speed: 1500, easing: 'easeOutCubic' }\",\n            ],\n            'cancelScroll' =\u003e false,\n            'destroy' =\u003e false,\n        ],\n        //$self in is widget object\n        'beginClientJs' =\u003e function($self){\n            $script = \"var logScrollEvent = function (event) {\n\n                // The event type\n                console.log('type:', event.type);\n            \n                // The anchor element being scrolled to\n                console.log('anchor:', event.detail.anchor);\n            \n                // The anchor link that triggered the scroll\n                console.log('toggle:', event.detail.toggle);\n            \n            };\";\n\n            return $script;\n        },\n        'endClientJs' =\u003e function($self){\n            $script = \"console.log(\" . $self-\u003egetScrollVarName() . \")\";\n\n            return $script;\n        },\n        \n        /**\n        * This script will be generated if you specify the elements of the array \n        * as in the example below.\n        *\n        * document.addEventListener('scrollStart', logScrollEvent, false);\n        * document.addEventListener('scrollStop', logScrollEvent, false);\n        * document.addEventListener('scrollCancel', logScrollEvent, false);\n        **/\n        'clientEvents' =\u003e [\n            'scrollStart' =\u003e ['logScrollEvent', false],\n            'scrollStop' =\u003e ['logScrollEvent', false],\n            'scrollCancel' =\u003e ['logScrollEvent', false],\n        ],\n    ]); \n?\u003e\n```\n\n\nReference to js plugin and more settings find in [github](https://github.com/cferdinandi/smooth-scroll) author repository that is used in this widget.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderius%2Fyii2-smooth-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderius%2Fyii2-smooth-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderius%2Fyii2-smooth-scroll/lists"}