This document captures the essence of a multi-faceted JavaScript learning journey, showcasing progression from basic concepts to advanced DOM manipulation and interactive web development.
This repository contains solutions to three practical JavaScript tasks involving problem solving skills and logic related to JavaScript.
Task | Live Demo |
---|---|
Task 1: Cursor Follower | Show Live Demo |
Task 2: Keyboard Event Game Creation | Show Live Demo |
Task 3: Dynamic Card Data Manipulation | Show Live Demo |
- Description: Updates the cursor position of the cursor when the cursor is moved.
- Live Demo: Show Live Demo
- Description: Applied keyboard events on this task to manipulate DOM.
- Live Demo: Show Live Demo
- Description: Changed the values of the Card Dynamically when button is clicked on the particular card.
- Live Demo: Show Live Demo
- Copy the code snippets into your browser console or a
.js
file. - Execute the code in a browser or using Node.js.
- Provide input when prompted to view results.
- You can replace the
#task-xx-demo
placeholders with actual hosted links (e.g., CodePen, GitHub Pages, or your preferred platform).
- Concepts Mastered:
- Variable declarations
- User input with
prompt()
- Type conversion (
parseInt()
,parseFloat()
) - Template literals
- Conditional (ternary) operators
// User input and calculation
let a = parseInt(prompt('Enter 1st number'));
let b = parseInt(prompt('Enter 2nd number'));
console.log(`Sum of ${a} and ${b} is ${a+b}`);
// Ternary operator usage
console.log(`${a%2 === 0 ? `${a} is Even Number` : `${a} is Odd Number`}`);
- Concepts Mastered:
- Mouse event handling
- Real-time coordinate tracking
- Dynamic element positioning
- Browser event APIs
document.addEventListener("mousemove", (e) => {
cursor.style.left = e.clientX + "px";
cursor.style.top = e.clientY + "px";
});
- Concepts Mastered:
- Advanced DOM manipulation
- Event-driven programming
- Collision detection
- Boundary management
- Game state handling
- Keyboard-driven character movement
- Precise coordinate tracking
- Collision detection using
getBoundingClientRect()
- Dynamic game state changes
- Concepts Mastered:
- Complex data rendering
- Array manipulation methods
- Dynamic HTML generation
- Interactive state management
- Event listener attachment
function createUserCards() {
user.forEach((userData, index) => {
// Dynamic card generation
const card = `
<div class="card">
<button userIndex="${index}">
${userData.available ? 'Unfriend' : 'Add Friend'}
</button>
</div>
`;
});
}
-
Beginner Level:
- Basic arithmetic
- User interactions
- Simple calculations
-
Intermediate Level:
- DOM manipulation
- Event handling
- Dynamic rendering
- State management
-
Advanced Techniques:
- Interactive game development
- Complex event tracking
- Dynamic UI generation
- Coordinate-based interactions
- Mastered JavaScript fundamentals
- Developed interactive web applications
- Learned advanced DOM manipulation
- Implemented complex event-driven interfaces
- Event-driven programming
- Dynamic content rendering
- Responsive user interactions
- Modular code design
- User input validation
- Dynamic content generation
- Complex event handling
- Interactive state management
- Modular function design
- Effective use of array methods
- Conditional rendering
- Real-time UI updates
- Advanced React/Vue.js frameworks
- State management libraries
- Performance optimization
- Advanced game development
- Complex interactive interfaces
- Practice consistently
- Break down complex problems
- Experiment with different approaches
- Build projects that excite you
- Learn from code reviews
- Embrace continuous learning
- Write clean, readable code
- Solve problems creatively
- Stay curious and passionate
Happy Coding! 🖥️🚀✨