
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
vue-waypoint
Advanced tools
> trigger functions and events based on the element position on the screen
trigger functions and events based on the element position on the screen
Open your browser console and see what's going on while scrolling up and down
npm i vue-waypoint
<template>
<Waypoint @change="onChange">
<!-- anything you want here -->
</Waypoint>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { Waypoint } from "vue-waypoint";
export default defineComponent({
name: "SomeComponent",
components: {
Waypoint,
},
setup() {
const onChange = (waypointState) => {
// Going can be:
// IN
// OUT
console.log(waypointState.going);
// Direction can be:
// UP
// DOWN
// LEFT
// RIGHT
console.log(waypointState.direction);
};
return { onChange };
},
});
</script>
active
true
/false
dynamicallyUsage:
<Waypoint :active="true" />
<Waypoint :active="false" />
options
change
event a portion of the element is completely on screenUsage:
IntersectionObserver
options: <Waypoint :options="options" />
options
: IntersectionObserverInit docsOptions example:
const options: IntersectionObserverInit = {
root: document,
rootMargin: "0px 0px 0px 0px",
threshold: [0.25, 0.75],
};
tag
Set your preferred tag for the element
Defaults to div
Waypoint as div: <Waypoint :tag="'div'" /> --> renders --> <div class="waypoint"></div>
Waypoint as span: <Waypoint :tag="'span'" /> --> renders --> <span class="waypoint"></span>
Waypoint as p: <Waypoint :tag="'p'" /> --> renders --> <p class="waypoint"></p>
disableCssHelpers
false
Usage:
<Waypoint :disableCssHelpers="false" />
<Waypoint :disableCssHelpers="true" />
DOM result:
<Waypoint /> --> renders --> <div class="waypoint going-in direction-down"></div>
<Waypoint :disableCssHelpers="true" /> --> renders --> <div></div>
The component comes with three classes:
waypoint
: set when the waypoint is readygoing-in
, going-out
: dynamically changed when the waypoint comes in and outdirection-up
, direction-down
, direction-left
, direction-right
: dynamically changed when the direction changesExamples:
<Waypoint class="waypoint going-in direction-up" />
- the element is visible and came from bottom and is going top (natural scroll)<Waypoint class="waypoint going-in direction-down" />
- the element is visible and came from top and is going up (reverse natural scroll)<Waypoint class="waypoint going-out direction-up" />
- the element is not visible and came from bottom and is going top<Waypoint class="waypoint going-out direction-down" />
- the element is not visible and came from top and is going upchange
Emitted every time the waypoint detects a change.
<template>
<Waypoint @change="onChange" />
</template>
function onChange(waypointState) {
/* ... */
}
interface WaypointState {
el: Element;
going: "IN" | "OUT";
direction: "UP" | "DOWN" | "LEFT" | "RIGHT";
}
npm i && npm run dev
)FAQs
> trigger functions and events based on the element position on the screen
The npm package vue-waypoint receives a total of 4,499 weekly downloads. As such, vue-waypoint popularity was classified as popular.
We found that vue-waypoint 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.