Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AnshMeshram authored Oct 17, 2023
2 parents c8c5ae3 + 88d31b0 commit 3e54f0b
Show file tree
Hide file tree
Showing 102 changed files with 23,111 additions and 102 deletions.
7 changes: 4 additions & 3 deletions 3D-Portfolio/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { BrowserRouter } from "react-router-dom";
import { Hero, Navbar, StarsCanvas, About, Experience, Works, Feedbacks, Contact } from "./components";
import './App.css'; // Import your custom styles

const App = () => {
return (
<BrowserRouter>
<div className='relative z-0 bg-primary'>
<div className='bg-hero-pattern bg-cover bg-no-repeat bg-center'>
<div className='app-container'>
<div className='hero-background'>
<Navbar />
<Hero />
</div>
<About />
<Experience />
<Works />
<Feedbacks />
<div className='relative z-0'>
<div className='stars-container'>
<StarsCanvas />
<Contact />
</div>
Expand Down
27 changes: 27 additions & 0 deletions Aim-training/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Aim training</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
</head>
<body>
<div style="text-align: center;
margin-top: 10px;
font-size: 30px; "><i style="color:black;" class="fas fa-home home-icon"></i></a></div>
<h1>Aim training</h1>
<div id="gameContainer">
<div id="score">Score: <span id="scoreValue">0</span></div>
<div id="highScore">High Score: <span id="highScoreValue">0</span></div>
<div id="timer">Time Left: <span id="timerValue">30</span> seconds</div>
<div id="bubbles"></div>
</div>
<button id="startButton" class="start-button">Start Game</button>
<audio id="popSound" src="pop.wav"></audio>
<audio id="endSound" src="end.wav"></audio>
<script src="script.js"></script>
</body>
</html>
139 changes: 139 additions & 0 deletions Aim-training/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// Variables
let score = 0;
let highScore = 0;
let timeLeft = 30;
let timerId;
let level = 1;
let bubbleInterval = 1000;
let gameInProgress = false; // Track if the game is in progress
let bubbleGenerationTimeout; // Store the timeout for bubble generation

// Function to create a bubble
function createBubble() {
const bubble = document.createElement("div");
bubble.className = "bubble";

// Generate random position
const posX = Math.random() * 500 + 50;
const posY = Math.random() * 300 + 50;

bubble.style.top = `${posY}px`;
bubble.style.left = `${posX}px`;

// Generate random size and color
const size = Math.floor(Math.random() * 30) + 20;
const color = `rgb(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255})`;

bubble.style.width = `${size}px`;
bubble.style.height = `${size}px`;
bubble.style.backgroundColor = color;

// Event listener to pop the bubble
bubble.addEventListener("click", function () {
if (bubble.parentNode) {
score++;
document.getElementById("scoreValue").textContent = score;
bubble.parentNode.removeChild(bubble);
playPopSound();
}
});

return bubble;
}

// Function to start the game
function startGame() {
if (gameInProgress) {
return; // Return if game is already in progress
}

const bubblesContainer = document.getElementById("bubbles");
const timerElement = document.getElementById("timerValue");
const startButton = document.getElementById("startButton");

// Clear previous bubbles
while (bubblesContainer.firstChild) {
bubblesContainer.firstChild.remove();
}

// Reset game state
score = 0;
timeLeft = 30;
level = 1;
bubbleInterval = 1000;
document.getElementById("scoreValue").textContent = score;
document.getElementById("timerValue").textContent = timeLeft;
gameInProgress = true;

// Start the timer
timerId = setInterval(function () {
timeLeft--;
timerElement.textContent = timeLeft;

if (timeLeft === 0) {
clearInterval(timerId);
endGame();
}
}, 1000);

// Start generating bubbles
generateBubble(bubblesContainer);

// Disable start button during gameplay
startButton.disabled = true;
}

// Function to generate bubbles
function generateBubble(container) {
if (!gameInProgress) {
return; // Return if game is not in progress
}

const bubble = createBubble();
container.appendChild(bubble);

// Schedule next bubble generation
bubbleGenerationTimeout = setTimeout(function () {
generateBubble(container);
}, bubbleInterval);
}

// Function to end the game
function endGame() {
gameInProgress = false; // Set gameInProgress to false

// Clear bubble generation timeout
clearTimeout(bubbleGenerationTimeout);

const startButton = document.getElementById("startButton");
startButton.disabled = false;
playEndSound();

// Update high score
if (score > highScore) {
highScore = score;
document.getElementById("highScoreValue").textContent = highScore;
}

// Display game over message
setTimeout(function () {
alert("Game Over! Your score: " + score);
}, 100);
}

// Function to play bubble pop sound
function playPopSound() {
const popSound = document.getElementById("popSound");
popSound.currentTime = 0;
popSound.play();
}

// Function to play game end sound
function playEndSound() {
const endSound = document.getElementById("endSound");
endSound.currentTime = 0;
endSound.play();
}

// Event listener for start button
document.getElementById("startButton").addEventListener("click", startGame);
85 changes: 85 additions & 0 deletions Aim-training/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
body {
text-align: center;
}

h1 {
color: #333;
}

#gameContainer {
margin-top: 50px;
position: relative;
}

#score,
#highScore,
#timer {
font-size: 20px;
color: #333;
margin-bottom: 10px;
}

#bubbles {
position: relative;
width: 600px;
height: 400px;
margin: 0 auto;
background-color: #ccc;
border: 2px solid #333;
border-radius: 10px;
overflow: hidden;
}

.bubble {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #f00;
cursor: pointer;
transition: top 0.5s ease-in-out, left 0.5s ease-in-out;
}

.bubble:hover {
background-color: #f00;
transform: scale(1.2);
}

#scoreValue,
#highScoreValue {
font-weight: bold;
}

#timerValue {
font-weight: bold;
animation: blink 1s infinite;
}

.start-button {
padding: 10px 20px;
font-size: 16px;
background-color: #333;
color: #fff;
border: none;
cursor: pointer;
margin-top: 20px;
}

@keyframes countdown {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}

@media (max-width: 768px) {
#bubbles {
width: 80%;
height: 300px;
}
}
99 changes: 99 additions & 0 deletions Avatar Generator/avatar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
text-align: center;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

h1 {
margin-bottom: 20px;
}

#userCards {
display: flex;
flex-wrap: wrap;
justify-content: center;
}

.userCard {
border: 1px solid #ccc;
border-radius: 5px;
padding: 20px;
margin: 10px;
width: 200px;
text-align: center;
}

.userAvatar {
border-radius: 50%;
width: 80px;
height: 80px;
margin-bottom: 10px;
}
</style>
<title>Random User Cards</title>
</head>
<body>
<div class="container">
<h1>Random User Cards</h1>
<div id="userCards"></div>
</div>

<script>
document.addEventListener('DOMContentLoaded', function () {
const userCardsContainer = document.getElementById('userCards');

// Function to generate random user cards
function generateUserCards(numCards) {
for (let i = 0; i < numCards; i++) {
// Fetch random user data from the API
fetch('https://randomuser.me/api/')
.then(response => response.json())
.then(data => {
const user = data.results[0];
const name = `${user.name.first} ${user.name.last}`;
const experience = `Experience: ${user.dob.age - 20}`;
const city = user.location.city;
const avatar = user.picture.medium;

// Create a user card element and populate it with user data
const userCard = document.createElement('div');
userCard.classList.add('userCard');
userCard.innerHTML = `
<img src="${avatar}" alt="User Avatar" class="userAvatar">
<h2>${name}</h2>
<p>${experience}</p>
<p>${city}</p>
`;

userCardsContainer.appendChild(userCard);
})
.catch(error => console.error('Error fetching random user:', error));
}
}

// Generate a specified number of user cards (e.g., 10)
generateUserCards(10);
});
</script>
</body>
</html>
13 changes: 13 additions & 0 deletions Desktop Notification/notification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# pythonw runs program in background - pythonw notification.py

from plyer import notification
import time

if __name__ == '__main__':
while True:
notification.notify(
title = " *** Drink Water *** ",
message= "Getting enough water every day is important for your health. Drinking water can prevent dehydration, a condition that can cause unclear thinking, result in mood change, cause your body to overheat, and lead to constipation and kidney stones.",
# app_icon= "C:\Users\BHATTAD\OneDrive\Desktop\python projects\Desktop Notification\water.ico",
timeout = 5)
time.sleep(3600)
1 change: 1 addition & 0 deletions Desktop Notification/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Desktop Notification in Python
Binary file added Desktop Notification/water.ico
Binary file not shown.
Loading

0 comments on commit 3e54f0b

Please sign in to comment.