@@ -82,15 +82,15 @@ <h1 class="name" title="Rocky">Rocky</h1>
82
82
< polygon
83
83
transform ="rotate(45 100 100) "
84
84
stroke-width ="1 "
85
- stroke ="hsl(138 , 100%, 71 %) "
85
+ stroke ="hsl(128 , 100%, 68 %) "
86
86
fill ="none "
87
87
points ="70,70 148,50 130,130 50,150 "
88
88
id ="bounce "
89
89
> </ polygon >
90
90
< polygon
91
91
transform ="rotate(45 100 100) "
92
92
stroke-width ="1 "
93
- stroke ="hsl(138 , 100%, 71 %) "
93
+ stroke ="hsl(128 , 100%, 68 %) "
94
94
fill ="none "
95
95
points ="70,70 148,50 130,130 50,150 "
96
96
id ="bounce2 "
@@ -118,7 +118,7 @@ <h1 class="name" title="Rocky">Rocky</h1>
118
118
transform ="translate(20, 31) "
119
119
stroke-width ="2 "
120
120
stroke =""
121
- fill ="hsl(138 , 100%, 71 %) "
121
+ fill ="hsl(128 , 100%, 68 %) "
122
122
points ="80,50 80,75 80,99 40,75 "
123
123
> </ polygon >
124
124
< polygon
@@ -130,19 +130,15 @@ <h1 class="name" title="Rocky">Rocky</h1>
130
130
> </ polygon >
131
131
< defs >
132
132
< linearGradient y2 ="100% " x2 ="0% " y1 ="-17% " x1 ="10% " id ="gradiente2 ">
133
- < stop style ="stop-color: hsla(138, 100%, 71%, 0) " offset ="20% "> </ stop >
134
- < stop
135
- style ="stop-color: hsla(138, 100%, 71%, 0.5); stop-opacity:1 "
136
- offset ="100% "
137
- id ="animatedStop "
138
- > </ stop >
133
+ < stop style ="stop-color: hsla(128, 100%, 68%, 0) " offset ="20% "> </ stop >
134
+ < stop style ="stop-color: hsla(128, 100%, 68%, 0.5); stop-opacity:1 " offset ="100% " id ="animatedStop "> </ stop >
139
135
</ linearGradient >
140
136
</ defs >
141
137
< polygon
142
138
transform ="rotate(180 100 100) translate(20, 20) "
143
139
stroke-width ="2 "
144
140
stroke =""
145
- fill ="hsl(138 , 100%, 71 %) "
141
+ fill ="hsl(128 , 100%, 68 %) "
146
142
points ="80,50 80,75 80,99 40,75 "
147
143
> </ polygon >
148
144
< polygon
@@ -154,38 +150,34 @@ <h1 class="name" title="Rocky">Rocky</h1>
154
150
> </ polygon >
155
151
< defs >
156
152
< linearGradient y2 ="100% " x2 ="10% " y1 ="0% " x1 ="0% " id ="gradiente3 ">
157
- < stop style ="stop-color: hsla(138, 100%, 71%, 0) " offset ="20% "> </ stop >
158
- < stop
159
- style ="stop-color: hsla(138, 100%, 71%, 0.5); stop-opacity:1 "
160
- offset ="100% "
161
- id ="animatedStop "
162
- > </ stop >
153
+ < stop style ="stop-color: hsla(128, 100%, 68%, 0) " offset ="20% "> </ stop >
154
+ < stop style ="stop-color: hsla(128, 100%, 68%, 0.5); stop-opacity:1 " offset ="100% " id ="animatedStop "> </ stop >
163
155
</ linearGradient >
164
156
</ defs >
165
157
< polygon
166
- transform ="rotate(45 100 100) translate(80, 95) "
167
- stroke-width ="2 "
168
- stroke =""
169
- fill ="hsl(138 , 100%, 71 %) "
170
- points ="5,0 5,5 0,5 0,0 "
171
- id ="particles "
172
- > </ polygon >
173
- < polygon
174
- transform ="rotate(45 100 100) translate(80, 55) "
175
- stroke-width ="2 "
176
- stroke =""
177
- fill ="hsl(138 , 100%, 71 %) "
178
- points ="6,0 6,6 0,6 0,0 "
179
- id ="particles "
180
- > </ polygon >
181
- < polygon
182
- transform ="rotate(45 100 100) translate(70, 80) "
183
- stroke-width ="2 "
184
- stroke =""
185
- fill ="hsl(138 , 100%, 71 %) "
186
- points ="2,0 2,2 0,2 0,0 "
187
- id ="particles "
188
- > </ polygon >
158
+ transform ="rotate(45 100 100) translate(80, 95) "
159
+ stroke-width ="2 "
160
+ stroke =""
161
+ fill ="hsl(128 , 100%, 68 %) "
162
+ points ="5,0 5,5 0,5 0,0 "
163
+ id ="particles "
164
+ > </ polygon >
165
+ < polygon
166
+ transform ="rotate(45 100 100) translate(80, 55) "
167
+ stroke-width ="2 "
168
+ stroke =""
169
+ fill ="hsl(128 , 100%, 68 %) "
170
+ points ="6,0 6,6 0,6 0,0 "
171
+ id ="particles "
172
+ > </ polygon >
173
+ < polygon
174
+ transform ="rotate(45 100 100) translate(70, 80) "
175
+ stroke-width ="2 "
176
+ stroke =""
177
+ fill ="hsl(128 , 100%, 68 %) "
178
+ points ="2,0 2,2 0,2 0,0 "
179
+ id ="particles "
180
+ > </ polygon >
189
181
< polygon
190
182
stroke-width ="2 "
191
183
stroke =""
@@ -201,6 +193,7 @@ <h1 class="name" title="Rocky">Rocky</h1>
201
193
> </ polygon >
202
194
</ g >
203
195
</ svg >
196
+
204
197
< p class ="title "> Python Programmer</ p >
205
198
</ div >
206
199
< button class ="info-more-btn " data-sidebar-btn >
@@ -519,81 +512,81 @@ <h3 class="h3 form-title">Contact Form</h3>
519
512
} ) ;
520
513
521
514
522
- class ClickSpark extends HTMLElement {
523
- constructor ( ) {
515
+ class ClickSpark extends HTMLElement {
516
+ constructor ( ) {
524
517
super ( ) ;
525
518
this . attachShadow ( { mode : "open" } ) ;
526
- }
519
+ }
527
520
528
- connectedCallback ( ) {
521
+ connectedCallback ( ) {
529
522
this . shadowRoot . innerHTML = this . createSpark ( ) ;
530
523
this . svg = this . shadowRoot . querySelector ( "svg" ) ;
531
524
this . _parent = this . parentNode ;
532
525
this . _parent . addEventListener ( "click" , this ) ;
533
- }
526
+ }
534
527
535
- disconnectedCallback ( ) {
528
+ disconnectedCallback ( ) {
536
529
this . _parent . removeEventListener ( "click" , this ) ;
537
530
delete this . _parent ;
538
- }
531
+ }
539
532
540
- handleEvent ( e ) {
533
+ handleEvent ( e ) {
541
534
this . setSparkPosition ( e ) ;
542
535
this . animateSpark ( ) ;
543
- }
536
+ }
544
537
545
- animateSpark ( ) {
538
+ animateSpark ( ) {
546
539
let sparks = [ ...this . svg . children ] ;
547
540
let size = parseInt ( sparks [ 0 ] . getAttribute ( "y1" ) ) ;
548
541
let offset = size / 2 + "px" ;
549
542
550
543
let keyframes = ( i ) => {
551
544
let deg = `calc(${ i } * (360deg / ${ sparks . length } ))` ;
552
545
553
- return [
546
+ return [
554
547
{
555
548
strokeDashoffset : size * 3 ,
556
- transform : `rotate(${ deg } ) translateY(${ offset } )`
549
+ transform : `rotate(${ deg } ) translateY(${ offset } )`
557
550
} ,
558
551
{
559
- strokeDashoffset : size ,
560
- transform : `rotate(${ deg } ) translateY(0)`
552
+ strokeDashoffset : size ,
553
+ transform : `rotate(${ deg } ) translateY(0)`
561
554
}
562
- ] ;
555
+ ] ;
563
556
} ;
564
557
565
558
let options = {
566
- duration : 660 ,
567
- easing : "cubic-bezier(0.25, 1, 0.5, 1)" ,
568
- fill : "forwards"
559
+ duration : 660 ,
560
+ easing : "cubic-bezier(0.25, 1, 0.5, 1)" ,
561
+ fill : "forwards"
569
562
} ;
570
563
571
564
sparks . forEach ( ( spark , i ) => spark . animate ( keyframes ( i ) , options ) ) ;
572
- }
565
+ }
573
566
574
- setSparkPosition ( e ) {
567
+ setSparkPosition ( e ) {
575
568
this . style . left = e . pageX - this . clientWidth / 2 + "px" ;
576
569
this . style . top = e . pageY - this . clientHeight / 2 + "px" ;
577
- }
570
+ }
578
571
579
- createSpark ( ) {
572
+ createSpark ( ) {
580
573
return `
581
- <style>
574
+ <style>
582
575
:host {
583
- position: absolute;
584
- pointer-events: none;
585
- z-index: 10;
576
+ position: absolute;
577
+ pointer-events: none;
578
+ z-index: 10;
586
579
}
587
- </style>
588
- <svg width="30" height="30" viewBox="0 0 100 100" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="hsl(128, 100%, 68%)" transform="rotate(-20)">
580
+ </style>
581
+ <svg width="30" height="30" viewBox="0 0 100 100" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" stroke="hsl(128, 100%, 68%)" transform="rotate(-20)">
589
582
${ Array . from (
590
- { length : 8 } ,
591
- ( _ ) =>
583
+ { length : 8 } ,
584
+ ( _ ) =>
592
585
`<line x1="50" y1="30" x2="50" y2="4" stroke-dasharray="30" stroke-dashoffset="30" style="transform-origin: center" />`
593
586
) . join ( "" ) }
594
- </svg>
587
+ </svg>
595
588
` ;
596
- }
589
+ }
597
590
}
598
591
599
592
customElements . define ( "click-spark" , ClickSpark ) ;
0 commit comments