Rrremark.com Overlay Highlighter

Developer
Size
4,438 Kb
Views
8,096

How do I make an rrremark.com overlay highlighter?

This is the overlay highlighter for rrremark.com's chrome extension. rrremark.com is a platform that lets you capture your inspiration on the web with screenshots and leave your remark on each one asking why it inspires you.. What is a rrremark.com overlay highlighter? How do you make a rrremark.com overlay highlighter? This script and codes were developed by Derick Ruiz on 27 December 2022, Tuesday.

Rrremark.com Overlay Highlighter Previews

Rrremark.com Overlay Highlighter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>rrremark.com Overlay Highlighter</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Inconsolata:400,700'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div data-behavior="mouse_move" id="rrremarkOverlay"></div> <div data-behavior="position_mouse" id="rrremarkCrosshairs"></div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Rrremark.com Overlay Highlighter - Script Codes CSS Codes

/* Foundation */
* { box-sizing: border-box;
}
*:before,
*:after { box-sizing: border-box;
}
html { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100%;
}
body { margin: 0; font-size: 14px; height: 100%;
}
h1,
h2,
h3,
h4,
p,
blockquote,
figure,
ol,
ul { margin: 0; padding: 0;
}
ul,
ol { list-style-type: none;
}
li { display: block;
}
h1,
h2,
h3,
h4 { font-size: inherit;
}
a { text-decoration: none; color: inherit;
}
img { max-width: 100%; height: auto; border: 0;
}
input { margin: 0; font-family: inherit; color: inherit; line-height: normal; border-radius: 0; -webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner { border: 0; padding: 0;
}
html { /* Typography related rules */ text-rendering: optimizeLegibility; -moz-font-feature-settings: "kern=0"; -ms-font-feature-settings: "kern" 0; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -o-font-smoothing: antialiased; -webkit-appearance: none;
}
body { font-size: 100%; font-family: "Inconsolata", "Courier New", Courier, monospace; background-color: #fdfdfd; color: #333; font-weight: 400;
}
#rrremarkOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 255, 0.5);
}
#rrremarkOverlay[data-state~="highlighting"] { background-color: rgba(0, 0, 255, 0.05); border-color: rgba(0, 0, 255, 0.5); border-style: solid;
}
#rrremarkCrosshairs { height: 100%; position: absolute; width: 100%; z-index: 2147483646;
}
#rrremarkCrosshairs::before,
#rrremarkCrosshairs::after { content: ""; height: 100%; width: 100%; position: absolute; border: none !important; -o-border-image: !important; border-image: !important;
}
#rrremarkCrosshairs::before { left: -100%; top: -100%; border-right: 1px solid white !important; border-bottom: 1px solid white !important;
}
#rrremarkCrosshairs::after { left: 0px; top: 0px; border-top: 1px solid white !important; border-left: 1px solid white !important;
}
.container { clear: both; overflow: hidden; width: 100%; height: 100%; background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/260969/Screen_Shot_2015-12-29_at_5.27.02_PM.png"); background-repeat: no-repeat; background-size: cover;
}

Rrremark.com Overlay Highlighter - Script Codes JS Codes

$(function () { /* Element references */ var overlay = document.querySelector("[data-behavior~='mouse_move']"), crosshairs = document.querySelector("[data-behavior~='position_mouse']"); var isMouseDown = false, windowWidth = $(window).width(), windowHeight = $(window).height(), startX, startY, endY, endX, coordinates = {}, borderWidth; window.rrremarkOverlayCoordinates = coordinates; $(document).mousedown(function (e) { isMouseDown = true; startX = e.clientX; startY = e.clientY; }); $(document).mousemove(function (e) { crosshairs.style.left = e.clientX + "px"; crosshairs.style.top = e.clientY + "px"; if (isMouseDown) { endY = e.clientY; endX = e.clientX; overlay.setAttribute('data-state', 'highlighting'); /* Change how the borderWidth is being calculated based on the x and y values. */ if (endX >= startX && endY >= startY) { console.log("endX >= startX && endY >= startY"); coordinates.startX = startX; coordinates.endX = endX; coordinates.startY = startY; coordinates.endY = endY; borderWidth = startY + "px " + (windowWidth - endX) + "px " + (windowHeight - endY) + "px " + startX + "px"; overlay.style.borderWidth = borderWidth; } else if (endX <= startX && endY >= startY) { console.log("endX <= startX && endY >= startY"); coordinates.startX = endX; coordinates.endX = startX; coordinates.startY = startY; coordinates.endY = endY; borderWidth = startY + "px " + (windowWidth - startX) + "px " + (windowHeight - endY) + "px " + endX + "px"; overlay.style.borderWidth = borderWidth; } else if (endX >= startX && endY <= startY) { console.log("endX >= startX && endY <= startY"); coordinates.startX = startX; coordinates.endX = endX; coordinates.startY = endY; coordinates.endY = startY; borderWidth = endY + "px " + (windowWidth - endX) + "px " + (windowHeight - startY) + "px " + startX + "px"; overlay.style.borderWidth = borderWidth; } else if (endX <= startX && endY <= startY) { console.log("endX <= startX && endY <= startY"); coordinates.startX = endX; coordinates.endX = startX; coordinates.startY = endY; coordinates.endY = startY; borderWidth = endY + "px " + (windowWidth - startX) + "px " + (windowHeight - startY) + "px " + endX + "px"; overlay.style.borderWidth = borderWidth; } console.log("What's borderWidth", borderWidth); } }); $(document).mouseup(function (e) { isMouseDown = false; overlay.removeAttribute('style'); overlay.removeAttribute('data-state'); console.log("What is window.rrremarkOverlayCoordinates?", window.rrremarkOverlayCoordinates); });
});
Rrremark.com Overlay Highlighter - Script Codes
Rrremark.com Overlay Highlighter - Script Codes
Home Page Home
Developer Derick Ruiz
Username derickruiz
Uploaded December 27, 2022
Rating 3
Size 4,438 Kb
Views 8,096
Do you need developer help for Rrremark.com Overlay Highlighter?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Derick Ruiz (derickruiz) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!