-
Notifications
You must be signed in to change notification settings - Fork 82
/
getting-started.html
180 lines (165 loc) · 6.93 KB
/
getting-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Getting Started - Marka</title>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="./static/marka/css/marka.css">
<link rel="stylesheet" type="text/css" href="./static/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./static/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="./static/css/prism.css">
<link rel="stylesheet" type="text/css" href="./static/css/style.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36521756-2', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="page">
<div class="nav">
<h1><a href="./">Marka</a></h1>
<p>Beautiful transformable icons <br> built for the web.</p>
<p>(v0.3.1)</p>
<div class="item">
<a href="./getting-started.html" class="button">Getting Started</a>
<br>
<a href="./icons.html" class="button">Icons</a>
<br>
<a href="./api.html" class="button">API</a>
<br>
<a href="./faq.html" class="button">FAQ</a>
<br>
<a href="./customize.html" class="button">Customize</a>
<br>
<a href="https://github.com/fians/marka/" class="button">GitHub</a>
</div>
</div>
<div class="content">
<h1 id="getting-started">Getting Started</h1>
<p>Marka is designed to be easy to use and integrated with
your website. Download the <a href="https://github.com/fians/marka/releases" target="_blank">latest version of Marka</a>
or you can install it via Bower with <code>bower install marka</code>,
put the files on your html file, and it's
ready to use.</p>
<pre><code class="lang-markup"><!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<link rel="stylesheet" href="/path/to/marka.min.css">
<script src="/path/to/marka.min.js"></script>
</head>
<body>
</body>
</html>
</code></pre>
<h2 id="initialize-marka">Initialize Marka</h2>
<p>Before set the icon you wan to use, you need initialize
Marka instance on the icon element you want to set up.</p>
<pre><code class="lang-markup"><i id="icon"></i>
<script>
var m = new Marka('#icon');
</script>
</code></pre>
<p>You can also pass jQuery element on Marka parameter,
like this,</p>
<pre><code class="lang-markup"><i id="icon"></i>
<script>
var m = new Marka($('#icon'));
</script>
</code></pre>
<p>Or if you want to set multiple icon,</p>
<pre><code class="lang-markup"><i class="icon"></i>
<i class="icon"></i>
<i class="icon"></i>
<script>
var m = new Marka('.icon');
</script>
</code></pre>
<p>But, remember. When you initialize multiple
element in one Marka instance, all those element
will be at same Marka instance, which means
when you set icon, color, size, or rotation
with that instance, they (elements) will
transform to same state simultaneously. So, it's
better to create Marka instance for each element.</p>
<p>Example:</p>
<pre><code class="lang-markup"><i id="toggleAccordion"></i>
<i id="toggleModal"></i>
<script>
var accordionIcon = new Marka('#toggleAccordion');
var modalIcon = new Marka('#toggleModal');
</script>
</code></pre>
<h2 id="set-icon">Set Icon</h2>
<p>Marka currently have <a href="./icons.html">36 icons</a> ready to use,
and you can see all those icons here. If you feel you didn't
need all Marka icons, you can <a href="./customize.html">customize marka.css</a> to pick
icons based on your needs. To set icon
you can use <code>set()</code> on Marka instance.</p>
<pre><code class="lang-javascript">var m = new Marka('#icon');
m.set('circle');
</code></pre>
<p>When you need to transform to another icon, just
apply <code>set()</code> to that instance again.</p>
<pre><code class="lang-javascript">var m = new Marka('#icon');
m.set('circle');
// Change after 3 second
setTimeout(function() {
m.set('square');
}, 3000);
</code></pre>
<h2 id="color-it">Color it</h2>
<p>By default, Marka set black <code>#000000</code> as default color
of any icon. You can overide the default color
of your icon, using <code>color()</code>.</p>
<p>Example:</p>
<pre><code class="lang-javascript">var m = new Marka('#icon');
m.set('times').color('#ffffff');
// Transform color after 3 second
setTimeout(function() {
m.color('#ff00000');
}, 3000);
</code></pre>
<h2 id="change-size">Change size</h2>
<p>Because created with HTML element, every Marka icon
is scalable. You can change to every size you want
using <code>size()</code> function.</p>
<pre><code class="lang-javascript">var m = new Marka('#icon');
m.set('circle').size(20); // Set icon size to 20px;
// Transform to larger icon after 3 second
setTimeout(function() {
m.size(30);
}, 3000);
</code></pre>
<h2 id="rotate-it">Rotate it</h2>
<p>Marka allows you to change direction of your icon
with <code>rotate()</code> function. The direction can be 'up',
'down', 'left', or 'right' and very useful if you
combine it with arrow icon.</p>
<p>Example:</p>
<pre><code class="lang-javascript">var m = new Marka('#icon');
m.set('arrow').rotate('left');
// or down
m.rotate('down');
// or right
m.rotate('right');
// or up again
m.rotate('up');
</code></pre>
<div class="footer">
2014 © <a href="http://fian.my.id/">Alfiana E. Sibuea</a>. All right reserved.
</div>
</div>
</div>
<script type="text/javascript" src="./static/marka/js/marka.js"></script>
<script type="text/javascript" src="./static/js/jquery.min.js"></script>
<script type="text/javascript" src="./static/js/prism.js"></script>
<script type="text/javascript" src="./static/js/main.js"></script>
</body>
</html>