aid-elements-cmcc
Version:
AI Design Elements
233 lines (217 loc) • 6.62 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title><%= fontName %></title>
<link href="css/<%= fontFileName %>.css" rel="stylesheet">
<style>
body {
font-family: "Helvetica Neue", Arial, sans-serif;
text-align: center;
background: #f7f7f7
}
.glyph {
padding: 0;
height: 100%;
}
.glyph > li {
display: inline-block;
margin: .4em .3em;
width: 8em;
/*height: 7.5em;*/
background: #fff;
border-radius: .5em;
position: relative;
/*padding: 10px;*/
}
.glyph > li .aid {
display: block;
margin-top: .1em;
/*line-height: 0*/
}
.glyph > li > i:hover {
color: #669cff;
cursor: pointer;
}
.glyph > li > i > span {
position: absolute;
top: 0;
left: 0;
text-align: center;
width: 100%;
color: rgba(0, 0, 0, 0);
line-height: 1em
}
.glyph-name {
font-size: .8em;
color: #666;
display: block;
height: 2.5em;
margin-top: 4px;
}
.glyph-codepoint {
color: #999;
font-family: monospace;
display: block;
margin-top: 4px;
}
.glyph > li > span:hover {
color: #669cff;
cursor: pointer;
}
.version {
font-size: .2em;
}
h1 {
margin: 20px 0;
}
.form-control {
display: block;
width: 100%;
width: 400px;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #999;
background-color: #fff;
background-image: none;
border: 0px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control-feedback {
position: absolute;
top: 6px;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none;
font-size: 24px;
color: #999;
}
.has-feedback {
position: relative;
}
.form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
margin-top: 20px;
}
div.copied {
position: fixed;
top: 30px;
left: 50%;
width: 200px;
text-align: center;
display: none;
padding: 10px 15px;
border-radius: 4px;
margin-left: -100px;
color: #ffffff;
box-shadow: 0 0 10px #3DDB92;
background: -webkit-linear-gradient(left top, #5ADBD3, #3DDB92); /* Safari 5.1 - 6.0 */
background: -o-linear-gradient(bottom right, #5ADBD3, #3DDB92); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(bottom right, #5ADBD3, #3DDB92); /* Firefox 3.6 - 15 */
background: linear-gradient(to bottom right, #5ADBD3, #3DDB92); /* Standard */
background: -ms-linear-gradient(to bottom right, #5ADBD3, #3DDB92);
}
footer {
margin-top: 30px ;
padding: 20px;
border-top: 1px solid #DDD;
text-align: center;
color: #ffffff;
font-size: 13px;
/*background: #F1F1F1;*/
background: -webkit-linear-gradient(left top, #669cff, #9a84ff); /* Safari 5.1 - 6.0 */
background: -o-linear-gradient(bottom right, #669cff, #9a84ff); /* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(bottom right, #669cff, #9a84ff); /* Firefox 3.6 - 15 */
background: linear-gradient(to bottom right, #669cff, #9a84ff); /* Standard */
}
</style>
</head>
<body>
<h1>
<span><%= fontName %></span>
<span class="version"><%= version %></span>
</h1>
<div class="form-group has-feedback">
<input type="input" id="search-input" class="form-control" placeholder="Search by name">
<span class="aid aid-magnify form-control-feedback"></span>
</div>
<ul class="glyph"><% _.each(glyphs, function(glyph) { %>
<li data-name="<%= glyph.name %>" data-tag="<%= glyph.name %>">
<i class="<%= className %> <%= className %>-<%= glyph.name %> <%= className %>-3x" title="Click to copy icon"><span><%= String.fromCodePoint(glyph.codepoint) %></span></i>
<span class="glyph-name" title="Click to copy icon name"><%= glyph.name %></span>
<span class="glyph-codepoint" title="Click to copy codepoint"><%= glyph.codepoint.toString(16).toUpperCase() %></span>
</li>
<% }); %>
</ul>
<div class="copied">
<span>Copied to Clipboard</span>
<textarea name="" id="copy-form" cols="30" rows="0" style="opacity:0;height:0px"></textarea>
</div>
<!--<footer>All Rights Reserved Copyright @2017 Asiainfo UXT Team</footer>-->
</body>
<script>
var searchInput = document.querySelector("#search-input");
var arrI = document.querySelectorAll(".glyph>li");
searchInput.onkeyup = function () {
var keyName = this.value;
if (keyName !== '') {
for (var m = 0, n = arrI.length; m < n; m++) {
var iconName = arrI[m].getAttribute("data-name");
if (iconName.search(keyName) != -1) {
arrI[m].setAttribute('style', 'display:inline-block');
} else {
arrI[m].setAttribute('style', 'display:none');
}
}
} else {
for (var m = 0, n = arrI.length; m < n; m++) {
arrI[m].setAttribute('style', 'display:inline-block');
}
}
};
for (var i = 0, j = arrI.length; i < j; i++) {
var icon = arrI[i].querySelector("i");
var iconCode = arrI[i].querySelector(".glyph-codepoint");
var iconName = arrI[i].querySelector(".glyph-name");
icon.onmouseup = function () {
var iconUnicode = this.querySelector("span");
copyText(iconUnicode.innerHTML);
};
iconCode.onmouseup = function () {
copyText(this.innerHTML);
};
iconName.onmouseup = function () {
copyText("aid-" + this.innerHTML);
};
}
/**
* copy text
* @param text
*/
function copyText (text) {
var copied = document.querySelector('.copied');
copied.setAttribute('style', 'display:block');
var copyFrom = document.querySelector('#copy-form');
copyFrom.value = text;
copyFrom.select();
document.execCommand('copy');
setTimeout(function () {
copyFrom.value = "";
copied.setAttribute('style', 'display:none');
}, 1500);
}
</script>
</html>