Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
added background to the site
Browse files Browse the repository at this point in the history
  • Loading branch information
GammaMicrowave committed Jan 1, 2024
1 parent eb83046 commit 22bd1c6
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 100 deletions.
45 changes: 43 additions & 2 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ body {
--d: 3000px;
--angle: 120deg;
overflow: auto;
/* background: linear-gradient(#0C1717, #17403E, #132222); */
/* background: repeating-linear-gradient(#0c1717, #17403e, #132222, #0c1717); */

background: repeating-linear-gradient(
var(--angle),
#0c1717,
Expand All @@ -13,6 +12,48 @@ body {
);
background-size: calc(var(--d) / sin(var(--angle))) 100%;
animation: AnimationName 5s linear infinite reverse;
/* height: 100vh; */
/* overflow: hidden; */
overflow-x: hidden;
margin: 0px;
}

.background {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: -5;
/* background-color: rgb(20, 20, 20); */
}
.tile-active {
background-color: #00cf90;
opacity: 100% !important;
scale: 1.2;
border-radius: 2px;
}

#tiles {
z-index: -1;
height: 100vh;
width: 100vw;
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
grid-template-rows: repeat(var(--rows), 1fr);
/* gap: 20px; */
opacity: 0.5;
}
.tile {
z-index: -1;
/* outline: 1px solid white; */
/* background-color: rgba(255, 255, 255, 0.5); */
/* background-color: red; */

/* outline: 1px solid#00cf90; */
border: 1px solid #00cf90;
opacity: 50%;
transition: 1s ease-in-out;
}

@keyframes AnimationName {
Expand Down
1 change: 1 addition & 0 deletions css/mentors.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
}
.mentorcard {
background-color: rgba(217, 217, 217, 0.2);
backdrop-filter: blur(10px);
width: 230px;
margin: 25px;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body {
}

.navbar {
position: fixed; /* Change to fixed */
/* position: fixed; Change to fixed */
top: 0; /* Add this line */
width: 100%;
display: flex;
Expand All @@ -19,7 +19,7 @@ body {
/* background: linear-gradient(#0C1717, #071615, #132222); */
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25),
4px 4px 4px 0px rgba(0, 0, 0, 0.25) inset;
backdrop-filter: blur(100px);
backdrop-filter: blur(5px);
z-index: 3; /* Add z-index to keep it above other elements */
}

Expand Down
1 change: 1 addition & 0 deletions css/organizers.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
}
.organizer-card {
background-color: rgba(217, 217, 217, 0.2);
backdrop-filter: blur(10px);
width: 230px;
margin: 25px;
text-align: center;
Expand Down
49 changes: 22 additions & 27 deletions css/project.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
.card {
background-color: rgba(217, 217, 217, 0.2);

backdrop-filter: blur(10px);
width: 230px;
margin: 25px 25px;
justify-content: center;
Expand All @@ -37,10 +37,9 @@
height: 24rem;
justify-content: center;
position: relative;

}
.card:hover {
box-shadow: 0px 40px 56px rgba(8, 157, 60, 0.1);
box-shadow: 0px 40px 56px rgba(8, 157, 60, 0.1);
transition: 0.3s;
}
.card {
Expand All @@ -59,15 +58,14 @@
font-family: "Kufam", sans-serif;
color: #00cf90;
font-weight: 400;
padding:0px 10px;

padding: 0px 10px;
}
.about-project {
margin-top: 25px;
margin-top: 25px;
font-size: 14px;
font-weight: 400;
text-align: left;
color: #B7E7D9;
color: #b7e7d9;
word-break: break-all;
margin-left: 4px;
margin-right: 4px;
Expand All @@ -80,39 +78,36 @@
}

.github_project {

font-size: 20px;
margin-top: 10px;
margin-bottom: 10px;
position: absolute;
bottom: 0px;
left:40%;
}
.github_project a{
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(79, 210, 105, 0.117);
margin:0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #00cf90;
transition: all 0.5s ease;
left: 40%;
}
.github_project a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(79, 210, 105, 0.117);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #00cf90;
transition: all 0.5s ease;
vertical-align: bottom;
}
.github_project a:hover{
color: rgb(255, 255, 255);
background-color: #00cf90;
.github_project a:hover {
color: rgb(255, 255, 255);
background-color: #00cf90;
}


@media screen and (max-width: 625px) {
.card {
margin: 25px 15px;
}
#container {

justify-content: space-between;
}
#project-div p {
Expand Down Expand Up @@ -146,4 +141,4 @@
margin-left: 10px;
margin-right: 10px;
}
}
}
68 changes: 0 additions & 68 deletions html/background.html

This file was deleted.

6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
<script src="js/navbar.js" defer></script>
<script src="js/projects.js" defer></script>
<script src="js/organizers.js" defer></script>
<script src="js/background.js" defer></script>
</head>
<body>
<body >
<div class="background">
<div id="tiles" class="tile"></div>
</div>
<!-- Navbar Section -->
<nav class="navbar">
<div class="eventname">
Expand Down
38 changes: 38 additions & 0 deletions js/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
document.addEventListener("DOMContentLoaded", function () {
let columns = Math.floor(document.body.clientWidth / 50);
let rows = Math.floor(document.body.clientHeight / 50);

const wrapper = document.getElementById("tiles");

const createTile = (index) => {
const tile = document.createElement("div");
tile.classList.add("tile");
return tile;
};

const createTiles = (quantity) => {
Array.from(Array(quantity)).map((tile, index) => {
wrapper.appendChild(createTile(index));
});
};
const createGrid = () => {
wrapper.innerHTML = "";
columns = Math.floor(screen.width / 50);
rows = Math.floor(screen.height / 50);
wrapper.style.setProperty("--columns", columns);
wrapper.style.setProperty("--rows", rows);
createTiles(columns * rows);
};
createGrid();
window.onresize = () => createGrid();
});

//add a interval after which a random tile is selected and a class is added to it to change its color
setInterval(() => {
const tiles = document.querySelectorAll(".tile");
const randomTile = tiles[Math.floor(Math.random() * tiles.length)];
randomTile.classList.add("tile-active");
setTimeout(() => {
randomTile.classList.remove("tile-active");
}, 2000);
}, 500);

0 comments on commit 22bd1c6

Please sign in to comment.