From 652fbdcc188198ac28db65b31669b8ca33a34830 Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Mon, 25 Mar 2024 19:22:09 -0500 Subject: [PATCH] new destructr script --- Applight/js/destruct.js | 181 ++- Atlas/js/destruct.js | 181 ++- Browny/assets/js/destruct.js | 181 ++- Browny/index.html | 2 +- Chain App Dev/assets/js/destruct.js | 181 ++- ConvidMedic/index.html | 2 +- ConvidMedic/js/destruct.js | 107 +- Digimedia/assets/js/destruct.js | 181 ++- Drifolio-Bootstrap-master/js/destruct.js | 107 +- Industrial/index.html | 2 +- Industrial/js/destruct.js | 181 ++- MedicalCare/js/destruct.js | 107 +- ONEPage/index.html | 582 ++++---- ONEPage/js/destruct.js | 107 +- Ogistic/index.html | 1 + Ogistic/js/destruct.js | 181 ++- Potoub/index.html | 2 +- Potoub/js/destruct.js | 181 ++- SBS/js/destruct.js | 107 +- Seo Dream/assets/js/destruct.js | 181 ++- Space Dynamic/assets/js/destruct.js | 181 ++- bootstrap-app/themes/js/destruct.js | 107 +- king-of-pasta/js/destruct.js | 107 +- lumia/index.html | 1672 +++++++++++++--------- lumia/js/destruct.js | 107 +- mabur/index.html | 2 +- mabur/js/destruct.js | 107 +- meetup/js/destruct.js | 107 +- superfresh/index.html | 808 ++++++----- superfresh/js/destruct.js | 107 +- wildflat/index.html | 6 +- wildflat/js/destruct.js | 107 +- 32 files changed, 4240 insertions(+), 1933 deletions(-) diff --git a/Applight/js/destruct.js b/Applight/js/destruct.js index d98966b..7d887cc 100644 --- a/Applight/js/destruct.js +++ b/Applight/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Atlas/js/destruct.js b/Atlas/js/destruct.js index d98966b..7d887cc 100644 --- a/Atlas/js/destruct.js +++ b/Atlas/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Browny/assets/js/destruct.js b/Browny/assets/js/destruct.js index d98966b..7d887cc 100644 --- a/Browny/assets/js/destruct.js +++ b/Browny/assets/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Browny/index.html b/Browny/index.html index ba7b828..37bb268 100644 --- a/Browny/index.html +++ b/Browny/index.html @@ -854,7 +854,7 @@
- +
diff --git a/Chain App Dev/assets/js/destruct.js b/Chain App Dev/assets/js/destruct.js index d98966b..7d887cc 100644 --- a/Chain App Dev/assets/js/destruct.js +++ b/Chain App Dev/assets/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/ConvidMedic/index.html b/ConvidMedic/index.html index 9710ead..f1760e1 100644 --- a/ConvidMedic/index.html +++ b/ConvidMedic/index.html @@ -243,7 +243,7 @@

Get Every Update....

- +
diff --git a/ConvidMedic/js/destruct.js b/ConvidMedic/js/destruct.js index c927683..7d887cc 100644 --- a/ConvidMedic/js/destruct.js +++ b/ConvidMedic/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Digimedia/assets/js/destruct.js b/Digimedia/assets/js/destruct.js index d98966b..7d887cc 100644 --- a/Digimedia/assets/js/destruct.js +++ b/Digimedia/assets/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Drifolio-Bootstrap-master/js/destruct.js b/Drifolio-Bootstrap-master/js/destruct.js index c927683..7d887cc 100644 --- a/Drifolio-Bootstrap-master/js/destruct.js +++ b/Drifolio-Bootstrap-master/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Industrial/index.html b/Industrial/index.html index 755f9a3..5f1fe19 100644 --- a/Industrial/index.html +++ b/Industrial/index.html @@ -455,9 +455,9 @@
diff --git a/Industrial/js/destruct.js b/Industrial/js/destruct.js index d98966b..7d887cc 100644 --- a/Industrial/js/destruct.js +++ b/Industrial/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/MedicalCare/js/destruct.js b/MedicalCare/js/destruct.js index c927683..7d887cc 100644 --- a/MedicalCare/js/destruct.js +++ b/MedicalCare/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/ONEPage/index.html b/ONEPage/index.html index 201c2e3..f7e4241 100644 --- a/ONEPage/index.html +++ b/ONEPage/index.html @@ -1,374 +1,332 @@ - - - - + + + Onepage - clean responsive HTML5 themes - thomsoon.com - - - - - - - - - - - + + + - + -
+ + + + + +
+ - +
+
+
+
+

+ Welcome
+ to our website +

+

Please familiarize yourself with our offer

-
- -
-
-
- -

Welcome
- to our website

-

Please familiarize yourself with our offer

- -
Read more
- +
Read more
+
+
-
-
- -
+ - - - - -
+ - + -
+
+

ABOUT US

+
+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do + eiusmod +

+
+ +
+ + + +
+ + + + + + +
  • + + Portfolio item

    PORTFOLIO 2

    -

    Your text here...

    -
    -
    -
  • +

    Your text here...

    +
    + + - - -
  • - - Portfolio item + + +
  • + + Portfolio item
    -

    PORTFOLIO 3

    -

    Your text here...

    -
    -
    -
  • +

    PORTFOLIO 3

    +

    Your text here...

    +
    + + + - - -
  • - - Portfolio item +
  • + + Portfolio item
    -

    PORTFOLIO 4

    -

    Your text here...

    -
    -
    -
  • +

    PORTFOLIO 4

    +

    Your text here...

    + + + - - -
  • - - Portfolio item + + +
  • + + Portfolio item
    -

    PORTFOLIO 5

    -

    Your text here...

    -
    -
    -
  • - +

    PORTFOLIO 5

    +

    Your text here...

    + + + - - -
  • - - Portfolio item + + +
  • + + Portfolio item
    -

    PORTFOLIO 6

    -

    Your text here...

    -
    -
    -
  • - - - -
  • - - Portfolio item +

    PORTFOLIO 6

    +

    Your text here...

    + +
    +
  • + + + +
  • + + Portfolio item
    -

    PORTFOLIO 7

    -

    Your text here...

    -
    -
    -
  • - - - -
  • - - Portfolio item +

    PORTFOLIO 7

    +

    Your text here...

    + +
    +
  • + + + +
  • + + Portfolio item
    -

    PORTFOLIO 8

    -

    Your text here...

    -
    -
    -
  • - - - -
  • - - Portfolio item +

    PORTFOLIO 8

    +

    Your text here...

    + +
    +
  • + + + +
  • + + Portfolio item
    -

    PORTFOLIO 9

    -

    Your text here...

    -
    -
    -
  • +

    PORTFOLIO 9

    +

    Your text here...

    + + + + - - - -
    Load more
    - - - - +
    Load more
    + + - -
    - - - - - +
    -
    - -
    - -
    - -

    Thanks for partners

    - - - -
    + -
    +
    +
    + +
    +

    Thanks for partners

    + + +
    +
    + + + +
    +

    Contact

    +
    - - - -
    -

    Contact

    -
    -
    -
    -
    - - - - - - - -
    - SEND -
    -
    - + + + + + + +
    + SEND +
    +
    -
    - - +
    - - To contact us please use the contact form visible

    + To contact us please use the contact form visible

    - When sending files, please use
    - the following e-mail

    + When sending files, please use
    + the following e-mail

    - Tomasz Mazurczak

    + Tomasz Mazurczak

    - e-mail: contact@thomsoon.com - + e-mail: contact@thomsoon.com
    - -
    - -
    +
    + - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/ONEPage/js/destruct.js b/ONEPage/js/destruct.js index c927683..7d887cc 100644 --- a/ONEPage/js/destruct.js +++ b/ONEPage/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Ogistic/index.html b/Ogistic/index.html index 0741186..ffc769c 100644 --- a/Ogistic/index.html +++ b/Ogistic/index.html @@ -755,6 +755,7 @@
    lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Potoub/index.html b/Potoub/index.html index efebf9c..7e47348 100644 --- a/Potoub/index.html +++ b/Potoub/index.html @@ -265,7 +265,7 @@
    - +
    diff --git a/Potoub/js/destruct.js b/Potoub/js/destruct.js index d98966b..7d887cc 100644 --- a/Potoub/js/destruct.js +++ b/Potoub/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/SBS/js/destruct.js b/SBS/js/destruct.js index c927683..7d887cc 100644 --- a/SBS/js/destruct.js +++ b/SBS/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Seo Dream/assets/js/destruct.js b/Seo Dream/assets/js/destruct.js index d98966b..7d887cc 100644 --- a/Seo Dream/assets/js/destruct.js +++ b/Seo Dream/assets/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/Space Dynamic/assets/js/destruct.js b/Space Dynamic/assets/js/destruct.js index d98966b..7d887cc 100644 --- a/Space Dynamic/assets/js/destruct.js +++ b/Space Dynamic/assets/js/destruct.js @@ -1,47 +1,134 @@ -let lastScrollTop = 0; - -window.addEventListener( - "scroll", - function () { - let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); - - if (st > lastScrollTop) { - // downscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(-1)"; - } - } else { - // upscroll - for (let i = 0; i < elements.length; i++) { - elements[i].style.transform = "scaleX(1)"; - } - } - lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling - }, - false -); - -// Define the CSS for the melting animation -var style = document.createElement('style'); -style.innerHTML = ` - @keyframes melt { - 0% { transform: translateY(0); } - 100% { transform: translateY(100px); opacity: 0; } - } - .melting { - animation: melt 2s linear forwards; - } -`; -document.head.appendChild(style); - -// Function to add 'melting' class to all text nodes -function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); - }); -} - -// Add event listener to the page -document.addEventListener('click', meltText); +//--------------Flip the img tags when scrolling --------------------// + +let lastScrollTop = 0; + +window.addEventListener( + "scroll", + function () { + let st = window.pageYOffset || document.documentElement.scrollTop; + let elements = document.body.getElementsByTagName("img"); + + if (st > lastScrollTop) { + // downscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(-1)"; + } + } else { + // upscroll + for (let i = 0; i < elements.length; i++) { + elements[i].style.transform = "scaleX(1)"; + } + } + lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling + }, + false +); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); +style.innerHTML = ` + @keyframes melt { + 0% { transform: translateY(0); } + 100% { transform: translateY(100px); opacity: 0; } + } + .melting { + animation: melt 2s linear forwards; + } +`; +document.head.appendChild(style); + +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type +function meltText() { + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); + }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } +} + +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/bootstrap-app/themes/js/destruct.js b/bootstrap-app/themes/js/destruct.js index c927683..7d887cc 100644 --- a/bootstrap-app/themes/js/destruct.js +++ b/bootstrap-app/themes/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/king-of-pasta/js/destruct.js b/king-of-pasta/js/destruct.js index c927683..7d887cc 100644 --- a/king-of-pasta/js/destruct.js +++ b/king-of-pasta/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/lumia/index.html b/lumia/index.html index 00fff25..fcc1c4d 100644 --- a/lumia/index.html +++ b/lumia/index.html @@ -1,643 +1,940 @@ - + - - - - -Lumia - Multipurpose Bootstrap Template - - - - - - - + + + + + Lumia - Multipurpose Bootstrap Template + + + + + + + - - + + - + - - - - - - - + + + + + + + - + - - - - - -
    -
    -
    - - -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -

    Bootstrap & Multipurpose!

    -

    Lumia Most Amazing Theme - That Ever Made

    -

    Accusantium quam, aliquam ultricies eget tempor id, aliquam eget nibh et. Maecen aliquam, risus at semper. Proin iaculis purus consequat sem cure digni ssim. Donec porttitora entum. - Proin iaculis purus consequat sem cure digni ssim. Donec porttitora entum.Proin iaculis purus consequat sem cure digni ssim. Donec porttitora entum. -

    - Learn more
    + $(document).ready(function () { + $(window).bind("scroll", function () { + if ($(window).scrollTop() > 0) { + $("#header_outer").addClass("fixed"); + } else { + $("#header_outer").removeClass("fixed"); + } + }); + }); + }); + function resizeText() { + var preferredWidth = 767; + var displayWidth = window.innerWidth; + var percentage = displayWidth / preferredWidth; + var fontsizetitle = 25; + var newFontSizeTitle = Math.floor(fontsizetitle * percentage); + $(".divclass").css("font-size", newFontSizeTitle); + } + + + + +
    +
    +
    + -
    -
    - -
    -
    + +
    -
    -
    -
    - + + - -
    -
    -

    Services

    -
    -
    -
    -
    -
    -

    Well Documented

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -

    Friendly Support

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -

    Launch Ready

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -
    -
    -

    Fully Responsive

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -

    Retina Ready

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -

    HTML5+CSS3

    -

    Proin iaculis purus consequat sem cure digni. Donec porttitora entum suscipit aenean rhoncus posuere odio in tincidunt.

    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -

    Latest Work

    -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -

    Project One

    -

    Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem.

    -
    + +
    +
    +
    +
    +
    +
    +
    +

    Bootstrap & Multipurpose!

    +

    Lumia Most Amazing Theme That Ever Made

    +

    + Accusantium quam, aliquam ultricies eget tempor id, aliquam + eget nibh et. Maecen aliquam, risus at semper. Proin iaculis + purus consequat sem cure digni ssim. Donec porttitora entum. + Proin iaculis purus consequat sem cure digni ssim. Donec + porttitora entum.Proin iaculis purus consequat sem cure + digni ssim. Donec porttitora entum. +

    + Learn more
    -
    -
    -
    -
    -
    - -
    - -
    -
    -

    Project Two

    -

    Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem.

    -
    +
    +
    +
    +
    +
    -
    -
    -
    -
    - -
    - -
    -
    -

    Project Three

    -

    Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem.

    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -

    Project Four

    -

    Donec id elit non mi porta gravida at eget metus. Fusce dapibus, justo sit amet risus etiam porta sem.

    -
    -
    -
    - -
    -
    -
    - -
    -
    - - - - - -
    - - -
    - - -
    -

    Portfolio

    -
    - - -
    - - -
    - - -
    - - - - - - -
    - - - - - - -
    -
    Portfolio 1
    -
    - -
    - -

    Foto Template

    -

    Design

    -
    -
    -
    - - - -
    -
    Portfolio 1
    -
    - -
    - -

    Sony Phone

    -

    Design

    -
    -
    -
    - - - -
    -
    Portfolio 1
    -
    - -
    - -

    Nike Shoes

    -

    Photography, Web, Branding

    -
    -
    -
    - - - -
    -
    Portfolio 1
    -
    - -
    - -

    Vinyl Record

    -

    Design

    -
    -
    -
    - - - -
    -
    Portfolio 1
    -
    - -
    - -

    iPhone

    -

    Web

    -
    -
    -
    - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    - - -
    - - - - -
    -

    Happy Clients

    -
    -
    -
    -
    -

    John Doe

    - Google Inc
    -
    -
    -

    Proin iaculis purus consequat sem cure digni ssim donec porttitora entum suscipit rhoncus. Accusantium quam, ultricies eget id, aliquam eget nibh et. Maecen aliquam, risus at semper.

    -
    -
    -
    -
    -
    -
    -

    Marie Gomez

    - BFA Foundation
    -
    -
    -

    Proin iaculis purus consequat sem cure digni ssim donec porttitora entum suscipit rhoncus. Accusantium quam, ultricies eget id, aliquam eget nibh et. Maecen aliquam, risus at semper.

    -
    -
    -
    -
    -
    - - -
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    -
    - -
    -
    -

    Amazing Team

    -
    Take a closer look into our amazing team. We won’t bite.
    -
    -
    -
    -
    - -
      -
    • -
    • -
    • -
    • -
    -
    -

    John Doe

    - Chief Executive Officer -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin consequat sollicitudin cursus. Dolor sit amet, consectetur adipiscing elit proin consequat.

    -
    -
    -
    -
    - -
      -
    • -
    • -
    • -
    • -
    -
    -

    Jesse Robert

    - Chief Operating Officer -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin consequat sollicitudin cursus. Dolor sit amet, consectetur adipiscing elit proin consequat.

    -
    -
    -
    -
    - -
      -
    • -
    • -
    • -
    • -
    -
    -

    Jane white

    - CMO -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin consequat sollicitudin cursus. Dolor sit amet, consectetur adipiscing elit proin consequat.

    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -

    Contact Us

    -
    -
    -
    -
    - 325 USA,
    - NewYork, US, 57204
    -
    -
    -
    -
    - 500-800-600-NOP
    -
    - -
    -
    -
    -
    -
    -

    Don’t be hesitate. Say hello!

    -

    Accusantium quam, aliquam ultricies eget tempor id, aliquam eget nibh et. Maecen aliquam, risus at semper. Accusantium quam, aliquam ultricies eget tempor id, aliquam eget nibh et. Maecen aliquam, risus at semper.

    -

    Accusantium quam, aliquam ultricies eget tempor id, aliquam eget nibh et. Maecen aliquampor id.

    -
    - -
    -
    -
    - - - -
    -
    -
    - -
    -
    - - - + + + event.preventDefault(); + }); + }); + - +--> - - - \ No newline at end of file + if (winWidth > 1024) { + columnNumb = 4; + } else if (winWidth > 900) { + columnNumb = 2; + } else if (winWidth > 479) { + columnNumb = 2; + } else if (winWidth < 479) { + columnNumb = 1; + } + + return columnNumb; + } + + function setColumns() { + var winWidth = $(window).width(), + columnNumb = splitColumns(), + postWidth = Math.floor(winWidth / columnNumb); + + container.find(".portfolio-item").each(function () { + $(this).css({ + width: postWidth + "px", + }); + }); + } + + function setProjects() { + setColumns(); + container.isotope("reLayout"); + } + + container.imagesLoaded(function () { + setColumns(); + }); + + $(window).bind("resize", function () { + setProjects(); + }); + }); + $(window).load(function () { + jQuery("#all").click(); + return false; + }); + + + diff --git a/lumia/js/destruct.js b/lumia/js/destruct.js index c927683..7d887cc 100644 --- a/lumia/js/destruct.js +++ b/lumia/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/mabur/index.html b/mabur/index.html index b551fee..5080089 100644 --- a/mabur/index.html +++ b/mabur/index.html @@ -457,7 +457,7 @@ License URL: http://creativecommons.org/licenses/by/3.0/
    - +

    diff --git a/mabur/js/destruct.js b/mabur/js/destruct.js index c927683..7d887cc 100644 --- a/mabur/js/destruct.js +++ b/mabur/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/meetup/js/destruct.js b/meetup/js/destruct.js index c927683..7d887cc 100644 --- a/meetup/js/destruct.js +++ b/meetup/js/destruct.js @@ -1,10 +1,12 @@ +//--------------Flip the img tags when scrolling --------------------// + let lastScrollTop = 0; window.addEventListener( "scroll", function () { let st = window.pageYOffset || document.documentElement.scrollTop; - let elements = document.body.getElementsByTagName("*"); + let elements = document.body.getElementsByTagName("img"); if (st > lastScrollTop) { // downscroll @@ -21,9 +23,8 @@ window.addEventListener( }, false ); - -// Define the CSS for the melting animation -var style = document.createElement('style'); +//-------------------------------------------// Define the CSS for the melting animation +var style = document.createElement("style"); style.innerHTML = ` @keyframes melt { 0% { transform: translateY(0); } @@ -35,13 +36,99 @@ style.innerHTML = ` `; document.head.appendChild(style); -// Function to add 'melting' class to all text nodes +// Initialize an array of text element types (tags) to rotate +var textElementTypes = [ + "p", + "h1", + "li", + "h2", + "span", + "img", + "h3", + "a", + "h4", + "div", + "h5", + "h6", +]; + +// Initialize a variable to keep track of the current text element type +var currentElementType = 0; + +// Initialize a variable to keep track of the click count +var clickCountMelt = 0; + +// Function to add 'melting' class to the specified text element type function meltText() { - var elements = document.querySelectorAll('p, h1, h2, h3, h4, h5, h6, li, a, span'); // Add more selectors as needed - elements.forEach(function(element) { - element.classList.add('melting'); + var elements = document.querySelectorAll( + textElementTypes[currentElementType] + ); + elements.forEach(function (element) { + element.classList.add("melting"); }); + + // Increment the click count + clickCountMelt++; + + // Check if every 3rd click + if (clickCountMelt % 3 === 0) { + // Remove 'melting' class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + } else { + // Increment the currentElementType and wrap around if needed + currentElementType = (currentElementType + 1) % textElementTypes.length; + } } -// Add event listener to the page -document.addEventListener('click', meltText); +// Add an event listener to the entire document +document.addEventListener("click", meltText); + +//--------------------------------------------Load something on 7th click-----------// +// Initialize a counter for the number of clicks +let clickCountReload = 0; +// Define the maximum number of clicks required +const maxClicksReload = 5; +// Define the predefined link to load +const predefinedLink = "#"; +// Function to handle the click event +function handleButtonClick() { + clickCountReload++; + // Check if the required number of clicks is reached + if (clickCountReload >= maxClicksReload) { + // Load the predefined link + window.location.href = predefinedLink; + // Remove the melting class from all elements + elements.forEach(function (element) { + element.classList.remove("melting"); + }); + // Reset the counter + clickCountReload = 0; + } +} +// Add an event listener to the entire document +document.addEventListener("click", handleButtonClick); +//----------------------------------------Changing Place holder texts ---------// +// Function to check if the user has scrolled to the bottom +function isScrolledToBottom() { + const windowHeight = window.innerHeight; + const documentHeight = document.documentElement.scrollHeight; + const scrollPosition = window.scrollY; + + // Consider a small buffer (e.g., 10 pixels) to account for minor discrepancies + return scrollPosition + windowHeight >= documentHeight - 10; +} + +// Function to replace the placeholder value of a textarea +function replacePlaceholderOnScroll() { + const textarea = document.getElementById("message"); + const placeholderText = "Please help me. This is not fun."; + + if (isScrolledToBottom()) { + textarea.placeholder = placeholderText; + } +} + +// Add an event listener to the window's scroll event +window.addEventListener("scroll", replacePlaceholderOnScroll); diff --git a/superfresh/index.html b/superfresh/index.html index aad5b3c..2abcb88 100644 --- a/superfresh/index.html +++ b/superfresh/index.html @@ -1,349 +1,493 @@ - - -Superfresh Bootstrap Template - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -

    welcome to

    -

    Superfresh Design Studio

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    - GET STARTED
    -
    -
    -
    - -
    -
    -
    -
    -

    Here's How we work.

    -
    -
    -

    Research.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    -
    -
    -

    Design.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    -
    -
    -

    Coding.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -

    The Superfresh Story

    -
    -
    about img
    -
    -

    ABOUT US

    -

    talented Designers & Developers.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet. Dolore magna aliquam erat volutpat.

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -

    Behind the Design Studio.

    -
    -
    team img -

    James Smith

    -

    Creative Director

    -
    -
    team img -

    Jonny Doe

    -

    CEO / CO-Founder

    -
    -
    team img -

    Jonathan Ive

    -

    Chief Design Office

    -
    -
    team img -

    Mary Lane

    -

    UX Designer

    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -

    Works. Portfolio

    + + + Superfresh Bootstrap Template + + + + + + + + + + + + + + + + +