-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
92 lines (83 loc) · 2.62 KB
/
Copy pathindex.html
File metadata and controls
92 lines (83 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html>
<head>
<title>Welcome to here!</title>
<link rel="preload" href="https://code.cdn.mozilla.net/fonts/fira.css" as="style">
<link rel="stylesheet" href="https://code.cdn.mozilla.net/fonts/fira.css">
<style>
@media (orientation: landscape) {
:root {
--text-scale-unit: 1vh;
}
}
@media (orientation: portrait) {
:root {
--text-scale-unit: 1vw;
}
}
body {
background: #282a36;
color: #f1fa8c;
font-family: Fira mono;
margin-top: calc(var(--text-scale-unit) * 30);
}
#container {
text-align: center;
overflow-wrap: break-word;
font-size: 0;
}
#cursor,
#text {
transition: 250ms;
font-size: calc(var(--text-scale-unit) * 7);
}
#logo {
display: none;
}
</style>
</head>
<body>
<p id="container">
<span id="text"></span>
<span id="cursor">|</span>
</p>
<img id="logo">
<script>
const url = new URL(window.location.href);
const referrer = document.referrer;
const inurl_referrer = url.searchParams.get("r");
const msg = url.searchParams.get("msg");
const str = msg || `Hi, I am Erfan Vahabi. ^^
The purpose of this page was solely to track your curiosity. :)`
const delay = 200, cursorDelay = 400
document.title = str
let i = 0;
let isDeleting = false
const textBox = document.querySelector('#text')
setInterval(function () {
// text typing
if (isDeleting) {
textBox.innerText = textBox.innerText.slice(0, -1)
i--;
} else {
textBox.innerText += str[i]
i++;
}
// change state
if (i == str.length || i == 0) {
isDeleting = !isDeleting
}
}, delay)
// Cursor flickering
const cursorElem = document.querySelector('#cursor')
setInterval(function () {
// cursor
cursorElem.style.opacity = 1 - cursorElem.style.opacity
}, cursorDelay)
let logo_i_param = "erfanva.github.io";
if (referrer) logo_i_param += "\nref: " + referrer;
if (inurl_referrer) logo_i_param += "\nurl_ref: " + inurl_referrer;
document.querySelector("#logo").src = "https://static.erfanva.com/assets/logo.png?i=" + encodeURIComponent(logo_i_param);
</script>
</body>
</html>