Embed in your own website to look up state electorates, federal electorates or both!
How it works
Function
A simple custom html element with a custom attribute called "jurisdictions". Change the attribute value to federal, state or both for your preference.
Add one small custom html element in your code. Include our javascript to run the code and voila! Expand for more.
Add this custom element to the page you want to include the electorate lookup in.<address-lookup class="" jurisdictions=""></address-lookup> Leaving jurisdictions="" blank will give both federal and state. Change it to jurisdictions="state" or jurisdictions="federal" for only one set of results. At the bottom of the page, call the following javascript files.
<script src="./js/electorate.js"></script>
<script src="p-pel-web-indexes/federal_web_index_embedded.js"></script>
<script src="p-pel-web-indexes/state_web_index_embedded.js"></script>
<script src="./js/dataLookupStep.js"></script>
<script src="./js/possible-electorates.js"></script>
<script src="./js/address-lookup.js"></script>
Style
You can use Democracy Developers' default style or style it yourself.
2 — Themed via CSS custom properties
Set --pel-* properties on the element or an ancestor. No knowledge of shadow DOM internals required.
3 — Fine-grained via ::part()
Target exposed parts with address-lookup::part(name) for structural changes that custom properties alone can't achieve.