Browse Source

Initial commit.

Kristian Vos 3 years ago
commit
3a2670c2cb
2 changed files with 80 additions and 0 deletions
  1. 60 0
      index.html
  2. 20 0
      style.css

+ 60 - 0
index.html

@@ -0,0 +1,60 @@
+<html lang="en">
+	<head>
+		<title>Kvos.dev - Homepage</title>
+		<link rel="stylesheet" href="style.css" type="text/css"/>
+	</head>
+	<body>
+		<div>
+			<h1>Kvos.dev</h1<br/>
+			<h3>Work in progress</h3>
+			<a href="https://git.kvos.dev">Git projects</a>
+			<p>
+				<span>Contact me:</span>
+				<button onclick="reveal()" id="reveal-button">Reveal</button>
+			</p>
+		</div>
+		<script>
+		const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@.+".split("");
+		const secret = "YM926LY926MRS9";
+		const shift = string => {
+			return string
+				.split("")
+				.map(character => chars[
+					(
+						chars.indexOf(character) !== -1 &&
+						chars.indexOf(character) + 1 < chars.length
+					)
+						? chars.indexOf(character) + 1
+						: 0
+				])
+				.join("");
+		}
+		
+		const reveal = () => {
+			const revealButton = document.getElementById("reveal-button");
+			const anchor = document.createElement("a");
+			const paragraph = document.createElement("p");
+			
+			let decrypted = secret;
+			revealButton.insertAdjacentElement("afterEnd", paragraph);
+			revealButton.remove();
+			
+			let index = 0;
+			const interval = setInterval(() => {
+				index++;
+				
+				decrypted = shift(decrypted);
+				paragraph.textContent = decrypted;
+				
+				if (index === 25) {
+					anchor.href = `mailto:${decrypted}`;
+					anchor.text = decrypted;
+					paragraph.replaceWith(anchor);
+				
+					clearInterval(interval);
+				}
+			}, 5);		
+		}
+		</script>
+	</body>
+</html>

+ 20 - 0
style.css

@@ -0,0 +1,20 @@
+h1, h3, a {
+	font-family: Sans-Serif;
+	font-weight: 400;
+	text-align: center;
+	display: block;
+}
+
+a {
+	text-decoration: none;
+}
+
+p > * {
+	display: inline;
+}
+
+body {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}