@cnbritain/wc-card-listdeprecated

Displays a list of of items (meant to be cards)

Usage no npm install needed!

<script type="module">
  import cnbritainWcCardList from 'https://cdn.skypack.dev/@cnbritain/wc-card-list';
</script>

README

wc-card-list

Displays a list of of items (meant to be cards)

Macro Settings

Key Optional Default Description
items false List of items to iterate over
cols true [2, 4] Number of columns you want to the list to switch between
class true '' Additional classes applied to .c-card-list

JS Documentation

CardList

CardList.init()

Initialises the cards in the list

Kind: static method of CardList

CardList~CardList

Kind: inner class of CardList

new CardList(el)

Param Type Description
el HTMLElement The card list

CardList~LISTENER_REGISTERED : Boolean

AdManager register listener boolean

Kind: inner property of CardList

CardList~cardListList : Array

List of CardLists

Kind: inner property of CardList

CardList~CLS_LIST : String

Card list css class

Kind: inner constant of CardList

CardList~CLS_ITEM : String

Card list item css class

Kind: inner constant of CardList

CardList~CLS_AD : String

Card list ad css class

Kind: inner constant of CardList

CardList~bindAdManagerListener()

Binds listeners to AdManager register event

Kind: inner method of CardList

CardList~getAdFromList(list, ad) ⇒ Number

Finds the ad in the list

Kind: inner method of CardList
Returns: Number - The index

Param Type
list Array.<Ad>
ad Ad

CardList~hasAdSlot(el) ⇒ Boolean

Checks if the element contains ad element

Kind: inner method of CardList

Param Type
el HTMLElement

CardList~isInitialised(el) ⇒ Boolean

Checks if the element is initialised

Kind: inner method of CardList

Param Type
el HTMLElement

CardList~onAdRenderStop(e)

Callback for when an Ad fires render or stop

Kind: inner method of CardList

Param Type
e Object

CardList~onManagerRegister(e)

Callback for when the AdManager emits a register event

Kind: inner method of CardList

Param Type
e Object

CardList~setInitialised(el)

Sets the card list element to initialised

Kind: inner method of CardList

Param Type
el HTMLElement

CardList~toArray(collection) ⇒ Array

Converts a collection to an array

Kind: inner method of CardList

Param Type
collection *

CardList~unbindAdManagerListener()

Unbinds the AdManager register listener

Kind: inner method of CardList

CardList~CardList

Kind: inner class of CardList

new CardList(el)

Param Type Description
el HTMLElement The card list

Current themes

  • Wired
  • Glamour

Prerequisites:

  • Node.jsbrew install node
  • Grunt - npm install -g grunt-cli
  • Other prereqs? Python? Virtualenv?

Demo:

Install dependencies:

npm install

Build the things:

npm run sass
npm run js

Python the pythons:

cd demo
virtualenv .
source bin/activate
pip install -r requirements.txt

Start the demo server:

python demo.py