Skip to content

Commit

Permalink
added more element into the code
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-wadhwa committed Mar 14, 2024
1 parent 6f7b665 commit 4d8e9c1
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 117 deletions.
62 changes: 62 additions & 0 deletions cursor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.cursor {
width: 20px;
height: 20px;
border: 2px solid #00a693; /* Teal green to represent the base of the feather */
border-radius: 50%;
position: absolute;
transition-duration: 200ms;
transition-timing-function: ease-out;
animation: cursorAnim .5s infinite alternate;
pointer-events: none;
z-index: 1000; /* To ensure it's above other content */
}

.cursor::after {
content: "";
width: 20px;
height: 20px;
position: absolute;
border: 8px solid #0047ab; /* Deep blue to represent the vibrant color of a peacock feather */
border-radius: 50%;
opacity: 0.5;
top: -8px;
left: -8px;
animation: cursorAnim2 .5s infinite alternate;
}

@keyframes cursorAnim {
from {
transform: scale(1);
}
to {
transform: scale(0.7); /* Mimicking the gentle movement of a feather */
}
}

@keyframes cursorAnim2 {
from {
transform: scale(1);
}
to {
transform: scale(0.4); /* Smaller scale for a subtle effect */
}
}

@keyframes cursorAnim3 {
0% {
transform: scale(1);
}
50% {
transform: scale(3); /* Mimic the feather floating away */
border-color: #008080; /* A mix of green and blue for the mid-animation color */
}
100% {
transform: scale(1);
opacity: 0; /* Fade out like a feather drifting out of sight */
}
}

.expand {
animation: cursorAnim3 .5s forwards;
border: 1px solid #00a693; /* Again, the teal green for consistency */
}
13 changes: 13 additions & 0 deletions cursor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const cursor = document.querySelector('.cursor');

document.addEventListener('mousemove', e => {
cursor.setAttribute("style", "top: "+(e.pageY - 10)+"px; left: "+(e.pageX - 10)+"px;")
})

document.addEventListener('click', () => {
cursor.classList.add("expand");

setTimeout(() => {
cursor.classList.remove("expand");
}, 500)
})
16 changes: 10 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Geeta Quote Daily - Daily Wisdom from the Bhagavad Gita</title>
<link rel="stylesheet" href="style.css">
<meta name="description" content="Geeta Quote Daily enriches your day with inspirational quotes from the Bhagavad Gita, set against serene visuals and accompanied by the soothing sounds of Krishna's flute. A moment of peace and reflection with every new tab.">
<meta name="author" content="Rohit Wadhwa">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="cursor.css">
</head>
<body>
<div class="container">
Expand All @@ -27,10 +27,14 @@
<source src="https://aac.saavncdn.com/100/098c92cfdc25fa1373be9f572b72ea90_320.mp4" type="audio/mp3">
Your browser does not support the audio element.
</audio>
<footer>
<p>&copy; <script>document.write(new Date().getFullYear());</script> <a href="https://www.linkedin.com/in/rohit-wadhwa?utm_source=share&utm_campaign=share_via&utm_content=profile&utm_medium=android_app" target="_blank">Rohit Wadhwa</a>. All rights reserved.</p>
<a href="https://bhagavadgitaapi.in/" id="made-possible-with">Made possible with <span>Bhagvad Gita API</span>.</a>
</footer>
<a href="https://bhagavadgitaapi.in/" id="made-possible-with">Made possible with <span>Bhagvad Gita API</span>.</a>
<div class="buy-me-coffee">
<a href="https://www.buymeacoffee.com/rohit.wadhwa" target="_blank">
<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=☕&slug=rohit.wadhwa&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" />
</a>
</div>
<div class="cursor"></div>
<script src="newtab.js"></script>
<script src="cursor.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "1.0",
"description": "Displays a random Bhagavad Gita shloka on a new tab.",
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "images/icon16.png",
"48": "images/icon48.png",
Expand Down
47 changes: 47 additions & 0 deletions popup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
body {
font-family: Arial, sans-serif;
margin: 10px;
padding: 10px;
}
h1 {
font-size: 1.4em;
}

.content {
text-align: center;
}

.support, .more-extensions {
margin-top: 20px;
}

.support img {
height: 40px; /* Adjust based on your preference */
}

.more-extensions a {
display: inline-block;
background-color: #40DCA5; /* Match Buy me a coffee button or choose a different color */
color: #ffffff;
padding: 10px 15px;
text-decoration: none;
border-radius: 5px;
font-family: 'Cookie', cursive; /* Optional: Match Buy me a coffee font */
}

.instructions {
background-color: #fff; /* Change as per your color theme */
border: 1px solid #ddd; /* Light border for some definition */
border-radius: 8px; /* Soften the edges */
padding: 20px; /* Spacing inside the instructions box */
margin: 10px 0; /* Spacing outside, to separate from other elements */
box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Subtle shadow for depth */
text-align: center; /* Center the text and button */
}

.instructions p {
color: #333; /* Dark color for text for better readability */
font-size: 14px; /* Adjust based on your preference */
margin: 0 0 20px; /* Spacing below the paragraph */
}

29 changes: 29 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Geeta Quote Daily</title>
<link rel="stylesheet" href="popup.css"> <!-- Ensure you have a popup.css file -->
</head>
<body>
<div class="content">
<h1>Geeta Quote Daily</h1>
<!-- Your existing popup content here -->
<div class="instructions">
<p>Open a new tab in Chrome to see today's Bhagavad Gita quote and start your day with wisdom and peace.</p>
</div>
<!-- Buy Me a Coffee Button -->
<div class="support">
<a href="https://www.buymeacoffee.com/rohit.wadhwa" target="_blank">
<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=rohit.wadhwa&button_colour=40DCA5&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" />
</a>
</div>

<!-- Link to More Extensions -->
<div class="more-extensions">
<a href="https://chrome.google.com/webstore/search/rohit%20wadhwa?hl=en-GB&authuser=0" target="_blank">Find more of my extensions here</a>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 4d8e9c1

Please sign in to comment.