Skip to content
Open
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
30 changes: 30 additions & 0 deletions RandomColorGenerator/AdyaTech/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script
src="https://kit.fontawesome.com/1935d064dd.js"
crossorigin="anonymous"
></script>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container">
<div class="counter-div">
<h1>Random Hex Color Generator</h1>
<span class="count hex">#ffffff</span>
<hr />
<div class="buttons">
<button class="reset generate">
<i class="fas fa-spinner"></i>
Generate
</button>
</div>
</div>
</div>

<script src="script.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions RandomColorGenerator/AdyaTech/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const hex = document.querySelector(".hex");
const btn = document.querySelector(".generate");

const generateColor = () => {
const randomColor = Math.random().toString(16).substring(2, 8);
document.body.style.backgroundColor = "#" + randomColor;
hex.innerHTML = "#" + randomColor;
};

btn.addEventListener("click", generateColor);

generateColor();

// let color = Math.random();
// color = Math.random().toString(16);
// color = Math.random().toString(16).substring(2, 8);

// console.log(color);
93 changes: 93 additions & 0 deletions RandomColorGenerator/AdyaTech/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap");

:root {
--white: #fff;
--black: #1c2b2d;
--blue: #31326f;
--light-blue: #005490;
--color-primary: #9d0191;
--color-sec: #db6400;
--grey: #eee;
--dark-grey: #222831;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
font-size: 10px;
}

body {
font-family: "Open Sans", sans-serif;
}

p {
font-size: 1.6rem;
line-height: 1.5;
}

img {
width: 100%;
}

.container {
max-width: 900px;
margin: 0 auto;
padding: 0 20px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.counter-div {
width: 40rem;
border: 1px solid var(--grey);
padding: 3rem;
background-color: var(--light-blue);
color: var(--white);
text-align: center;
border-radius: 5px;
}

.counter-div > * {
margin-bottom: 2rem;
}

.count{
font-size: 2rem;
}
/* .count {
font-size: 2rem;
border: 1px solid var(--white);
padding: 8 3rem;
}
.count-hex{
padding-left: 4rem ;
} */
.buttons button {
padding: 1rem;
margin: 0 1rem;
font-size: 1.5rem;
color: var(--white);
font-weight: 700;
border: none;
outline: none;
border-radius: 3px;
cursor: pointer;
}

button.subtract {
background-color: orangered;
}
button.reset {
background-color: var(--white);
color: var(--black);
}
button.add {
background-color: green;
}