threedbox

0.0.1 • Public • Published

GitHub license

PLAY

Demo

CDN

<script src="https://cdn.jsdelivr.net/gh/jerosoler/3dbox/THREEDBox.js"></script>

NPM

npm install threedbox

How to use

Download THREEDBox.js file.

Javascript:

if ('paintWorklet' in CSS && 'registerProperty' in CSS && 'CSSUnitValue' in window) {
    CSS.registerProperty({
        name: '--threedbox-angle-vertical',
        syntax: '<length>',
        initialValue: '10px',
        inherits: false
    });
    CSS.registerProperty({
        name: '--threedbox-angle-horitzontal',
        syntax: '<length>',
        initialValue: '10px',
        inherits: false
    });
    CSS.registerProperty({
        name: '--threedbox-padding',
        syntax: '<length>',
        initialValue: '50px',
        inherits: false
    });
    CSS.registerProperty({
        name: '--threedbox-color',
        syntax: '<color>',
        initialValue: '#ffffff',
        inherits: false
    });
    CSS.registerProperty({
        name: '--threedbox-color-back',
        syntax: '<color>',
        initialValue: '#ffffff',
        inherits: false
    });
    CSS.registerProperty({
        name: '--threedbox-color-border',
        syntax: '<color>',
        initialValue: '#ffffff',
        inherits: false
    });

    CSS.paintWorklet.addModule('THREEDBox.js');
} else {
    console.log("Not Supported");
    alert("Not Supported");
}

CSS

div {
    padding: 50px;
    --threedbox-color: #ff7d64;
    --threedbox-color-back: #a32107;
    --threedbox-color-border: #ff0000;
    --threedbox-angle-vertical: 15px;
    --threedbox-angle-horitzontal: -15px;
    --threedbox-padding: 50px;
    background-image: paint(threedbox);
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    1

Package Sidebar

Install

npm i threedbox

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

8.14 kB

Total Files

4

Last publish

Collaborators

  • jerosoler