-
Notifications
You must be signed in to change notification settings - Fork 890
Completed #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Completed #46
Changes from all commits
63a0531
c2b4fb1
1e6a442
c7c4c4c
76b63dd
c85e34c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import tkinter as tk | ||
from tkinter import messagebox | ||
import threading | ||
import time | ||
import random | ||
from plyer import notification | ||
from pynput import keyboard | ||
|
||
# --- Notification Content --- | ||
useless_facts = [ | ||
"A group of flamingos is called a flamboyance.", | ||
"Bananas are berries, but strawberries aren't.", | ||
"Octopuses have three hearts.", | ||
"The Eiffel Tower can grow taller in summer.", | ||
"Cows moo with regional accents.", | ||
"Mosquitoes are attracted to people who just ate bananas.", | ||
"If you lift a goldfish out of water, it forgets everything instantly.", | ||
] | ||
|
||
cringe_dialogues = [ | ||
"Are you Google? Because you have everything I’ve been searching for.", | ||
"If beauty were time, you’d be eternity.", | ||
"I put the 'pro' in procrastination.", | ||
"You're so bright, even the sun wears shades.", | ||
"Are you a keyboard? Because you're just my type.", | ||
] | ||
|
||
roasts = [ | ||
"Backspace won't fix your life choices.", | ||
"Trying to erase your failures with Backspace?", | ||
"You press backspace like it’ll delete your personality.", | ||
"Deleting won't help. You're still wrong.", | ||
"Your keyboard's crying from all the regrets you're backspacing.", | ||
] | ||
|
||
riddles = [ | ||
("What has keys but can't open locks?", "keyboard"), | ||
("The more you take, the more you leave behind. What am I?", "footsteps"), | ||
("What gets wetter as it dries?", "towel"), | ||
("What has to be broken before you can use it?", "egg"), | ||
("I'm tall when I'm young and short when I'm old. What am I?", "candle") | ||
] | ||
|
||
# --- Function Definitions --- | ||
def show_notification(message): | ||
notification.notify( | ||
title="🔥 Gotcha!", | ||
message=message, | ||
timeout=3 | ||
) | ||
|
||
def spam_notifications(): | ||
for _ in range(12): | ||
msg = random.choice(useless_facts + cringe_dialogues + roasts) | ||
show_notification(msg) | ||
time.sleep(5) | ||
|
||
def show_riddle_lock(): | ||
def check_answers(): | ||
correct = 0 | ||
for i in range(5): | ||
if entries[i].get().strip().lower() == riddles[i][1]: | ||
correct += 1 | ||
if correct == 5: | ||
root.destroy() | ||
else: | ||
result_label.config(text=f"{correct}/5 correct. Try again!") | ||
|
||
root = tk.Toplevel() | ||
root.title("🧠 Solve to Escape!") | ||
tk.Label(root, text="Solve all 5 riddles to continue", font=("Comic Sans MS", 12, "bold")).pack(pady=5) | ||
|
||
entries = [] | ||
for q, _ in riddles: | ||
tk.Label(root, text=q, font=("Comic Sans MS", 10)).pack() | ||
entry = tk.Entry(root, font=("Comic Sans MS", 10)) | ||
entry.pack(pady=2) | ||
entries.append(entry) | ||
|
||
tk.Button(root, text="Submit", command=check_answers, font=("Comic Sans MS", 10), bg="#FFD700").pack(pady=5) | ||
result_label = tk.Label(root, text="", font=("Comic Sans MS", 10)) | ||
result_label.pack() | ||
|
||
root.mainloop() | ||
|
||
def on_key_press(key): | ||
try: | ||
if key == keyboard.Key.backspace: | ||
roast = random.choice(roasts) | ||
show_notification(roast) | ||
except: | ||
pass | ||
|
||
def fake_notification_trigger(): | ||
while running_event.is_set(): | ||
time.sleep(30) | ||
if running_event.is_set(): | ||
threading.Thread(target=spam_notifications).start() | ||
app.after(0, show_riddle_lock) # triggers the riddle challenge in main thread | ||
|
||
|
||
def start_app(): | ||
global running_event | ||
start_btn.config(state="disabled") | ||
running_event.set() | ||
threading.Thread(target=fake_notification_trigger, daemon=True).start() | ||
threading.Thread(target=lambda: keyboard.Listener(on_press=on_key_press).run(), daemon=True).start() | ||
messagebox.showinfo("App Running", "App is now running in the background. Press Backspace anywhere!") | ||
|
||
# --- GUI Interface --- | ||
app = tk.Tk() | ||
app.title("🎉 NotiLoop Prank App") | ||
app.geometry("400x300") | ||
app.configure(bg="#FFE4E1") | ||
|
||
# Cartoon-style header | ||
tk.Label(app, text="😈 Welcome to NotiLoop!", font=("Comic Sans MS", 16, "bold"), bg="#FFE4E1", fg="#FF1493").pack(pady=20) | ||
tk.Label(app, text="Your fun, annoying prank app", font=("Comic Sans MS", 10), bg="#FFE4E1").pack(pady=5) | ||
|
||
# Start button | ||
start_btn = tk.Button(app, text="Start Chaos!", command=start_app, font=("Comic Sans MS", 12, "bold"), bg="#FF69B4", fg="white", relief="raised") | ||
start_btn.pack(pady=30) | ||
|
||
|
||
|
||
|
||
# Control flag | ||
running_event = threading.Event() | ||
|
||
def on_app_close(): | ||
show_riddle_lock() | ||
|
||
app.protocol("WM_DELETE_WINDOW", on_app_close) | ||
|
||
# Launch GUI | ||
app.mainloop() |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,60 +1,52 @@ | ||||||
<img width="3188" height="1202" alt="frame (3)" src="https://github.com/user-attachments/assets/517ad8e9-ad22-457d-9538-a9e62d137cd7" /> | ||||||
|
||||||
|
||||||
# [Project Name] 🎯 | ||||||
|
||||||
# NOTILOOP: INFINITE CRINGE 🎯 | ||||||
|
||||||
## Basic Details | ||||||
### Team Name: [Name] | ||||||
### Team Name: FIREFLY | ||||||
|
||||||
|
||||||
### Team Members | ||||||
- Team Lead: [Name] - [College] | ||||||
- Member 2: [Name] - [College] | ||||||
- Member 3: [Name] - [College] | ||||||
|
||||||
- Member 1: RISHANANDA V R - College of Engineering Attingal | ||||||
- Member 2: ANIKA KARUVAN KAVIL - College of Engineering Attingal | ||||||
|
||||||
### Project Description | ||||||
[2-3 lines about what your project does] | ||||||
This prototype of an app is a chaotic devil thats triggers a loop of notifications for a certain time period whenever the user recieves a random message/notification. The notification pops up with random pointless facts, cringe dialogues. | ||||||
This app further adds to the mess by sending roasts that melts your brain whenever user hit backspace. | ||||||
It adds more to the chaos by pushing the user to solve riddles to close this loop. | ||||||
|
||||||
### The Problem (that doesn't exist) | ||||||
[What ridiculous problem are you solving?] | ||||||
You are at peace. | ||||||
|
||||||
### The Solution (that nobody asked for) | ||||||
[How are you solving it? Keep it fun!] | ||||||
Sends you messages that roasts you | ||||||
|
||||||
## Technical Details | ||||||
### Technologies/Components Used | ||||||
For Software: | ||||||
- [Languages used] | ||||||
- [Frameworks used] | ||||||
- [Libraries used] | ||||||
- [Tools used] | ||||||
- Languages used - Python | ||||||
- Frameworks used - playwright | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove "playwright" from frameworks - it's not used in the implementation The codebase doesn't use playwright. The Python application uses tkinter for GUI, not playwright. -- Frameworks used - playwright
+- Frameworks used - tkinter 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
- Libraries used - time, threading, tkinter, plyer, pynput, random | ||||||
- Tools used - VsCode, pythonv3.13, windows | ||||||
|
||||||
For Hardware: | ||||||
- [List main components] | ||||||
- [List specifications] | ||||||
- [List tools required] | ||||||
|
||||||
### Implementation | ||||||
For Software: | ||||||
For Software: with the help of chatpgt and mentors | ||||||
# Installation | ||||||
[commands] | ||||||
VSCODE, GITHUB, PYTHON | ||||||
|
||||||
# Run | ||||||
[commands] | ||||||
|
||||||
### Project Documentation | ||||||
For Software: | ||||||
|
||||||
# Screenshots (Add at least 3) | ||||||
 | ||||||
*Add caption explaining what this shows* | ||||||
|
||||||
 | ||||||
*Add caption explaining what this shows* | ||||||
|
||||||
 | ||||||
*Add caption explaining what this shows* | ||||||
SCreenshot 55 - Notifications popping up | ||||||
Screenshot 56 - Showing riddles | ||||||
Screenshot 2025-08-02 154205 - Copy.png - User interface | ||||||
Screenshot 2025-08-02 154230.png - App seeking permission | ||||||
|
||||||
# Diagrams | ||||||
 | ||||||
|
@@ -81,17 +73,14 @@ For Hardware: | |||||
|
||||||
### Project Demo | ||||||
# Video | ||||||
[Add your demo video link here] | ||||||
*Explain what the video demonstrates* | ||||||
https://github.com/RISHANANDA/team_firefly/blob/main/NOTLOOP_INFINITE%20CRINGE.py.py%20-%20team_firefly%20-%20Visual%20Studio%20Code%202025-08-02%2016-23-45.mp4 | ||||||
|
||||||
# Additional Demos | ||||||
[Add any extra demo materials/links] | ||||||
|
||||||
## Team Contributions | ||||||
- [Name 1]: [Specific contributions] | ||||||
- [Name 2]: [Specific contributions] | ||||||
- [Name 3]: [Specific contributions] | ||||||
|
||||||
- RISHANANDA VR - TEAMWORK | ||||||
- ANIKA KARUVAN KAVIL - TEAMWORK | ||||||
--- | ||||||
Made with ❤️ at TinkerHub Useless Projects | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Notiapp</title> | ||
<link rel= "stylesheet" href="style.css"> | ||
</head> | ||
|
||
|
||
<body> | ||
|
||
<button onclick="startLoop()">Start NotiLoop</button> | ||
<button onclick="stopLoop()">Stop</button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing ID to stop button - JavaScript code references non-existent element The JavaScript code tries to access - <button onclick="stopLoop()">Stop</button>
+ <button id="stopBtn" onclick="stopLoop()">Stop</button> Also applies to: 62-73 🤖 Prompt for AI Agents
|
||
|
||
<div class="status" id="status">Not running</div> | ||
|
||
<script> | ||
let intervalId = null; | ||
let count = 0; | ||
|
||
function showNotification() { | ||
count++; | ||
const options = { | ||
body: `Notification #${count}\nYou’ve been notified again.`, | ||
icon: 'https://cdn-icons-png.flaticon.com/512/1827/1827392.png', | ||
}; | ||
new Notification("🔁 NotiLoop", options); | ||
} | ||
|
||
function startLoop() { | ||
if (!("Notification" in window)) { | ||
alert("This browser does not support desktop notification"); | ||
return; | ||
} | ||
|
||
if (Notification.permission === "granted") { | ||
runLoop(); | ||
} else if (Notification.permission !== "denied") { | ||
Notification.requestPermission().then(permission => { | ||
if (permission === "granted") { | ||
runLoop(); | ||
} else { | ||
alert("Notification permission denied!"); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
function runLoop() { | ||
document.getElementById("status").textContent = "Running..."; | ||
count = 0; | ||
showNotification(); | ||
intervalId = setInterval(showNotification, 3000); // every 3 seconds | ||
} | ||
|
||
function stopLoop() { | ||
clearInterval(intervalId); | ||
document.getElementById("status").textContent = "Stopped"; | ||
} | ||
|
||
const stopBtn = document.getElementById("stopBtn"); | ||
|
||
stopBtn.addEventListener("mouseenter", () => { | ||
const maxX = window.innerWidth - stopBtn.offsetWidth; | ||
const maxY = window.innerHeight - stopBtn.offsetHeight; | ||
|
||
const newX = Math.random() * maxX; | ||
const newY = Math.random() * maxY; | ||
|
||
stopBtn.style.left = `${newX}px`; | ||
stopBtn.style.top = `${newY}px`; | ||
}); | ||
Comment on lines
+62
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify button positioning CSS exists The stop button movement code sets 🏁 Script executed: #!/bin/bash
# Check if style.css exists and contains positioning for stopBtn
if [ -f "style.css" ]; then
echo "Checking for stopBtn positioning in style.css:"
rg -A 2 -B 2 "#stopBtn|button.*position" style.css || echo "No positioning found for stopBtn"
else
echo "style.css not found"
fi Length of output: 71 Add explicit positioning for the stop button • No
This will ensure your randomized 🤖 Prompt for AI Agents
|
||
|
||
</script> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||
<!DOCTYPE html> | ||||||||||||||||||||||||||
<html lang="en"> | ||||||||||||||||||||||||||
<head> | ||||||||||||||||||||||||||
<meta charset="UTF-8"> | ||||||||||||||||||||||||||
<title>NotiLoop: Cringe Edition</title> | ||||||||||||||||||||||||||
<link rel="stylesheet" href="style.css"> | ||||||||||||||||||||||||||
<link rel="manifest" href="manifest.json"> | ||||||||||||||||||||||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||||||||||||||||||||||||
<script> | ||||||||||||||||||||||||||
if ('serviceWorker' in navigator) { | ||||||||||||||||||||||||||
navigator.serviceWorker.register('sw.js'); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for service worker registration The service worker registration lacks error handling and doesn't verify HTTPS context. Service workers only work in secure contexts (HTTPS or localhost). <script>
if ('serviceWorker' in navigator) {
- navigator.serviceWorker.register('sw.js');
+ navigator.serviceWorker.register('sw.js')
+ .then(registration => console.log('Service Worker registered:', registration))
+ .catch(error => console.error('Service Worker registration failed:', error));
}
</script> 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||
</head> | ||||||||||||||||||||||||||
<body> | ||||||||||||||||||||||||||
<h1>💀 NotiLoop: Infinite Cringe</h1> | ||||||||||||||||||||||||||
<p>Get ready to regret your life choices.</p> | ||||||||||||||||||||||||||
<button id="startBtn">Start Loop</button> | ||||||||||||||||||||||||||
<button id="stopBtn">Try to Stop</button> | ||||||||||||||||||||||||||
<div id="status">Status: idle</div> | ||||||||||||||||||||||||||
<script src="script.js"></script> | ||||||||||||||||||||||||||
</body> | ||||||||||||||||||||||||||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace bare except with specific exception handling
Bare
except
clauses can hide unexpected errors. Specify the exception type you're handling.📝 Committable suggestion
🧰 Tools
🪛 Ruff (0.12.2)
91-91: Do not use bare
except
(E722)
🤖 Prompt for AI Agents