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

@enhances/bigscreen-fit

v0.2.8

Published

Vue2 大屏适配方案、scale、可不压缩、不黑边、适配浏览器缩放、不同分辨率、提供全屏、退出全屏、判断全屏、提供缩放不同状态的classname

Downloads

3

Readme

bigscreen-fit

大屏适配方案、scale、可不压缩、不黑边、适配浏览器缩放、不同分辨率、提供全屏、退出全屏、判断全屏、提供缩放不同状态的classname

  • image-1

支持

  • Vue版本 <= 2.7

支持 Vue3 前往 @enhances/bigscreen-fit-vue3

  • or install
npm i @enhances/bigscreen-fit-vue3
  • 组件

bs-config-provider

Props

interface PropsType {
    id?: string,
}

methods

declare function updateWinOption: (): void;
  • 组件

bigscreen-fit

Props

interface PropsType {
    designWidth?: number;
    designHeight?: number;
    zoom?: number | ((isFullScreen: boolean) => number);
    id?: string;
    push?: boolean;
    compress?: boolean | 'auto';
    origin?: string;
    customScale?: string | 'auto';
    zIndex?: number;
}

指令

import * as bigscreenFit from '@enhances/bigscreen-fit';
//  指令推荐在弹窗下使用、组件请使用bigscreen-fit组件
Vue.use(bigscreenFit.directive, {
    compress: false, // 不压缩
});

share

   declare function usResizeObjserver(el: Element, callback: (enter: Enters) => void): void  // 监听一个元素变化
   declare function onFullScreenChange(callback: (isFunllscreen: boolean) => void): void  // 监听全屏变化
   declare function enterFullScreen() // 进入全屏
   declare function exitFullScreen() // 退出全屏
   declare function isFullScreen() //  是否全屏

注册方式一

import bigScreenFit from '@enhances/bigscreen-fit';

Vue.use(bigScreenFit, {
    compress: false, // 不压缩
});

组件引入方式

import { components, share } from '@enhances/bigscreen-fit';
const { BigScreenFit, BsConfigProvider } = components;

demo code

  • code
<template>
    <div class="app">
        <BsConfigProvider>
            <BigScreenFit>
                <template v-slot:default="{ customClass }">
                <div class="container">
                    <BigScreenFit :z-index="2" :push="headPush" :custom-scale="headPush ? 'auto' : '1'">
                        <div class="header">
                                <div class="header__text">
                                    <button @click="headPush=!headPush">
                                        {{ headPush ? '已优化': '点击优化头部压缩' }}  {{ customClass }}
                                    </button>
                                </div>
                        </div>
                    </BigScreenFit>
                    <BigScreenFit :push="push" :custom-scale="push ? 'auto' : '1'">
                        <template v-slot:default="{ customClass }">
                            <div class="left_container flex-box">
                            
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                            
                            </div>
                            <BigScreenFit :push="true">
                                <CenterBox></CenterBox>
                            </BigScreenFit>
                            <div class="right_container flex-box">
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                                    <DemoBox :class="customClass">
                                        <button @click="push=!push">
                                        {{ push ? '已优化': '点击优化压缩' }}
                                        </button>
                                    </DemoBox>
                            
                            </div>
                        </template>
                    </BigScreenFit>
                </div>
            </template>
            </BigScreenFit>
        </BsConfigProvider>
        <div class="dialog" v-scale-fit>
            <p>这是一个APP模态对话框。使用了v-scale-fit指令</p>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { components, share } from '@enhances/bigscreen-fit';
const { BigScreenFit, BsConfigProvider } = components;

import DemoBox from './comp/demo_box.vue';
import CenterBox from './comp/center.vue';

import { ref } from 'vue';
const push = ref(true);
const headPush = ref(true);
</script>
<style lang="scss">
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}
</style>
<style lang="scss" scoped>
.container {
    background: url('~@/assets/bg.png');
    background-size: 100% 100%;
    width: 100%;
    height:1080px;
    display: flex;
    justify-content: space-between;
}

.dialog {
    position: absolute;
    width: 200px;
    height: 100px;
    background: #fff;
    z-index: 99;
    left: 50%;
    top: 50%;
    padding: 10px;
    border-radius: 5px;
}
.left_container {
    position: absolute;
    left: 20px;
   
}
.header {
    width: 100%;
    height: 85px;
    border: 1px solid #fff;
    margin: 3px;
}
.header__text {
    height: 85px;
    display: flex;
    justify-content: center;
    align-items: center;
  
    button {
        font-size: 18px;
        font-weight: 600;
    }
}
.flex-box {
    width: 600px;
    height: calc(1080px - 110px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    box-sizing: border-box;
    padding: 20px 0;
    margin-top: 110px;
    border: 1px solid #fff;
}
.right_container {
    position: absolute;
    right: 20px;
}
</style>