
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
adjust-engine
Advanced tools
Position an element relative to another element. This repository is the workhorse behind adjust.
npm install adjust-engine
adjust = Adjust(options)
Initialize an adjustment. Supports the following options:
left top
right bottom
center middle
10% 16% (x y)
target (string): Alignment point of the target (or host) element. Supports same CSS style adjustments as attachment
.
offset (object): Specify an offset to apply to the attachment element:
x: 10
y: -10
true
. Automatically flip the element if the adjustment causes the attachment to be out of viewport. You should specify a viewport_position
for flip to work properly.adjust(attachment_position, target_position, [ viewport_position ])
Get a position of where the attachment should be. Here's a full example:
var adjust = Adjust({
attachment: 'center middle',
target: 'center middle'
});
var attachment = {
height: 50,
width: 50
}
var target = {
top: 0,
left: 0,
right: 100,
bottom: 100
}
var position = adjust(attachment, target)
assert.deepEqual(position, {
top: 25,
left: 25,
width: 50,
height: 50,
right: 75,
bottom: 75
})
make test
MIT
FAQs
adjust an element relative to another element
We found that adjust-engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.