Repository: monolesan/fix-posture Branch: master Commit: 441d4aa7b934 Files: 7 Total size: 43.4 KB Directory structure: gitextract_41cl6_5b/ ├── .glitch-assets ├── LICENSE.md ├── README.md ├── index.html ├── posenet.js ├── script.js └── style.css ================================================ FILE CONTENTS ================================================ ================================================ FILE: .glitch-assets ================================================ {"name":"drag-in-files.svg","date":"2016-10-22T16:17:49.954Z","url":"https://cdn.hyperdev.com/drag-in-files.svg","type":"image/svg","size":7646,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/drag-in-files.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(102, 153, 205)","uuid":"adSBq97hhhpFNUna"} {"name":"click-me.svg","date":"2016-10-23T16:17:49.954Z","url":"https://cdn.hyperdev.com/click-me.svg","type":"image/svg","size":7116,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/click-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(243, 185, 186)","uuid":"adSBq97hhhpFNUnb"} {"name":"paste-me.svg","date":"2016-10-24T16:17:49.954Z","url":"https://cdn.hyperdev.com/paste-me.svg","type":"image/svg","size":7242,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/paste-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(42, 179, 185)","uuid":"adSBq97hhhpFNUnc"} {"uuid":"adSBq97hhhpFNUna","deleted":true} {"uuid":"adSBq97hhhpFNUnb","deleted":true} {"uuid":"adSBq97hhhpFNUnc","deleted":true} {"name":"header.svg","date":"2019-09-03T10:16:41.155Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fheader.svg","type":"image/svg+xml","size":65538,"imageWidth":302,"imageHeight":79,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fheader.svg","thumbnailWidth":302,"thumbnailHeight":79,"uuid":"kvufGrZopH1N79fJ"} {"name":"creationprocess.svg","date":"2019-09-04T00:45:12.850Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fcreationprocess.svg","type":"image/svg+xml","size":160223,"imageWidth":326,"imageHeight":171,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fcreationprocess.svg","thumbnailWidth":326,"thumbnailHeight":171,"uuid":"W36L1drdKYMHNIkm"} {"name":"point.svg","date":"2019-09-04T02:48:33.734Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fpoint.svg","type":"image/svg+xml","size":847,"imageWidth":31,"imageHeight":29,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fpoint.svg","thumbnailWidth":31,"thumbnailHeight":29,"uuid":"OItIeQX5SnAHdt59"} {"name":"fav.png","date":"2019-09-05T08:27:20.061Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Ffav.png","type":"image/png","size":754,"imageWidth":32,"imageHeight":32,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Ffav.png","thumbnailWidth":32,"thumbnailHeight":32,"uuid":"ZpxJQkMiNvCe2gpy"} {"name":"fav2.png","date":"2019-09-05T08:27:20.197Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Ffav2.png","type":"image/png","size":701,"imageWidth":32,"imageHeight":32,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Ffav2.png","thumbnailWidth":32,"thumbnailHeight":32,"uuid":"8DwHB4QlluLRx5e4"} {"name":"how does it work_ ai journey map.png","date":"2019-09-07T05:51:07.419Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","type":"image/png","size":69233,"imageWidth":1627,"imageHeight":815,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","thumbnailWidth":330,"thumbnailHeight":166,"uuid":"lMpHbSJf7M9JxPqN"} {"uuid":"lMpHbSJf7M9JxPqN","deleted":true} {"name":"how does it work_ ai journey map.png","date":"2019-09-07T05:54:17.983Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","type":"image/png","size":69233,"imageWidth":1627,"imageHeight":815,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","thumbnailWidth":330,"thumbnailHeight":166,"uuid":"EkLO6EIjkTZ9J4nH"} {"name":"Human journey map.png","date":"2019-09-07T05:54:33.398Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2FHuman%20journey%20map.png","type":"image/png","size":118252,"imageWidth":2765,"imageHeight":806,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2FHuman%20journey%20map.png","thumbnailWidth":330,"thumbnailHeight":97,"uuid":"Fw9QjyrkhLWAjcys"} {"uuid":"Fw9QjyrkhLWAjcys","deleted":true} {"name":"Human journey map.png","date":"2019-09-07T06:00:50.575Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2FHuman%20journey%20map.png","type":"image/png","size":118252,"imageWidth":2765,"imageHeight":806,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2FHuman%20journey%20map.png","thumbnailWidth":330,"thumbnailHeight":97,"uuid":"zsBPxhEd9z7yfEqg"} {"uuid":"zsBPxhEd9z7yfEqg","deleted":true} {"uuid":"EkLO6EIjkTZ9J4nH","deleted":true} {"name":"how does it work_ ai journey map.png","date":"2019-09-07T06:01:10.477Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","type":"image/png","size":146007,"imageWidth":1627,"imageHeight":1852,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","thumbnailWidth":290,"thumbnailHeight":330,"uuid":"97OiC8Cz9uzzmRNw"} {"uuid":"97OiC8Cz9uzzmRNw","deleted":true} {"name":"how does it work_ ai journey map.png","date":"2019-09-07T06:02:04.377Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","type":"image/png","size":69233,"imageWidth":1627,"imageHeight":815,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fhow%20does%20it%20work_%20ai%20journey%20map.png","thumbnailWidth":330,"thumbnailHeight":166,"uuid":"9UYBmYvAXgxzinQI"} {"name":"Human journey map.png","date":"2019-09-07T06:02:04.735Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2FHuman%20journey%20map.png","type":"image/png","size":146007,"imageWidth":1627,"imageHeight":1852,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2FHuman%20journey%20map.png","thumbnailWidth":290,"thumbnailHeight":330,"uuid":"ni6GbMxnpAQaGBLz"} {"name":"short description idea.png","date":"2019-09-07T07:00:28.766Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fshort%20description%20idea.png","type":"image/png","size":216313,"imageWidth":1440,"imageHeight":2348,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fshort%20description%20idea.png","thumbnailWidth":203,"thumbnailHeight":330,"uuid":"bDNKpcwAIspoSYJt"} {"name":"fix posture.png","date":"2019-09-07T07:48:37.612Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Ffix%20posture.png","type":"image/png","size":296938,"imageWidth":1627,"imageHeight":3646,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Ffix%20posture.png","thumbnailWidth":148,"thumbnailHeight":330,"uuid":"lRddbj7AjD1DuGrv"} {"name":"links.png","date":"2019-09-07T08:07:34.548Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flinks.png","type":"image/png","size":61466,"imageWidth":1627,"imageHeight":890,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flinks.png","thumbnailWidth":330,"thumbnailHeight":181,"uuid":"NH5YhVcJzpadpk6f"} {"uuid":"NH5YhVcJzpadpk6f","deleted":true} {"name":"links.png","date":"2019-09-07T08:09:38.589Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flinks.png","type":"image/png","size":59121,"imageWidth":1627,"imageHeight":714,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flinks.png","thumbnailWidth":330,"thumbnailHeight":145,"uuid":"pX3PTOF4JyGN30QL"} {"name":"headersss.png","date":"2019-09-07T08:57:38.012Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fheadersss.png","type":"image/png","size":138692,"imageWidth":1344,"imageHeight":1007,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fheadersss.png","thumbnailWidth":330,"thumbnailHeight":248,"uuid":"KkDuOFuvCtZl6n43"} {"uuid":"KkDuOFuvCtZl6n43","deleted":true} {"name":"headersss.png","date":"2019-09-07T09:38:04.879Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fheadersss.png","type":"image/png","size":152363,"imageWidth":1344,"imageHeight":929,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fheadersss.png","thumbnailWidth":330,"thumbnailHeight":229,"uuid":"WFtjNgCzP4AwKETd"} {"name":"lists.png","date":"2019-09-07T09:46:26.218Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flists.png","type":"image/png","size":43845,"imageWidth":1120,"imageHeight":1202,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flists.png","thumbnailWidth":308,"thumbnailHeight":330,"uuid":"siQid6ydqV8KJpl3"} {"name":"code window.png","date":"2019-09-07T09:57:42.173Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fcode%20window.png","type":"image/png","size":24998,"imageWidth":1042,"imageHeight":480,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fcode%20window.png","thumbnailWidth":330,"thumbnailHeight":153,"uuid":"Ra2yUB1uIb9Toua7"} {"name":"experiment.gif","date":"2019-09-07T10:16:15.440Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fexperiment.gif","type":"image/gif","size":502014,"imageWidth":600,"imageHeight":317,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fexperiment.gif","thumbnailWidth":330,"thumbnailHeight":175,"uuid":"i8QvmszpOA5nQEpc"} {"name":"little design system.png","date":"2019-09-07T11:02:50.317Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flittle%20design%20system.png","type":"image/png","size":94567,"imageWidth":1627,"imageHeight":1964,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flittle%20design%20system.png","thumbnailWidth":274,"thumbnailHeight":330,"uuid":"Lli080heDKVGd13y"} {"name":"lists.png","date":"2019-09-08T07:41:09.880Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flists.png","type":"image/png","size":44527,"imageWidth":1120,"imageHeight":1296,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flists.png","thumbnailWidth":286,"thumbnailHeight":330,"uuid":"fwHdWgyBaciqsY6z"} {"name":"code window.png","date":"2019-09-08T07:41:10.028Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fcode%20window.png","type":"image/png","size":27077,"imageWidth":1344,"imageHeight":649,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fcode%20window.png","thumbnailWidth":330,"thumbnailHeight":160,"uuid":"AOgrbGulPXtUBFhF"} {"name":"links.png","date":"2019-09-08T07:41:10.207Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Flinks.png","type":"image/png","size":59598,"imageWidth":1627,"imageHeight":767,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Flinks.png","thumbnailWidth":330,"thumbnailHeight":156,"uuid":"A9aRwAYG6E4IltIw"} {"name":"headersss.png","date":"2019-09-08T07:41:15.635Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fheadersss.png","type":"image/png","size":154134,"imageWidth":1344,"imageHeight":1064,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fheadersss.png","thumbnailWidth":330,"thumbnailHeight":262,"uuid":"W2MQ571dHzBWZ3qq"} {"uuid":"pX3PTOF4JyGN30QL","deleted":true} {"uuid":"Ra2yUB1uIb9Toua7","deleted":true} {"uuid":"siQid6ydqV8KJpl3","deleted":true} {"name":"pictures.png","date":"2019-09-08T12:14:27.916Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fpictures.png","type":"image/png","size":68604,"imageWidth":1627,"imageHeight":767,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fpictures.png","thumbnailWidth":330,"thumbnailHeight":156,"uuid":"uiwaL2DDICWHnRTb"} {"uuid":"uiwaL2DDICWHnRTb","deleted":true} {"name":"pictures.png","date":"2019-09-08T12:22:06.338Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fpictures.png","type":"image/png","size":100907,"imageWidth":1627,"imageHeight":1315,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fpictures.png","thumbnailWidth":330,"thumbnailHeight":267,"uuid":"bldCXXtGbtLpinRG"} {"uuid":"bldCXXtGbtLpinRG","deleted":true} {"name":"pictures.png","date":"2019-09-08T12:25:16.091Z","url":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fpictures.png","type":"image/png","size":100923,"imageWidth":1627,"imageHeight":1315,"thumbnail":"https://cdn.glitch.com/ec7ef02b-8dc9-4e3b-92c9-82124d3c2d83%2Fthumbnails%2Fpictures.png","thumbnailWidth":330,"thumbnailHeight":267,"uuid":"yAjnJjslsCaLAPcH"} ================================================ FILE: LICENSE.md ================================================ MIT License Copyright (c) 2019 monolesan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ Can we solve a problem of poor posture using webcamera and pose tracking? ========================================================================== Fix Posture is an experimental project where A.I. tracks posture and blurs the screen if a person is sitting poorly. Made with TensorFlow.js PoseNet model, ml5.js and p5.js. * posenet.js is a part with A.I. * script.js is a file with UI tricks Made by me (by monolesan!!!) My links: * instagram: https://www.instagram.com/monolesan/ * twitter: https://twitter.com/monolesan * my cooooooooool website that I made with TensorFlow.js Facemesh model: https://monolesan.com/ Project's website: https://fix-posture.glitch.me/ ----- Code on Glitch: https://glitch.com/~fix-posture Design on Figma: https://www.figma.com/file/hvYOl9g4oO2UaTpVOqRwcF/AI-experiments-by-me-Good-posture?node-id=0%3A1 ================================================ FILE: index.html ================================================ Fix posture
================================================ FILE: posenet.js ================================================ let video; let poseNet; let poses = []; var started = false; function setup() { const canvas = createCanvas(640, 480); // or use to make fullscreen canvas window.innerWidth, window.innerHeight, but you should to change the formula in changeFontSize() canvas.parent('videoContainer'); // Video capture video = createCapture(VIDEO); video.size(width, height); if (video == true) {console.log('true');} // Create a new poseNet method with a single detection poseNet = ml5.poseNet(video, modelReady); // This sets up an event that fills the global variable "poses" // with an array every time new poses are detected poseNet.on('pose', function(results) { poses = results; }); // Hide the video element, and just show the canvas video.hide(); noLoop(); } // This function turns on AI function start() { select('#startbutton').html('stop') document.getElementById('startbutton').addEventListener('click', stop); started = true; loop(); } // This function stops the experiment function stop() { select('#startbutton').html('start') document.getElementById('startbutton').addEventListener('click', start); removeBlur(); started = false; noLoop(); } function draw() { if(started){ //We use white picture as background. You can comment this line and see what will happen. It's cool glitch effect. // image(whitePicture, 0, 0, width, height); image(video, 0, 0, width, height); drawEyes(); } } function modelReady(){ // select('#text').html('Hmm... What is it? It’s time to move! AI has turned on. You can insert your text here.') } var rightEye, leftEye, rightShoulder, leftShoulder, rightWrist, leftWrist, rightKnee, leftKnee, rightAnkle, leftAnkle, distanceEye, defaultRightEyePosition = [], defaultLeftEyePosition = []; // A function to draw ellipses over the detected keypoints function drawEyes() { // Loop through all the poses detected for (let i = 0; i < poses.length; i++) { // For each pose detected, loop through all the keypoints let pose = poses[i].pose; for (let j = 0; j < pose.keypoints.length; j++) { // A keypoint is an object describing a body part (like rightArm or leftShoulder) let keypoint = pose.keypoints[j]; rightEye = pose.keypoints[2].position; leftEye = pose.keypoints[1].position; rightShoulder = pose.keypoints[6].position; leftShoulder = pose.keypoints[5].position; rightWrist = pose.keypoints[10].position; leftWrist = pose.keypoints[9].position; rightKnee = pose.keypoints[14].position; leftKnee = pose.keypoints[13].position; rightAnkle = pose.keypoints[16].position; leftAnkle = pose.keypoints[15].position; //Position of eyes when a human opens experiment page. Start position. while(defaultRightEyePosition.length < 1) { defaultRightEyePosition.push(rightEye.y); } while(defaultLeftEyePosition.length < 1) { defaultLeftEyePosition.push(leftEye.y); } //Math.abs converts a negative number to a positive one if (Math.abs(rightEye.y - defaultRightEyePosition[0]) > 15) { blurScreen(); } if (Math.abs(rightEye.y - defaultRightEyePosition[0]) < 15) { removeBlur(); } // Only draw an eye is the pose probability is bigger than 0.2 if (keypoint.score > 0.9 ) { fill(255, 0, 0); noStroke(); ellipse(rightEye.x, rightEye.y, 10, 10); ellipse(leftEye.x, leftEye.y, 10, 10); console.log(Math.abs(rightEye.y - defaultRightEyePosition[0])); } } } } function blurScreen() { document.body.style.filter = 'blur(10px)'; document.body.style.transition= '0.9s'; } function removeBlur() { document.body.style.filter = 'blur(0px)'; } ================================================ FILE: script.js ================================================ var reminderText = document.getElementById('reminderText'); function reminder() { reminderText.style.transition= '0.3s'; reminderText.style.borderBottom = 'thick solid red'; } function reminderOff() { reminderText.style.borderBottom = 'none'; } function highlightCode(codeId) { document.getElementById(codeId + '_code').style.color = 'red'; document.getElementById(codeId + '_code').style.transition= '0.3s'; } function removeHighlight(codeId) { document.getElementById(codeId + '_code').style.color = 'black'; } ================================================ FILE: style.css ================================================ /* SHADOWS */ .left_shadow { box-shadow: -6px 4px 0px rgba(0, 0, 0, 0.54); } .left_shadow:active { box-shadow: -3px 3px 0px rgba(0, 0, 0, 0.54); } .right_shadow { box-shadow: 5px 4px 0px rgba(0, 0, 0, 0.54); } .right_shadow:active { box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.54); } /* CARD SETTTTTTINGS */ .pink { background: #FDEAFF; } .yellow { background: #FFF96C; } .card { border: 3px solid #000000; padding: 24px 30px 20px 36px; margin-bottom: 1em; max-width: 900px; /* font */ font-family: Poppins; font-style: italic; font-weight: 500; font-size: 25px; line-height: 37px; } .textblock { padding: 24px 15px 20px 20px; margin-bottom: 0.5em; max-width: 900px; /* max-height: 400px; */ font-family: Poppins; font-weight: 500; font-size: 25px; line-height: 37px; } .code { border: 3px solid #000000; padding: 16px 16px 16px 24px; max-width: 900px; font-family: 'VT323', monospace; font-size: 25px; } /* ADDITIONAL CARD SETTINGS */ .right_align { display: flex; justify-content: flex-end; } .double_cards { display: flex; justify-content: space-between; } .small { max-width: 378px; /* max-height: 100px; */ } .middle { max-width: 476px; max-height: 250px; } .code_explain { border-bottom: thick solid red; } .comment { color: gray; } button { border: 4px solid #000000; padding: 0px 48px 0px 48px; box-sizing: border-box; /* font */ font-family: Poppins; font-style: italic; font-weight: 900; font-size: 25px; line-height: 37px; /* identical to box height */ display: flex; align-items: center; text-align: center; } button: active { outline: none; } button:focus { outline: none; } a { border: 4px solid #000000; box-sizing: border-box; /* font */ font-family: Poppins; font-style: italic; font-weight: 500; font-size: 25px; line-height: 37px; color: black; text-decoration: none; } a:hover, button:hover { /* background: #F064FF; */ cursor: pointer; background: red; } .a_righttext { padding: 0px 4px 0px 12px; } .a_lefttext { padding: 0px 12px 0px 4px; } ul { /* list-style-type: hiragana-iroha; */ list-style-type: katakana; } /* SECTION NAME */ h1 { font-family: Poppins; font-style: italic; font-weight: 900; font-size: 50px; line-height: 75px; color: #FDEAFF; -webkit-text-stroke: 3px black; margin: 0 0 20px 40px; } /* SMALL BLACK HEADER */ h2 { font-family: Poppins; font-style: italic; font-weight: 900; font-size: 30px; line-height: 37px; padding: 0; margin: 0; } img { margin-bottom: 24px; padding: 0 20px 0 20px; } .design_img { max-width: 900px; } /* This is very hard code to hide video under page content */ #videoContainer { position: absolute; z-index: 1; top:0; left:0; } #containerforcontainer{ position: absolute; z-index: 20; top:0; left:0; width: 100%; background: white; } #container { display: flex; align-items: center; flex-direction: column; color: black; } /* VIP THINGS THAT HAVE ID */ #name_img { display: flex; align-content: space-between; } #descriptionText p { margin-bottom: 0; } #startbuttonCont { padding-top: 25px; } #creationprocessHeader { margin-left: 20px; } #firstDesignSection { display: flex; flex-direction: column; align-items: flex-start; } #firstCodeSection { margin-top: 40px; } #solution { max-height: 400px; filter: blur(1px); } @media only screen and (max-width: 810px) { .double_cards { display: flex; flex-direction: column; align-items: center; } .design_img { max-width: 600px; min-width: 200px; } #name_img img { max-width: 220px; } body { font-size: 18px; } }