Skip to content

Commit

Permalink
code showing fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-coder committed Oct 26, 2024
1 parent 7acd72e commit d80edb5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 33 deletions.
42 changes: 9 additions & 33 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1565,64 +1565,40 @@ <h3>Thank You!</h3>

</body>

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () {
scrollFunction();
};
function scrollFunction() {
if (
document.body.scrollTop > 20 ||
document.documentElement.scrollTop > 20
) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}


// When the user clicks on the button, scroll to the top of the document
function goToTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>

<script>

window.addEventListener('scroll', function () {
const winScroll = document.body.scrollTop || document.documentElement.scrollTop;
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
const scrolled = (winScroll / height) * 100;
document.getElementById('progress-bar').style.width = scrolled + '%';
});
</script>

<script>
window.embeddedChatbotConfig = {
chatbotId: "X6k1f9B5oxQr2T4-NzVxG",
domain: "www.chatbase.co"
}
</script>
<script src="https://www.chatbase.co/embed.min.js" chatbotId="X6k1f9B5oxQr2T4-NzVxG" domain="www.chatbase.co" defer>
domain: "www.chatbase.co"
}
</script>
<script src="https://www.chatbase.co/embed.min.js" chatbotId="X6k1f9B5oxQr2T4-NzVxG" domain="www.chatbase.co" defer></script>

<script>
// Get the button
var mybutton = document.getElementById("goToTopBtn");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () {
scrollFunction();
};
};

function scrollFunction() {
if (
document.body.scrollTop > 20 ||
document.documentElement.scrollTop > 20
) {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20 ) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
}

// When the user clicks on the button, scroll to the top of the document
function goToTop() {
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "canvas-editor",
"version": "1.0.0",
"description": "<div align=\"center\">",
"main": "visi.js",
"scripts": {
"start": "node visi.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

0 comments on commit d80edb5

Please sign in to comment.