Skip to content

riskul/kotlin-jsbindings-spin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kotlin-jsbindings-spin

Kotlin bindings for https://github.com/fgnass/spin.js/

Usage

  1. Add repository
    <repositories>
        <repository>
            <id>public</id>
            <name>Public Repo</name>
            <url>http://mvn.snx.su/repository/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
  1. Add dependency
    <dependencies>
        <dependency>
            <groupId>su.snx.kotlin.jsbindings</groupId>
            <artifactId>spin</artifactId>
            <version>x.x.x.x</version>
        </dependency>
    </dependencies>
  1. Add http://spin.js.org/spin.min.js to scripts
    <!-- here -->
    <script type="text/javascript" src="http://spin.js.org/spin.min.js"></script>
    <script type="text/javascript" src="lib/kotlin.js"></script>
  1. Put script tag after Kotlin's script tag
    <script type="text/javascript" src="lib/kotlin.js"></script>
    <!-- here -->
    <script type="text/javascript" src="lib/spin.js"></script>
  1. Write code:
    Spinner(SpinnerOptions(speed = 5)).spin(target);