-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hero Bild reagiert auf Mausinteraktion
- Loading branch information
1 parent
b4033c7
commit 97db27c
Showing
7 changed files
with
137 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
dist/assets/AboutView-7e180d58.js → dist/assets/AboutView-f42ad35c.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
dist/assets/Komponenten-a1bf328d.js → dist/assets/Komponenten-ef354b22.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
dist/assets/index-5518a5b4.js → dist/assets/index-69f833c9.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
dist/assets/index-602001f1.css → dist/assets/index-b1a773aa.css
Large diffs are not rendered by default.
Oops, something went wrong.
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,122 @@ | ||
<template> | ||
<div class="tiltingCard"> | ||
|
||
<div class="mousePositionTracker"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
|
||
</div> | ||
</template> | ||
|
||
<style> | ||
.tiltingCard { | ||
--perspective: 500px; | ||
--rotateX: 0; | ||
--rotateY: 0; | ||
--angle: 15deg; | ||
height: 50vh; | ||
width: 100%; | ||
position: relative; | ||
display: grid; | ||
place-content: center; | ||
text-align: center; | ||
box-shadow: 0 0 8px gray; | ||
padding: 2rem; | ||
background-image: url(../../public/img/wandern.jpg); | ||
background-size: cover; | ||
background-position: bottom center; | ||
/*aspect-ratio: 1 / 2;*/ | ||
transform: perspective(var(--perspective)) rotateX(var(--rotateX)) | ||
rotateY(var(--rotateY)); | ||
transition: transform 350ms ease; | ||
} | ||
.mousePositionTracker { | ||
position:absolute; | ||
inset:0; | ||
} | ||
.mousePositionTracker > div { | ||
position: absolute; | ||
width: calc(100% / 3); | ||
height: calc(100% / 3); | ||
z-index: 2; | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(1):hover) { | ||
--rotateX: var(--angle); | ||
--rotateY: calc(var(--angle) * -1); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(2):hover) { | ||
--rotateX: var(--angle); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(3):hover) { | ||
--rotateX: var(--angle); | ||
--rotateY: var(--angle); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(4):hover) { | ||
--rotateY: calc(var(--angle) * -1); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(6):hover) { | ||
--rotateY: var(--angle); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(7):hover) { | ||
--rotateX: calc(var(--angle) * -1); | ||
--rotateY: calc(var(--angle) * -1); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(8):hover) { | ||
--rotateX: calc(var(--angle) * -1); | ||
} | ||
.tiltingCard:has(.mousePositionTracker > div:nth-child(9):hover) { | ||
--rotateX: calc(var(--angle) * -1); | ||
--rotateY: var(--angle); | ||
} | ||
/* 1st 4th 7th */ | ||
.mousePositionTracker > div:nth-of-type(3n - 2) { | ||
left:0; | ||
} | ||
/* 2nd 5th 8th */ | ||
.mousePositionTracker > div:nth-of-type(3n - 1) { | ||
left:calc(100% / 3) | ||
} | ||
/* 3rd 6th 9th */ | ||
.mousePositionTracker > div:nth-of-type(3n) { | ||
right:0; | ||
} | ||
/* 1-3 */ | ||
.mousePositionTracker > div:nth-child(n + 1):nth-child(-n + 3) { | ||
top:0; | ||
} | ||
/* 4-6 */ | ||
.mousePositionTracker > div:nth-child(n + 4):nth-child(-n + 6) { | ||
top:calc(100% / 3); | ||
} | ||
/* 7-9 */ | ||
.mousePositionTracker > div:nth-child(n + 7):nth-child(-n + 9) { | ||
bottom:0; | ||
} | ||
</style> |