Skip to content

Commit de2e093

Browse files
committed
update leaky ring 2
1 parent d92c0df commit de2e093

4 files changed

Lines changed: 58 additions & 8 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"svg.preview.background": "dark-transparent"
3+
}

src/components/webrings/LeakyRing.svelte

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
lastUpdate = setTimeout(() => {doRequest()}, updateInterval * 1000);
4242
if (bilging) return;
4343
// if (page.url.hostname == "localhost") {
44-
// fillAmount = 60;
44+
// fillAmount = 100;
4545
// allSites = [];
4646
// return;
4747
// }
@@ -113,7 +113,7 @@
113113
{@html '<!-- <script src="https://melonking.net/scripts/flood.js"></script> -->'}
114114
<button class="leaky-ring-holder"
115115
style:--level={fillAmount / fillMax}
116-
aria-label={`Water level: ${fillAmount / fillMax * 100}% - click to bilge`}
116+
aria-label={`Water level: ${fillAmount / fillMax * 100}% - click to flush some water`}
117117
onclick={doBilge}
118118
></button>
119119
<div class:active={cooldownTimeout || bilging || fillAmount / fillMax >= 0.5} aria-hidden={true}>
@@ -122,14 +122,33 @@
122122
{:else if bilging}
123123
(trying my best...)
124124
{:else}
125-
(click here to bilge)
125+
(click here to flush some water)
126126
{/if}
127127
</div>
128128
<WebringNav
129129
indexLink="https://melonking.net/free/software/flood"
130130
allLinks={allSites}
131131
{broken} />
132132
</article>
133+
<svg>
134+
<defs>
135+
<filter id="leaky-ring-water">
136+
<feTurbulence baseFrequency="0.005" numOctaves="2" stitchTiles="stitch">
137+
138+
</feTurbulence>
139+
<feTile>
140+
<animate attributeName="dx" values="-60%;60%;-60%" dur="10s" repeatCount="indefinite"/>
141+
<animate attributeName="dy" values="60%;-60%;60%" dur="10s" repeatCount="indefinite"/>
142+
</feTile>
143+
<feColorMatrix type="hueRotate" result="displacement-map">
144+
<animate attributeName="values" values="0;360" dur="2s" repeatCount="indefinite"/>
145+
</feColorMatrix>
146+
<feDisplacementMap in="SourceGraphic" in2="map" scale="16" xChannelSelector="R" yChannelSelector="G">
147+
<animate attributeName="scale" values="24;16;24" dur="10s" repeatCount="indefinite"/>
148+
</feDisplacementMap>
149+
</filter>
150+
</defs>
151+
</svg>
133152
</li>
134153

135154
<style>
@@ -141,14 +160,30 @@
141160
position: absolute;
142161
border-width: 0px;
143162
margin: 0;
163+
padding: 0;
144164
inset: 0;
145-
background: url(/index/res/images/tiling-bg.svg) repeat, linear-gradient(#5df, #59f);
146-
mask: linear-gradient(white, white) no-repeat bottom / 100% calc(var(--level, 0) * 100%);
147-
transition: mask 2s cubic-bezier(0.075, 0.82, 0.165, 1);
165+
background: transparent;
166+
overflow: hidden;
148167
cursor: url(https://melonking.net/images/ui/bucket.png), pointer;
149168
}
150-
.leaky-ring.bilging .leaky-ring-holder {
151-
transition: mask 5s linear;
169+
.leaky-ring-holder::before {
170+
content: "";
171+
display: block;
172+
inset: -1em -1em -1em -1em;
173+
width: calc(100% + 2em);
174+
height: calc(100% + 2em);
175+
margin: -1em;
176+
background:
177+
linear-gradient(black, black) top left / 100% calc(100% - var(--level, 0) * 100%) no-repeat,
178+
url(/index/res/images/wave.svg) left calc(calc(1 - var(--level, 0)) * calc(100% + 20px)) / 200px 20px repeat-x,
179+
url(/index/res/images/wave2.svg) left calc(calc(1 - var(--level, 0)) * calc(100% + 30px)) / 300px 30px repeat-x,
180+
url(/index/res/images/tiling-bg.svg) repeat,
181+
linear-gradient(#5df, #59f);
182+
transition: background 2s cubic-bezier(0.075, 0.82, 0.165, 1);
183+
filter: url(#leaky-ring-water);
184+
}
185+
.leaky-ring.bilging .leaky-ring-holder::before {
186+
transition: background 5s linear;
152187
}
153188
.leaky-ring-holder + div {
154189
position: absolute;

static/index/res/images/wave.svg

Lines changed: 6 additions & 0 deletions
Loading

static/index/res/images/wave2.svg

Lines changed: 6 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)