Skip to content

Commit

Permalink
Merge pull request #48 from Davichobits/copyright
Browse files Browse the repository at this point in the history
Copyright year updated dynamically
  • Loading branch information
DhanushNehru authored May 21, 2024
2 parents 474343f + ac36df3 commit ded92b7
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 39 deletions.
89 changes: 50 additions & 39 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,58 @@
<meta charset="UTF-8" />
<title>Breakout Game</title>
<link rel="stylesheet" href="styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<header>
<h1 class="heading">The Breakout Game</h1>
</header>
<main>
<article class="game-container">
<section class="game-info">
<div>
<h2>Breakout Game</h2>
<p>This game is simple and easy to play and also beginner friendly. So why are you waiting? Start playing the game and enjoy to the fullest!</p>
</div>
</section>
<canvas id="myCanvas" width="600" height="600"></canvas>
<section class="game-option">
<h3>Game Options :</h3>
<div class="speed-container">
<label for="speed-slider">Change speed of the ball :</label>
<input id="speed-slider" type="range" min="1" max="5" value="2.5" />
</div>
<div id="size-container">
<label for="size-slider">Change size of the ball :</label>
<input id="size-slider" type="range" min="3" max="30" />
</div>
</section>
<div class="alert success">
<strong>YOU WIN, CONGRATULATIONS!</strong>
<button id="successBtn" class="close">Restart the Game</button>
</div>
<div class="alert failure">
<strong>GAME OVER!</strong>
<button id="failureBtn" class="close">Restart the Game</button>
</div>
</article>
</main>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto&display=swap"
rel="stylesheet"
/>
</head>
<body>
<header>
<h1 class="heading">The Breakout Game</h1>
</header>
<main>
<article class="game-container">
<section class="game-info">
<div>
<h2>Breakout Game</h2>
<p>
This game is simple and easy to play and also beginner friendly.
So why are you waiting? Start playing the game and enjoy to the
fullest!
</p>
</div>
</section>
<canvas id="myCanvas" width="600" height="600"></canvas>
<section class="game-option">
<h3>Game Options :</h3>
<div class="speed-container">
<label for="speed-slider">Change speed of the ball :</label>
<input id="speed-slider" type="range" min="1" max="5" value="2.5" />
</div>
<div id="size-container">
<label for="size-slider">Change size of the ball :</label>
<input id="size-slider" type="range" min="3" max="30" />
</div>
</section>
<div class="alert success">
<strong>YOU WIN, CONGRATULATIONS!</strong>
<button id="successBtn" class="close">Restart the Game</button>
</div>
<div class="alert failure">
<strong>GAME OVER!</strong>
<button id="failureBtn" class="close">Restart the Game</button>
</div>
</article>
</main>
<footer>
<span>Copyright &copy; 2022 Dhanush Nehru | The Breakout Game ❤</span>
<span
>Copyright &copy; <span id="year"></span> Dhanush Nehru | The Breakout
Game ❤</span
>
</footer>
<script src="utils/utilsCopyright.js"></script>
<script src="utils/utilsColor.js"></script>
<script src="script.js"></script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions utils/utilsCopyright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const currentYear = new Date().getFullYear();

document.getElementById('year').textContent = currentYear;

0 comments on commit ded92b7

Please sign in to comment.