Changes to posturepro.scroll.pub

root
root
24 days ago
Initial commit
body.html
Changed around line 1
+
+

PosturePro

+

Your AI-powered posture coach

+
+
+
+
+
+
+
+
+
+
Good Posture
+
⚠️ Adjust your posture!
+
+
+
+
+

Posture Tips

+
    +
  • Keep your back straight
  • +
  • Align your ears with your shoulders
  • +
  • Keep your feet flat on the floor
  • +
  • Position your screen at eye level
  • +
    +
    +
    +
    +
    +

    Take care of your posture, take care of your health

    +
    index.scroll
    Changed around line 1
    + buildHtml
    + baseUrl https://posturepro.scroll.pub
    + metaTags
    + editButton /edit.html
    + title PosturePro - Improve Your Sitting Posture with AI
    + style.css
    + body.html
    + script.js
    prompt.json
    Changed around line 1
    + {
    + "id": "6ab9f1bd-ac33-4803-8dd7-0b31e87b62d5",
    + "object": "chat.completion",
    + "created": 1735423528,
    + "model": "deepseek-chat",
    + "choices": [
    + {
    + "index": 0,
    + "message": {
    + "role": "assistant",
    + "content": "---domain---\nposturepro.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://posturepro.scroll.pub\nmetaTags\neditButton /edit.html\ntitle PosturePro - Improve Your Sitting Posture with AI\nstyle.css\nbody.html\nscript.js\n---body.html---\n
    \n

    PosturePro

    \n

    Your AI-powered posture coach

    \n
    \n\n
    \n
    \n
    \n \n \n
    \n
    \n
    Good Posture
    \n
    ⚠️ Adjust your posture!
    \n
    \n
    \n\n
    \n

    Posture Tips

    \n
      \n
    • Keep your back straight
    • \n
    • Align your ears with your shoulders
    • \n
    • Keep your feet flat on the floor
    • \n
    • Position your screen at eye level
    • \n
    \n
    \n
    \n\n
    \n

    Take care of your posture, take care of your health

    \n
    \n---style.css---\n:root {\n --primary-color: #4a90e2;\n --warning-color: #ff4757;\n --success-color: #2ed573;\n --text-color: #2f3542;\n --bg-color: #f1f2f6;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n color: var(--text-color);\n background-color: var(--bg-color);\n margin: 0;\n padding: 0;\n line-height: 1.6;\n}\n\nheader {\n text-align: center;\n padding: 2rem;\n background-color: var(--primary-color);\n color: white;\n}\n\nh1 {\n margin: 0;\n font-size: 2.5rem;\n}\n\nmain {\n max-width: 800px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\n.camera-container {\n position: relative;\n width: 100%;\n max-width: 640px;\n margin: 0 auto;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\nvideo, canvas {\n width: 100%;\n display: block;\n}\n\n.overlay {\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.status-container {\n margin: 1rem 0;\n text-align: center;\n}\n\n#status {\n font-size: 1.5rem;\n font-weight: bold;\n color: var(--success-color);\n}\n\n#warning {\n color: var(--warning-color);\n font-weight: bold;\n opacity: 0;\n transition: opacity 0.3s ease;\n}\n\n.warning-visible {\n opacity: 1;\n}\n\n#tips {\n margin-top: 2rem;\n background: white;\n padding: 1.5rem;\n border-radius: 12px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background-color: var(--primary-color);\n color: white;\n margin-top: 2rem;\n}\n\n@media (max-width: 600px) {\n h1 {\n font-size: 2rem;\n }\n \n .camera-container {\n border-radius: 8px;\n }\n}\n---script.js---\n// Get video element\nconst video = document.getElementById('webcam');\nconst canvas = document.getElementById('posture-canvas');\nconst ctx = canvas.getContext('2d');\nconst statusText = document.getElementById('status');\nconst warningText = document.getElementById('warning');\n\n// Camera setup\nasync function setupCamera() {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n video.srcObject = stream;\n video.onloadedmetadata = () => {\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n processPosture();\n };\n } catch (error) {\n console.error('Error accessing webcam:', error);\n }\n}\n\n// Posture processing\nfunction processPosture() {\n // Draw video frame to canvas\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n \n // Basic posture detection (placeholder logic)\n const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n const brightness = calculateAverageBrightness(imageData);\n \n // Simple posture check based on brightness (example logic)\n if (brightness < 100) {\n statusText.textContent = \"Poor Posture\";\n statusText.style.color = \"var(--warning-color)\";\n warningText.classList.add('warning-visible');\n } else {\n statusText.textContent = \"Good Posture\";\n statusText.style.color = \"var(--success-color)\";\n warningText.classList.remove('warning-visible');\n }\n \n // Repeat processing\n requestAnimationFrame(processPosture);\n}\n\n// Helper function to calculate brightness\nfunction calculateAverageBrightness(imageData) {\n let total = 0;\n const data = imageData.data;\n \n for (let i = 0; i < data.length; i += 4) {\n total += (data[i] + data[i+1] + data[i+2]) / 3;\n }\n \n return total / (data.length / 4);\n}\n\n// Initialize\nsetupCamera();\n---end---"
    + },
    + "logprobs": null,
    + "finish_reason": "stop"
    + }
    + ],
    + "usage": {
    + "prompt_tokens": 258,
    + "completion_tokens": 1312,
    + "total_tokens": 1570,
    + "prompt_cache_hit_tokens": 0,
    + "prompt_cache_miss_tokens": 258
    + },
    + "system_fingerprint": "fp_f1afce2943"
    + }
    readme.scroll
    Changed around line 1
    + # posturepro.scroll.pub
    + Website generated by DeepSeek from prompt: Design a minimalistic and user-friendly web application that leverages computer vision to promote better sitting posters using webcam and give warning
    script.js
    Changed around line 1
    + // Get video element
    + const video = document.getElementById('webcam');
    + const canvas = document.getElementById('posture-canvas');
    + const ctx = canvas.getContext('2d');
    + const statusText = document.getElementById('status');
    + const warningText = document.getElementById('warning');
    +
    + // Camera setup
    + async function setupCamera() {
    + try {
    + const stream = await navigator.mediaDevices.getUserMedia({ video: true });
    + video.srcObject = stream;
    + video.onloadedmetadata = () => {
    + canvas.width = video.videoWidth;
    + canvas.height = video.videoHeight;
    + processPosture();
    + };
    + } catch (error) {
    + console.error('Error accessing webcam:', error);
    + }
    + }
    +
    + // Posture processing
    + function processPosture() {
    + // Draw video frame to canvas
    + ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
    +
    + // Basic posture detection (placeholder logic)
    + const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
    + const brightness = calculateAverageBrightness(imageData);
    +
    + // Simple posture check based on brightness (example logic)
    + if (brightness < 100) {
    + statusText.textContent = "Poor Posture";
    + statusText.style.color = "var(--warning-color)";
    + warningText.classList.add('warning-visible');
    + } else {
    + statusText.textContent = "Good Posture";
    + statusText.style.color = "var(--success-color)";
    + warningText.classList.remove('warning-visible');
    + }
    +
    + // Repeat processing
    + requestAnimationFrame(processPosture);
    + }
    +
    + // Helper function to calculate brightness
    + function calculateAverageBrightness(imageData) {
    + let total = 0;
    + const data = imageData.data;
    +
    + for (let i = 0; i < data.length; i += 4) {
    + total += (data[i] + data[i+1] + data[i+2]) / 3;
    + }
    +
    + return total / (data.length / 4);
    + }
    +
    + // Initialize
    + setupCamera();
    style.css
    Changed around line 1
    + :root {
    + --primary-color: #4a90e2;
    + --warning-color: #ff4757;
    + --success-color: #2ed573;
    + --text-color: #2f3542;
    + --bg-color: #f1f2f6;
    + }
    +
    + body {
    + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    + color: var(--text-color);
    + background-color: var(--bg-color);
    + margin: 0;
    + padding: 0;
    + line-height: 1.6;
    + }
    +
    + header {
    + text-align: center;
    + padding: 2rem;
    + background-color: var(--primary-color);
    + color: white;
    + }
    +
    + h1 {
    + margin: 0;
    + font-size: 2.5rem;
    + }
    +
    + main {
    + max-width: 800px;
    + margin: 2rem auto;
    + padding: 0 1rem;
    + }
    +
    + .camera-container {
    + position: relative;
    + width: 100%;
    + max-width: 640px;
    + margin: 0 auto;
    + border-radius: 12px;
    + overflow: hidden;
    + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    + }
    +
    + video, canvas {
    + width: 100%;
    + display: block;
    + }
    +
    + .overlay {
    + position: absolute;
    + top: 0;
    + left: 0;
    + }
    +
    + .status-container {
    + margin: 1rem 0;
    + text-align: center;
    + }
    +
    + #status {
    + font-size: 1.5rem;
    + font-weight: bold;
    + color: var(--success-color);
    + }
    +
    + #warning {
    + color: var(--warning-color);
    + font-weight: bold;
    + opacity: 0;
    + transition: opacity 0.3s ease;
    + }
    +
    + .warning-visible {
    + opacity: 1;
    + }
    +
    + #tips {
    + margin-top: 2rem;
    + background: white;
    + padding: 1.5rem;
    + border-radius: 12px;
    + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    + }
    +
    + footer {
    + text-align: center;
    + padding: 1rem;
    + background-color: var(--primary-color);
    + color: white;
    + margin-top: 2rem;
    + }
    +
    + @media (max-width: 600px) {
    + h1 {
    + font-size: 2rem;
    + }
    +
    + .camera-container {
    + border-radius: 8px;
    + }
    + }