Skip to content

Commit fccddae

Browse files
v2.3
2 parents 8abb9ba + 6c479df commit fccddae

File tree

3 files changed

+164
-118
lines changed

3 files changed

+164
-118
lines changed

dist/services/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ ul li:before {
141141
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='487' height='243.5' viewBox='0 0 1600 800' style='&%2310; opacity: .45;&%2310;'%3E%3Cpath fill='%23fdb9a0' d='M1102.5 734.8c2.5-1.2 24.8-8.6 25.6-7.5.5.7-3.9 23.8-4.6 24.5-.2.3-16-12.3-21-17zm123.8-505.7c0-.1-4.9-9.4-7-14.2-.1-.3-.3-1.1-.4-1.6-.1-.4-.3-.7-.6-.9-.3-.2-.6-.1-.8.1l-13.1 12.3c-.2.2-.3.5-.4.8 0 .3 0 .7.2 1 .1.1 1.4 2.5 2.1 3.6 2.4 3.7 6.5 12.1 6.5 12.2.2.3.4.5.7.6.3 0 .5-.1.7-.3 0 0 1.8-2.5 2.7-3.6 1.5-1.6 3-3.2 4.6-4.7 1.2-1.2 1.6-1.4 2.1-1.6.5-.3 1.1-.5 2.5-1.9.4-.5.5-1.3.2-1.8zM33 770.3c0-.7-.5-1.2-1.2-1.2-.1 0-.3 0-.4.1-1.6.2-14.3.1-22.2 0-.3 0-.6.1-.9.4-.2.2-.4.5-.4.9 0 .2 0 4.9.1 5.9l.4 13.6c0 .3.2.6.4.9.2.2.5.3.8.3h.1c7.3-.7 14.7-.9 22-.6.3 0 .7-.1.9-.3.2-.2.4-.6.4-.9-.1-6.1-.1-13.2 0-19.1z' style='&%2310;'/%3E%3Cpath fill='%23fee272' d='M171.1 383.4c1.3-2.5 14.3-22 15.6-21.6.8.3 11.5 21.2 11.5 22.1-.1.3-20.3.1-27.1-.5zm425.3 328.4c-.1-.1-6.7-8.2-9.7-12.5-.2-.3-.5-1-.7-1.5-.2-.4-.4-.7-.7-.8-.3-.1-.6 0-.8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6.3.9 1.1.5 1.7-1 1.9-2.2 3.8-3.5 5.6-.2.2-.5.4-.9.4zm310 196.4c-1.4 0-2.9-.2-4.5-.7-8.4-2.7-16.6-12.7-18.7-20-.4-1.4-.7-2.9-.9-4.4-8.1 3.3-15.5 10.6-15.4 21 0 1.5-1.2 2.7-2.7 2.8-1.5 0-2.7-1.2-2.7-2.7-.1-6.7 2.4-12.9 7-18 3.6-4 8.4-7.1 13.7-8.8.5-6.5 3.1-12.9 7.4-17.4 7-7.4 18.2-8.9 27.3-10.1l.7-.1c1.5-.2 2.9.9 3.1 2.3.2 1.5-.9 2.9-2.3 3.1l-.7.1c-8.6 1.2-18.4 2.5-24 8.4-3 3.2-5 7.7-5.7 12.4 7.9-1 17.7 1.3 24.3 5.7 4.3 2.9 7.1 7.8 7.2 12.7.2 4.3-1.7 8.3-5.2 11.1-2.4 1.6-5 2.6-7.9 2.6zm-18.7-26.7c.1 1.5.4 3 .8 4.4 1.7 5.8 8.7 14.2 15.1 16.3 2.8.9 5.1.5 7.2-1.1 2.7-2.1 3.2-4.8 3.1-6.6-.1-3.2-2-6.4-4.8-8.3-5.7-3.9-14.7-5.8-21.4-4.7z'/%3E%3C/g%3E%3C/svg%3E");
142142
}
143143
.c-section span:after {
144-
content: "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Beatae accusamus eaque necessitatibus modi facilis aspernatur ut natus saepe!";
144+
content: "Here at straight-code, we try our best to give our help where it is needed.";
145145
display: block;
146146
font-size: 1.4rem;
147147
position: absolute;

index.html

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
1-
<!DOCTYPE html>
2-
<html lang="en" >
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>CodePen - Download Button Animation</title>
6-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
7-
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,500,700&amp;display=swap'><link rel="stylesheet" href="./style.css">
8-
9-
</head>
10-
<body>
11-
<!-- partial:index.partial.html -->
12-
<div class="container">
13-
14-
<a href="" class="button">
15-
<ul>
16-
<li>&#68;ownload</li>
17-
<li>&#68;ownloading</li>
18-
<li>Open File</li>
19-
</ul>
20-
<div>
21-
<svg viewBox="0 0 24 24"></svg>
22-
</div>
23-
</a>
24-
</div>
25-
26-
<!-- dribbble -->
27-
<a class="dribbble" href="https://dribbble.com/shots/7299868-Download-Buttons" target="_blank"><img src="https://cdn.dribbble.com/assets/dribbble-ball-mark-2bd45f09c2fb58dbbfb44766d5d1d07c5a12972d602ef8b32204d28fa3dda554.svg" alt=""></a>
28-
<!-- partial -->
29-
<script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-latest-beta.min.js'></script><script src="./script.js"></script>
30-
31-
</body>
32-
</html>
1+
2+
<!DOCTYPE html>
3+
<html lang="en" >
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Welcome to straight-code</title>
7+
<link rel="stylesheet" href="./css/styles.css">
8+
<link href="./assets/straight-code.png" rel="shortcut icon">
9+
</head>
10+
<body>
11+
12+
13+
14+
<!-- Starbackground -->
15+
<div id='stars'></div>
16+
<div id='stars2'></div>
17+
<div id='stars3'></div>
18+
19+
<!-- parallax text/java -->
20+
<div id="parallax">
21+
<div class="layer" data-depth="0.6">
22+
23+
<!-- text -->
24+
<div class="some-space">
25+
<h1>straight-code</h1>
26+
27+
</div>
28+
29+
</div>
30+
<div class="layer" data-depth="0.4">
31+
<div id="particles-js"></div>
32+
</div>
33+
34+
<!-- Button -->
35+
<div class="layer" data-depth="0.3">
36+
<div class="some-more-space1"><a href="./dist/index.html" target="blank">Continue to website</a></div>
37+
</div>
38+
39+
</div>
40+
<script src="./script.js"></script>
41+
42+
</body>
43+
</html>

script.js

Lines changed: 120 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,120 @@
1-
document.querySelectorAll('.button').forEach(button => {
2-
3-
let duration = 3000,
4-
svg = button.querySelector('svg'),
5-
svgPath = new Proxy({
6-
y: null,
7-
smoothing: null
8-
}, {
9-
set(target, key, value) {
10-
target[key] = value;
11-
if(target.y !== null && target.smoothing !== null) {
12-
svg.innerHTML = getPath(target.y, target.smoothing, null);
13-
}
14-
return true;
15-
},
16-
get(target, key) {
17-
return target[key];
18-
}
19-
});
20-
21-
button.style.setProperty('--duration', duration);
22-
23-
svgPath.y = 20;
24-
svgPath.smoothing = 0;
25-
26-
button.addEventListener('click', e => {
27-
28-
e.preventDefault();
29-
30-
if(!button.classList.contains('loading')) {
31-
32-
button.classList.add('loading');
33-
34-
gsap.to(svgPath, {
35-
smoothing: .3,
36-
duration: duration * .065 / 1000
37-
});
38-
39-
gsap.to(svgPath, {
40-
y: 12,
41-
duration: duration * .265 / 1000,
42-
delay: duration * .065 / 1000,
43-
ease: Elastic.easeOut.config(1.12, .4)
44-
});
45-
46-
setTimeout(() => {
47-
svg.innerHTML = getPath(0, 0, [
48-
[3, 14],
49-
[8, 19],
50-
[21, 6]
51-
]);
52-
}, duration / 2);
53-
54-
}
55-
56-
});
57-
58-
});
59-
60-
function getPoint(point, i, a, smoothing) {
61-
let cp = (current, previous, next, reverse) => {
62-
let p = previous || current,
63-
n = next || current,
64-
o = {
65-
length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)),
66-
angle: Math.atan2(n[1] - p[1], n[0] - p[0])
67-
},
68-
angle = o.angle + (reverse ? Math.PI : 0),
69-
length = o.length * smoothing;
70-
return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length];
71-
},
72-
cps = cp(a[i - 1], a[i - 2], point, false),
73-
cpe = cp(point, a[i - 1], a[i + 1], true);
74-
return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`;
75-
}
76-
77-
function getPath(update, smoothing, pointsNew) {
78-
let points = pointsNew ? pointsNew : [
79-
[4, 12],
80-
[12, update],
81-
[20, 12]
82-
],
83-
d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, '');
84-
return `<path d="${d}" />`;
85-
}
1+
$('#parallax').parallax({
2+
invertX: true,
3+
invertY: true,
4+
scalarX: 15,
5+
frictionY: .1
6+
});
7+
8+
9+
particlesJS("particles-js", {
10+
"particles": {
11+
"number": {
12+
"value": 120,
13+
"density": {
14+
"enable": true,
15+
"value_area": 800
16+
}
17+
},
18+
"color": {
19+
"value": "#ffffff"
20+
},
21+
"shape": {
22+
"type": "circle",
23+
"stroke": {
24+
"width": 0,
25+
"color": "#000000"
26+
},
27+
"polygon": {
28+
"nb_sides": 5
29+
},
30+
"image": {
31+
"src": "img/github.svg",
32+
"width": 100,
33+
"height": 100
34+
}
35+
},
36+
"opacity": {
37+
"value": 0.5,
38+
"random": false,
39+
"anim": {
40+
"enable": false,
41+
"speed": 1,
42+
"opacity_min": 0.1,
43+
"sync": false
44+
}
45+
},
46+
"size": {
47+
"value": 3,
48+
"random": true,
49+
"anim": {
50+
"enable": false,
51+
"speed": 40,
52+
"size_min": 0.1,
53+
"sync": false
54+
}
55+
},
56+
"line_linked": {
57+
"enable": true,
58+
"distance": 150,
59+
"color": "#ffffff",
60+
"opacity": 0.4,
61+
"width": 1
62+
},
63+
"move": {
64+
"enable": true,
65+
"speed": 6,
66+
"direction": "none",
67+
"random": false,
68+
"straight": false,
69+
"out_mode": "out",
70+
"bounce": false,
71+
"attract": {
72+
"enable": false,
73+
"rotateX": 600,
74+
"rotateY": 1200
75+
}
76+
}
77+
},
78+
"interactivity": {
79+
"detect_on": "canvas",
80+
"events": {
81+
"onhover": {
82+
"enable": true,
83+
"mode": "grab"
84+
},
85+
"onclick": {
86+
"enable": true,
87+
"mode": "push"
88+
},
89+
"resize": true
90+
},
91+
"modes": {
92+
"grab": {
93+
"distance": 140,
94+
"line_linked": {
95+
"opacity": 1
96+
}
97+
},
98+
"bubble": {
99+
"distance": 400,
100+
"size": 40,
101+
"duration": 2,
102+
"opacity": 8,
103+
"speed": 3
104+
},
105+
"repulse": {
106+
"distance": 200,
107+
"duration": 0.4
108+
},
109+
"push": {
110+
"particles_nb": 4
111+
},
112+
"remove": {
113+
"particles_nb": 2
114+
}
115+
}
116+
},
117+
"retina_detect": true
118+
});
119+
120+

0 commit comments

Comments
 (0)