An embeddable widget to find your nearest polling station, for upcoming elections in the UK.
Add the following lines to your HTML, where you want the widget to appear on the page
<noscript>
<iframe src="https://wheredoivote.co.uk/embed/"
style="width:100%; height:1100px"
frameborder="0"
scrolling="no">
</iframe>
</noscript>
<div id="dc_wdiv" aria-live="polite" role="region"></div>
<script type="text/javascript" src="https://widget.wheredoivote.co.uk/wdiv.js"></script>
Default English with option to toggle to Welsh:
<noscript>
<iframe src="https://wheredoivote.co.uk/embed/"
style="width:100%; height:1100px"
frameborder="0"
scrolling="no">
</iframe>
</noscript>
<div id="dc_wdiv" data-language="en" aria-live="polite" role="region"></div>
<script type="text/javascript" src="https://widget.wheredoivote.co.uk/wdiv.js"></script>
Default Welsh with option to toggle to English:
<noscript>
<iframe src="https://wheredoivote.co.uk/embed/"
style="width:100%; height:1100px"
frameborder="0"
scrolling="no">
</iframe>
</noscript>
<div id="dc_wdiv" data-language="cy" aria-live="polite" role="region"></div>
<script type="text/javascript" src="https://widget.wheredoivote.co.uk/wdiv.js"></script>
<noscript>
<a href="https://whocanivotefor.co.uk/">Information about elections in your area</a>
</noscript>
<div id="dc_wdiv" data-elections="true" data-language="en" aria-live="polite" role="region"></div>
<script type="text/javascript" src="https://widget.wheredoivote.co.uk/wdiv.js"></script>
Similarly to pyenv, nvm is a tool to manage multiple versions of node. Using nvm is recommended to avoid conflicts between different projects or to test out upgrades.
To install: npm install nvm
How to use nvm:
nvm install node
nvm install [version]
nvm uninstall [version]
nvm ls
nvm ls-remote
nvm use node
or nvm use [version]
nvm which [version]
npm install
Run with test data from the API sandbox:
dc:start:sandbox
Run with local test data:
npm run start:mock
Run using the production API with a key:
npm start
To run the test suite locally, you will need at least node 13 due to the internationalization features required by React-Intl. See https://formatjs.io/docs/runtime-requirements
npm test
src/dc-widget-styles.css
and src/ec-widget-styles.css
both in the root
and host
sections. src/dc-widget-styles.css
and src/ec-widget-styles.css
both in the root
and host
sections, such as:
party-305.candidate-name::before {
background: var(--party-colour-party-305);
}