MCPcopy Index your code
hub / github.com/GoogleChromeLabs/two-up

github.com/GoogleChromeLabs/two-up @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
18 symbols 32 edges 4 files 4 documented · 22% updated 38d ago★ 3373 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

A web component to compare two DOM elements

Usage

npm install --save-dev two-up-element
<two-up>


This appears on one side




This appears on the other


</two-up>

Now the user can slide between the two.

API

<two-up class="my-two-up">


…




…


</two-up>
<script>
  const twoUp = document.querySelector('.my-two-up');
</script>

Attributes

<two-up legacy-clip-compat></two-up>

Boolean attribute that enables Edge support. The downside is the elements within the <two-up> become absolutely positioned. This is because CSS clip is used rather than clip-path.

This can also be get/set via the boolean property twoUp.legacyClipCompat.

<two-up orientation="horizontal"></two-up>

…or "vertical". The direction the handle moves.

This can also be get/set via the property twoUp.orientation.

CSS Custom Properties

.my-two-up {
  /* Color of the track & thumb */
  --accent-colour: #777;
  /* Or you can set the two independently: */
  --track-color: #777;
  --thumb-color: #777;
  /* Background of the thumb */
  --thumb-background: #fff;
  /* Size of the thumb */
  --thumb-size: 62px;
  /* Thickness of the bar */
  --bar-size: 6px;
  /* Touch-thickness of the bar */
  --bar-touch-size: 30px;
}

Demo

TODO.

Files

  • lib/index.ts - Original TypeScript.
  • dist/two-up.mjs - JS module. Default exports TwoUp.
  • dist/two-up.js - Plain JS. Exposes TwoUp on the global.
  • dist/two-up-min.js - Minified plain JS. 2.4k gzipped.

Extension points exported contracts — how you extend this code

ResizeObserverCallback (Interface)
(no doc)
lib/missing-types.d.ts
ResizeObserverEntry (Interface)
(no doc)
lib/missing-types.d.ts
ResizeObserver (Interface)
(no doc)
lib/missing-types.d.ts

Core symbols most depended-on inside this repo

_resetPosition
called by 4
lib/two-up.ts
_childrenChange
called by 2
lib/two-up.ts
_setPosition
called by 2
lib/two-up.ts
observe
called by 2
lib/missing-types.d.ts
_pointerChange
called by 1
lib/two-up.ts
observedAttributes
called by 0
lib/two-up.ts
constructor
called by 0
lib/two-up.ts
connectedCallback
called by 0
lib/two-up.ts

Shape

Method 13
Interface 3
Class 2

Languages

TypeScript100%

Modules by API surface

lib/two-up.ts12 symbols
lib/missing-types.d.ts6 symbols

For agents

$ claude mcp add two-up \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact