Skip to content

Commit

Permalink
Added the sun and its rays
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmonisit committed Aug 29, 2023
1 parent 77faa29 commit 07cb10d
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 28 deletions.
28 changes: 0 additions & 28 deletions public/tailwind-output.css
Original file line number Diff line number Diff line change
Expand Up @@ -1163,45 +1163,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
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
38 changes: 38 additions & 0 deletions src/components/_Landing/assets/scripts/stars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


// Twinkling Star Animation
// https://codepen.io/cliffgurney/pen/GNpzdx
//

// Amount of stars
// function createStars(i) {
// var i = i;
// while(i){
// drawStars();
// i-=1;
// }
// }
// // Create Stars
// function drawStars(){
// var tmpStar = document.createElement("figure");
// tmpStar.className = "star";
// tmpStar.style.top = 100*Math.random()+"%";
// tmpStar.style.left = 100*Math.random()+"%";
// document.getElementById("sky").appendChild(tmpStar);
// }
// // Animate Stars
// function selectStars() {
// stars = document.querySelectorAll(".star");
// console.log(stars);
// }
// function animateStars() {
// Array.prototype.forEach.call(stars, function(el, i){
// TweenMax.to(el, Math.random() * 0.4 + 0.4, {opacity: Math.random(), onComplete: animateStars});
// });
// }

// createStars(500);
// selectStars();
// animateStars();


180 changes: 180 additions & 0 deletions src/components/_Landing/assets/sun/sun.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
#sun-container {
left: 15%;
top: -250px;
position: absolute;
width: 100px;
height: 100px;
z-index: 100;
opacity: 80%;
animation: rotateSun 15s infinite alternate ;
}

@keyframes rotateSun {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(5deg);
}
}

#sun {
position: absolute;
top: 50%;
left: 50%;
width: 300px;
height: 300px;
background-color: #c1e8da;
opacity: 30%;
border-radius: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}


#sun2 {
position: absolute;
top: 50%;
left: 50%;
width: 500px;
height: 500px;
background-color: #c1e8da;
opacity: 15%;
border-radius: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}

#sun3 {
position: absolute;
top: 50%;
left: 50%;
width: 700px;
height: 700px;
background-color: #c1e8da;
opacity: 10%;
border-radius: 50%;
transform: translate(-50%, -50%);
z-index: 1;
}

/* Start of First Ray Styling (and sub-rays) */


#ray {
position: absolute;
z-index: -1000;
top: 50%;
left: -450%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: bottom left;
transform: rotate(deg);
background: linear-gradient(to top, transparent 50%, #c1e8da);
opacity: 20%;
}

#ray2 {
position: absolute;
z-index: -1000;
top: 50%;
left: -450%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: bottom left;
transform: rotate(deg);
background: linear-gradient(to top, transparent 60%, #c1e8da);
opacity: 5%;
}

#ray3 {
position: absolute;
z-index: -1000;
top: 50%;
left: -450%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 55%, 100% 55%);
/* animation: animateClipPath 3s alternate 2; */
/* animation-iteration-count: 4; */
transform-origin: bottom left;
/* transform: rotate(deg); */
background: linear-gradient(to top, transparent 80%, #c1e8da);
opacity: 10%;
}


/* Start of Second Ray Styling (and sub-rays) */
#ray4 {
position: absolute;
z-index: -1000;
top: -500%;
left: 1800%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: bottom left;
transform: rotate(-45deg);
background: linear-gradient(to top, transparent 50%, #c1e8da);
opacity: 14%;
}

#ray5 {
position: absolute;
z-index: -1000;
top: -500%;
left: 1800%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 55%, 100% 63%);
transform-origin: bottom left;
transform: rotate(-45deg);
background: linear-gradient(to top, transparent 50%, #c1e8da);
opacity: 10%;
}

#ray6 {
position: absolute;
z-index: -1000;
top: -500%;
left: 1800%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: bottom left;
transform: rotate(-45deg);
background: linear-gradient(to top, transparent 50%, #c1e8da);
opacity: 5%;
}

/* Start of Third Ray Styling (and sub-rays) */

#ray7 {
position: absolute;
z-index: -1000;
top: -1400%;
left: -2000%;

width: 1000px;
height: 3000px;

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
transform-origin: bottom left;
transform: rotate(40deg);
background: linear-gradient(to top, transparent 50%, #c1e8da);
opacity: 20%;
}
26 changes: 26 additions & 0 deletions src/components/_Landing/assets/sun/sun.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import "./sun.css";

function Sun() {
return (
<div id="sun-container">
<div id="sun"></div>
<div id="sun2"></div>

<div id="sun3"></div>
<div id="ray"></div>
<div id="ray2"></div>
<div id="ray3"></div>

<div id="ray4"></div>
<div id="ray5"></div>
<div id="ray6"></div>

<div id="ray7"></div>
<div id="ray8"></div>
<div id="ray9"></div>
</div>
);
}

export default Sun;

0 comments on commit 07cb10d

Please sign in to comment.