Skip to content

Instantly share code, notes, and snippets.

@atakde
Created July 28, 2024 08:50
Show Gist options
  • Save atakde/c97849080a3644adfeb51b7aa5c152a5 to your computer and use it in GitHub Desktop.
Save atakde/c97849080a3644adfeb51b7aa5c152a5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OG Image</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Inter', sans-serif;
}
.og-container {
position: relative;
background: #13121C;
color: #fff;
height: 630px;
width: 1200px;
overflow: hidden;
}
.og-container h1 {
font-size: 64px;
font-weight: 700;
margin-left: 80px;
margin-top: 80px;
position: relative;
z-index: 2;
}
.circle {
width: 765px;
height: 765px;
background: #4557F6;
border-radius: 50%;
transform: translate(20%, -75%);
position: absolute;
right: 0;
top: 0;
z-index: 1;
}
.logo-container {
position: absolute;
bottom: 0;
right: 0;
margin-right: 80px;
margin-bottom: 80px;
}
.logo-container img {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div class="og-container">
<div>
<h1 id="title"></h1>
<div class="circle"></div>
</div>
<div class="logo-container">
<img src="https://keeplearning.dev/images/kl-logo.png">
</div>
</div>
<script>
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
document.getElementById("title").innerHTML = params.title || "This is the og image title";
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment