-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
100 lines (94 loc) · 3.1 KB
/
Copy pathscript.js
File metadata and controls
100 lines (94 loc) · 3.1 KB
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
// Star Trek TNG Quotes
const tngQuotes = [
{
text: "Make it so.",
author: "Captain Jean-Luc Picard"
},
{
text: "Engage!",
author: "Captain Jean-Luc Picard"
},
{
text: "Things are only impossible until they're not.",
author: "Captain Jean-Luc Picard"
},
{
text: "It is possible to commit no mistakes and still lose. That is not a weakness; that is life.",
author: "Captain Jean-Luc Picard"
},
{
text: "Resistance is futile.",
author: "The Borg"
},
{
text: "I am Locutus of Borg. You will respond to my questions.",
author: "Locutus of Borg"
},
{
text: "Data, there are still many human emotions I don't understand.",
author: "Geordi La Forge"
},
{
text: "In all trust, there is the possibility for betrayal.",
author: "Data"
},
{
text: "Perhaps today is a good day to die! Prepare for ramming speed!",
author: "Lieutenant Worf"
},
{
text: "I am NOT a merry man!",
author: "Lieutenant Worf"
},
{
text: "Computer, tea. Earl Grey. Hot.",
author: "Captain Jean-Luc Picard"
},
{
text: "The line must be drawn here! This far, no further!",
author: "Captain Jean-Luc Picard"
}
];
// Meme URLs (using popular meme templates from imgflip)
const memeUrls = [
"https://i.imgflip.com/1bij.jpg", // Success Kid
"https://i.imgflip.com/2cp1.jpg", // Bad Luck Brian
"https://i.imgflip.com/26am.jpg", // Drake Pointing
"https://i.imgflip.com/30b1gx.jpg", // Drake No/Yes
"https://i.imgflip.com/1g8my4.jpg", // Distracted Boyfriend
"https://i.imgflip.com/61kn.jpg", // Disaster Girl
"https://i.imgflip.com/1yhz.jpg", // Expanding Brain
"https://i.imgflip.com/9ehk.jpg", // Philosoraptor
"https://i.imgflip.com/16iyn1.jpg", // Roll Safe
"https://i.imgflip.com/5c7lwq.jpg", // Bernie Sanders
"https://i.imgflip.com/t9h6f.jpg", // Two Buttons
"https://i.imgflip.com/1ur9b0.jpg" // Surprised Pikachu
];
function getRandomItem(array) {
return array[Math.floor(Math.random() * array.length)];
}
function loadNewMeme() {
const memeImage = document.getElementById('meme-image');
const randomMemeUrl = getRandomItem(memeUrls);
memeImage.src = randomMemeUrl;
}
function loadNewQuote() {
const quote = getRandomItem(tngQuotes);
document.getElementById('quote-text').textContent = `"${quote.text}"`;
document.getElementById('quote-author').textContent = `— ${quote.author}`;
}
// Load initial content when page loads
document.addEventListener('DOMContentLoaded', function() {
loadNewMeme();
loadNewQuote();
// Load version from package.json if available
fetch('./package.json')
.then(response => response.json())
.then(data => {
document.getElementById('version').textContent = data.version || '1.0.0';
})
.catch(() => {
// If package.json doesn't exist, keep default version
console.log('No package.json found, using default version');
});
});