From 304ccaf427118f3ea5f4d2c9a381eb4b3be54b83 Mon Sep 17 00:00:00 2001 From: PythonScratcher <81612672+PythonScratcher@users.noreply.github.com> Date: Mon, 1 Jan 2024 22:36:45 +0000 Subject: [PATCH] Add files via upload --- README.md | 2 +- adblocktest.js | 55 +++++++++++++++ index.html | 177 +++++++++++++++++++++++-------------------------- script.js | 57 ++++++++++++++++ style.css | 102 ++++++++++++++++++++++++++-- 5 files changed, 295 insertions(+), 98 deletions(-) create mode 100644 adblocktest.js create mode 100644 script.js diff --git a/README.md b/README.md index e7d0db9..0e8956f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Banana Web Store -This is the Banana Web Store page, built with vanilla HTML, CSS, and JS. It's mostly a single-page site, using JS to show, hide, and replace components as needed. that's done to improve speed. The production version is at https://thebananastore.xyz. +This is the Banana Web Store page, built with vanilla HTML, CSS, and JS. It's mostly a single-page site, using JS to show, hide, and replace components as needed. that's done to improve speed. The production version is at https://thebananastore.cf. # Stuff used > W3.CSS, a quality alternative to bootstrap that makes my job a whole lot easier diff --git a/adblocktest.js b/adblocktest.js new file mode 100644 index 0000000..0385072 --- /dev/null +++ b/adblocktest.js @@ -0,0 +1,55 @@ +function setCookie(cname, cvalue, exdays) { + const d = new Date(); + d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); + let expires = "expires="+d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; +} + +function getCookie(cname) { + let name = cname + "="; + let ca = document.cookie.split(';'); + for(let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) == ' ') { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ""; +} + +document.addEventListener('DOMContentLoaded', init, false); + +function init(){ + adsBlocked(function(blocked){ + if(blocked){ + if (getCookie("sawnotice") == ""){ + //alert("Hi there! We noticed you're using an adblocker. That's fine with us (many of us use them too!) but just this once, we're asking you nicely, if you're fine, to disable your adblocker on this page. We're not making money off of this, it's because many of our image sources use sites that also host ads. We have none of that here, but your adblock takes no chances. So if you could turn off your adblock, just for this page, we can focus on improving the Banana Store instead of telling users the exact stuff you're reading. If you don't, that's OK! We'll keep helping you! Be warned, the images may be wonky at times...") + setCookie("sawnotice", "yep", 9999) + } + } + }) +} + +function adsBlocked(callback){ + var testURL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js' + + var myInit = { + method: 'HEAD', + mode: 'no-cors' + }; + + var myRequest = new Request(testURL, myInit); + + fetch(myRequest).then(function(response) { + return response; + }).then(function(response) { + console.log(response); + callback(false) + }).catch(function(e){ + console.log(e) + callback(true) + }); +} \ No newline at end of file diff --git a/index.html b/index.html index b487ea5..118535a 100644 --- a/index.html +++ b/index.html @@ -1,103 +1,94 @@ - - My page - - - - - - - - - - - - -
- - +
+
+ + +
BANANAWEBSTORE
+ +
+ +
+ + + + +
+
+ + + +
+
+
1 / 3
+ Gimp Logo +
+
+ +
+
2 / 3
+ LineRider Logo +
+
+ +
+
3 / 3
+ MCPI++ Logo +
+
+
+ +
+

FEATURED

+ A curated list of our best apps. If you're new to the store, start here. +
+ + diff --git a/script.js b/script.js new file mode 100644 index 0000000..a39ea14 --- /dev/null +++ b/script.js @@ -0,0 +1,57 @@ +const Slideshow = document.getElementById("Slideshow") + +function setImageWidth() { + Slideshow.setAttribute("width", window.innerWidth) + Slideshow.setAttribute("height", window.innerHeight - 40) +} + +//setInterval(setImageWidth, 1) + +const MenuButton = document.getElementById("menuNav"); +const Sidebar = document.getElementById("sidebar"); + +var SidebarOpen = false; + +function OpenSidebar() { + gsap.to("#sidebar", {duration: 0.5, x: 0, ease: "sine.out"}); +}; + +function CloseSidebar() { + gsap.to("#sidebar", {duration: 0.5, x: -200, ease: "sine.out"}); +}; + +function ToggleSidebar() { + if (SidebarOpen == true) { + SidebarOpen = false; + } else { + SidebarOpen = true + } + + if (SidebarOpen == true) { + OpenSidebar(); + } else { + CloseSidebar() + } +}; + +MenuButton.addEventListener("click", ToggleSidebar) + +// Slideshow code, moved from the index.html file + +let slideIndex = 0; +showSlides(); + +function showSlides() { + let i; + let slides = document.getElementsByClassName("mySlides"); + for (i = 0; i < slides.length; i++) { + slides[i].style.display = "none"; + } + slideIndex++; + if (slideIndex > slides.length) {slideIndex = 1} + slides[slideIndex-1].style.display = "block"; + setTimeout(showSlides, 8000); // Change image every 8 seconds +} + function myFunction(x) { + x.classList.toggle("change"); +} diff --git a/style.css b/style.css index 6908a7b..180e45a 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,98 @@ -body { - background-color: #1a1a1a; - margin: 0rem; -} +/* moved most of this from the index.html file */ + +* {box-sizing: border-box;} + body {font-family: Verdana, sans-serif;} + .mySlides {display: none;} + img {vertical-align: middle;} + + /* Slideshow container */ + .slideshow-container { + max-width: 1000px; + position: relative; + margin: auto; + } + + /* Caption text */ + .text { + color: #f2f2f2; + font-size: 15px; + padding: 8px 12px; + position: absolute; + bottom: 8px; + width: 100%; + text-align: center; + } + + /* Number text (1/3 etc) */ + .numbertext { + color: #f2f2f2; + font-size: 12px; + padding: 8px 12px; + position: absolute; + top: 0; + } + + /* The dots/bullets/indicators */ + .dot { + height: 15px; + width: 15px; + margin: 0 2px; + background-color: #bbb; + border-radius: 50%; + display: inline-block; + transition: background-color 0.6s ease; + } + + .active { + background-color: #717171; + } + + /* Fading animation */ + .fade { + -webkit-animation-name: fade; + -webkit-animation-duration: 1.5s; + animation-name: fade; + animation-duration: 1.5s; + } + + @-webkit-keyframes fade { + from {opacity: .4} + to {opacity: 1} + } + + @keyframes fade { + from {opacity: .4} + to {opacity: 1} + } + + /* On smaller screens, decrease text size */ + @media only screen and (max-width: 300px) { + .text {font-size: 11px} + } + +/* moved this menu button css from the main file again */ + +.container { + display: inline-block; + cursor: pointer; + } + + .bar1, .bar2, .bar3 { + width: 18px; + height: 3px; + background-color: white; + margin: 3px 0; + transition: 0.4s; + } + + .change .bar1 { + -webkit-transform: translateY(6px) rotate(-45deg); + transform: translateY(6px) rotate(-45deg); + } + + .change .bar2 {opacity: 0;} + + .change .bar3 { + -webkit-transform: translateY(-6px) rotate(45deg); + transform: translateY(-6px) rotate(45deg); + } \ No newline at end of file