PHPackages                             thomhines/square1 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. thomhines/square1

ActiveLibrary[Image &amp; Media](/categories/media)

thomhines/square1
=================

Square1 jQuery slider (JS/CSS image/content slider with responsive srcset support).

1.0.1(1mo ago)906MITJavaScript

Since Apr 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/thomhines/square1)[ Packagist](https://packagist.org/packages/thomhines/square1)[ Docs](https://github.com/thomhines/square1)[ RSS](/packages/thomhines-square1/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Square1
=======

[](#square1)

A very simple jQuery image/content slider that responsively handles images of any size or shape.

*Requires jQuery*

### [Demo](http://projects.thomhines.com/square1/)

[](#demo)

Installation
------------

[](#installation)

### 1) Manual installation

[](#1-manual-installation)

Download or copy the project files into your web-accessible assets directory, then load jQuery and Square1:

```

```

### 2) Composer (Packagist)

[](#2-composer-packagist)

Install with Composer:

```
composer require thomhines/square1
```

Then include files from your Composer `vendor` directory:

```

```

### 3) Git submodule

[](#3-git-submodule)

Add Square1 as a submodule:

```
git submodule add https://github.com/thomhines/square1.git vendor/square1
git submodule update --init --recursive
```

Then include it in your page:

```

```

### Usage

[](#usage)

#### HTML

[](#html)

Each **direct child** of the slideshow container is wrapped in an internal **slide** element. You can use a flat list of images:

```

```

- **`caption`** — optional; used by the caption UI when enabled (in addition to `alt`).
- **`data-src` / `data-srcset`** — optional **data-** prefix delays loading until Square1 promotes them to `src` / `srcset` (sequential loading). Pair with the **`lazy_load`** option to load each slide only when needed.
- **`srcset` / `sizes`** — optional; native responsive selection applies to visible images.
- **`scale-from` / `scale-from-mobile`** — optional per-image **`object-position`**; on narrow viewports (under 600px), `scale-from-mobile` wins when present.
- **`space`** — optional; copied onto the slide wrapper for advanced filtering (see global `filter_gallery` in the script if you use tagged slides).

Or use **rich slides** (first `` in each child is the photo layer; remaining markup is overlaid or non-image slides without an ``):

```

		Slide title

		Slide title

```

#### JavaScript

[](#javascript)

```
$(function() {
	$('.slideshow').square1();
});
```

Slideshow options
-----------------

[](#slideshow-options)

Pass an object of overrides to **`square1()`**:

```
$('.slideshow').square1({
	slide_duration: 8000,
	dots_nav: 'hover'
});
```

Defaults and meanings (see **`square1.js`** for inline comments):

OptionDefaultDescription**`width`**`''`Any CSS width. Blank uses stylesheet / block layout (demo uses full width).**`height`**`''`Any CSS height. When blank and **`aspect_ratio`** is also blank, the first decoded image sets **`aspect-ratio`** on the root so the box gets a height.**`aspect_ratio`**`''`Any valid CSS **`aspect-ratio`** (e.g. `'16/9'`, `'1.3'`). When set, height is applied as **`auto`** so the box sizes from width and this ratio.**`animation`**`'fade'``'fade'` or `'slide'`.**`fill_mode`**`'cover'``'cover'` or `'contain'` — maps to **`object-fit`** on slide images.**`scale_from`**`'center center'`Default **`object-position`** for images (same keyword grammar as CSS).**`start_delay`**`0`Milliseconds before autoplay when **`auto_start`** is true.**`slide_duration`**`4000`Milliseconds each slide stays visible.**`transition_time`**`500`Transition duration in ms.**`lazy_load`**`false`When **`true`**, does not pre-load the sequential chain; images load when needed (still use **`data-src`** / **`data-srcset`** where appropriate).**`auto_start`**`true`Start the timer automatically.**`pause_on_hover`**`false`Pause autoplay while the pointer is over the slideshow.**`keyboard`**`true`Arrow keys; tabindex is set when enabled.**`gestures`**`true`Swipe to change slides on touch devices.**`theme`**`'dark'``'dark'` or `'light'` UI chrome.**`background`**`'none'`CSS background on the slideshow root.**`prev_next_nav`**`'inside'``'inside'`, `'outside'`, `'hover'`, or `'none'`.**`dots_nav`**`'inside'`Same choices as arrows.**`caption`**`'outside'``'inside'`, `'outside'`, `'hover'`, or `'none'` — uses the **`caption`** attribute when present.**`onLoad`**`function () {}`Fires when all slides have finished loading.**`onPlay`**`function () {}`Fires when playback starts.**`onStop`**`function () {}`Fires when playback stops.**`onChange`**`function () {}`Fires after the active slide changes.Remote control
--------------

[](#remote-control)

```
$('.slideshow').square1('play');
$('.slideshow').square1('stop');
$('.slideshow').square1('next');
$('.slideshow').square1('prev');
$('.slideshow').square1(5);   // jump to slide 5 (1-based index)
```

License
-------

[](#license)

Square1 is released under the MIT License. See the [`LICENSE`](LICENSE) file for full text.

Thanks
------

[](#thanks)

Thanks to the following image providers used in the demos:

-
-
-

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance89

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4ce72db869fb4ab9fba72291ced3540c59fc26c71b1176eb9f6a9ac96e5f9cc?d=identicon)[thomhines](/maintainers/thomhines)

---

Top Contributors

[![thomhines](https://avatars.githubusercontent.com/u/760759?v=4)](https://github.com/thomhines "thomhines (47 commits)")

---

Tags

image-sliderjqueryslideshowjavascriptcssjquerycarouselfrontendsliderslideshow

### Embed Badge

![Health badge](/badges/thomhines-square1/health.svg)

```
[![Health](https://phpackages.com/badges/thomhines-square1/health.svg)](https://phpackages.com/packages/thomhines-square1)
```

###  Alternatives

[machy8/webloader

Simple, easy to use, php bundler for javascript and css

2135.3k3](/packages/machy8-webloader)[tatter/frontend

Opinionated suite of frontend tech for CodeIgniter 4

125.4k](/packages/tatter-frontend)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
