This repository has been archived by the owner on May 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gratuitous ragged edges look for feedback
- Loading branch information
1 parent
480b101
commit b30fca1
Showing
6 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { raggedEdgesDirective } from '@/utils/svgUtils' | ||
|
||
export default ({ app }) => { | ||
app.directive('ragged-edges', raggedEdgesDirective) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="0" | ||
width="0" | ||
> | ||
<defs> | ||
<filter | ||
v-for="variant in variants" | ||
:id="`ragged-edges-${variant}`" | ||
:key="variant" | ||
> | ||
<feTurbulence | ||
id="turbulence" | ||
type="fractalNoise" | ||
baseFrequency="0.01" | ||
numOctaves="4" | ||
result="main" | ||
:seed="variant" | ||
/> | ||
<feDisplacementMap | ||
id="displacement" | ||
in="SourceGraphic" | ||
in2="main" | ||
result="main" | ||
scale="8" | ||
/> | ||
<feGaussianBlur stdDeviation="1" /> | ||
<feComponentTransfer result="main"> | ||
<feFuncA | ||
type="gamma" | ||
amplitude="50" | ||
exponent="5" | ||
/> | ||
</feComponentTransfer> | ||
<feComposite | ||
in="SourceGraphic" | ||
in2="main" | ||
operator="over" | ||
/> | ||
</filter> | ||
</defs> | ||
</svg> | ||
</template> | ||
|
||
<script setup> | ||
import { raggedEdgeVariations } from '@/utils/svgUtils' | ||
const variants = Array.from({ length: raggedEdgeVariations }, (_, i) => i + 1) | ||
const styleSheet = new CSSStyleSheet() | ||
for (const variant of variants) { | ||
styleSheet.insertRule(`.ragged-edges-${variant} { filter: url(#ragged-edges-${variant})}`) | ||
} | ||
document.adoptedStyleSheets.push(styleSheet) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters