npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-topmodal

v0.2.2

Published

<p align="center"> <img src="https://github.com/adileo/vue-topmodal/raw/master/topmodal.png" width="480" alt="vue-popmodal"/> </p>

Downloads

37

Readme

Features

  • Fully Customisable (borders, shadow, position, colors, backgrounds, width, etc...)
  • Responsive
  • Scrollable (with lock scroll on body)
  • Stackable (with z-index)
  • Animated (separate animations for background and modal window)
  • Auto-close on background click
  • Lightweight <15Kb
  • Header / Footer / Content Slots

Demo: jsFiddle

Getting started

  1. Install the component:
npm install --save vue-topmodal
yarn add vue-topmodal
  1. (Option A) Add the component into your app:
import Vue from 'vue'
import TopModal from 'vue-topmodal'

Vue.component('top-modal', TopModal)
  1. (Option B) Include JS & CSS:
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vue-topmodal/dist/TopModal.css">
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-topmodal"></script>
<script>
new Vue({
  components: {
    TopModal,
  },
  el: "#app",
})
</script>
  1. Usage
<top-modal 
:open="showModal1"
:z-index="1000"
:bg-image="'radial-gradient(50% 54%, #53A0FD 50%, #4F3EEB 200%)'"
:column-position="'center'"
:column-max-width="'300px'"
:modal-position="'center'"
:modal-border-radius="'5px'"
:modal-box-shadow="'0 0 9px 7px rgba(0,0,0,0.09)'"
@bg-click="showModal1=false">
    <template v-slot:header></template>
    <template v-slot:content>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ipsum a dolor ultricies volutpat.
    </template>
    <template v-slot:footer></template>
</top-modal>

Props

  • open (Boolean): Open or close the modal.
  • z-index (Number): Z-index of the modal.
  • bg (String): Background behind the modal.
  • bg-image (String): Background behind the modal, useful for images or gradients.
  • bg-animation (String): Name of the animation to use. Default to bg
  • container-scrollable (Boolean): Set to true if you want a scrollable modal.
  • column-position (String): Set the horizontal alignment of the modal. Valid values are: left,right,center
  • column-right (String): Space from right, eg. 10%. Only valid if column-position is right.
  • column-left (String): Space from left, eg. 10px. Only valid if column-position is left.
  • column-max-width (String): Set the max width of the modal. (for responsive use $mq | mq({...}) filters)
  • modal-animation (String): Name of the animation to use. Default to modal
  • modal-position (String): Set the vertical alignment of the modal. Valid values are: top,bottom,center
  • modal-top (String): Space from top, eg. 10%. Only valid if modal-position is top.
  • modal-bottom (String): Space from bottom, eg. 10px. Only valid if modal-position is bottom.
  • modal-border (String): Border of the modal eg. 1px solid black.
  • modal-border-radius (String): Border radius of the modal. Eg. 5px
  • modal-box-shadow (String): Shadow of the modal
  • modal-height (String): Height of the modal, default to auto
  • modal-background (String): Background of the modal
  • content-padding (String): Padding of the modal content slot. Default to 1em
  • scroll-lock (Boolean): Enable/Disable scroll lock. Enabled by default.

Events

  • bg-click: Fired when the user click on the background behind the modal
  • opened: Open animation ended
  • closed: Hide animation ended, modal closed and unmounted

Slots

  • header
  • content
  • footer

Responsive

I suggest to use the Vue mq plugin to modify the props based on the user device screen. In this way you can modify the whole behaviour of the modal for different resolutions. Eg:

:column-max-width="$mq | mq({
    sm: '350px',
    md: '500px',
    lg: '600px'
})"

Structure

Authors

  • Adileo Barone

License

This project is licensed under the MIT License

Contributing

  1. Fork it (https://github.com/adileo/vue-topmodal/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request