diff --git a/public/butter.js b/public/butter.js index 0412ac7..c8140bd 100644 --- a/public/butter.js +++ b/public/butter.js @@ -1,118 +1,126 @@ // butter.js -(function(root){ - var Butter = function() { - - var self = this; - - this.defaults = { - wrapperId: 'butter', - wrapperDamper: 0.07, - cancelOnTouch: false - } - - this.validateOptions = function(ops) { - for (var prop in ops) { - if (self.defaults.hasOwnProperty(prop)) { - Object.defineProperty(self.defaults, prop, {value: Object.getOwnPropertyDescriptor(ops, prop).value}) - } - } - } - // ???? What is this for ???? - // this.wrapperDamper; - // this.wrapperId; - // this.cancelOnTouch; - // this.wrapper; - this.wrapperOffset = 0; - // this.animateId; - this.resizing = false; - this.active = false; - // this.wrapperHeight; - // this.bodyHeight; +(function (root) { + var Butter = function () { + var self = this; + + this.defaults = { + wrapperId: "butter", + wrapperDamper: 0.07, + cancelOnTouch: false, }; - Butter.prototype = { - - init: function(options) { - if (options) { - this.validateOptions(options); - } - - this.active = true; - this.resizing = false; - this.wrapperDamper = this.defaults.wrapperDamper; - this.wrapperId = this.defaults.wrapperId; - this.cancelOnTouch = this.defaults.cancelOnTouch; - - this.wrapper = document.getElementById(this.wrapperId); - this.wrapper.style.position = 'fixed'; - this.wrapper.style.width = '100%'; - - this.wrapperHeight = this.wrapper.clientHeight; - document.body.style.height = this.wrapperHeight + 'px'; - - window.addEventListener('resize', this.resize.bind(this)); - if (this.cancelOnTouch) { - window.addEventListener('touchstart', this.cancel.bind(this)); - } - this.wrapperOffset = 0.0; - this.animateId = window.requestAnimationFrame(this.animate.bind(this)); - - // window.addEventListener('load', this.resize.bind(this)); - }, - - wrapperUpdate: function() { - var scrollY = (document.scrollingElement !== undefined) ? document.scrollingElement.scrollTop : (document.documentElement.scrollTop || 0.0); - this.wrapperOffset += (scrollY - this.wrapperOffset) * this.wrapperDamper; - this.wrapper.style.transform = 'translate3d(0,' + (-this.wrapperOffset.toFixed(2)) + 'px, 0)'; - }, - - checkResize: function() { - if (this.wrapperHeight !== this.wrapper.clientHeight) { - this.resize(); - } - }, - - resize: function() { - var self = this; - if (!self.resizing) { - self.resizing = true; - window.cancelAnimationFrame(self.animateId); - window.setTimeout(function() { - self.wrapperHeight = self.wrapper.clientHeight; - if (parseInt(document.body.style.height) !== parseInt(self.wrapperHeight)) { - document.body.style.height = self.wrapperHeight + 'px'; - } - self.animateId = window.requestAnimationFrame(self.animate.bind(self)); - self.resizing = false; - }, 150) - } - }, - - animate: function() { - this.checkResize(); - this.wrapperUpdate(); - this.animateId = window.requestAnimationFrame(this.animate.bind(this)); - }, - - cancel: function() { - if (this.active) { - window.cancelAnimationFrame(this.animateId); - - window.removeEventListener('resize', this.resize); - window.removeEventListener('touchstart', this.cancel); - this.wrapper.removeAttribute('style'); - document.body.removeAttribute('style'); - - this.active = false; - this.wrapper = ""; - this.wrapperOffset = 0; - this.resizing = true; - this.animateId = ""; - } - }, + this.validateOptions = function (ops) { + for (var prop in ops) { + if (self.defaults.hasOwnProperty(prop)) { + Object.defineProperty(self.defaults, prop, { + value: Object.getOwnPropertyDescriptor(ops, prop).value, + }); + } + } }; + // ???? What is this for ???? + // this.wrapperDamper; + // this.wrapperId; + // this.cancelOnTouch; + // this.wrapper; + this.wrapperOffset = 0; + // this.animateId; + this.resizing = false; + this.active = false; + // this.wrapperHeight; + // this.bodyHeight; + }; + + Butter.prototype = { + init: function (options) { + if (options) { + this.validateOptions(options); + } + + this.active = true; + this.resizing = false; + this.wrapperDamper = this.defaults.wrapperDamper; + this.wrapperId = this.defaults.wrapperId; + this.cancelOnTouch = this.defaults.cancelOnTouch; + + this.wrapper = document.getElementById(this.wrapperId); + this.wrapper.style.position = "fixed"; + this.wrapper.style.width = "100%"; + + this.wrapperHeight = this.wrapper.clientHeight; + document.body.style.height = this.wrapperHeight + "px"; + + window.addEventListener("resize", this.resize.bind(this)); + if (this.cancelOnTouch) { + window.addEventListener("touchstart", this.cancel.bind(this)); + } + this.wrapperOffset = 0.0; + this.animateId = window.requestAnimationFrame(this.animate.bind(this)); + + // window.addEventListener('load', this.resize.bind(this)); + }, + + wrapperUpdate: function () { + var scrollY = + document.scrollingElement !== undefined + ? document.scrollingElement.scrollTop + : document.documentElement.scrollTop || 0.0; + this.wrapperOffset += (scrollY - this.wrapperOffset) * this.wrapperDamper; + this.wrapper.style.transform = + "translate3d(0," + -this.wrapperOffset.toFixed(2) + "px, 0)"; + }, + + checkResize: function () { + if (this.wrapperHeight !== this.wrapper.clientHeight) { + this.resize(); + } + }, + + resize: function () { + var self = this; + if (!self.resizing) { + self.resizing = true; + window.cancelAnimationFrame(self.animateId); + window.setTimeout(function () { + self.wrapperHeight = self.wrapper.clientHeight; + if ( + parseInt(document.body.style.height) !== + parseInt(self.wrapperHeight) + ) { + document.body.style.height = self.wrapperHeight + "px"; + } + self.animateId = window.requestAnimationFrame( + self.animate.bind(self), + ); + self.resizing = false; + }, 150); + } + }, + + animate: function () { + this.checkResize(); + this.wrapperUpdate(); + this.animateId = window.requestAnimationFrame(this.animate.bind(this)); + }, + + cancel: function () { + if (this.active) { + window.cancelAnimationFrame(this.animateId); + + window.removeEventListener("resize", this.resize); + window.removeEventListener("touchstart", this.cancel); + this.wrapper.removeAttribute("style"); + document.body.removeAttribute("style"); - root.butter = new Butter(); - -})(this); \ No newline at end of file + this.active = false; + this.wrapper = ""; + this.wrapperOffset = 0; + this.resizing = true; + this.animateId = ""; + } + }, + }; + + root.butter = new Butter(); +})(this); diff --git a/src/components/App.jsx b/src/components/App.jsx index a86058c..fbc0a09 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -7,17 +7,17 @@ import Home from "./Home"; import Socials from "./Socials"; export default function App() { - return ( - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - - ) + return ( + + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + ); } diff --git a/src/components/Chars.css b/src/components/Chars.css index 116a938..10ca3d9 100644 --- a/src/components/Chars.css +++ b/src/components/Chars.css @@ -2,8 +2,7 @@ opacity: 0.3; transition: opacity 0.1s ease; } - + .visible { opacity: 1; } - \ No newline at end of file diff --git a/src/components/Events.css b/src/components/Events.css index d3abe02..c25f66d 100644 --- a/src/components/Events.css +++ b/src/components/Events.css @@ -33,4 +33,4 @@ font-size: 3rem; font-style: normal; font-weight: 350; line-height: 100%; /* 3rem */ -} \ No newline at end of file +} diff --git a/src/components/Events.jsx b/src/components/Events.jsx index c7d4eb8..5cdb6ea 100644 --- a/src/components/Events.jsx +++ b/src/components/Events.jsx @@ -2,31 +2,31 @@ import React from "react"; import Navbar from "./NonPage/NavBar"; import Texture from "./NonPage/Texture"; import Initiatives from "./NonPage/Initiatives"; -import Footer from "./NonPage/Footer" -import AnnouncementLine from "../Images/announcementsLine.svg" +import Footer from "./NonPage/Footer"; +import AnnouncementLine from "../Images/announcementsLine.svg"; import "./Events.css"; import Carousel from "./NonPage/Carousel"; import CustomCursor from "./NonPage/Cursor"; export default function Events() { - let eventsPage = ( -
- - - -
-
-

All Initiatives

- line -
-
- -
-
- -
- -