-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
174 lines (139 loc) · 9.13 KB
/
demo.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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>LC Text Shortener - by LCweb</title>
<!-- PAGE BASE CSS -->
<style type="text/css"> a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
*{box-sizing:border-box;line-height:normal}body{background:#fcfcfc;font-family:sans-serif;color:#303030}.container:after{content:"";display:block;clear:both}.header{text-align:center;padding:40px 20px 20px;background:#343434;border-bottom:4px solid #7dc242;position:relative;z-index:2;overflow:hidden;color:#fefefe;}#logo{border:0;background:#343434;padding:0;position:relative;bottom:-5px;width:29px;margin-right:5px}svg{filter:blur(1px);opacity:.015;position:absolute;top:0;left:0;right:0;bottom:0;transform:rotate(3deg) scale(1.35);z-index:-1}.left-shade{fill:#afafaf}.right-shade{fill:#bfbfbf}.header h2{font-size:34px;margin-top:-12px;}.header h4{font-size:18px;font-weight:400;line-height:135%;margin:15px 0;color:#f0f0f0;}.header h4 a{color:#cfcfcf;}.content{max-width:1200px; margin:auto;}
</style>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<style>
small {
font-size: 13px;
font-weight: normal;
padding-left: 10px;
}
#second_div{
padding: 40px 50px 20px;
text-align: center;
overflow: hidden;
}
#third_div {
margin: 10px 50px;
}
#second_div h4 {
margin-top: 0;
font-size: 19px;
margin-bottom: 7px;
color: #333;
}
#second_div hr {
width: 200%;
margin-left: -50%;
border: 2px solid #eaeaea;
}
#default_txt,
#shortened_wrap {
margin: 25px 0;
padding: 25px;
text-align: left;
background: #f9f9f9;
border-radius: 7px;
color:#444;
border: 1px solid #e7e7e7;
}
#shortened_wrap {
min-width: 170px;
min-height: 77px;
overflow: hidden;
padding-bottom: 30px;
}
#second_div section a,
#second_div section strong,
#second_div section em {
color: #63a031
}
#shortened_txt {
overflow: hidden;
min-height: 28px;
max-width: 100%;
min-width: 150px;
}
.ui-icon-gripsmall-diagonal-se {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAFzUkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAr0lEQVQ4T9XTvQ7BUBiH8YNITLgVq0Rs4hJMHVyCARGTUQw2s1uQiBtxId1FeF49b6NNxd/oSX49p01Ov9IGSiuc0IHUo+SAJqTqcXzvils21SrfgVlAzhZsMYtzt4HUGf4odmU/wdIOKLXj6K0hL/6v5thn07xuHL+2gr/cnR2gBi62UephjBr6aGGEBHJT3OF34n5qgsJJqv6FT9kPNkRhjT2Tkn1sRwxee3khPAHS7iyGKxwUEwAAAABJRU5ErkJggg==") no-repeat center center transparent !important;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h2>
<img id="logo" src=" data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAlCAMAAAD7q3BLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAxQTFRFS1NFfsJCx8jKNDQ0SyWmjgAAAAR0Uk5T////AEAqqfQAAACySURBVHja7JTLFsQgCEOD/P8/jw9EgjiLWU88XQi3sSoUSgJaQwrRRNqQ4EWgbQEVcfKTuQgwEGxQGZANXnlnUCzAS0Hf+WXTB3lA1vDAPBxHEMWbWnM+bnFXse1g2ZnOBjshlhuPbPVZIIzRk7+JGYnAr4R8J/RPXGcaxXd77i71JxHi7+pVY0KMEVTudKXji69aj5WVidUvSgwRiH1bEMi9n4jc+26zCdT/ICdi9CPAAHRlCGHRLtsqAAAAAElFTkSuQmCC" />
LC Text Shortener
</h2>
<h4>Micro jQuery plugin creating excerpts on the fly, basing on a fixed value or container's height.<br/>By <a href="https://lcweb.it" target="_blank">LCweb</a></h4>
<svg width="100%" height="100%">
<pattern id="pattern-cubes" x="0" patternUnits="userSpaceOnUse" viewBox="0 0 10 16" height="100" width="116" y="68">
<g id="cube">
<path class="left-shade" d="M0 0l5 3v5l-5 -3z" />
<path class="right-shade" d="M10 0l-5 3v5l5 -3" />
</g>
<use x="5" y="8" xlink:href="#cube" />
<use x="-5" y="8" xlink:href="#cube" />
</pattern>
<rect x="0" y="0" width="100%" height="100%" fill="url(#pattern-cubes)" />
</svg>
</div>
<div class="content">
<!-- //////////////////////////////////////////////// -->
<!-- REQUIRED HTML -->
<div id="second_div">
<h4>As it displays normally</h4>
<section id="default_txt">
Lorem ipsum dolor sit amet, <strong>consectetur adipisci elit</strong>, sed eiusmod tempor incidunt ut <a href="#">labore et dolore magna aliqua</a>. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur. <br/> <br/>
Quis aute iure reprehenderit in voluptate velit <a href="#">esse cillum dolore eu fugiat nulla pariatur</a>. Excepteur sint obcaecat <em>cupiditat non proident, sunt in culpa qui officia</em> deserunt mollit anim id est laborum.
<br/> <br/>
Lorem ipsum dolor sit amet, <strong>consectetur adipisci elit</strong>, sed eiusmod tempor incidunt ut <a href="#">labore et dolore magna aliqua</a>. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.
<br/> <br/>
Quis aute iure reprehenderit in voluptate velit <a href="#">esse cillum dolore eu fugiat nulla pariatur</a>. Excepteur sint obcaecat <em>cupiditat non proident, sunt in culpa qui officia</em> deserunt mollit anim id est laborum.
</section>
<br/><br/>
<h4>Shortened - resize it!</h4>
<div id="shortened_wrap" class="ui-widget-content">
<section id="shortened_txt">
Lorem ipsum dolor sit amet, <strong>consectetur adipisci elit</strong>, sed eiusmod tempor incidunt ut <a href="#">labore et dolore magna aliqua</a>. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur. <br/> <br/>
Quis aute iure reprehenderit in voluptate velit <a href="#">esse cillum dolore eu fugiat nulla pariatur</a>. Excepteur sint obcaecat <em>cupiditat non proident, sunt in culpa qui officia</em> deserunt mollit anim id est laborum.
<br/> <br/>
Lorem ipsum dolor sit amet, <strong>consectetur adipisci elit</strong>, sed eiusmod tempor incidunt ut <a href="#">labore et dolore magna aliqua</a>. Ut enim ad minim veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.
<br/> <br/>
Quis aute iure reprehenderit in voluptate velit <a href="#">esse cillum dolore eu fugiat nulla pariatur</a>. Excepteur sint obcaecat <em>cupiditat non proident, sunt in culpa qui officia</em> deserunt mollit anim id est laborum.
</section>
</div>
</div>
<div id="third_div">
<em style="color: #777; font-size: 14px;"><strong>NB:</strong> Green elements are bold and italic texts and links. Script correctly handles them on resize</em>
</div>
<!-- //////////////////////////////////////////////// -->
</div>
</div>
<!-- //////////////////////////////////////////////// -->
<!-- REQUIRED JAVASCRIPT -->
<script src="lc_text_shortener.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(e) {
$("#shortened_wrap").resizable({
stop: function(event, ui) {
$('#shortened_txt').css('height', 'auto').css('width', ui.size.width);
$('#shortened_txt').lc_txt_shortener('[..]', false, 'strong, a , em');
}
});
$('#shortened_txt').lc_txt_shortener('[..]', 250, 'strong, a , em');
});
</script>
<!-- //////////////////////////////////////////////// -->
</body>
</html>