Skip to content

Instantly share code, notes, and snippets.

View 0xtlt's full-sized avatar
🪐
Visiting Mars

Thomas 0xtlt

🪐
Visiting Mars
View GitHub Profile
<html>
<head>
<style>
.fade {
display: block;
background: red;
margin-bottom: 50px;
width: 100%;
height: 150px;
opacity: 0.2;
@0xtlt
0xtlt / script.js
Created February 25, 2021 18:12
Depth CSS
(function() {
// original gist : https://gist.github.com/csswizardry/ad11c8dc6e1bc20dd602312196974de6
const styleElement = document.createElement("style");
styleElement.innerHTML = `
/**
* Tier 1 – Dotted
*/
* { outline: 2px dotted purple; }
* * { outline: 2px dotted blue; }
* * * { outline: 2px dotted green; }
@0xtlt
0xtlt / wait.js
Created April 14, 2021 12:12
Wait function in JS
async function Wait(time) {
return new Promise(resolve => {
setTimeout(resolve, time);
});
}
@0xtlt
0xtlt / Str2JSON.js
Created April 14, 2021 12:40
String to JSON
"str1=hello,str2=world".split(",")
.map(str => str.split("="))
.map(arr => {let tmp = {};tmp[arr[0]]=arr[1];return tmp;})
.reduce((a,b) => ({...a, ...b}));
@0xtlt
0xtlt / index.html
Last active July 29, 2021 08:22
lazy load image set
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.bg-lz-load {
background: white;