------------------------------------------------------------
commit c3c10d0807791f7c41e417869b8be6d4eb251921
Author: ffff:72.234.190.31 <ffff:72.234.190.31@ratemyfocus.breckyunits.com>
Date: Mon Nov 11 23:07:36 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index edad704..edceb18 100644
--- a/basic.html
+++ b/basic.html
@@ -357,7 +357,7 @@
}
async function analyzeTextPro() {
- window.location = "https://buy.stripe.com/9AQ3fYgzfgHbguY5kP";
+ window.location = "https://buy.stripe.com/bIYdUC1El4Yt1A45kQ";
}
// Add the spin animation to the existing style section
------------------------------------------------------------
commit a83225f418cf9be7ea64808bd4fb9fef2e3890ce
Author: ffff:72.234.190.31 <ffff:72.234.190.31@ratemyfocus.breckyunits.com>
Date: Mon Nov 11 23:04:16 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 6128863..edad704 100644
--- a/basic.html
+++ b/basic.html
@@ -7,7 +7,6 @@
content="https://ratemyfocus.breckyunits.com/og.png"
/>
<title>RateMyFocus - Measure The Focus Of Your Published Thoughts</title>
- <script src="tf.min.js"></script>
<script src="chart.umd.min.js"></script>
<style>
body {
@@ -95,6 +94,18 @@
.sample-link:hover {
color: #0052a3;
}
+ .loading {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(255, 255, 255, 0.8);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 1000;
+ }
</style>
</head>
<body>
@@ -119,9 +130,7 @@
<textarea id="textInput" placeholder="Paste your text here..."></textarea>
<div>
- <button onclick="analyzeText(); calculateFocusArea();">
- Calculate FocusRating (Basic)
- </button>
+ <button onclick="analyzeText()">Calculate FocusRating (Basic)</button>
<button onclick="analyzeTextPro()" class="pro-button">
Calculate FocusRating (Pro)
</button>
@@ -136,8 +145,6 @@
</div>
<script>
- let embeddings = [];
- let projectedPoints = [];
let chart = null;
function loadSampleData() {
@@ -167,12 +174,9 @@
document.getElementById("focusThought").value = "football";
document.getElementById("textInput").value = sampleMessages;
- // Automatically trigger analysis
analyzeText();
- calculateFocusArea();
}
- // Rest of the JavaScript remains the same
function basicEmbedding(text) {
const words = text
.toLowerCase()
@@ -220,38 +224,48 @@
]);
}
- function analyzeText() {
- const text = document.getElementById("textInput").value;
- embeddings = basicEmbedding(text);
- projectedPoints = simplePCA(embeddings);
- updateVisualization();
- }
-
- function analyzeTextPro() {
- window.location = "https://buy.stripe.com/9AQ3fYgzfgHbguY5kP";
- }
-
- function updateVisualization() {
+ function updateVisualization(
+ projectedPoints,
+ messages,
+ focusEmbedding = null,
+ ) {
const ctx = document.getElementById("plotCanvas").getContext("2d");
if (chart) {
chart.destroy();
}
- chart = new Chart(ctx, {
- type: "scatter",
- data: {
- datasets: [
+ const datasets = [
+ {
+ label: "Thoughts",
+ data: projectedPoints.map((point, index) => ({
+ x: point[0],
+ y: point[1],
+ message: messages[index],
+ })),
+ backgroundColor: "rgba(0, 102, 204, 0.5)",
+ },
+ ];
+
+ // Add focus point if provided
+ if (focusEmbedding) {
+ datasets.push({
+ label: "Target",
+ data: [
{
- label: "Thought Embeddings",
- data: projectedPoints.map((point) => ({
- x: point[0],
- y: point[1],
- })),
- backgroundColor: "rgba(0, 102, 204, 0.5)",
+ x: focusEmbedding[0],
+ y: focusEmbedding[1],
+ message: document.getElementById("focusThought").value,
},
],
- },
+ backgroundColor: "rgba(255, 0, 0, 0.8)",
+ pointRadius: 8,
+ });
+ }
+
+ chart = new Chart(ctx, {
+ type: "scatter",
+ data: { datasets },
options: {
responsive: true,
maintainAspectRatio: false,
@@ -261,30 +275,102 @@
position: "bottom",
},
},
+ plugins: {
+ tooltip: {
+ callbacks: {
+ label: function (context) {
+ return context.raw.message;
+ },
+ },
+ },
+ legend: {
+ display: true,
+ },
+ },
},
});
}
- function calculateFocusArea() {
- const focusThought = document
- .getElementById("focusThought")
- .value.toLowerCase();
- const text = document.getElementById("textInput").value;
- const lines = text
- .toLowerCase()
- .split(/\n+/)
- .filter((w) => w.length > 0);
+ function showLoading() {
+ const loadingDiv = document.createElement("div");
+ loadingDiv.className = "loading";
+ loadingDiv.id = "loadingIndicator";
+
+ const spinnerHTML = `
+ <div style="text-align: center;">
+ <div style="border: 4px solid #f3f3f3;
+ border-top: 4px solid #0066cc;
+ border-radius: 50%;
+ width: 40px;
+ height: 40px;
+ animation: spin 1s linear infinite;
+ margin: 0 auto;
+ margin-bottom: 10px;">
+ </div>
+ <div style="color: #0066cc; font-weight: 500;">Analyzing...</div>
+ </div>
+ `;
- const totalLines = lines.length;
- const hits = lines.filter((line) => line.includes(focusThought)).length;
- const focusRating = (100 * hits) / totalLines;
+ loadingDiv.innerHTML = spinnerHTML;
+ document.body.appendChild(loadingDiv);
+ }
- document.getElementById("results").innerHTML = `
- <h3>RateMyFocus Results</h3>
- <p>Total Thoughts: ${totalLines}</p>
- <p>FocusRating for <b>${focusThought}</b>: ${focusRating.toFixed(0)}% 🔍</p>
- `;
+ function hideLoading() {
+ const loadingDiv = document.getElementById("loadingIndicator");
+ if (loadingDiv) {
+ loadingDiv.remove();
+ }
}
+
+ function analyzeText() {
+ showLoading();
+
+ setTimeout(() => {
+ const text = document.getElementById("textInput").value;
+ const focusThought = document.getElementById("focusThought").value;
+ const lines = text.split(/\n+/).filter((line) => line.length > 0);
+
+ const totalLines = lines.length;
+ const hits = lines.filter((line) =>
+ line.toLowerCase().includes(focusThought.toLowerCase()),
+ ).length;
+
+ const focusRating = (100 * hits) / totalLines;
+
+ const embeddings = basicEmbedding(text);
+ const focusEmbedding = basicEmbedding(focusThought)[0];
+ const projectedPoints = simplePCA(embeddings);
+
+ const focusProjected = simplePCA([focusEmbedding])[0];
+
+ updateVisualization(projectedPoints, lines, focusProjected);
+
+ document.getElementById("results").innerHTML = `
+ <h3>RateMyFocus Results</h3>
+ <p>Total Thoughts: ${totalLines}</p>
+ <p>FocusRating for <b>${focusThought}</b>: ${focusRating.toFixed(1)}% 🔍</p>
+ <p><small>Using basic word matching</small></p>
+ `;
+
+ hideLoading();
+ }, 100); // Small delay to ensure loading indicator shows even for quick operations
+ }
+
+ async function analyzeTextPro() {
+ window.location = "https://buy.stripe.com/9AQ3fYgzfgHbguY5kP";
+ }
+
+ // Add the spin animation to the existing style section
+ const styleSheet = document.styleSheets[0];
+ styleSheet.insertRule(
+ `
+ @keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+ }
+`,
+ styleSheet.cssRules.length,
+ );
</script>
</body>
</html>
------------------------------------------------------------
commit 3604265a708db0b3051d54397f99a30ffcde4f4c
Author: ffff:72.234.190.31 <ffff:72.234.190.31@thoughtfocus.breckyunits.com>
Date: Mon Nov 11 15:55:05 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 451449c..6128863 100644
--- a/basic.html
+++ b/basic.html
@@ -113,17 +113,17 @@
</div>
<p>
Paste everything you published today, each message or document on its
- own line. Emails, tweets, texts, etc, to calculate your RateMyFocus.
+ own line. Emails, tweets, texts, etc, to calculate your FocusRating.
</p>
<textarea id="textInput" placeholder="Paste your text here..."></textarea>
<div>
<button onclick="analyzeText(); calculateFocusArea();">
- Calculate RateMyFocus (Basic)
+ Calculate FocusRating (Basic)
</button>
<button onclick="analyzeTextPro()" class="pro-button">
- Calculate RateMyFocus (Pro)
+ Calculate FocusRating (Pro)
</button>
</div>
------------------------------------------------------------
commit 9a89c458d78de1ec68d72205239eaa4d67a3ede4
Author: ffff:72.234.190.31 <ffff:72.234.190.31@thoughtfocus.breckyunits.com>
Date: Mon Nov 11 15:54:19 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 816c733..451449c 100644
--- a/basic.html
+++ b/basic.html
@@ -4,9 +4,9 @@
<meta charset="UTF-8" />
<meta
property="og:image"
- content="https://thoughtfocus.breckyunits.com/og.png"
+ content="https://ratemyfocus.breckyunits.com/og.png"
/>
- <title>ThoughtFocus - Measure Your Focus By Your Words</title>
+ <title>RateMyFocus - Measure The Focus Of Your Published Thoughts</title>
<script src="tf.min.js"></script>
<script src="chart.umd.min.js"></script>
<style>
@@ -99,7 +99,9 @@
</head>
<body>
<div class="container">
- <h1>ThoughtFocus · Measure Your Focus by Your Words · TF = FT/T</h1>
+ <h1>
+ RateMyFocus · Measure The Focus of Your Published Thoughts · FR = FT/T
+ </h1>
<div class="input-container">
<input
@@ -110,18 +112,18 @@
<a class="sample-link" onclick="loadSampleData()">Sample</a>
</div>
<p>
- Paste everything you wrote today, each message or document on its own
- line. Emails, tweets, texts, etc, to calculate your ThoughtFocus.
+ Paste everything you published today, each message or document on its
+ own line. Emails, tweets, texts, etc, to calculate your RateMyFocus.
</p>
<textarea id="textInput" placeholder="Paste your text here..."></textarea>
<div>
<button onclick="analyzeText(); calculateFocusArea();">
- Calculate ThoughtFocus (Basic)
+ Calculate RateMyFocus (Basic)
</button>
<button onclick="analyzeTextPro()" class="pro-button">
- Calculate ThoughtFocus (Pro)
+ Calculate RateMyFocus (Pro)
</button>
</div>
@@ -275,12 +277,12 @@
const totalLines = lines.length;
const hits = lines.filter((line) => line.includes(focusThought)).length;
- const focusScore = (100 * hits) / totalLines;
+ const focusRating = (100 * hits) / totalLines;
document.getElementById("results").innerHTML = `
- <h3>ThoughtFocus Results</h3>
+ <h3>RateMyFocus Results</h3>
<p>Total Thoughts: ${totalLines}</p>
- <p>ThoughtFocus for <b>${focusThought}</b>: ${focusScore.toFixed(0)}% 🔍</p>
+ <p>FocusRating for <b>${focusThought}</b>: ${focusRating.toFixed(0)}% 🔍</p>
`;
}
</script>
------------------------------------------------------------
commit 92d15108e761eab5273f083b065ab07d5faeea9b
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:45:34 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 9918db8..816c733 100644
--- a/basic.html
+++ b/basic.html
@@ -23,7 +23,7 @@
color: black;
}
.pro-button:hover {
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
background: gold;
color: black;
}
------------------------------------------------------------
commit e300a992a72b782683915b68519744806a3d3e06
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:45:20 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 0350212..9918db8 100644
--- a/basic.html
+++ b/basic.html
@@ -23,7 +23,7 @@
color: black;
}
.pro-button:hover {
- opacity: 0.5;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
background: gold;
color: black;
}
------------------------------------------------------------
commit 9513cc512666c859f121bcebb4972ea0e07a0bea
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:45:08 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 3a9931b..0350212 100644
--- a/basic.html
+++ b/basic.html
@@ -23,7 +23,7 @@
color: black;
}
.pro-button:hover {
- opacity: 0.9;
+ opacity: 0.5;
background: gold;
color: black;
}
------------------------------------------------------------
commit 062433255586953d54609c4ca976d328902bc763
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:44:49 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 0f10772..3a9931b 100644
--- a/basic.html
+++ b/basic.html
@@ -24,6 +24,7 @@
}
.pro-button:hover {
opacity: 0.9;
+ background: gold;
color: black;
}
.container {
------------------------------------------------------------
commit c2a6b7d6dd7b51703ec77b3d5938270e8ee2a3f5
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:44:42 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 0403701..0f10772 100644
--- a/basic.html
+++ b/basic.html
@@ -22,6 +22,10 @@
background: gold;
color: black;
}
+ .pro-button:hover {
+ opacity: 0.9;
+ color: black;
+ }
.container {
background: white;
padding: 20px;
------------------------------------------------------------
commit 86009c2b6b26d52788593bfe3faeb11df6dceefe
Author: ffff:24.165.26.201 <ffff:24.165.26.201@hub.scroll.pub>
Date: Mon Nov 11 01:43:54 2024 +0000
Updated basic.html
diff --git a/basic.html b/basic.html
index 806ef1d..0403701 100644
--- a/basic.html
+++ b/basic.html
@@ -20,6 +20,7 @@
}
.pro-button {
background: gold;
+ color: black;
}
.container {
background: white;