Corresponding Filename: flippant-basic

Welcome to Foundation

Example from flippant repo

In this case the back content is defined in javascript.

Flip This!

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Flip This!

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Flip This!

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.


More generic example

In this more generic case the back content is contained in the html so that it may be populated easily using javascript tempalting. Then the back element from the html is assigned to a variable when the flippant js is called.

document.addEventListener('click', function(e) {
  if (e.target.classList.contains('flippant-open')) {
    e.preventDefault()
    var flipper = e.target.parentNode
    var card = e.target.parentNode.parentNode
   // var back_content = card.querySelector('p').innerText
    // var back_content = card.getElementById('back').innerHTML
    var myDiv = card.getElementsByTagName('div')
 
var back_content = myDiv[1].innerHTML

    var back


    if (e.target.classList.contains('card')) {
      back = flip(flipper, back_content)
    } else {
      back = flip(flipper, back_content, 'modal')
    }

    back.addEventListener('click', function(e) {
      if (e.target.classList.contains('flippant-close')) {

        back.close(back, 'close')
      }
    })

  }
})

Flip This!

Front One - Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Back of Card 1

Here's some text on the back of the card.

Flip This!

Front Two - Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Front Two B - Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Back of Card 2

Here's some text on the back of the card.

Flip This!

Front three - Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

Back of Card 3

Here's some text on the back of the card.

Try one of these buttons:

Simple Button
Success Btn
Alert Btn
Secondary Btn

So many components, girl!

A whole kitchen sink of goodies comes with Foundation. Check out the docs to see them all, along with details on making them your own.

Go to Foundation Docs