Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions NOTLOOP_INFINITE CRINGE.py.py
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

Comment on lines +86 to +93
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace bare except with specific exception handling

Bare except clauses can hide unexpected errors. Specify the exception type you're handling.

 def on_key_press(key):
     try:
         if key == keyboard.Key.backspace:
             roast = random.choice(roasts)
             show_notification(roast)
-    except:
+    except AttributeError:
         pass
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def on_key_press(key):
try:
if key == keyboard.Key.backspace:
roast = random.choice(roasts)
show_notification(roast)
except:
pass
def on_key_press(key):
try:
if key == keyboard.Key.backspace:
roast = random.choice(roasts)
show_notification(roast)
except AttributeError:
pass
🧰 Tools
🪛 Ruff (0.12.2)

91-91: Do not use bare except

(E722)

🤖 Prompt for AI Agents
In NOTLOOP_INFINITE CRINGE.py.py around lines 86 to 93, the bare except clause
in the on_key_press function should be replaced with a specific exception type
to avoid hiding unexpected errors. Identify the likely exceptions that could
occur in the try block, such as KeyError or IndexError, and catch only those
specific exceptions instead of a bare except. This will improve error handling
clarity and debugging.

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()
57 changes: 23 additions & 34 deletions README.md
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Frameworks used - playwright
- Frameworks used - tkinter
🤖 Prompt for AI Agents
In README.md at line 31, remove the mention of "playwright" from the list of
frameworks since it is not used in the codebase. Replace or update the
frameworks section to accurately reflect the technologies actually used, such as
tkinter for the GUI.

- 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)
![Screenshot1](Add screenshot 1 here with proper name)
*Add caption explaining what this shows*

![Screenshot2](Add screenshot 2 here with proper name)
*Add caption explaining what this shows*

![Screenshot3](Add screenshot 3 here with proper name)
*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
![Workflow](Add your workflow/architecture diagram here)
Expand All @@ -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

Expand Down
78 changes: 78 additions & 0 deletions useless_project.html
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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing ID to stop button - JavaScript code references non-existent element

The JavaScript code tries to access document.getElementById("stopBtn") but the stop button doesn't have an ID, causing a null reference error.

-  <button onclick="stopLoop()">Stop</button>
+  <button id="stopBtn" onclick="stopLoop()">Stop</button>

Also applies to: 62-73

🤖 Prompt for AI Agents
In useless_project.html at line 14 and also lines 62 to 73, the stop button
element lacks an ID attribute, but the JavaScript code references it using
document.getElementById("stopBtn"), causing a null reference error. Add the
attribute id="stopBtn" to the stop button element to ensure the JavaScript can
correctly find and interact with it.


<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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify button positioning CSS exists

The stop button movement code sets left and top properties, which only work with absolute or fixed positioning. Ensure your style.css includes appropriate positioning for the stop button.


🏁 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
The mouseenter handler sets left and top, but there’s no CSS defining the stop button’s positioning—without position: absolute (or fixed), those styles won’t take effect.

• No style.css was found in the repo, so the button’s positioning isn’t defined anywhere.
• Add one of the following:

  • A CSS rule in your stylesheet:
    #stopBtn {
      position: absolute;
    }
  • An inline style on the button element:
    <button id="stopBtn" style="position: absolute;">Stop</button>

This will ensure your randomized left/top values actually move the button.

🤖 Prompt for AI Agents
In useless_project.html around lines 62 to 73, the stop button's CSS positioning
is not set, so the left and top styles applied in the mouseenter event do not
move the button. Fix this by adding a CSS rule that sets #stopBtn to position:
absolute, either by adding a style block or inline style on the button element,
ensuring the left and top properties take effect and the button moves as
intended.


</script>

</body>
</html>
23 changes: 23 additions & 0 deletions useless_project2.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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
</script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js')
.then(registration => console.log('Service Worker registered:', registration))
.catch(error => console.error('Service Worker registration failed:', error));
}
</script>
🤖 Prompt for AI Agents
In useless_project2.html around lines 9 to 13, the service worker registration
code lacks error handling and does not check if the page is served over HTTPS or
localhost. Update the script to first verify that the context is secure (HTTPS
or localhost) before attempting registration. Add a .catch block to the
navigator.serviceWorker.register promise to handle and log any registration
errors.

</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>