-
Notifications
You must be signed in to change notification settings - Fork 0
/
logo-generator.html
117 lines (103 loc) · 3.72 KB
/
logo-generator.html
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!-- This is a helper file used to generate the animated logo.
Included in the repository for either future updates or for others to learn from -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body {
background-color: #1f1e1e;
display: flex;
margin: 40px;
}
.logo,
.projectName {
margin: 0px;
padding: 10px;
border: 1px solid #1f1e1e;
background-color: rgb(35, 152, 35);
color: rgb(255, 255, 255);
font-family: 'Poppins', sans-serif;
display: grid;
grid-template-rows: auto;
font-size: 35px;
text-shadow: 3px 3px 3px #1f1e1e;
}
.logo {
width: 128px;
overflow: hidden;
}
.projectName {
display: flex;
align-items: center;
justify-content: center;
padding: 30px;
font-size: 50px;
}
.element {
display: flex;
align-items: center;
justify-content: center;
padding: 0px;
transition:
margin 1.5s ease,
opacity 0.8s ease;
}
.moveOffScreenRight {
margin-right: -350px;
opacity: 0;
}
.moveOffScreenLeft {
margin-left: -350px;
opacity: 0;
}
</style>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap"
rel="stylesheet"
/>
<!-- Font courtesy of Poppins: https://fonts.google.com/specimen/Poppins -->
<script src="https://unpkg.com/alphanumeric-encoder"></script>
</head>
<body>
<div class="logo">
<strong>
<div id="logoLetter" class="element">A</div>
<div id="logoNumber" class="element">1</div>
</strong>
</div>
<div class="projectName">Alphanumeric Encoder</div>
<script>
const encoder = new AlphanumericEncoder()
const logoLetter = document.getElementById('logoLetter')
const logoNumber = document.getElementById('logoNumber')
const logo = document.querySelector('body')
const letterArray = ['A', 'B', 'C', 'AA', 'AB', 'AC', 'ANA', 'ANB', 'ANC', 'AND', 'ANE']
let i = 0
setInterval(() => {
logoLetter.classList.toggle('moveOffScreenLeft')
logoNumber.classList.toggle('moveOffScreenRight')
setTimeout(() => {
logoLetter.innerText = letterArray[i]
logoNumber.innerText = encoder.decode(letterArray[i])
logoLetter.classList.toggle('moveOffScreenLeft')
logoNumber.classList.toggle('moveOffScreenRight')
}, 600)
i += 1
if (i > letterArray.length - 1) {
i = 0
}
}, 3500)
</script>
</body>
</html>