-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathabout.js
62 lines (49 loc) · 1.41 KB
/
about.js
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
var ejs = require('ejs');
var Logo = require('logo-wavepot');
var modal = require('modal');
var utils = require('./utils');
var createElement = utils.createElement;
var tmpl = {
about: require('./about.html')
};
var about = module.exports = {};
about.show = show;
about.active = null;
function show(){
if (about.active) return;
// var fund = require('./fund');
// if (fund.active) {
// fund.modal.once('hide', about.show.bind(about));
// fund.modal.hide();
// return;
// }
about.active = true;
var el = createElement('about', 'modal');
el.innerHTML = tmpl.about;
var logo = new Logo(0.5);
logo.svg.setAttribute('width', '310px');
logo.svg.setAttribute('height', '210px');
logo.svg.setAttribute('viewBox', '0 0 60 50');
logo.svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
logo.pot.setAttribute('stroke-width', 2.75);
logo.pot.setAttribute('stroke-linecap', 'butt');
logo.wave.setAttribute('stroke-width', 2.75);
logo.wave.setAttribute('stroke-linecap', 'butt');
query('.about-logo').appendChild(logo.el);
// query('a.fundraiser').onclick = function(ev){
// ev.preventDefault();
// fund.show('milestone I');
// return false;
// };
about.modal = modal(el)
.overlay()
.closeable()
.effect('fade-and-scale')
.show()
.on('hide', function(){
about.active = null;
});
function query(sel){
return el.querySelector(sel);
}
}