moves scripts to dedicated folder
This commit is contained in:
parent
ce606023e2
commit
a0d02e87c4
5 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,8 @@ body{
|
|||
color: #ffd256;
|
||||
font-family: "roboto";
|
||||
background-color: #181818;
|
||||
|
||||
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
h1{
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
setTimeout(() => {
|
||||
if (window.scrollY < 20)
|
||||
window.scrollBy({top: window.innerHeight - 70, left: 0, behavior: 'smooth'})
|
||||
}, 1800); // we scroll the screen down a bit so the user realises theres more
|
|
@ -1,34 +0,0 @@
|
|||
var currentSlide = 0;
|
||||
var allSlides = document.querySelectorAll(".programGallery");
|
||||
|
||||
|
||||
window.nextSlide = function nextSlide(){
|
||||
currentSlide++;
|
||||
updateSlide();
|
||||
}
|
||||
|
||||
window.lastSlide = function lastSlide(){
|
||||
currentSlide--;
|
||||
updateSlide();
|
||||
}
|
||||
|
||||
function updateSlide(){
|
||||
if (currentSlide > allSlides.length-1){
|
||||
currentSlide = 0;
|
||||
} else if (currentSlide < 0){
|
||||
currentSlide = allSlides.length-1;
|
||||
}
|
||||
|
||||
hideAll();
|
||||
allSlides[currentSlide].style.display = "grid";
|
||||
|
||||
}
|
||||
|
||||
function hideAll(){
|
||||
for (var i = 0; i < allSlides.length; i++){
|
||||
allSlides[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
hideAll()
|
||||
updateSlide();
|
|
@ -1,31 +0,0 @@
|
|||
//taken and reworked from here https://www.labnol.org/visitor-country-ip-address-200822
|
||||
//original code by Amit Agarwal
|
||||
//this is here due to the fact that I'm know by different names online and in the real world,
|
||||
//however it was removed because the ip2c server wasnt accurate enough
|
||||
|
||||
|
||||
const checkCountry = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
window
|
||||
.fetch("https://ip2c.org/self")
|
||||
.then((data) => data.text())
|
||||
.then((data) => {
|
||||
const [status, country] = String(data).split(";");
|
||||
if (status !== "1") {
|
||||
console.log("Unable to fetch country, defaulting to normal title");
|
||||
}
|
||||
|
||||
if (country != "UK"){
|
||||
document.title = "Rosia E Evans Portfolio"
|
||||
document.getElementById("siteTitle").innerHTML = "Rosia E Evans"
|
||||
document.getElementById("profileImage").src = "images/Profile3.png"
|
||||
}else{
|
||||
document.title = "Nye Evans Portfolio"
|
||||
document.getElementById("siteTitle").innerHTML = "Nye Evans"
|
||||
document.getElementById("profileImage").src = "images/Profile2.png"
|
||||
}
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
checkCountry();
|
Loading…
Add table
Add a link
Reference in a new issue