From 1bcf68f530c6dc713769685a4f06989897be7296 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Sat, 16 Apr 2016 21:17:52 +0800 Subject: update autocomplete, chip code, and Readme doc --- index.html | 193 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 146 insertions(+), 47 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 5239e1b..c2b5861 100644 --- a/index.html +++ b/index.html @@ -89,7 +89,7 @@

There are 3 ways to get started with Spectre CSS framework in your projects. You can either manually install or use NPM and Bower.

Install manually
-

Download the compiled and minified Spectre CSS file (about 25KB):

+

Download the compiled and minified Spectre CSS file (about 28KB):

Download Spectre.css

Install with NPM
@@ -828,6 +828,7 @@
avatars chips + autocomplete tooltips labels badges @@ -944,21 +945,73 @@
- Yan Zhu + Tony Stark
- Yan Zhu + Thor Odinson
- Yan Zhu + Steve Rogers
+ + +
+

Add a container element with the class chip. And add child text elements with chip-name or icons with icon.

+
+ + +
+<div class="chip-sm">
+    <span class="chip-name">Crime</span>
+    <button class="btn btn-clear"></button>
+</div>
+
+<div class="chip-sm">
+    <span class="icon icon-favorite_border"></span>
+    <span class="chip-name">Drama</span>
+    <button class="btn btn-clear"></button>
+</div>
+
+<div class="chip-sm">
+    <img src="img/avatar-1.png" class="avatar" />
+    <span class="chip-name">Yan Zhu</span>
+    <button class="btn btn-clear"></button>
+</div>
+
+ +
+ +
+

autocomplete

+
+

Autocomplete form component provides suggestions while you type. It is often used for tags and contacts input.

+
@@ -966,32 +1019,54 @@
- Yan Zhu + Tony Stark
- Yan Zhu + Thor Odinson
- Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso + Steve Rogers
- Yan Zhu + Bruce Banner
-
+
- Yan Zhu + Natasha Romanoff + +
+ +
+
+
+
+
+
+
+ Tony Stark
- - Yan Zhu + Thor Odinson + +
+
+ Steve Rogers + +
+
+ Bruce Banner + +
+
+ Natasha Romanoff
@@ -1005,41 +1080,37 @@
- Yan Zhu + Tony Stark
- Yan Zhu + Thor Odinson
- +
    -
  • -
    +
  • +
    -
    - Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso +
    + Steve Rogers
    -
    - +
    +
  • -
  • -
    +
  • +
    -
    +
    Yan Zhu
    -
    - +
    +
@@ -1048,26 +1119,54 @@
-

Add a container element with the class chip. And add child text elements with chip-name or icons with icon.

+

Add a container element with the class form-autocomplete. There are 2 parts of it, one is form-autocomplete-input, another is form-autocomplete-list. Spectre.css does not include JavaScript code, you will need to implement your JS to interact with the autocomplete. The autocomplete HTML structure is exampled below.

- +
-<div class="chip">
-    <span class="chip-name">Crime</span>
-    <button class="btn btn-clear"></button>
-</div>
-
-<div class="chip">
-    <span class="icon icon-favorite_border"></span>
-    <span class="chip-name">Drama</span>
-    <button class="btn btn-clear"></button>
-</div>
-
-<div class="chip">
-    <img src="img/avatar-1.png" class="avatar" />
-    <span class="chip-name">Yan Zhu</span>
-    <button class="btn btn-clear"></button>
+<div class="form-autocomplete">
+    <!-- autocomplete input container -->
+    <div class="form-autocomplete-input">
+        <!-- autocomplete chips -->
+        <div class="chip-sm">
+            <img src="img/avatar-1.png" class="avatar" />
+            <span class="chip-name">Yan Zhu</span>
+            <button class="btn btn-clear"></button>
+        </div>
+        <div class="chip-sm selected">
+            <img src="img/avatar-2.png" class="avatar" />
+            <span class="chip-name">Yan Zhu</span>
+            <button class="btn btn-clear"></button>
+        </div>
+        <!-- autocomplete real input box -->
+        <input class="form-input" type="text" placeholder="typing here" />
+    </div>
+    <!-- autocomplete suggestion list -->
+    <ul class="form-autocomplete-list">
+        <!-- autocomplete list chips -->
+        <li class="chip hand">
+            <div class="chip-icon">
+                <img src="img/avatar-4.png" class="avatar" />
+            </div>
+            <div class="chip-content">
+                Steve Rogers
+            </div>
+            <div class="chip-action">
+                <button class="btn"><span class="icon icon-markunread"></span></button>
+            </div>
+        </li>
+        <li class="chip hand">
+            <div class="chip-icon">
+                <img src="img/avatar-3.png" class="avatar" />
+            </div>
+            <div class="chip-content">
+                Yan Zhu
+            </div>
+            <div class="chip-action">
+                <button class="btn"><span class="icon icon-markunread"></span></button>
+            </div>
+        </li>
+    </ul>
 </div>
 
-- cgit v1.3.1-26-gb76a