Skip to content

Instantly share code, notes, and snippets.

@kirillzubovsky
Created April 30, 2025 18:43
Show Gist options
  • Save kirillzubovsky/a7df510acb1ab581bbf3369ae2e15922 to your computer and use it in GitHub Desktop.
Save kirillzubovsky/a7df510acb1ab581bbf3369ae2e15922 to your computer and use it in GitHub Desktop.
Animate a16z website medallion with a light shine
<script type="text/javascript">
var gk_isXlsx = false;
var gk_xlsxFileLookup = {};
var gk_fileData = {};
function filledCell(cell) {
return cell !== '' && cell != null;
}
function loadFileData(filename) {
if (gk_isXlsx && gk_xlsxFileLookup[filename]) {
try {
var workbook = XLSX.read(gk_fileData[filename], { type: 'base64' });
var firstSheetName = workbook.SheetNames[0];
var worksheet = workbook.Sheets[firstSheetName];
// Convert sheet to JSON to filter blank rows
var jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1, blankrows: false, defval: '' });
// Filter out blank rows (rows where all cells are empty, null, or undefined)
var filteredData = jsonData.filter(row => row.some(filledCell));
// Heuristic to find the header row by ignoring rows with fewer filled cells than the next row
var headerRowIndex = filteredData.findIndex((row, index) =>
row.filter(filledCell).length >= filteredData[index + 1]?.filter(filledCell).length
);
// Fallback
if (headerRowIndex === -1 || headerRowIndex > 25) {
headerRowIndex = 0;
}
// Convert filtered JSON back to CSV
var csv = XLSX.utils.aoa_to_sheet(filteredData.slice(headerRowIndex)); // Create a new sheet from filtered array of arrays
csv = XLSX.utils.sheet_to_csv(csv, { header: 1 });
return csv;
} catch (e) {
console.error(e);
return "";
}
}
return gk_fileData[filename] || "";
}
</script><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>a16z Medallion Light Reflection</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #000;
overflow: hidden;
}
#medallion-container {
position: relative;
width: 300px;
height: 300px;
}
#medallion {
width: 100%;
height: 100%;
background-image: url('a16z-medallion-2880.webp?text=Medallion');
background-size: cover;
border-radius: 50%;
}
#highlight {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6), transparent 70%);
pointer-events: none;
mix-blend-mode: overlay;
border-radius: 50%;
}
</style>
</head>
<body>
<div id="medallion-container">
<div id="medallion"></div>
<div id="highlight"></div>
</div>
<script>
const container = document.getElementById('medallion-container');
const highlight = document.getElementById('highlight');
container.addEventListener('mousemove', (e) => {
const rect = container.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const percentX = (x / rect.width) * 100;
const percentY = (y / rect.height) * 100;
highlight.style.background = `radial-gradient(circle at ${percentX}% ${percentY}%, rgba(255, 255, 255, 0.6), transparent 70%)`;
});
container.addEventListener('mouseleave', () => {
highlight.style.background = `radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4), transparent 70%)`;
});
</script>
<!-- A quick website update by Kirill Zubovsky and Grok -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment