Skip to content

Commit 5955c82

Browse files
authored
initial commit
1 parent 2622b28 commit 5955c82

44 files changed

Lines changed: 1738 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

random-image-generator/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="style.css" />
7+
<title>Random Image Feed</title>
8+
</head>
9+
<body>
10+
<h1 class="title">Random Image Feed</h1>
11+
<div class="container"></div>
12+
13+
<script src="script.js"></script>
14+
</body>
15+
</html>

random-image-generator/script.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const container = document.querySelector('.container')
2+
const unsplashURL = 'https://source.unsplash.com/random/'
3+
const rows = 5
4+
5+
for(let i = 0; i < rows * 3; i++) {
6+
const img = document.createElement('img')
7+
img.src = `${unsplashURL}${getRandomSize()}`
8+
container.appendChild(img)
9+
}
10+
11+
function getRandomSize() {
12+
return `${getRandomNr()}x${getRandomNr()}`
13+
}
14+
15+
function getRandomNr() {
16+
return Math.floor(Math.random() * 10) + 300
17+
}

random-image-generator/style.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2+
3+
* {
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
font-family: 'Roboto', sans-serif;
9+
display: flex;
10+
flex-direction: column;
11+
align-items: center;
12+
justify-content: center;
13+
min-height: 100vh;
14+
margin: 0;
15+
}
16+
17+
.title {
18+
margin: 10px 0 0;
19+
text-align: center;
20+
}
21+
22+
.container {
23+
display: flex;
24+
align-items: center;
25+
justify-content: center;
26+
flex-wrap: wrap;
27+
max-width: 1000px;
28+
}
29+
30+
.container img {
31+
object-fit: cover;
32+
margin: 10px;
33+
height: 300px;
34+
width: 300px;
35+
max-width: 100%;
36+
}

rotating-nav-animation/index.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
7+
<link rel="stylesheet" href="style.css" />
8+
<title>Rotating Navigation</title>
9+
</head>
10+
<body>
11+
<div class="container">
12+
<div class="circle-container">
13+
<div class="circle">
14+
<button id="close">
15+
<i class="fas fa-times"></i>
16+
</button>
17+
<button id="open">
18+
<i class="fas fa-bars"></i>
19+
</button>
20+
</div>
21+
</div>
22+
23+
<div class="content">
24+
<h1>Amazing Article</h1>
25+
<small>Florin Pop</small>
26+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium quia in ratione dolores cupiditate, maxime aliquid impedit dolorem nam dolor omnis atque fuga labore modi veritatis porro laborum minus, illo, maiores recusandae cumque ipsa quos. Tenetur, consequuntur mollitia labore pariatur sunt quia harum aut. Eum maxime dolorem provident natus veritatis molestiae cumque quod voluptates ab non, tempore cupiditate? Voluptatem, molestias culpa. Corrupti, laudantium iure aliquam rerum sint nam quas dolor dignissimos in error placeat quae temporibus minus optio eum soluta cupiditate! Cupiditate saepe voluptates laudantium. Ducimus consequuntur perferendis consequatur nobis exercitationem molestias fugiat commodi omnis. Asperiores quia tenetur nemo ipsa.</p>
27+
28+
<h3>My Dog</h3>
29+
<img src="https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80" alt="doggy" />
30+
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Sit libero deleniti rerum quo, incidunt vel consequatur culpa ullam. Magnam facere earum unde harum. Ea culpa veritatis magnam at aliquid. Perferendis totam placeat molestias illo laudantium? Minus id minima doloribus dolorum fugit deserunt qui vero voluptas, ut quia cum amet temporibus veniam ad ea ab perspiciatis, enim accusamus asperiores explicabo provident. Voluptates sint, neque fuga cum illum, tempore autem maxime similique laborum odio, magnam esse. Aperiam?</p>
31+
</div>
32+
</div>
33+
34+
<nav>
35+
<ul>
36+
<li><i class="fas fa-home"></i><a href="#"> Home</a></li>
37+
<li><i class="fas fa-user-alt"></i><a href="#"> About</a></li>
38+
<li><i class="fas fa-envelope"></i><a href="#"> Contact</a></li>
39+
</ul>
40+
</nav>
41+
<script src="script.js"></script>
42+
</body>
43+
</html>

rotating-nav-animation/script.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const open = document.getElementById('open')
2+
const close = document.getElementById('close')
3+
const container = document.querySelector('.container')
4+
5+
open.addEventListener('click', () => container.classList.add('show-nav'))
6+
7+
close.addEventListener('click', () => container.classList.remove('show-nav'))

rotating-nav-animation/style.css

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
2+
3+
* {
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
font-family: 'Lato', sans-serif;
9+
background-color: #333;
10+
color: #222;
11+
overflow-x: hidden;
12+
margin: 0;
13+
}
14+
15+
.container {
16+
background-color: #fafafa;
17+
transform-origin: top left;
18+
transition: transform 0.5s linear;
19+
width: 100vw;
20+
min-height: 100vh;
21+
padding: 50px;
22+
}
23+
24+
.container.show-nav {
25+
transform: rotate(-20deg);
26+
}
27+
28+
.circle-container {
29+
position: fixed;
30+
top: -100px;
31+
left: -100px;
32+
}
33+
34+
.circle {
35+
background-color: #ff7979;
36+
height: 200px;
37+
width: 200px;
38+
border-radius: 50%;
39+
position: relative;
40+
transition: transform 0.5s linear;
41+
}
42+
43+
.container.show-nav .circle {
44+
transform: rotate(-70deg);
45+
}
46+
47+
.circle button {
48+
cursor: pointer;
49+
position: absolute;
50+
top: 50%;
51+
left: 50%;
52+
height: 100px;
53+
background: transparent;
54+
border: 0;
55+
font-size: 26px;
56+
color: #fff;
57+
}
58+
59+
.circle button:focus {
60+
outline: none;
61+
}
62+
63+
.circle button#open {
64+
left: 60%;
65+
}
66+
67+
.circle button#close {
68+
top: 60%;
69+
transform: rotate(90deg);
70+
transform-origin: top left;
71+
}
72+
73+
.container.show-nav + nav li {
74+
transform: translateX(0);
75+
transition-delay: 0.3s;
76+
}
77+
78+
nav {
79+
position: fixed;
80+
bottom: 40px;
81+
left: 0;
82+
z-index: 100;
83+
}
84+
85+
nav ul {
86+
list-style-type: none;
87+
padding-left: 30px;
88+
}
89+
90+
nav ul li {
91+
text-transform: uppercase;
92+
color: #fff;
93+
margin: 40px 0;
94+
transform: translateX(-100%);
95+
transition: transform 0.4s ease-in;
96+
}
97+
98+
nav ul li i {
99+
font-size: 20px;
100+
margin-right: 10px;
101+
}
102+
103+
nav ul li + li {
104+
margin-left: 15px;
105+
transform: translateX(-150%);
106+
}
107+
108+
nav ul li + li + li {
109+
margin-left: 30px;
110+
transform: translateX(-200%);
111+
}
112+
113+
nav a{
114+
color: #fafafa;
115+
text-decoration: none;
116+
transition: all 0.5s;
117+
}
118+
119+
nav a:hover {
120+
color: #FF7979;
121+
font-weight: bold;
122+
}
123+
124+
.content img {
125+
max-width: 100%;
126+
}
127+
128+
.content {
129+
max-width: 1000px;
130+
margin: 50px auto;
131+
}
132+
133+
.content h1 {
134+
margin: 0;
135+
}
136+
137+
.content small {
138+
color: #555;
139+
font-style: italic;
140+
}
141+
142+
.content p {
143+
color: #333;
144+
line-height: 1.5;
145+
}

scroll-animation/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="style.css" />
7+
<title>Scroll Animation</title>
8+
</head>
9+
<body>
10+
<h1>Scroll to see the animation</h1>
11+
<div class="box"><h2>Content</h2></div>
12+
<div class="box"><h2>Content</h2></div>
13+
<div class="box"><h2>Content</h2></div>
14+
<div class="box"><h2>Content</h2></div>
15+
<div class="box"><h2>Content</h2></div>
16+
<div class="box"><h2>Content</h2></div>
17+
<div class="box"><h2>Content</h2></div>
18+
<div class="box"><h2>Content</h2></div>
19+
<div class="box"><h2>Content</h2></div>
20+
<div class="box"><h2>Content</h2></div>
21+
<div class="box"><h2>Content</h2></div>
22+
<div class="box"><h2>Content</h2></div>
23+
<div class="box"><h2>Content</h2></div>
24+
<script src="script.js"></script>
25+
</body>
26+
</html>

scroll-animation/script.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const boxes = document.querySelectorAll('.box')
2+
3+
window.addEventListener('scroll', checkBoxes)
4+
5+
checkBoxes()
6+
7+
function checkBoxes() {
8+
const triggerBottom = window.innerHeight / 5 * 4
9+
10+
boxes.forEach(box => {
11+
const boxTop = box.getBoundingClientRect().top
12+
13+
if(boxTop < triggerBottom) {
14+
box.classList.add('show')
15+
} else {
16+
box.classList.remove('show')
17+
}
18+
})
19+
}

scroll-animation/style.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2+
3+
* {
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
background-color: #efedd6;
9+
font-family: 'Roboto', sans-serif;
10+
display: flex;
11+
flex-direction: column;
12+
align-items: center;
13+
justify-content: center;
14+
margin: 0;
15+
overflow-x: hidden;
16+
}
17+
18+
h1 {
19+
margin: 10px;
20+
}
21+
22+
.box {
23+
background-color: steelblue;
24+
color: #fff;
25+
display: flex;
26+
align-items: center;
27+
justify-content: center;
28+
width: 400px;
29+
height: 200px;
30+
margin: 10px;
31+
border-radius: 10px;
32+
box-shadow: 2px 4px 5px rgba(0, 0, 0, 0.3);
33+
transform: translateX(400%);
34+
transition: transform 0.4s ease;
35+
}
36+
37+
.box:nth-of-type(even) {
38+
transform: translateX(-400%);
39+
}
40+
41+
.box.show {
42+
transform: translateX(0);
43+
}
44+
45+
.box h2 {
46+
font-size: 45px;
47+
}

0 commit comments

Comments
 (0)