Update README.md
Browse files
README.md
CHANGED
|
@@ -19,9 +19,10 @@ tags:
|
|
| 19 |
<style>
|
| 20 |
.parallax-container {
|
| 21 |
position: relative;
|
| 22 |
-
overflow:
|
| 23 |
height: 120px;
|
| 24 |
margin: 20px 0;
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
.text-layer {
|
|
@@ -31,18 +32,21 @@ tags:
|
|
| 31 |
font-family: 'Arial Black', 'Helvetica', sans-serif;
|
| 32 |
font-size: 72px;
|
| 33 |
font-weight: bold;
|
| 34 |
-
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
.text-base {
|
| 38 |
color: #ff71ce;
|
| 39 |
text-shadow: 2px 2px 0 #ff00ff;
|
|
|
|
| 40 |
}
|
| 41 |
|
| 42 |
.text-overlay {
|
| 43 |
color: #01cdfe;
|
| 44 |
text-shadow: -2px -2px 0 #00ffff;
|
| 45 |
opacity: 0.8;
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
.sigma {
|
|
@@ -51,29 +55,9 @@ tags:
|
|
| 51 |
2px 2px 0 #ff00ff,
|
| 52 |
-2px -2px 0 #00ffff;
|
| 53 |
}
|
| 54 |
-
|
| 55 |
-
.subtitle {
|
| 56 |
-
font-family: 'Arial', sans-serif;
|
| 57 |
-
font-size: 24px;
|
| 58 |
-
text-align: center;
|
| 59 |
-
color: #00ffff;
|
| 60 |
-
margin-top: 10px;
|
| 61 |
-
text-shadow: 2px 2px 4px rgba(0, 255, 255, 0.5);
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
@keyframes glow {
|
| 65 |
-
from {
|
| 66 |
-
filter: drop-shadow(0 0 2px #ff00ff)
|
| 67 |
-
drop-shadow(0 0 4px #ff00ff);
|
| 68 |
-
}
|
| 69 |
-
to {
|
| 70 |
-
filter: drop-shadow(0 0 4px #ff00ff)
|
| 71 |
-
drop-shadow(0 0 8px #ff00ff);
|
| 72 |
-
}
|
| 73 |
-
}
|
| 74 |
</style>
|
| 75 |
|
| 76 |
-
<div class="parallax-container">
|
| 77 |
<div class="text-layer text-base">
|
| 78 |
Proteus<span class="sigma">Σ</span>
|
| 79 |
</div>
|
|
@@ -83,31 +67,20 @@ tags:
|
|
| 83 |
</div>
|
| 84 |
|
| 85 |
<script>
|
| 86 |
-
document.
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
})
|
| 98 |
-
|
| 99 |
-
// Add mouse movement effect
|
| 100 |
-
document.addEventListener('mousemove', function(e) {
|
| 101 |
-
const overlay = document.querySelector('.text-overlay');
|
| 102 |
-
const base = document.querySelector('.text-base');
|
| 103 |
-
|
| 104 |
-
const moveX = (e.clientX - window.innerWidth/2) * 0.01;
|
| 105 |
-
const moveY = (e.clientY - window.innerHeight/2) * 0.01;
|
| 106 |
-
|
| 107 |
-
overlay.style.transform = `translate(${moveX}px, ${moveY}px)`;
|
| 108 |
-
base.style.transform = `translate(${-moveX * 0.5}px, ${-moveY * 0.5}px)`;
|
| 109 |
});
|
| 110 |
-
</script>
|
| 111 |
|
| 112 |
|
| 113 |
## Example Outputs
|
|
|
|
| 19 |
<style>
|
| 20 |
.parallax-container {
|
| 21 |
position: relative;
|
| 22 |
+
overflow: visible;
|
| 23 |
height: 120px;
|
| 24 |
margin: 20px 0;
|
| 25 |
+
perspective: 100px;
|
| 26 |
}
|
| 27 |
|
| 28 |
.text-layer {
|
|
|
|
| 32 |
font-family: 'Arial Black', 'Helvetica', sans-serif;
|
| 33 |
font-size: 72px;
|
| 34 |
font-weight: bold;
|
| 35 |
+
white-space: nowrap;
|
| 36 |
+
will-change: transform;
|
| 37 |
}
|
| 38 |
|
| 39 |
.text-base {
|
| 40 |
color: #ff71ce;
|
| 41 |
text-shadow: 2px 2px 0 #ff00ff;
|
| 42 |
+
z-index: 1;
|
| 43 |
}
|
| 44 |
|
| 45 |
.text-overlay {
|
| 46 |
color: #01cdfe;
|
| 47 |
text-shadow: -2px -2px 0 #00ffff;
|
| 48 |
opacity: 0.8;
|
| 49 |
+
z-index: 2;
|
| 50 |
}
|
| 51 |
|
| 52 |
.sigma {
|
|
|
|
| 55 |
2px 2px 0 #ff00ff,
|
| 56 |
-2px -2px 0 #00ffff;
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
</style>
|
| 59 |
|
| 60 |
+
<div class="parallax-container" id="parallax">
|
| 61 |
<div class="text-layer text-base">
|
| 62 |
Proteus<span class="sigma">Σ</span>
|
| 63 |
</div>
|
|
|
|
| 67 |
</div>
|
| 68 |
|
| 69 |
<script>
|
| 70 |
+
const parallax = document.getElementById('parallax');
|
| 71 |
+
const textBase = parallax.querySelector('.text-base');
|
| 72 |
+
const textOverlay = parallax.querySelector('.text-overlay');
|
| 73 |
+
|
| 74 |
+
window.addEventListener('scroll', () => {
|
| 75 |
+
requestAnimationFrame(() => {
|
| 76 |
+
const scrolled = window.pageYOffset;
|
| 77 |
+
const baseOffset = scrolled * -0.2;
|
| 78 |
+
const overlayOffset = scrolled * 0.2;
|
| 79 |
+
|
| 80 |
+
textBase.style.transform = `translateY(${baseOffset}px)`;
|
| 81 |
+
textOverlay.style.transform = `translateY(${overlayOffset}px)`;
|
| 82 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
});
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
## Example Outputs
|