-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmedium.html
249 lines (196 loc) · 9.47 KB
/
medium.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8" />
<title>Global DAO - Blog</title>
<meta name="description" content="Organización Autónoma Descentralizada para proteger los derechos humanos, garantizar que la población pueda desarrollarse social y económicamente y que cuente con acceso a servicios de educación y salud." />
<meta name="Author" content="Global DAO [globaldao.network]" />
<!-- mobile settings -->
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0" />
<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->
<!-- WEB FONTS : use %7C instead of | (pipe) -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700" rel="stylesheet" type="text/css" />
<!-- CORE CSS -->
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- REVOLUTION SLIDER -->
<link href="assets/plugins/slider.revolution/css/extralayers.css" rel="stylesheet" type="text/css" />
<link href="assets/plugins/slider.revolution/css/settings.css" rel="stylesheet" type="text/css" />
<!-- THEME CSS -->
<link href="assets/css/essentials.css" rel="stylesheet" type="text/css" />
<link href="assets/css/layout.css" rel="stylesheet" type="text/css" />
<!-- PAGE LEVEL SCRIPTS -->
<link href="assets/css/header-1.css" rel="stylesheet" type="text/css" />
<link href="assets/css/color_scheme/blue.css" rel="stylesheet" type="text/css" id="color_scheme" />
<!-- library to include html files and other option -->
<script src="assets/js/w3.js"></script>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<!--
AVAILABLE BODY CLASSES:
smoothscroll = create a browser smooth scroll
enable-animation = enable WOW animations
bg-grey = grey background
grain-grey = grey grain background
grain-blue = blue grain background
grain-green = green grain background
grain-blue = blue grain background
grain-orange = orange grain background
grain-yellow = yellow grain background
boxed = boxed layout
pattern1 ... patern11 = pattern background
menu-vertical-hide = hidden, open on click
BACKGROUND IMAGE [together with .boxed class]
data-background="assets/images/_smarty/boxed_background/1.jpg"
enable-materialdesign = enable material design js library
-->
<body ng-app="" class="smoothscroll enable-animation">
<!-- SLIDE TOP -->
<div ng-include="'slide-top.html'"></div>
<!-- /SLIDE TOP -->
<!-- wrapper -->
<div id="wrapper" class="mdl-shadow--4dp">
<!--
AVAILABLE HEADER CLASSES
Default nav height: 96px
.header-md = 70px nav height
.header-sm = 60px nav height
.b-0 = remove bottom border (only with transparent use)
.transparent = transparent header
.translucent = translucent header
.sticky = sticky header
.static = static header
.dark = dark header
.bottom = header on bottom
shadow-before-1 = shadow 1 header top
shadow-after-1 = shadow 1 header bottom
shadow-before-2 = shadow 2 header top
shadow-after-2 = shadow 2 header bottom
shadow-before-3 = shadow 3 header top
shadow-after-3 = shadow 3 header bottom
.clearfix = required for mobile menu, do not remove!
Example Usage: class="clearfix sticky header-sm transparent b-0"
-->
<div id="header" class="navbar-toggleable-md clearfix sticky dark b-0 translucent">
<!-- TOP NAV -->
<div ng-include="'top-nav.html'"></div>
<!-- /Top Nav -->
</div>
<!--
PAGE HEADER
CLASSES:
.page-header-xs = 20px margins
.page-header-md = 50px margins
.page-header-lg = 80px margins
.page-header-xlg= 130px margins
.dark = dark page header
.light = light page header
-->
<section class="page-header dark page-header-xs parallax parallax-3" style="background-image:url('assets/images/blog-header.jpg')">
<div class="container text-center">
<h1>BLOG</h1>
<span class="font-lato fs-18 fw-300">de Global DAO</span>
<!-- breadcrumbs -->
<ol class="breadcrumb breadcrumb-center">
<li><a href="index.html">Inicio</a></li>
<li class="active">Blog</li>
</ol><!-- /breadcrumbs -->
</div>
</section>
<!-- /PAGE HEADER -->
<!-- INICIA CONTENIDO -->
<div class="container">
<div class="row">
<div class="row" id="jsonContent"></div>
</div>
<hr>
<div class="text-center">
<span class="text-center"><a href="https://medium.com/global-dao" target="_blank" class="btn btn-info btn-block">Ver todos los posts</a></span>
</div>
</div>
<!-- TERMINA CONTENIDO -->
<!-- / -->
<!-- FOOTER -->
<div w3-include-html="footer.html"></div>
<!-- /FOOTER -->
</div>
<!-- /wrapper -->
<!-- SCROLL TO TOP -->
<a href="#" id="toTop"></a>
<!-- PRELOADER -->
<div id="preloader">
<div class="inner">
<span class="loader"></span>
</div>
</div><!-- /PRELOADER -->
<!-- JAVASCRIPT FILES -->
<script>var plugin_path = 'assets/plugins/';</script>
<script src="assets/plugins/jquery/jquery-3.3.1.min.js"></script>
<script src="assets/js/scripts.js"></script>
<script>
w3.includeHTML();
</script>
<script>
$(function () {
var mediumPromise = new Promise(function (resolve) {
var $content = $('#jsonContent');
var data = {
rss: 'https://medium.com/feed/global-dao'
};
$.get('https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fmedium.com%2Ffeed%2Fglobal-dao', data, function (response) {
if (response.status == 'ok') {
$("#logo").append(`<img src="${response.feed["image"]}" class="rounded mx-auto d-block">`)
var output = '';
$.each(response.items, function (k, item) {
output += `<div class="card mb-3 mx-auto mr-5 " style="width: 20rem;">`;
var tagIndex = item.description.indexOf('<img'); // Find where the img tag starts
var srcIndex = item.description.substring(tagIndex).indexOf('src=') + tagIndex; // Find where the src attribute starts
var srcStart = srcIndex + 5; // Find where the actual image URL starts; 5 for the length of 'src="'
var srcEnd = item.description.substring(srcStart).indexOf('"') + srcStart; // Find where the URL ends
var src = item.description.substring(srcStart, srcEnd); // Extract just the URL
output += `<img src="${src}" class="card-img-top" alt="Cover image">`;
output += `<div class="card-body">`;
output += `<h5 class="card-title"><a href="${item.link}" target="_blank">${item.title}</a></h5>`;
var yourString = item.description.replace(/<img[^>]*>/g,""); //replace with your string.
yourString = yourString.replace('h4', 'p');
yourString = yourString.replace('h3', 'p');
var maxLength = 200; // maximum number of characters to extract
//trim the string to the maximum length
var trimmedString = yourString.substr(0, maxLength);
//re-trim if we are in the middle of a word
trimmedString = trimmedString.substr(0, Math.min(trimmedString.length, trimmedString.lastIndexOf(" ")))
output += `<p class="card-text">${trimmedString}...</p>`;
output += `<a href="${item.link}" target="_blank" class="btn btn-outline-info">Leer mas</a>`;
output += '</div></div>';
return k < 10;
});
resolve($content.html(output));
}
});
});
mediumPromise.then(function()
{
//Pagination
pageSize = 3;
var pageCount = $(".card").length / pageSize;
for (var i = 0; i < pageCount; i++) {
$("#pagin").append(`<li class="page-item"><a class="page-link" href="#">${(i + 1)}</a></li> `);
}
$("#pagin li:nth-child(1)").addClass("active");
showPage = function (page) {
$(".card").hide();
$(".card").each(function (n) {
if (n >= pageSize * (page - 1) && n < pageSize * page)
$(this).show();
});
}
showPage(1);
$("#pagin li").click(function () {
$("#pagin li").removeClass("active");
$(this).addClass("active");
showPage(parseInt($(this).text()))
});
});
});
</script>
</body>
</html>