-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.html
61 lines (59 loc) · 2.68 KB
/
index.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
---
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>bullshit job titles generator</title>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#1393d5">
<link rel="shortcut icon" href="https://bullg.it/media/pixels/favicon.png" type="image/x-icon">
<link rel="icon" href="https://bullg.it/media/pixels/favicon.png" type="image/x-icon">
<meta name="description" content="the shittiest job titles you'll ever see">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="bullshit job titles generator">
<meta property="og:description" content="the shittiest job titles you'll ever see">
<meta property="og:url" content="http://bullg.it">
<meta property="og:site_name" content="bullgit">
<meta property="og:image" content="https://bullg.it/media/pixels/bullgit-logo.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@bullgit">
<meta property="twitter:title" content="bullshit job titles generator">
<meta property="twitter:description" content="the shittiest job titles you'll ever see">
<meta property="twitter:url" content="http://bullg.it">
<meta property="twitter:image" content="https://bullg.it/media/pixels/bullgit-logo.png">
<link rel="stylesheet" href="style.css">
</head>
<body>
<button id="generator" class="button">Generate new</button>
<p id="newtitle"></p>
<a href="" id="share-link">share this one!</a>
<script language="javascript">
const data = {% include_relative bullshit-job-titles.json %};
function generate() {
const titles = data;
index1 = Math.floor(Math.random() * titles.first.length);
index2 = Math.floor(Math.random() * titles.last.length);
const jobtitle = `${titles.first[index1]} ${titles.last[index2]}`;
const matches = jobtitle.match(/\b(\w)/g);
const jobacronym = matches.join('');
const title = `${jobtitle} (${jobacronym})`;
document.getElementById("newtitle").innerHTML = title;
document.getElementById("share-link").href = `#${title.replace(/ /g, '-')}`;
}
document.getElementById('generator').addEventListener('click', generate);
document.addEventListener('DOMContentLoaded', () => {
const title = location.hash.substring(1).replace(/-/g, ' ');
if (title) {
document.getElementById("newtitle").innerHTML = title;
} else {
generate();
}
});
</script>
<!-- It needs a badge -->
<script src="https://bullg.it/badge/badge.js"></script>
</body>
</html>