1.0.3 • Published 4 years ago

oeil v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

To install: npm i --save oeil

Or use directly with es modules:

import {view, refs} from 'https://unpkg.com/oeil?module'

...Or import as a normal js file

<script src="https://unpkg.com/oeil"></script>

  import {view, refs} from 'https://unpkg.com/oeil?module'

  // Construct a dom tree using arrays and functions
  let tree = view(['div.pa3.avenir'
    , ['h1#greeting.red', 'Hello World!']
    , ['p.subtitle', 'How are we doing today?']
  ])

  // Just use it (it's a vanilla DOM node)
  document.body.append(tree)

  // Get references to any node that has an id
  const {greeting} = refs(tree)

  setTimeout(_ => {
    greeting.classList.remove('red')
    greeting.classList.add('green')
  }, 700)

  

Demo: Try it live!

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago