design/styleguide/generator/index.html
2025-02-09 15:01:45 +01:00

78 lines
No EOL
3.1 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body style="height: 100vh;">
<div style="display: flex; flex-direction: column; gap: 1em; align-items: center">
<div>
<input id="file_input" type="file" name="image" accept="image/*">
</div>
<img id="source_img" src=""
style="width: 400px; height: 300px; border: solid 4px darkblue; background-color: darkblue; object-fit: contain;"/>
<img id="result_img" src=""
style="width: 400px; height: 300px; border: solid 4px darkgreen; background-color: darkgreen; object-fit: contain;"/>
<div style="display: none;">
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<filter id="filter0" color-interpolation-filters="linearRGB" filterUnits="objectBoundingBox"
primitiveUnits="userSpaceOnUse">
<feTurbulence type="turbulence" baseFrequency="0 0.1" numOctaves="1" result="noise"/>
<feDisplacementMap in="SourceGraphic" in2="noise" result="distorted" scale="20"/>
<feColorMatrix in="distorted" type="saturate" values="0" result="bw"/>
<feColorMatrix in="bw" type="luminanceToAlpha" result="ltoa"/>
<feComponentTransfer in="ltoa" result="ltoa_inverse">
<feFuncA type="table" tableValues="0 1"/>
</feComponentTransfer>
<feConvolveMatrix
in="ltoa_inverse"
result="edges"
kernelMatrix="-2 0 -2
0 0 0
2 0 2"/>
<feComponentTransfer in="edges" result="pink">
<feFuncR type="table" tableValues="1 0"/>
<feFuncG type="table" tableValues="0 1"/>
<feFuncB type="table" tableValues="0.1 0"/>
</feComponentTransfer>
<feOffset in="pink" result="pink_shift" dx="-4" dy="0"/>
<feComponentTransfer in="edges" result="cyan">
<feFuncR type="table" tableValues="0.1 0"/>
<feFuncG type="table" tableValues="1 0"/>
<feFuncB type="table" tableValues="1 0"/>
</feComponentTransfer>
<feOffset in="cyan" result="cyan_shift" dx="4" dy="0"/>
<feMerge result="pink_cyan_shift">
<feMergeNode in="distorted"/>
<feMergeNode in="pink_shift"/>
<feMergeNode in="cyan_shift"/>
</feMerge>
</filter>
<rect fill="#000000" width="100%" height="100%"/>
<g filter="url(#filter0)">
<image href="" width="100%" height="100%"/>
</g>
</svg>
</div>
<button id="download" disabled>
Download Result
</button>
</div>
<script src="generator.js" type="text/javascript"></script>
</body>
</html>