Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the sun and its rays #566

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 46 additions & 23 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"bootstrap": "^4.1.3",
"chart.js": "^2.9.4",
"font-awesome": "^4.7.0",
"gsap": "^2.1.3",
"material-ui-chip-input": "^1.1.0",
"parallax-js": "^3.1.0",
"qrcode.react": "^0.9.3",
Expand Down
44 changes: 12 additions & 32 deletions public/tailwind-output.css
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,10 @@ video {
position: sticky;
}

.top-0 {
top: 0px;
}

.-left-48 {
left: -12rem;
}
Expand Down Expand Up @@ -670,10 +674,6 @@ video {
right: 0px;
}

.top-0 {
top: 0px;
}

.bottom-\[20rem\] {
bottom: 20rem;
}
Expand Down Expand Up @@ -865,6 +865,10 @@ video {
height: 100%;
}

.h-\[900vh\] {
height: 900vh;
}

.h-5 {
height: 1.25rem;
}
Expand Down Expand Up @@ -901,6 +905,10 @@ video {
width: 100%;
}

.w-\[100vw\] {
width: 100vw;
}

.w-\[24rem\] {
width: 24rem;
}
Expand Down Expand Up @@ -1163,45 +1171,17 @@ video {
background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
}

.from-mainBg {
--tw-gradient-from: #1f6aa0;
--tw-gradient-to: rgb(31 106 160 / 0);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-black {
--tw-gradient-from: #000;
--tw-gradient-to: rgb(0 0 0 / 0);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-f23-lightGreen {
--tw-gradient-from: #8db67e;
--tw-gradient-to: rgb(141 182 126 / 0);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-f23-mediumGreen {
--tw-gradient-from: #3e8169;
--tw-gradient-to: rgb(62 129 105 / 0);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.from-f23-darkGreen {
--tw-gradient-from: #133d35;
--tw-gradient-to: rgb(19 61 53 / 0);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.via-f23-mediumGreen {
--tw-gradient-to: rgb(62 129 105 / 0);
--tw-gradient-stops: var(--tw-gradient-from), #3e8169, var(--tw-gradient-to);
}

.to-endBg {
--tw-gradient-to: #0f3854;
}

.to-f23-darkGreen {
--tw-gradient-to: #133d35;
}
Expand Down
7 changes: 4 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import {
import LandingPage from "./components/_Landing/Landing";
import { Snackbar } from "@material-ui/core"; // Alert messages
import { Alert } from "@material-ui/lab"; // Alert messages
import ParticleBackground from "./components/_Landing/assets/Particles";
// import ParticleBackground from "./components/_Landing/assets/Particles";
import NavBar from "./NavBar";
import { defaults } from "./Defaults"; // Get a handle to the default application settings
import { Profile } from "./components/Profile"; // User profile storage
import StarryBackground from "./components/_Landing/assets/scripts/StarryBackground";

const updateStateOnURLChange = (component) => {
let previousUrl = "";
Expand Down Expand Up @@ -238,8 +239,8 @@ class App extends Component {
return (
<BrowserRouter style={{ width: "100%" }}>
{/* BrowserRouter wil allow us to switch between the different pages in our SPA based on the URL routing */}
<div className="bg-gradient-to-b from-mainBg to-endBg">
<ParticleBackground />
<div className="bg-gradient-to-b from-mainBg to-endBg relative">
<StarryBackground />
{/* Application alert messages go here */}
<Snackbar open={this.state.alertProps.open}
autoHideDuration={this.state.alertProps.duration}>
Expand Down
8 changes: 8 additions & 0 deletions src/components/_Landing/Landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
background-color: rgba(0, 0, 0, 0.4);
}

.star {
position: absolute;
width: 4px;
height: 4px;
border-radius: 2px;
background: white;
}

.floating {
animation-name: floating;

Expand Down
2 changes: 2 additions & 0 deletions src/components/_Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Hero from "./sections/hero/hero";
import { randomizeAnimationDurations } from "./utilities";
import Schedule from "./sections/schedule/Schedule";
import Sponsors from "./sections/sponsors/Sponsors";
import Sun from "./assets/sun/sun";


function LandingPage(props: any) {
Expand All @@ -21,6 +22,7 @@ function LandingPage(props: any) {
<div className="w-full h-fit bg-gradient-to-b
from-f23-lightGreen via-f23-mediumGreen to-f23-darkGreen
to-f23-">
<Sun />
<Hero profile={props.profile} />
<About />
<Schedule />
Expand Down
49 changes: 0 additions & 49 deletions src/components/_Landing/assets/Particles.tsx

This file was deleted.

14 changes: 14 additions & 0 deletions src/components/_Landing/assets/scripts/StarryBackground.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, { useEffect } from "react";
import initStars from "./stars";

function StarryBackground() {

useEffect(() => {
initStars(500);
}, []);

return <div id="starryBackground"
className="w-[100vw] h-full absolute top-0 overflow-hidden" />;
}

export default StarryBackground;
29 changes: 29 additions & 0 deletions src/components/_Landing/assets/scripts/stars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { TweenMax } from "gsap/TweenMax";

// Amount of stars
function createStars(numberOfStars) {
for (let i = 0; i < numberOfStars; i++) {
placeStarRandomly();
}
}
// Create Stars
function placeStarRandomly(){
const tmpStar = document.createElement("figure");
tmpStar.className = "star";
tmpStar.style.top = 100*Math.random()+"%";
tmpStar.style.left = 100*Math.random()+"%";
document.getElementById("starryBackground").appendChild(tmpStar);
}

function animateStars() {
const stars = document.querySelectorAll(".star");
Array.prototype.forEach.call(stars, function(el,){
TweenMax.to(el, Math.random() * 0.4 + 0.4, {opacity: Math.random(), onComplete: animateStars});
});
}


export default function initStars(numberOfStars) {
createStars(numberOfStars);
animateStars();
}
Loading
Loading