This repository has been archived by the owner on Oct 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
group_sticker.html
113 lines (105 loc) · 3.8 KB
/
group_sticker.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
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="local.js"></script>
<script src="api_key.js"></script>
<script id="config" type="text/javascript" charset="utf-8">
var $parameters = {
urlname: "nystartrek",
width: 300,
label: "I SUPPORT",
_height: 300,
_name: "Meetup Mini Badge",
_description: "Simple badge to show support for a Meetup group."
};
var $queries = {
groups: function() {
return mup_widget.api_call("/groups", {group_urlname: $parameters.urlname});
}
};
</script>
<link rel="stylesheet" type="text/css" href="http://static2.meetupstatic.com/style/widget.css">
<script type="text/javascript" charset="utf-8">
mup_widget.with_jquery(function($, ctx) {
var group = '',
addLink = function( content, link ) {
return '<a href="' + link + '">' + content + '</a>';
},
addImage = function( imagesrc, alt, height) {
if (imagesrc == "" ) {
return '';
} else {
return '<img src="'+imagesrc+'" height="'+height+'" alt="'+alt+'" class="mup-img"/>';
}
};
var w = $parameters.width; //width
var h = parseInt(w / 1.5); //height
var r = parseInt(w / 20); //radius
var bm = parseInt(h / 7); //bottom margin
var tm = parseInt(bm * 2); //top margin
var sm = parseInt(w * .015); //side margin
var fh = h - bm - tm; //front height
var fw = w - sm - sm; //front width
var fs = parseInt(h / 10); //font size
var lp = parseInt( (tm/2) - (fs/2) ); //label padding
$.getJSON($queries.groups(), function(data) {
if (data.results.length == 0) {
$('.mug-badge2', ctx).width($parameters.width);
$('.mug-badge2', ctx).append(
'<div class="mup-widget error">\
<div class="errorMsg">Oops. No results for "' + $parameters.urlname + '"</div>\
</div>');
}
else {
group = data.results[0];
$('.mug-badge2', ctx).width($parameters.width);
$('.mug-badge2', ctx).append('\
<div style="height: '+h+'px; width:'+w+'px; border-radius: '+r+'px; -moz-border-radius: '+r+'px; -webkit-border-radius: '+r+'px; background: #CC0000; background-color: #CC0000; text-align: center;">\
<div style="padding-top: '+lp+'px; font-size: '+fs+'px; font-weight: bold;color: #FFF;">\
'+$parameters.label+'\
</div>\
<div class="mup-front" style="text-align:left;height:'+fh+'px;width:'+fw+'px;top:'+tm+'px;left:'+sm+'px;">\
'+addImage(group.photo_url,group.name,fh)+'\
</div>\
</div>\
');
}
});
});
</script>
<style type="text/css" media="screen">
.mug-badge2 {
font-family: "lucida grande", lucida, tahoma, helvetica, arial, sans-serif !important;
font-size: 12px;
}
.mug-badge2 .mup-front {
background:#FFF;
background-color:#FFF;
position: absolute;
}
.mug-badge2 .mup-widget,
.mug-badge2 .mup-widget {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding-top: 8px;
}
.mug-badge2 .mup-widget .mup-bd {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding: 8px 6px;
margin: 0 8px;
background: #CC0000;
height:50px;
width:100px;
}
.mug-badge .mup-widget .mup-img {
border-radius: 1px;
}
</style>
</head>
<body>
<div class="mug-badge2"></div>
</body>
</html>