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
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Tester
# Mindful Visualizer

This is a simple mindfulness web app that lets you visualize your thoughts and pair them with emotions. Type a thought in the input box and click **Add Thought**. Each thought appears as a bubble that you can click to cycle through different emotions.

Available emotions:
- calm (blue)
- happy (yellow)
- sad (purple)
- angry (red)

Open `index.html` in a browser to try it out.
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mindful Visualizer</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Mindful Visualizer</h1>
<div id="input-section">
<input id="thoughtInput" type="text" placeholder="Enter your thought" />
<button id="addThoughtBtn">Add Thought</button>
</div>
<div id="thoughtContainer"></div>

<script src="script.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const emotions = ["calm", "happy", "sad", "angry"];

function createThoughtElement(text) {
const div = document.createElement("div");
div.className = "thought";
div.textContent = text;
div.dataset.emotion = "neutral";
div.addEventListener("click", () => cycleEmotion(div));
return div;
}

function cycleEmotion(element) {
const current = element.dataset.emotion;
const index = emotions.indexOf(current);
const nextEmotion = emotions[(index + 1) % emotions.length];
element.dataset.emotion = nextEmotion;
}

function addThought() {
const input = document.getElementById("thoughtInput");
const text = input.value.trim();
if (!text) return;
const thoughtEl = createThoughtElement(text);
document.getElementById("thoughtContainer").appendChild(thoughtEl);
input.value = "";
}

document.getElementById("addThoughtBtn").addEventListener("click", addThought);
52 changes: 52 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
background: #f2f2f2;
min-height: 100vh;
margin: 0;
padding: 20px;
}

#input-section {
margin-bottom: 20px;
}

#thoughtContainer {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
max-width: 800px;
}

.thought {
padding: 10px 15px;
border-radius: 20px;
background: #ccc;
color: #000;
cursor: pointer;
transition: transform 0.2s;
}

.thought:hover {
transform: scale(1.1);
}

/* Emotion Colors */
.thought[data-emotion="calm"] {
background: #a0d8ef;
}

.thought[data-emotion="happy"] {
background: #fff176;
}

.thought[data-emotion="sad"] {
background: #b39ddb;
}

.thought[data-emotion="angry"] {
background: #ef9a9a;
}
1 change: 0 additions & 1 deletion test.c

This file was deleted.