mirror of
https://github.com/hexahigh/cdn.git
synced 2025-12-11 20:15:22 +01:00
update ajax.js
This commit is contained in:
parent
866a986e99
commit
817571fff0
21
js/ajax.js
21
js/ajax.js
@ -1,8 +1,11 @@
|
||||
/* This is a simple javascript library that i made.
|
||||
It needs jquery to function.
|
||||
The ip grabber does not store the users ip anywhere.
|
||||
The ip grabber does not store the users ip.
|
||||
*/
|
||||
|
||||
//##Options##
|
||||
//Enable automatic responsive website (beta)
|
||||
//Put this in a javascript file: var resppage = true/false
|
||||
|
||||
// Set delay to ms
|
||||
function delay(milliseconds){
|
||||
@ -11,6 +14,9 @@ function delay(milliseconds){
|
||||
});
|
||||
}
|
||||
|
||||
//Get the current year and store it in a variable
|
||||
var year = new Date().getFullYear();
|
||||
|
||||
// Get the userip and store it in a variable
|
||||
$.getJSON("https://europe-central2-portfolio-website-374313.cloudfunctions.net/getip", function(data) {
|
||||
})
|
||||
@ -22,3 +28,16 @@ window.onload = async function startdown(){
|
||||
fetch('https://t0m0t0w.github.io/favicon.png', {cache: "no-store"})
|
||||
}
|
||||
}
|
||||
|
||||
// Get the width of the screen
|
||||
var screenWidth = window.innerWidth;
|
||||
|
||||
// Get all elements with the class "responsive"
|
||||
var responsiveElements = document.getElementsByClassName("responsive");
|
||||
|
||||
// Loop through all responsive elements and adjust their width
|
||||
if(resppage = true){
|
||||
for (var i = 0; i < responsiveElements.length; i++) {
|
||||
responsiveElements[i].style.width = (screenWidth / responsiveElements.length) + "px";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user