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-x11

v0.0.6

Published

Customizable windowing system designed for VueJS.

Downloads

7

Readme

Vue-x11

Provides x11-like windowing system for Vue!

About

Want to create a web-based application with fancy windowing system? Vue-x11 is your best choice! it a customizable window-like component designed for VueJS inspired by modern OS windowing systems.

Preview

Live demo

Features

  • Window-like components.
  • Auto sort z-index based on recent interaction of the windows.
  • Come with ready-to use style.
  • Customizable header with slots.

Dependencies

  • Please note that Vue 3 is NOT supported yet.

How to

Install the plugin

npm install vue-x11

Vue.Use() in /src/main.js

import Vue from 'vue';
import App from './App.vue';

import vueX11 from 'vue-x11'; // <-- add this

Vue.config.productionTip = false;

Vue.use(vueX11); // <-- and this

new Vue({
  render: h => h(App),
}).$mount('#app');

Here's a short example for this live demo

<template>
  <div id="app">
    <XWindowManager>
      <XWindow
        v-for="i in 2" 
        :key="i" 
        :ref="`window-${i}`"
        :title="`Window${i}`"
        :default-y="`${20 * (i - 1)}%`"
        :default-x="`${20 * (i - 1)}%`"
        min-width="25%"
      >
        Lorem ipsum dolor sit amet
      </XWindow>
      <XWindow
        ref="window-3"
        :default-y="`${20 * 2}%`"
        :default-x="`${20 * 2}%`"
        min-width="25%"
        min-height="25%"
        :hide-default-header="true"
      >
        <template slot="header">
          <div class="custom-header">
            Window 3 with custom header
            <span class="actions" @click="minimizeWindow(3)"> MINIMIZE </span>
            <span class="actions" @click="closeWindow(3)"> CLOSE </span>
          </div>
        </template>
        Lorem ipsum dolor sit amet
      </XWindow>
    </XWindowManager>
  </div>
</template>

<script>

export default {
  name: 'App',
  methods: {
    minimizeWindow(i){
      this.$refs[`window-${i}`].toggleMinimize();
    }, 
    closeWindow(i){
      this.$refs[`window-${i}`].toggleVisibility();
    }, 
  },
}
</script>

<style>
body {
  font-family: Helvetica, sans-serif;
  color: #d7d7d7;
  background-color: #555;
  left: 0px;
  top: 0px;
  margin: 0;
}
.custom-header{
  background-color: #444;
  padding: .25rem;
  border-radius: 0.3rem 0.3rem 0 0;
  box-sizing: border-box;
  cursor: grab;
}
.custom-header .actions{
  float: right;
  margin: 0 0.5rem;
  box-sizing: border-box;
  height: 100%;
}
.custom-header .actions:hover{
  background: #333;
  cursor: pointer;
}
</style>

Props of Window component

| Prop | Desrciption | Type | Default value | | --------------------- | ------------------------------------------------------ | ------- | ------------- | | allow-out-of-bound | Allow/disallow window moving out of the browser window | Boolean | false | | title | Window title | String | "Window" | | hide-default-header | Set to true to use slot to customize window header | Boolean | false | | header-color | Color of header text | String | null | | header-background | Color of header background | String | "#00000090" | | header-border-radius | Header border radius | String | "0.25em" | | window-background | Color of windows' background | String | "#00000010" | | window-border-radius | Window border radius | String | "0.25em" | | window-backdrop-blur | Blurs backdround if window background has transparency | String | "5px" | | default-y | Default Y(width) position window will be placed | String | null | | default-x | Default X(Height) position window will be placed | String | null | | min-width | Windows' min width | String | null | | min-height | Windows' min height | String | null | | width | Windows' width | String | "fit-content" | | height | Windows' height | String | "fit-content" | | max-width | Windows' max width | String | null | | max-height | Windows' max height | String | null | | visibility-transition | Transition name when toggleVisibility() is called | String | "fade" | | minimize-transition | Transition name when toggleMinimize() is called | String | "fade" |

Methods of Window component

toggleVisibility()
  • Toggling window's visibility (includes header).
toggleMinimize()
  • Toggling window content's visibility.

Props of Window component

| Prop | Desrciption | Type | Default value | | --------------------- | ---------------------------------------------------------------------- | ------- | ------------- | | auto-sort-z-index | Auto sort windows' z-index based on recent interaction of the windows. | Boolean | true |