Coder Social home page Coder Social logo

euniceshaw / vue-metro-tile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuanfux/vue-metro-tile

0.0 2.0 0.0 2.41 MB

๐Ÿ”ทA windows 10 like metro tile component in vue

Home Page: https://yuanfux.github.io/vue-metro-tile/

JavaScript 1.37% Vue 98.63%

vue-metro-tile's Introduction

vue-metro-tile

npm GitHub issues Maintenance NpmLicense

Preview

View Demo

The demo is empowered by vue-metro-tile & vue-grid-layout

Vue Metro Tile is a Vue component for building Windows 10 like metro layout in modern browser. The component currently got the following features:

  1. Customized tile content
  2. 3D tile rotation
  3. Glare effect when hovering or clicking
  4. Tilt effect when mouse holds down

Install

npm install vue-metro-tile --save

or

yarn add vue-metro-tile

Import

support both cjs and umd

import MetroTile from 'vue-metro-tile';

or

 <script src="/path/to/vue-metro-tile.umd.min.js"></script>

Usage

A blue metro tile with simple texts on 4 faces

<metro-tile
    @click="handleClick($event)" 
    faceStyle="{'background-color': 'blue'}"
    >
  <div slot="front">
    front
  </div>
  <div slot="back">
    back
  </div>
  <div slot="top">
    top
  </div>
  <div slot="bottom">
    bottom
  </div>
</metro-tile>

Props

// style object for all 6 faces
// this prop has a lower priority than specific face style
faceStyle?: object;

// style object for front face
frontStyle?: object;

// style object for back face
backStyle?: object;

// style object for left face
leftStyle?: object;

// style object for right face
rightStyle?: object;

// style object for top face
topStyle?: object;

// style object for bottom face
bottomStyle?: object;

// the width of square prism in px
width?: number = 200;

// the height of square prism in px
height?: number = 200;

// the rotation along X axis in degree
rotateX?: number = 0;

// the perspective of square prism container in px
perspective?: number = 750;

// the max tilt angle in degree along the X axis
maxTiltX?: number = 20;

// the max tilt angle in degree along the Y axis
maxTiltY?: number = 10;

// the initial glare size when clicking 
clickGlareSize?: number = 90;

// the glare opacity when clicking
clickGlareOpacity?: number = 0.15;

// the glare opacity when hovering
hoverGlareOpacity?: number = 0.3;

Slots

  • front
  • back
  • left
  • right
  • top
  • bottom

Events

  • click

Browser compatibility

IE / Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
latest latest latest latest latest

Some older versions may be supported as well

License

MIT

vue-metro-tile's People

Contributors

yuanfux avatar

Watchers

James Cloos avatar EuniceShaw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.