Hi,
I’d really like to implement the spritespin jquery Plugin to my kirby site. But I’ve got some difficulties.
(http://spritespin.ginie.eu/)
The installation guide tells me to make the reference to jquery and spitespin scripts:
<script src="https://code.jquery.com/jquery-3.3.1.min.js" type='text/javascript'></script>
<script src='https://unpkg.com/spritespin@x.x.x/release/spritespin.js' type='text/javascript'></script>
So I added this to “site/Snippets/footer.php” just above the body tag
<script src="https://unpkg.com/spritespin@4.0.11/release/spritespin.js" type="text/javascript">
I guess I don’t need the jquery script, because it’s already on the kirby site (am I right?)
Next step is to create the container for spritespin:
<div id='mySpriteSpin'></div>
So I did.
I put that in my panel as a “text section” in the position, where I want the rotating image to appear.
<div id="mySpriteSpin" class="spritespin-instance with-canvas" unselectable="on"
style="user-select: none; position: relative; overflow: hidden; width: 371px; height: 252px;">
<div class="spritespin-stage" style="width: 100%; height: 100%; inset: 0px; position: absolute; overflow: hidden;"></div>
<canvas class="spritespin-canvas" width="371" height="252" style="width: 100%; height: 100%; inset: 0px; position: absolute; overflow: hidden;"></canvas>
</div>
Can I just put a div tag to a text section on the panel-Backend?
Next Step is to “initalize the plugin”
<script type='text/javascript'>
$("#mySpriteSpin").spritespin({
// path to the source images.
source: [
"path/to/frame_001.jpg",
"path/to/frame_002.jpg",
"path/to/frame_003.jpg",
"path/to/frame_004.jpg",
"path/to/frame_005.jpg",
"path/to/frame_006.jpg",
"path/to/frame_007.jpg",
"path/to/frame_008.jpg",
"path/to/frame_009.jpg",
"path/to/frame_010.jpg",
],
width : 480, // width in pixels of the window/frame
height : 327, // height in pixels of the window/frame
});
</script>
Here I struggle even more. I uploaded the images on my panel and put in the text section below my
<script type='text/javascript'>
$("#mySpriteSpin").spritespin({
// path to the source images.
source: [
"bett-1_0000.png",
"bett-1_0001.png",
"bett-1_0002.png",
"bett-1_0003.png",
"bett-1_0004.png",
"bett-1_0005.png",
"bett-1_0006.png",
"bett-1_0007.png",
"bett-1_0008.png",
"bett-1_0009.png",
],
width : 371, // width in pixels of the window/frame
height : 252, // height in pixels of the window/frame
});
</script>
Nothing appears on the front-end.
Can anyone please help? Or is there someone to help me commercially?
Best, Thomas