Skip to content
This repository was archived by the owner on Sep 17, 2020. It is now read-only.

Commit

Permalink
feature: verison 1.2.0
Browse files Browse the repository at this point in the history
- Add new solid icons: bookmark, hear, star
- Add new line icons: home, printer
  • Loading branch information
Junyu Pu committed Mar 7, 2019
1 parent fede747 commit 2783106
Show file tree
Hide file tree
Showing 8 changed files with 418 additions and 597 deletions.
Binary file modified docs/fonts/yoco.eot
Binary file not shown.
14 changes: 12 additions & 2 deletions docs/fonts/yoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/fonts/yoco.ttf
Binary file not shown.
Binary file modified docs/fonts/yoco.woff
Binary file not shown.
52 changes: 39 additions & 13 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
margin: 2rem 0;
}

.divider {
font-size: 12px;
color: #8a8a8a;
font-weight: 700;
}

.yoco.icon-preview {
font-size: 4rem;
}
Expand Down Expand Up @@ -184,10 +190,24 @@ <h2>
<i class="yoco">close</i>
</button>
</div>
<div class="divider">Solid</div>
<div class="icons">
<div
class="icon-container"
v-for="icon in displayString(solidIconString)"
@click="previewIcon=icon"
>
<div class="icon">
<i class="yoco" ref="liga">{{ icon }}</i>
<div class="icon-liga" v-text="icon"></div>
</div>
</div>
</div>
<div class="divider">Line</div>
<div class="icons">
<div
class="icon-container"
v-for="icon in displayString"
v-for="icon in displayString(iconString)"
@click="previewIcon=icon"
>
<div class="icon">
Expand All @@ -213,9 +233,16 @@ <h2>
loadJSON(function(response) {
const json = JSON.parse(response).iconSets[0].selection;
let iconMoonString = [];
json.map(function(item) {
iconMoonString.push(item.ligatures.split(",")[0]);
let solidIconMoonString = [];
json.forEach(function(item) {
const liga = item.ligatures.split(",")[0];
if (liga.includes("solid")) {
solidIconMoonString.push(liga);
} else {
iconMoonString.push(liga);
}
});
app.solidIconString = solidIconMoonString;
app.iconString = iconMoonString;
});

Expand All @@ -224,6 +251,7 @@ <h2>
data() {
return {
iconString: [],
solidIconString: [],
previewIcon: "idea",
serachString: ""
};
Expand All @@ -237,23 +265,21 @@ <h2>
];
}, i * 100);
}
}
},
computed: {
displayString() {
if (this.serachString) {
return this.searchResults;
}
return this.iconString;
},
searchResults() {
let results = this.iconString.filter(result =>
searchResults(strings) {
let results = strings.filter(result =>
result.includes(this.serachString.toLowerCase())
);
if (results.length === 1) {
this.previewIcon = results[0];
}
return results;
},
displayString(strings) {
if (this.serachString) {
return this.searchResults(strings);
}
return strings;
}
}
});
Expand Down
Loading

0 comments on commit 2783106

Please sign in to comment.