Taogen's Blog

Stay hungry stay foolish.

java.util.Date is in core java API since Java 1.0. And it is not recommended for use. If you are using Java 8 or a later version, it is better to use java.time.LocalDate and java.time.Instant, which were introduced in Java 8.

In this post, I will cover common operations related to datetime.

Read more »

Add watermark

document.getElementsByTagName('body')[0].style.backgroundImage = 'url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' version=\'1.1\' height=\'100px\' width=\'100px\'><text transform=\'translate(20, 100) rotate(-30)\' fill=\'rgba(128,128,128, 0.3)\' font-size=\'20\' >watermark</text></svg>")';
const div = document.createElement("div");
div.innerHTML = `<div id="watermark" style="position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-image: url(&quot;data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='440px' height='293.3333333333333px'><text transform='translate(5, 100) rotate(-20)' fill='rgba(128,128,128, 0.3)' font-size='20' >watermark</text></svg>&quot;); background-repeat: repeat; background-size: 300px 200px; pointer-events: none; z-index: 9999; opacity: 0.5;"></div>`;
document.body.appendChild(div);
0%