Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traffic light #2439

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Art/nyame100/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Triangle</title>
</head>
<body>
<div class="traffic-light">
<div class="container">
<div class="bubble">
<div class="red"></div>
</div>
<div class="bubble">
<div class="yellow"></div>
</div>
<div class="bubble">
<div class="green"></div>
</div>
</div>
<div class="stand"></div>
</div>
</body>
</html>
141 changes: 141 additions & 0 deletions Art/nyame100/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.traffic-light {
display: flex;
flex-flow: column;
}
.stand {
height: 300px;
width: 20px;
background: #000;
justify-content: center;
align-items: center;
position: relative;
margin-top: -1px;
top: 0;
left: 40px;
}

.container {
background: #5a5959;
width: 100px;
height: 300px;
display: flex;
flex-flow: column;
justify-content: space-around;
align-items: center;
border-radius: 50px;
}
.bubble {
width: 70px;
height: 70px;
border-radius: 50%;
box-shadow: 0 0 10px #264653;
}

.red,
.yellow,
.green {
height: 70px;
width: 70px;
border-radius: 50%;
}
.red {
background: #300;
animation: stop 8s linear infinite;
}
.yellow {
background: #430;
animation: ready 8s linear infinite;
}
.green {
background: #030;
animation: go 8s linear infinite;
}

@keyframes stop {
0% {
background: #300;
}
10% {
background: #f00;
}
30% {
background: #f00;
}
35% {
background: #300;
}
65% {
background: #300;
}
80% {
background: #300;
}
100% {
background: #300;
}
}

@keyframes ready {
0% {
background: #430;
}
35% {
background: #430;
}
45% {
background: #fc0;
}
45% {
background: #fc0;
}
65% {
background: #fc0;
}
80% {
background: #430;
}
100% {
background: #430;
}
}

@keyframes go {
0% {
background: #030;
}
55% {
background: #030;
}
60% {
background: #030;
}
70% {
background: #030;
}
75% {
background: #030;
}
80% {
background: #0a0;
}
85% {
background: #0a0;
}
95% {
background: #0a0;
}
100% {
background: #030;
}
}
Binary file added Art/nyame100/trafficLight.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion include.js
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,6 @@ let cards = [
author: 'Nyariki Kevin',
githubLink: 'https://github.com/nyrkn10>'
},

{
artName: 'Fascinating Animation',
pageLink: './Art/moutro/index.html',
Expand Down Expand Up @@ -2908,6 +2907,13 @@ let cards = [
imageLink: './Art/hamzakadd/matrix.gif',
author: 'Hamza',
githubLink: 'https://github.com/hamzakadd'
},
{
artName: 'Traffic Light Animation',
pageLink: './Art/nyame100/index.html',
imageLink: './Art/nyame100/trafficLight.gif',
author: 'Nyame Richmond',
githubLink: 'https://github.com/nyame100'
}
];

Expand Down