Skip to content

Commit 4fe09f8

Browse files
committed
(v0.1.6-alpha) Glitch Effect
Added a glitch kinda effect on hovering over the cipher title :) Thanks Hyperplexed for guiding lol
1 parent 4ec9902 commit 4fe09f8

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
- [ ] Fix logo and make it PERFECT.
55
- [ ] When the user presses enter it may remove all the text (typewriter) and then do something.
66
- [ ] FIX: the logo in the navbar.
7+
- [ ] When switching different tabs it should have a swoosh (slide left) animation or side rigth if reverse
78

89
## CHANGELOGS:

DESIGN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
the cipher text could literally be a cipher
3+
which is revealed on hover

src/routes/landing.jsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
import "../styles/routes/landing.css";
2+
import {useState} from "react";
23

34
function Landing() {
5+
const DEFAULT_TITLE = "C1PHΣR"
6+
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
7+
const [title, setTitle] = useState("C1PHΣR");
8+
9+
const glitchEffect = () => {
10+
let iterations = 0;
11+
12+
const interval = setInterval(() => {
13+
setTitle(
14+
title.split("")
15+
.map((letter, index) => {
16+
if (index < iterations) {
17+
return DEFAULT_TITLE[index];
18+
}
19+
20+
return letters[Math.floor(Math.random() * 26)]
21+
})
22+
.join("")
23+
);
24+
25+
if (iterations >= DEFAULT_TITLE.length) clearInterval(interval);
26+
27+
iterations += 1/3;
28+
}, 30);
29+
30+
};
431

532
return (
633
<>
734
<div className={"landing"}>
8-
<h1 className={"header-font"}>C1PH<span className={"sigma-font"}>Σ</span>R</h1>
35+
<h1
36+
className={"header-font"}
37+
onMouseOver={glitchEffect}
38+
>
39+
{title.split("").map((char, i) =>
40+
char === "Σ"
41+
? <span key={i} className="sigma-font">Σ</span>
42+
: char
43+
)}
44+
</h1>
945
<h2>
1046
press
1147
<span className={"enter"}> ENTER </span>

src/styles/routes/landing.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111

1212
.landing h1 {
13+
height: 5rem;
1314
font-size: 7rem;
14-
margin: -1.75rem;
1515
}
1616

1717
.landing h2 {

0 commit comments

Comments
 (0)