-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>5.1: Svg Filters</title> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
<link rel="stylesheet" href="../overall.css" /> | ||
<link rel="stylesheet" href="styles.css" /> | ||
<script src="scripts.js"></script> | ||
</head> | ||
<body> | ||
<header> | ||
<div></div> | ||
</header> | ||
|
||
<div | ||
class="outer-square flex justify-center items-center flex-col h-[80vh]" | ||
> | ||
<div class="circle w-[100px] h-[100px]"></div> | ||
<div class="square w-400 h-400 border-primary-text grid"> | ||
<div class="big-circle w-[320px] h-[320px]"></div> | ||
</div> | ||
</div> | ||
<svg class="hidden"> | ||
<defs> | ||
<filter id="filter" x="0" y="0" width="100%" height="100%"> | ||
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" /> | ||
<feColorMatrix | ||
in="blur" | ||
mode="matrix" | ||
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" | ||
result="goo" | ||
/> | ||
</filter> | ||
</defs> | ||
</svg> | ||
</body> | ||
</html> |
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,8 @@ | ||
document.addEventListener("DOMContentLoaded", function () { | ||
document.addEventListener("mousemove", function (e) { | ||
const x = e.clientX; | ||
const y = e.clientY; | ||
document.documentElement.style.setProperty("--x", `${x}px`); | ||
document.documentElement.style.setProperty("--y", `${y}px`); | ||
}); | ||
}); |
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,48 @@ | ||
body { | ||
//cursor: none; | ||
} | ||
|
||
.circle { | ||
border-radius: 50%; | ||
background-color: var(--color-beige); | ||
translate: var(--x) var(--y); | ||
position: absolute; | ||
top: -50px; | ||
left: -50px; | ||
pointer-events: none; | ||
grid-area: 1 / 1; | ||
transition: scale 0.5s ease-in-out; | ||
} | ||
.big-circle { | ||
background-color: var(--color-beige); | ||
border-radius: 61% 39% 76% 24% / 55% 48% 52% 45%; | ||
animation: wobble 7s ease-in-out alternate infinite; | ||
/* -webkit-transform: translate3d(0, 0, 0); */ | ||
} | ||
.square { | ||
place-content: center; | ||
place-items: center; | ||
} | ||
.outer-square { | ||
margin-left: -50px; | ||
padding-left: 50px; | ||
filter: url(#filter); | ||
} | ||
.big-circle { | ||
grid-area: 1 / 1; | ||
} | ||
|
||
@keyframes wobble { | ||
25% { | ||
border-radius: 41% 59% 49% 51% / 35% 31% 69% 65%; | ||
} | ||
50% { | ||
border-radius: 51% 49% 43% 57% / 53% 30% 70% 47%; | ||
} | ||
75% { | ||
border-radius: 50% 50% 61% 39% / 57% 27% 73% 43%; | ||
} | ||
100% { | ||
border-radius: 31% 69% 57% 43% / 38% 62% 38% 62%; | ||
} | ||
} |