Skip to content

Instantly share code, notes, and snippets.

@ToadKing
Created October 19, 2019 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ToadKing/38c6a249a1419c1df6cce4b7174f1fdb to your computer and use it in GitHub Desktop.
Save ToadKing/38c6a249a1419c1df6cce4b7174f1fdb to your computer and use it in GitHub Desktop.
<div id="wheel" ref="wheelContainer" :style="styles.wheel">
<img :style="styles.ticker"
ref="ticker"
:src="settings.ticker.url"/>
<div id="inner-wheel">
<img v-if="settings.centerImage.enabled"
:src="settings.centerImage.url"
:style="styles.centerImage" />
<svg viewBox="-1 -1 2 2"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
:style="'transform: rotate(' + rotation + 'rad)'">
<defs>
<pattern id="img1" patternUnits="userSpaceOnUse" width="1" height="1">
<image xlink:href="https://i.imgur.com/DHzWJAq.png" width="1" height="1" />
</pattern>
</defs>
<path v-for="(range, index) in ranges"
:id="'prize-' + (index + 1)"
:d="range.d"
:fill="'url(#img' + (index + 1) + ')'"
stroke="black"
stroke-width="0.01"
class="pie-section"></path>
</svg>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment