-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
90 lines (80 loc) · 2.45 KB
/
main.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
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
// Adjust header margin to accommodate floating nav
document.querySelector('header').style.marginTop = `${
document.querySelector('nav').offsetHeight
}px`
// Create nav links
const navContainer = document.querySelector('#site-nav>.content')
const navItems = [
{
href: 'https://tsys.com',
text: 'TSYS'
},
{
href: 'https://developers.tsys.com',
text: 'APIs'
},
{
href: 'https://github.com/tsys',
text: 'Open Source'
},
{
href: 'https://medium.com/tsys-engineering',
text: 'Blog'
}
]
navItems.forEach((item) => {
const a = document.createElement('a')
a.href = item.href
a.target = '_blank'
a.textContent = item.text
navContainer.appendChild(a)
})
// Create cards
const cardContainer = document.querySelector('.card-container')
const cards = [
{
title: 'Issuing Essentials in North America',
body:
'Card, Account Payments, Customer, Financial Institutions, and Transaction APIs.',
link: {
href: 'https://developers.tsys.com/api/product?key=Issuing+Essentials',
text: 'Issuing Essentials'
}
},
{
title: 'Loyalty Experiences',
body:
'Rewards APIs allow customers to see the rewards they have earned through their loyalty account. These APIs also let the customer spend and redeem their rewards.',
link: {
href: 'https://developers.tsys.com/api/product?key=Loyalty+Experiences',
text: ''
}
},
{
title: 'Digital Experiences in International',
body:
'Payment, Activations, Identity Providers, Activity, Alerts and other APIs that enable world class digital experience.',
link: {
href: 'https://intl.developers.tsys.com/api/product?key=Digital+Experiences',
text: 'Digital Experiences'
}
}
]
cards.forEach((card) => {
const section = document.createElement('section')
section.classList.add('card')
const h3 = document.createElement('h3')
h3.textContent = card.title
section.appendChild(h3)
if (card.body) {
const p = document.createElement('p')
p.textContent = card.body
section.appendChild(p)
}
const a = document.createElement('a')
a.href = card.link.href
a.textContent = card.link.text || card.title
a.target = '_blank'
section.appendChild(a)
cardContainer.appendChild(section)
})