forked from wordshub/free-font
-
Notifications
You must be signed in to change notification settings - Fork 0
/
font.html
207 lines (176 loc) · 8.52 KB
/
font.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>字集-免费字体</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/wordshub/free-font/css/theme.css">
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.svg">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.svg">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.svg">
</head>
<body>
<div class="site-wrapper">
<!-- Header -->
<header class="header header-default">
<div class="header-main">
<div class="container">
<nav class="navbar navbar-default fhmm" role="navigation">
<script src="//cdn.jsdelivr.net/gh/wordshub/free-font/js/header.js"></script>
</nav>
</div>
</div>
</header>
<!-- Header / End -->
<!-- Main -->
<div class="main" role="main">
<!-- Page Heading -->
<!-- Page Heading / End -->
<!-- Page Content -->
<section class="page-content padding-bottom2">
<div class="container">
<div class="fonts-navigation">
<div class="fontMainTit">
<a href="javascript:" longdesc="hei">黑体</a>
<a href="javascript:" longdesc="song">宋体</a>
<a href="javascript:" longdesc="kai">楷体</a>
<a href="javascript:" longdesc="yishu">艺术</a>
<a href="javascript:" longdesc="shouhui">手绘</a>
</div>
<div id="fontList" class=""></div>
<div class="arrow down"></div>
</div>
<div class="row">
<div class="col-sm-8 col-md-8 poster">
<div id="poster"></div>
</div>
<div id="fontDesc" class="col-sm-4 col-md-4 font-detail-desc">
<div class="fontDescTit" id="fontDescTit">简介</div>
<div id="designDesc" class="fontDesc" style="padding-bottom:30px;"></div>
<div class="fontDesc mobi-align-center down-wrapper">
<a id="down" class="btn btn-red btn-buy btn-down" target="blank" style="text-align:center;display: none;" href="#">开始下载</a>
</div>
</div>
<div id="fontImgset" class="col-sm-12 col-md-12 poster"></div>
</div>
</div>
</section>
<!-- Page Content / End -->
<!-- Footer -->
<footer class="myfooter">
<div class="container">
<script src="//cdn.jsdelivr.net/gh/wordshub/free-font/js/footer.js"></script>
</div>
</footer>
<!-- Footer / End -->
</div>
<!-- Main / End -->
</div>
<!-- Javascript Files
================================================== -->
<script src="//cdn.jsdelivr.net/gh/wordshub/free-font/vendor/jquery-1.11.0.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/wordshub/free-font/js/custom.js"></script>
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript">
var song = new Array();
var hei = new Array();
var kai = new Array();
var shouhui = new Array();
var yishu = new Array();
function insertFontNaviHtml() {
var fname = location.search.substring(1);
fname = fname.indexOf("=") >= 0 ? fname.substring(0, fname.length - 1) : fname;
var ttype = fontsMap[fname].type;
var download = fontsMap[fname].download;
if (download.length > 0) {
$("#down").attr("href", download).show();
}
var mainNavi = new Array();
for (var fontname in fontsMap) {
var name = fontsMap[fontname].name;
var code = fontsMap[fontname].code;
var type = fontsMap[fontname].type;
if (type == "1") {
hei.push('<a class="' + (hei.length == 0 ? 'firstFont' : '') + (fname == fontname ? ' on' : '') + '" href="font.html?' + fontname + '#try" >' + name + '</a>');
} else if (type == "2") {
song.push('<a class="' + (song.length == 0 ? 'firstFont' : '') + (fname == fontname ? ' on' : '') + '" href="font.html?' + fontname + '#try" l>' + name + '</a>');
} else if (type == "3") {
kai.push('<a class="' + (yishu.length == 0 ? 'firstFont' : '') + (fname == fontname ? ' on' : '') + '" href="font.html?' + fontname + '#try" >' + name + '</a>');
} else if (type == "4") {
yishu.push('<a class="' + (yishu.length == 0 ? 'firstFont' : '') + (fname == fontname ? ' on' : '') + '" href="font.html?' + fontname + '#try" >' + name + '</a>');
} else if (type == "5") {
shouhui.push('<a class="' + (shouhui.length == 0 ? 'firstFont' : '') + (fname == fontname ? ' on' : '') + '" href="font.html?' + fontname + '#try" >' + name + '</a>');
}
};
if (ttype == "1") {
$("#fontList").append(hei.join('\r\n'));
$(".fontMainTit a").eq(0).addClass("on");
} else if (ttype == "2") {
$("#fontList").append(song.join('\r\n'));
$(".fontMainTit a").eq(1).addClass("on");
} else if (ttype == "3") {
$("#fontList").append(kai.join('\r\n'));
$(".fontMainTit a").eq(2).addClass("on");
} else if (ttype == "4") {
$("#fontList").append(yishu.join('\r\n'));
$(".fontMainTit a").eq(3).addClass("on");
} else if (ttype == "5") {
$("#fontList").append(shouhui.join('\r\n'));
$(".fontMainTit a").eq(4).addClass("on");
}
var posters = fontsMap[fname].posters;
var imgsHtml = new Array();
var posterHtml = '';
var imgsLength = posters.length;
for (var i = 0; i < imgsLength; i++) {
var image = posters[i];
if (image.indexOf('http') == -1) {
image = baseUrl + image;
}
if (i == 0) {
posterHtml = '<img src="' + image + '"/>\r\n';
} else {
imgsHtml.push('<img src="' + image + '"/>');
}
}
$("#fontImgset").append(imgsHtml.join('\r\n'));
$("#poster").append(posterHtml);
$("#designDesc").html(fontsMap[fname].desc);
$("#fontDescTit").html(fontsMap[fname].name.replace("-", "") + "设计说明");
// $("#headerFontName").html(fontsMap[fname].name.replace("-", ""));
/**/
$(".fontMainTit a").on("click", function() {
$(".fontMainTit a").removeClass("on");
$(this).addClass("on");
var aimNavi = eval($(this).attr("longdesc"));
$("#fontList").html(aimNavi.join('\r\n')).removeClass('overflow-hidden');
initNav()
});
};
function initNav() {
if ($('#fontList').height() <= 84) {
$('.arrow').hide()
$('#fontList').removeClass('overflow-hidden')
} else {
$('.arrow').show().removeClass('up').addClass('down');
$('#fontList').addClass('overflow-hidden')
}
}
$(document).ready(function() {
insertFontNaviHtml();
initNav()
$('.arrow').on('click', function() {
if ($(this).hasClass('down')) {
$(this).removeClass('down').addClass('up');
$('#fontList').removeClass('overflow-hidden')
} else {
$(this).removeClass('up').addClass('down');
$('#fontList').addClass('overflow-hidden')
}
})
});
</script>
</body>
</html>