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

animate-popup

v1.0.4

Published

基于vant4的vue3弹窗,拥有ios16的沉浸式效果!

Downloads

4

Readme

animate-popup

组件介绍

animate-popup是一个弹窗组件,实现了ios15沉浸式的弹窗效果; 引入组件,自动完成背景缩放效果,详见下图: https://xydideo.gitee.io/blog/public-image/animate-popup.gif

组件依赖

vue3、vant4、less

组件使用

  1. 在main.js中引入并组册
import AnimatePopup from 'animate-popup'
import "animate-popup/style.css"
app.use(AnimatePopup)

// 或者页面中局部注册
// import { AnimatePopup } from 'animate-popup'
// import "animate-popup/style.css"
  1. 在index.html 的 app 元素添加一个根目录
<!-- 解决fixed跟transform的问题 -->
<div>
    <div id="app"></div>
</div>
  1. 模板中使用demo示例
<template>
  <div>
    <div @click="isShow=true">点击弹窗组件</div>
    <animate-popup v-model:isShow="isShow" title="弹窗标题" :isScaleAni="true" :close-on-click-overlay="false">
      <!-- 弹窗内容插槽 -->
      <template #main>
        <div>
          弹窗的内容
        </div>
      </template>
    </animate-popup>
  </div>
</template>

<script setup>
import { ref } from 'vue'
// 控制组件的显示否
const isShow = ref(false)
</script>

组件api

Props

| 参数 | 说明 | 类型 | 默认值 | |------------|---------------------|---------|--------| | isShow | 是否显示弹窗 | Boolean | false | | height | 弹窗高度 | String | 96vh | | title | 弹窗标题 | String | `` | | isScaleAni | 是否需要沉浸式ios交互 | Boolean | true |

组件重置

如果想修改app弹层,可以重置样式

.app-scale-class {
  transform: translateY(-3vh) scale(0.9);
  transform-origin: top;
  opacity: 0.5;
  border-radius: 20px;
  overflow: hidden;
}

其他

app默认设置样式为:

#app{
  transition: all ease 300ms;
  font-size: 14px;
  background: #fff;
}

全局样式类名为: .app-scale-class,.body-scale-class,.popup-main

其中popup-main为弹窗版心内容

.popup-main {
  height: 100%;
  .popup-content {
    overflow: scroll;
  }
}