-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
77 lines (60 loc) · 1.95 KB
/
main.js
File metadata and controls
77 lines (60 loc) · 1.95 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
//javaing on my script
function $(id){
return document.getElementById(id)
}
var randomText = $("random")
var randomTitleArray = [
"I will confiscate your opinion do not test me",
"Dictator Removal Specialist",
"Tactical Breach Hamster",
"He loves his mom",
"Professional Boat Rocker",
"Expert Procrastinator",
"Not a crypto bro",
"very cool",
"respectfully yours!",
"Rocket Launcher Enthuasiast",
"Script Kiddy!",
"The very model of a modern major general!",
"Never gonna give you up!",
"Now in 3-D!",
"The cake is a lie",
"insert funny quip here",
"you just lost The Game"
]
//images are stored like this ["imagepath", "caption"]
var slideShowImages = [
["graphics/Screenshot 2025-12-04 181352.png", "The splash screen of my upcoming game."],
["./graphics/20241020192400_1.jpg", "Taken in Garry's Mod"],
["graphics/iteration_zero.png", "Experimenting with shader nodes in blender"],
["graphics/unityImage.png", "Foiliage and grass experiments in Unity"],
["graphics/metroidvania thumbnail.jpg", "Abandoned metroidvania project"],
["graphics/prototypedesertgame.png", "Prototype psychic FPS game"]
]
var random = getRandomIntInclusive(0, randomTitleArray.length-1)
console.log(randomTitleArray[random])
randomText.textContent = randomTitleArray[random]
function getRandomIntInclusive(min, max) {
min = Math.ceil(min); // Ensure min is an integer
max = Math.floor(max); // Ensure max is an integer
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var currentSlide = 0;
function changeSlide(n){
var img = $("slideshow");
if (currentSlide + n > slideShowImages.length-1)
{
currentSlide = 0;
}
else if(currentSlide + n < 0){
currentSlide = slideShowImages.length-1;
}
else{
currentSlide += n;
}
console.log(currentSlide)
img.src = slideShowImages[currentSlide][0]
$("caption").textContent = slideShowImages[currentSlide][1]
}
changeSlide(0)
//CRT