Skip to content

Commit

Permalink
Merge pull request #311 from 05hiteshbansal/contribution
Browse files Browse the repository at this point in the history
Linear_Gradient_background_creater as a micro JS Project
  • Loading branch information
selemondev authored Oct 17, 2023
2 parents d54b0df + 2296790 commit 993cd56
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 1 deletion.
Binary file added Linear_gradient_background/copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions Linear_gradient_background/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
*{
padding: 0%;
margin: 0%;

}

.container{
display: flex;
width: 100vw;
height: 100vh;
justify-content: center;
align-items: center;
flex-direction: column;
}
.text{
width: 50%;
text-align: center;
display: block;
font-size:1.5vmax;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
.box{
cursor: cell;
margin-top: 10px;
display: flex;
flex-direction: row;
background-color: rgb(54, 50, 50);
align-items: center;
justify-items: center;
}
.box>img{
height:2vmax;
width: 2vmax;
}
.box>button{
background-color: initial;
border: 0cap;
color: white;
font-size: 1.5vmax;
font-size: medium;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
padding: 1vmax 0.5vmax ;
cursor: cell;
}

.box:hover{
background-color:rgb(30, 28, 28);
}

.inner{
width: 60%;
padding: 2vmax 0.5vmax;
background-color:color-mix(in hsl increasing hue, rgb(63, 62, 62) 20%, white 30%);
display: flex;
align-items: center;
justify-items: center;
flex-direction: column;
border-radius: 10px;
}
25 changes: 25 additions & 0 deletions Linear_gradient_background/home.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="./home.css"
crossorigin="anonymous"
/>
<title>Linear-Gradient</title>
</head>
<body>
<div class="container">
<div class="inner">
<div class="text">Click to Generate Gradient</div>
<div class="box">
<button class="btn">Change Colour</button>
<img src="./copy.png" alt="copy">
</div>
</div>
</div>
<script src="./home.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions Linear_gradient_background/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const button =document.getElementsByClassName('btn')[0]
const text =document.getElementsByClassName('text')[0]
const container = document.getElementsByClassName('container')[0]
function displayDate(){
let colours =[];
let m = Math.floor(Math.random()*6)+2;
for(let i =0; i<m ; i++){
let colour=`rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`
colours.push(colour)
}
let value =container.style.background =`linear-gradient(${Math.floor(Math.random() * 360)}deg, ${colours.join(',')})`;
text.innerHTML =value

}

button.addEventListener("click", displayDate);
5 changes: 5 additions & 0 deletions Linear_gradient_background/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Linear-colour-Gradient

### Javascript Linear-colour-Gradient

This project is a javascript based Product. It allows you to click a cell and make a random Linear Gradient at random degree with random colours . Also number of colours are also not specific so a user can generate linear-Gradient with any number of colours
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ More information about the pack can be found here [Github Student Developer Pack
| [QR Code Generator](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Qr_Code_Generator) | [Quiz](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Quiz) | [Random Background Generator](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Random-Background-Generator) | [Recipe Finder](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Recipe-Finder) |
| [Scannable QR Code Generator](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Scannable%20QR%20CODE%20Generator) | [Table Tennis Scorekeeper](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Table%20Tennis%20scorekeeper) | [Task Management App](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/task-management-app) | [Temperature Convertor](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/tempreture-converter) |
[Tic Tac Toe](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/TicTacToe%20Game) | [To Do List](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/to-do-list) | [Typing Progress Bar](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Typing%20Progress%20Bar) | [Weather App](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/WeatherApp) |
| [Wix Template](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/WixTemplate) | [URL Shortner](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/url-shortner) | [Aim Training](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Aim-training) | [Flappy Bird Game](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Flappy_Bird_Game) | [Desktop Notification](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Desktop%20Notification)
| [Wix Template](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/WixTemplate) | [URL Shortner](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/url-shortner) | [Aim Training](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Aim-training) | [Flappy Bird Game](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Flappy_Bird_Game) | [Desktop Notification](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Desktop%20Notification) | [Linear_gradient_background](https://github.com/DhanushNehru/Ultimate-Web-Development-Resources/tree/main/Linear_gradient_background)


Please note that the links provided are the GitHub repository URLs for each project.

Expand Down

0 comments on commit 993cd56

Please sign in to comment.