5 Commits

Author SHA1 Message Date
Josh Creek bd7ef970b9 chore(*): Update package version 2022-10-09 12:54:21 +01:00
Josh Creek 0d641c4f66 fix(*): Fix ability to click circle to spin 2022-10-09 12:53:47 +01:00
Josh Creek 983b097a3c fix(*): Include missing assets 2022-10-08 23:50:22 +01:00
Josh Creek 86b94e2e6a docs(*): Add custom image to explainer text 2022-10-08 23:09:48 +01:00
Josh Creek 9e56971116 Merge pull request #15 from jcreek/2-add-image-querystring-functionality-for-centre-of-spinner
feat(#2): Add image customisation for mid-spinner
2022-10-08 22:36:41 +01:00
3 changed files with 25 additions and 20 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "SelectionWheel", "name": "SelectionWheel",
"version": "1.4.0", "version": "1.4.1",
"description": "A fun and simple selection wheel.", "description": "A fun and simple selection wheel.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+19 -18
View File
@@ -4,6 +4,9 @@ import loadServiceWorker from './loadServiceWorker';
require('./assets/favicon.ico'); require('./assets/favicon.ico');
require('./assets/android-chrome-192x192.png'); require('./assets/android-chrome-192x192.png');
require('./assets/android-chrome-512x512.png'); require('./assets/android-chrome-512x512.png');
require('./assets/apple-touch-icon.png');
require('./assets/favicon-16x16.png');
require('./assets/favicon-32x32.png');
require('./styles/main.scss'); require('./styles/main.scss');
const padding = { const padding = {
@@ -74,25 +77,23 @@ function makeArrowAndCircle(
.attr('x', 0) .attr('x', 0)
.attr('y', 0) .attr('y', 0)
.attr('preserveAspectRatio', 'xMaxYMax slice'); .attr('preserveAspectRatio', 'xMaxYMax slice');
}
container
.append('circle')
.attr('cx', 0)
.attr('cy', 0)
.attr('r', 60)
.style('fill', 'white')
.style('fill', 'url(#image)')
.style('cursor', 'pointer');
if (imageUrlForSpinner.length === 0) {
// spin text
container container
.append('text') .append('circle')
.attr('x', 0) .attr('cx', 0)
.attr('y', 10) .attr('cy', 0)
.attr('text-anchor', 'middle') .attr('r', 60)
.text('SPIN') .style('fill', 'white')
.style('font-weight', 'bold') .style('fill', 'url(#image)')
.style('font-size', '30px'); .style('cursor', 'pointer');
} else {
container
.append('circle')
.attr('cx', 0)
.attr('cy', 0)
.attr('r', 60)
.style('fill', 'white')
.style('cursor', 'pointer');
} }
} }
+5 -1
View File
@@ -40,7 +40,11 @@
<div id="input-container"> <div id="input-container">
<textarea id="input-lines" class="input-items" rows="15" cols="60" name="text" <textarea id="input-lines" class="input-items" rows="15" cols="60" name="text"
placeholder="Enter names to be shuffled, one per line. Leave this area empty in order to use a default set of generated names."></textarea> placeholder="Enter names to be shuffled, one per line. Leave this area empty in order to use a default set of generated names.
You can also customise the centre of the spinner with an image. Just put ?imgUrl= at the end of the web address and the URL of the image you want to use.
For example, https://wheel.jcreek.co.uk/?imgUrl=https://www.mammal.org.uk/wp-content/uploads/2021/09/red-fox-300x300.jpg"></textarea>
<button id="startSpinning" class="input-items button button-green" role="button">Start spinning</button> <button id="startSpinning" class="input-items button button-green" role="button">Start spinning</button>
</div> </div>