This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathside-links.js
137 lines (116 loc) · 2.83 KB
/
side-links.js
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
const sideLinksTemplate = document.createElement('template')
sideLinksTemplate.innerHTML = `
<style>
/* Background Styles Only */
@import url('https://fonts.googleapis.com/css?family=Raleway');
.side-links {
font-family: Raleway, sans-serif;
position: fixed;
top: 10px;
right: 10px;
z-index: 9999;
}
.side-link i {
display: none;
}
.side-link {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
margin-bottom: 10px;
font-size: 14px !important;
color: white;
width: 120px;
padding: 5px 0;
border-radius: 10px;
transition: all 0.5s;
}
.side-link:hover,
.side-link:active,
.side-link:focus {
/* border: 1px solid #fefefe; */
transform: scale(1.05);
}
.side-link-website {
background-color: #f2fa;
}
.side-link-linkedin {
background-color: #1da1f2aa;
}
.side-link-github {
background-color: #6e5494aa;
}
.side-link-text {
/* margin-left: 10px; */
/* font-size: 18px; */
}
.side-link-icon {
color: white;
/* font-size: 30px; */
}
@media (max-width: 600px) {
html {
padding-bottom: 50px;
}
.side-links {
/* bottom: 0;
left: 0;
right: auto;
top: auto; */
inset: auto auto 0 0;
display: flex;
flex-direction: row;
gap: 0.5em;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
width: 100%;
padding: 10px 0;
background-color: #000a;
}
.side-link {
align-self: center;
margin-bottom: 0;
}
}
</style>
<!-- Side Links Only -->
<div class="side-links">
<a
href="https://igautamjain.netlify.app"
target="_blank"
class="side-link side-link-website"
>
<i class="fab fa-website-square side-link-icon"></i>
<span class="side-link-text">View Portfolio</span>
</a>
<a
href="https://github.com/astrogeek77"
target="_blank"
class="side-link side-link-github side-link-icon"
>
<i class="fab fa-github-square"></i>
<span class="side-link-text">View GitHub</span>
</a>
<a
href="https://linkedin.com/in/astrogeek77"
target="_blank"
class="side-link side-link-linkedin"
>
<i class="fab fa-linkedin-square side-link-icon"></i>
<span class="side-link-text">View Linkedin</span>
</a>
</div>
`
class SideLinks extends HTMLElement {
constructor() {
// Always call super first in constructor
super()
}
connectedCallback() {
const shadowRoot = this.attachShadow({ mode: 'open' })
shadowRoot.appendChild(sideLinksTemplate.content)
}
}
customElements.define('sidelinks-component', SideLinks)