-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from tajulafreen/Just_Relax
50Projects-HTML-CSS-JavaScript : Just relax
- Loading branch information
Showing
4 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!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>Just Relax App</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<h1>Just Relax !!</h1> | ||
<div class="container"> | ||
<div class="circle"></div> | ||
<p id="text"></p> | ||
<div class="pointer-container"> | ||
<span class="pointer"></span> | ||
</div> | ||
<div class="gradient-circle"></div> | ||
</div> | ||
</body> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable no-use-before-define */ | ||
const container = document.querySelector('.container'); | ||
const text = document.querySelector('#text'); | ||
|
||
const TOTAL_TIME = 7500; | ||
const BREATHE_TIME = (TOTAL_TIME / 5) * 2; | ||
const HOLD_TIME = TOTAL_TIME / 7; | ||
|
||
// Start the animation | ||
const startBreathingAnimation = () => { | ||
animateBreathing(); | ||
setInterval(animateBreathing, TOTAL_TIME); | ||
}; | ||
|
||
const animateBreathing = () => { | ||
text.textContent = 'Breathe In!'; | ||
container.classList.add('grow'); | ||
container.classList.remove('shrink'); | ||
|
||
setTimeout(() => { | ||
text.textContent = 'Hold...'; | ||
|
||
setTimeout(() => { | ||
text.textContent = 'Breathe Out!'; | ||
container.classList.add('shrink'); | ||
container.classList.remove('grow'); | ||
}, HOLD_TIME); | ||
}, BREATHE_TIME); | ||
}; | ||
|
||
// Initialize the animation | ||
startBreathingAnimation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@550;700&display=swap'); | ||
|
||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
background: linear-gradient(90deg, #5567b7, #53a0ad); | ||
color: rgb(243, 250, 235); | ||
font-family: 'Dancing Script', sans-serif; | ||
font-size: large; | ||
font-weight: 500; | ||
min-height: 100vh; | ||
overflow: hidden; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 300px; | ||
width: 300px; | ||
margin: auto; | ||
position: relative; | ||
transform: scale(1); | ||
} | ||
|
||
.gradient-circle { | ||
background: | ||
conic-gradient( | ||
#5567b7 0%, | ||
#954ca4 40%, | ||
#fff 40%, | ||
#fff 60%, | ||
#53afb3 60%, | ||
#53a0ad 100% | ||
); | ||
height: 320px; | ||
width: 320px; | ||
position: absolute; | ||
top: -10px; | ||
left: -10px; | ||
z-index: -2; | ||
border-radius: 50%; | ||
} | ||
|
||
.circle { | ||
background-color: rgb(2, 16, 43); | ||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: -1; | ||
border-radius: 50%; | ||
} | ||
|
||
.pointer-container { | ||
position: absolute; | ||
top: -40px; | ||
left: 140px; | ||
width: 20px; | ||
height: 190px; | ||
animation: rotate 7.5s linear forwards infinite; | ||
transform-origin: bottom center; | ||
} | ||
|
||
.pointer { | ||
background-color: lavender; | ||
border-radius: 50%; | ||
height: 20px; | ||
width: 20px; | ||
display: block; | ||
} | ||
|
||
.container.grow { | ||
animation: grow 3s linear forwards; | ||
} | ||
|
||
.container.shrink { | ||
animation: shrink 3s linear forwards; | ||
} | ||
|
||
@keyframes rotate { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
|
||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@keyframes grow { | ||
from { | ||
transform: scale(1); | ||
} | ||
|
||
to { | ||
transform: scale(1.2); | ||
} | ||
} | ||
|
||
@keyframes shrink { | ||
from { | ||
transform: scale(1.2); | ||
} | ||
|
||
to { | ||
transform: scale(1); | ||
} | ||
} |