mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
709 B
35 lines
709 B
6 years ago
|
<script>
|
||
|
let hereKitty = false;
|
||
|
|
||
1 year ago
|
const handleMouseenter = () => (hereKitty = true);
|
||
|
const handleMouseleave = () => (hereKitty = false);
|
||
6 years ago
|
</script>
|
||
|
|
||
1 year ago
|
<svelte:body on:mouseenter={handleMouseenter} on:mouseleave={handleMouseleave} />
|
||
4 years ago
|
|
||
|
<!-- creative commons BY-NC http://www.pngall.com/kitten-png/download/7247 -->
|
||
|
<img
|
||
|
class:curious={hereKitty}
|
||
|
alt="Kitten wants to know what's going on"
|
||
3 years ago
|
src="/tutorial/kitten.png"
|
||
1 year ago
|
/>
|
||
4 years ago
|
|
||
6 years ago
|
<style>
|
||
|
img {
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
bottom: -60px;
|
||
|
transform: translate(-80%, 0) rotate(-30deg);
|
||
|
transform-origin: 100% 100%;
|
||
|
transition: transform 0.4s;
|
||
|
}
|
||
|
|
||
|
.curious {
|
||
|
transform: translate(-15%, 0) rotate(0deg);
|
||
|
}
|
||
|
|
||
|
:global(body) {
|
||
|
overflow: hidden;
|
||
|
}
|
||
3 years ago
|
</style>
|