Skip to content

Feedback #1

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

Open
wants to merge 62 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9d3b0f5
Setting up GitHub Classroom Feedback
github-classroom[bot] Apr 19, 2023
6ce0d21
Add assignment deadline url
github-classroom[bot] Apr 19, 2023
db595f6
added index.html, styles.css and img folder with spoon pic
Hannah-Sofie Apr 19, 2023
601229d
added simple 5x5 board and spoon cursor
Hannah-Sofie Apr 19, 2023
bd12e15
added questions to the readme file about project
Hannah-Sofie Apr 19, 2023
be07336
updated html structure and created new branch
Jonhels Apr 19, 2023
fa63a54
Merge pull request #2 from AdvancedCSS2023/Jonhelge
Hannah-Sofie Apr 19, 2023
96bea8f
structured html added checkboxes for game
Jonhels Apr 19, 2023
6c429de
Merge pull request #3 from AdvancedCSS2023/Jonhelge
Ekkeskit Apr 19, 2023
c02959f
added egg and blinking animation
Hannah-Sofie Apr 19, 2023
031d836
html structure and css
Jonhels Apr 19, 2023
b52167c
Merge pull request #4 from AdvancedCSS2023/Jonhelge
Ekkeskit Apr 19, 2023
bbce094
tes
Ekkeskit Apr 19, 2023
2c9fd13
added pictures for each checkbox and blinking animation
Hannah-Sofie Apr 19, 2023
39e49f0
Merge branch 'main' into hannah
Hannah-Sofie Apr 19, 2023
b8c9ca0
Merge pull request #6 from AdvancedCSS2023/hannah
Jonhels Apr 19, 2023
cc7e830
updated pointer-event to none when clicked
Hannah-Sofie Apr 19, 2023
199d5ce
Merge pull request #7 from AdvancedCSS2023/animation
Hannah-Sofie Apr 19, 2023
8d4fadb
Merge branch 'main' of https://github.com/AdvancedCSS2023/assignment-…
Ekkeskit Apr 19, 2023
415c6f4
Merge branch 'main' of https://github.com/AdvancedCSS2023/assignment-…
Ekkeskit Apr 19, 2023
1911060
pull and push
Ekkeskit Apr 19, 2023
17209d2
Merge pull request #8 from AdvancedCSS2023/elina
Jonhels Apr 19, 2023
6e6f65b
Graphical changes
Ekkeskit Apr 19, 2023
a988541
Design changes
Ekkeskit Apr 20, 2023
4b9ee9d
Stylistic changes
Ekkeskit Apr 20, 2023
0fac3ec
Merge pull request #9 from AdvancedCSS2023/elina
Jonhels Apr 20, 2023
4b84f63
updated the read me file
Hannah-Sofie Apr 20, 2023
0316b80
Merge pull request #10 from AdvancedCSS2023/readme
Hannah-Sofie Apr 20, 2023
18af612
Font, border and color changes
Ekkeskit Apr 20, 2023
213058d
added some css variables
Hannah-Sofie Apr 20, 2023
5f770fa
Merge pull request #11 from AdvancedCSS2023/repetitive
Jonhels Apr 20, 2023
6a23682
removed repetitive code and added css variables
Hannah-Sofie Apr 20, 2023
2a7a6d4
Merge pull request #12 from AdvancedCSS2023/styles
Hannah-Sofie Apr 20, 2023
66c92d6
Merge branch 'main' of https://github.com/AdvancedCSS2023/assignment-…
Ekkeskit Apr 20, 2023
20e71d4
added script and counter for cracking eggs
Jonhels Apr 20, 2023
e6d495c
Merge pull request #13 from AdvancedCSS2023/Jonhelge
Hannah-Sofie Apr 20, 2023
b406a1a
updated script for timer
Jonhels Apr 20, 2023
acec62e
Merge pull request #14 from AdvancedCSS2023/Jonhelge
Hannah-Sofie Apr 20, 2023
8dac7fb
Merge branch 'main' into elina
Hannah-Sofie Apr 20, 2023
bc61689
Merge pull request #15 from AdvancedCSS2023/elina
Hannah-Sofie Apr 20, 2023
43eecbe
Merge pull request #16 from AdvancedCSS2023/main
Hannah-Sofie Apr 20, 2023
2dacf05
merge request
Jonhels Apr 20, 2023
4973c47
Merge branch 'Jonhelge' of https://github.com/AdvancedCSS2023/assignm…
Jonhels Apr 20, 2023
7dade23
fixed bug
Hannah-Sofie Apr 20, 2023
b3be7e0
Merge branch 'main' of https://github.com/AdvancedCSS2023/assignment-…
Jonhels Apr 20, 2023
aa1dff8
updated css and script to show game articles one and one
Jonhels Apr 20, 2023
644f109
Merge pull request #17 from AdvancedCSS2023/Jonhelge
Hannah-Sofie Apr 20, 2023
dfeebf7
Merge pull request #18 from AdvancedCSS2023/main
Hannah-Sofie Apr 20, 2023
ac534f2
added some hover animation and fixed margin
Hannah-Sofie Apr 20, 2023
8fc9e43
Merge branch 'main' into hannah
Hannah-Sofie Apr 20, 2023
dd16c0f
Merge pull request #19 from AdvancedCSS2023/hannah
Jonhels Apr 20, 2023
4d837c0
Revert "added some hover animation and fixed margin"
Hannah-Sofie Apr 20, 2023
21d2b23
favicon added
Ekkeskit Apr 20, 2023
93d65c7
Merge pull request #20 from AdvancedCSS2023/revert-19-hannah
Jonhels Apr 20, 2023
b4a7564
Merge pull request #21 from AdvancedCSS2023/elina
Hannah-Sofie Apr 20, 2023
0769191
updated readme file
Jonhels Apr 20, 2023
46907ed
Merge pull request #22 from AdvancedCSS2023/Jonhelge
Ekkeskit Apr 20, 2023
500b0e8
added hover animation
Hannah-Sofie Apr 20, 2023
520fa95
Merge pull request #23 from AdvancedCSS2023/animation
Jonhels Apr 20, 2023
033ef52
updated readme file
Jonhels Apr 20, 2023
7a2c244
updated readmefile
Jonhels Apr 20, 2023
689d267
Merge pull request #24 from AdvancedCSS2023/Jonhelge
Hannah-Sofie Apr 20, 2023
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
Binary file added .DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# Assignment 2 - CSS game | Advanced CSS

## What does the project do?

- This project is a game that has been created using CSS. The objective of the game is to click on eggs that appear on the screen before the timer runs out, with a time limit of 30 seconds.

## Why is the project useful?

- From a practical standpoint, this project may not have any specific use or application. However, it can serve as an entertaining and engaging game for users to play and pass the time. Games like this can also be used to improve hand-eye coordination and reaction time, which can have practical benefits in real-world scenarios such as driving or sports. Additionally, creating games like this can help individuals develop their programming and design skills, which can be useful in future projects or career paths.

## How can users get started with the project?

- They can download the zip file to their computer and play the game. Or they can clone the repository and play.

## Where can users get help with your project?

- If users need help with the project they can contact the developers for assistance. This may be done through email, social media, or other contact methods listed on the project's website or documentation.

## Which technology is used?

- CSS is the primary technology used to create this game, but HTML have also been used to structure and organize the content on the page.
- We have used some javacript to hide articles for better UX javascript have also been used to create a timer and counter for the game. We did this to create a good feeling for the users and make the game seem more like a game.

## Who maintains and contributes to the project?

- Elina, Hannah and Jon are the individuals who maintain and contribute to the project, as they were the ones who created it.

[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/LlYauwvp)
[![Open in Visual Studio Code](https://classroom.github.com/assets/open-in-vscode-718a45dd9cf7e7f842a935f5ebbe5719a5e09af4491e668f4dbf3b35d5cca122.svg)](https://classroom.github.com/online_ide?assignment_repo_id=10919012&assignment_repo_type=AssignmentRepo)
Binary file added img/.DS_Store
Binary file not shown.
Binary file added img/chickcry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/chickhappy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/chickneutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/easteregg7.png
Binary file added img/easteregg8.png
Binary file added img/easteregg9.png
Binary file added img/egg1.png
Binary file added img/egg10.png
Binary file added img/egg11.png
Binary file added img/egg12.png
Binary file added img/egg13.png
Binary file added img/egg14.png
Binary file added img/egg15.png
Binary file added img/egg16.png
Binary file added img/egg17.png
Binary file added img/egg18.png
Binary file added img/egg19.png
Binary file added img/egg2.png
Binary file added img/egg20.png
Binary file added img/egg21.png
Binary file added img/egg22.png
Binary file added img/egg23.png
Binary file added img/egg24.png
Binary file added img/egg25.png
Binary file added img/egg3.png
Binary file added img/egg4.png
Binary file added img/egg5.png
Binary file added img/egg6.png
Binary file added img/egg7.png
Binary file added img/egg8.png
Binary file added img/egg9.png
Binary file added img/favicon.ico
Binary file not shown.
Binary file added img/spoon.png
119 changes: 119 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<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=Dongle:wght@400;700&display=swap" rel="stylesheet">
<title>Easter Game</title>
</head>

<body>
<main>
<article id="startScreen">
<div class="wrapper--information">
<h1>Egg hunt</h1>
<p>You crave an omelette. Go hunt for eggs!
</p>
<img src="./img/chickneutral.png" alt="Neutral chicken">
<p>How to play: Crack all the eggs as fast as you can!</p>
<a href="#gameScreen"> <button>Start game</button></a>
</div>
</article>
<article id="gameScreen">
<div class="game--information">
<h1>Gametime</h1>
<div>
<p>Eggs cracked: <span id="counter">0</span></p>
<p>Time elapsed: <span id="timer">00:00:00</span></p>
</div>
</div>
<div class="gameboard">
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage1">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage2">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage3">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage4">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage5">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage6">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage7">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage8">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage9">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage10">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage11">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage12">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage13">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage14">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage15">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage16">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage17">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage18">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage19">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage20">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage21">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage22">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage23">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage24">
</div>
<div class="gameboard__square">
<input type="checkbox" class="gameboard__checkbox--eggimage25">
</div>
<a href="./index.html"><button>Return to start</button></a>
</article>
</main>
</div>
<script src="./script.js"></script>
</body>

</html>
86 changes: 86 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// get all the checkboxes
const checkboxes = document.querySelectorAll('input[type="checkbox"]');

// add event listener to each checkbox
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
// get the number of checked checkboxes
const checkedCount = document.querySelectorAll('input[type="checkbox"]:checked').length;

// update the counter display
const counter = document.querySelector('#counter');
counter.textContent = checkedCount;
});
});

// Timer

// get all the checkboxes

// add event listener to each checkbox
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
// get the number of checked checkboxes
const checkedCount = document.querySelectorAll('input[type="checkbox"]:checked').length;

// update the counter display
const counter = document.querySelector('#counter');
counter.textContent = checkedCount;
});
});

// Timer

const counter = document.getElementById('counter');
const timer = document.getElementById('timer');
let startTime;
let timerInterval;

function startTimer() {
startTime = new Date().getTime();
timerInterval = setInterval(updateTimer, 1000);
}

function updateTimer() {
const elapsedTime = new Date().getTime() - startTime;
const seconds = Math.floor(elapsedTime / 1000);
const minutes = Math.floor(seconds / 60);
timer.textContent = `${minutes.toString().padStart(2, '0')}:${(seconds % 60).toString().padStart(2, '0')}`;
}

let numChecked = 0;
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('click', function() {
if (numChecked === 0) {
startTimer();
}
if (checkbox.checked) {
numChecked++;
} else {
numChecked--;
}
counter.textContent = numChecked;
if (numChecked === checkboxes.length) {
clearInterval(timerInterval);
alert(`You cracked all the eggs in ${timer.textContent}!`);
}
});
});

// Hide and show articles
const startButton = document.querySelector('#startScreen button');
const gameScreen = document.querySelector('#gameScreen');
const returnButton = document.querySelector('#gameScreen button');


startButton.addEventListener('click', () => {
// hide the start screen
startScreen.style.display = 'none';
// show the game screen
gameScreen.style.display = 'block';
});

returnButton.addEventListener('click', () => {
// reset the game
location.reload();
});
Loading