Skip to content

Commit b85cae7

Browse files
authored
Create index.html
1 parent 8190d69 commit b85cae7

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

index.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>class.cart.js - WebDevLabs</title>
8+
<link href="/class.cart.js/assets/css/style.css?v=8190d69dc201fafb67b0e586783467d786178f30" rel="stylesheet">
9+
</head>
10+
<body>
11+
<div class="container markdown-body">
12+
<h1 id="classcartjs">class.cart.js</h1>
13+
<p>Simple standalone client-side pure JavaScript (<em>ECMAScript 6</em>) shopping cart with browser sessionStorage</p>
14+
15+
<h1 id="usage">Usage:</h1>
16+
<h2 id="html">HTML</h2>
17+
<p><strong>add 2 cart button</strong></p>
18+
<div class="highlighter-rouge"><pre class="highlight"><code>&lt;button class="add2cart" data-itemid="123" data-title="some product" data-price="12.99"&gt;Add 2 cart&lt;/button&gt;
19+
</code></pre>
20+
</div>
21+
<p><strong>shopping cart div (you can put it anywhere as it’s position is fixed and defined in css)</strong></p>
22+
<div class="highlighter-rouge"><pre class="highlight"><code>&lt;div id="shoppingCart" data-price="0"&gt;
23+
&lt;ul&gt;&lt;/ul&gt;
24+
&lt;span class="cartBtn"&gt;
25+
&lt;i class="glyphicon glyphicon-shopping-cart"&gt;&lt;/i&gt;
26+
&lt;strong id="cartTotal"&gt;&lt;/strong&gt;
27+
&lt;/span&gt;
28+
&lt;/div&gt;
29+
</code></pre>
30+
</div>
31+
<p><strong>becouse it is standalone you can load it asynchronously</strong></p>
32+
<div class="highlighter-rouge"><pre class="highlight"><code>&lt;script src="class.cart.js" async&gt;&lt;/script&gt;
33+
</code></pre>
34+
</div>
35+
<h2 id="css">CSS</h2>
36+
<div class="highlighter-rouge"><pre class="highlight"><code>#shoppingCart {
37+
display: none;
38+
position: fixed;
39+
right: 17px;
40+
bottom: 0;
41+
z-index: 9999;
42+
opacity: 0.8;
43+
background-color: #ff8040;
44+
border-radius: 7px;
45+
min-width: 100px;
46+
color: black;
47+
}
48+
49+
#shoppingCart ul {
50+
text-align: left;
51+
list-style-type: none;
52+
margin: 10px;
53+
padding: 0;
54+
display: none;
55+
}
56+
57+
#shoppingCart ul li,
58+
.cartBtn {
59+
cursor: pointer;
60+
}
61+
62+
#shoppingCart ul li:hover {
63+
cursor: pointer;
64+
color: white;
65+
text-decoration: line-through;
66+
}
67+
</code></pre>
68+
</div>
69+
70+
</div>
71+
</body>
72+
</html>

0 commit comments

Comments
 (0)