diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml new file mode 100644 index 0000000..930e471 --- /dev/null +++ b/.github/workflows/deno.yml @@ -0,0 +1,42 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow will install Deno then run Deno lint and test. +# For more information see: https://github.com/denoland/setup-deno + +name: Deno + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Setup repo + uses: actions/checkout@v3 + + - name: Setup Deno + # uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@004814556e37c54a2f6e31384c9e18e983317366 + with: + deno-version: v1.x + + # Uncomment this step to verify the use of 'deno fmt' on each commit. + # - name: Verify formatting + # run: deno fmt --check + + - name: Run linter + run: deno lint + + - name: Run tests + run: deno test -A --unstable diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..30877b0 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,50 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v1 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/26293.jpg b/26293.jpg new file mode 100644 index 0000000..1c853c9 Binary files /dev/null and b/26293.jpg differ diff --git a/README.md b/README.md deleted file mode 100644 index 75c7343..0000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Games - -I have designed and code 3 games in this repository. - - - -2. ADDIIONAL GAME: -The computer will generate two numbers for you to add together, you have 10 seconds to hit a new highscore - -1. Subtraction: -The computer will generate a random number between 1 to 9 and you have to guess it before the time reaches 0! - -3. Multiplication Game: -The computer will generate two numbers for you to multiply, you have 10 seconds to hit a new highscore - - -I am able to do this with the use of HTML/CSS and javascript, -one of the key things i learnt while building the game is how to use persitant data(aka, cookies). You will notice that even when you -refresh the pages, your high score remains the same, that way you don't miss out on any of it. diff --git a/files/Vj Loops - 32745.mp4 b/Vj Loops - 32745.mp4 similarity index 100% rename from files/Vj Loops - 32745.mp4 rename to Vj Loops - 32745.mp4 diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c419263..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/scripts/add.js b/add.js similarity index 85% rename from scripts/add.js rename to add.js index 97c76fc..c7dc6a1 100644 --- a/scripts/add.js +++ b/add.js @@ -1,18 +1,10 @@ var x = document.getElementById("myAudio"); -let timeLeft = 10; +let timeLeft = 15; let timerinterval; highscore = 0; score = 0; correctAnswer = 0; -window.onload = function(){ - scoreFromBrowser = localStorage.getItem("highscore"); - if (scoreFromBrowser != undefined) highscore = scoreFromBrowser; - document.getElementById("highscore").innerHTML = "High Score: " + highscore; - -} - - function timmer(){ let timeDisplay = document.getElementById("time"); timeDisplay.hidden =false @@ -26,13 +18,19 @@ function timmer(){ document.getElementById("btn3").hidden = true; document.getElementById("btn4").hidden = true; window.alert("GAME OVER!"); - location.reload(); + location.reload(); } },1000) } function dis(){ - document.getElementById("startbtn").hidden =true; + document.getElementById("startbtn").hidden = true; + document.getElementById("btn1").hidden = false; + document.getElementById("btn2").hidden = false; + document.getElementById("btn3").hidden = false; + document.getElementById("btn4").hidden = false; + + } function playAudio() { @@ -91,10 +89,3 @@ function checkAnswer(buttonIndex){ document.getElementById("highscore").innerHTML = "High Score: " + highscore; nextquestion(); } -/* - -var btnsStart = document.getElementById("startbtn") - -btnsStart.addEventListener ("click", checkHighscore) - -*/ diff --git a/additiongame.html b/additiongame.html index 35c4306..46111ed 100644 --- a/additiongame.html +++ b/additiongame.html @@ -4,7 +4,7 @@ - + ADDITION GAME @@ -17,34 +17,27 @@
Current Score: 0

What is the Answer?

0 + 0
-
- - - - - + + + +
- - W3Schools.com + + homeicon
- + diff --git a/files/beep audio.mp3 b/beep audio.mp3 similarity index 100% rename from files/beep audio.mp3 rename to beep audio.mp3 diff --git a/files/26293.jpg b/files/26293.jpg deleted file mode 100644 index 8af0286..0000000 Binary files a/files/26293.jpg and /dev/null differ diff --git a/files/bg.jpg b/files/bg.jpg deleted file mode 100644 index 9fb56af..0000000 Binary files a/files/bg.jpg and /dev/null differ diff --git a/files/home.png b/home.png similarity index 100% rename from files/home.png rename to home.png diff --git a/index.html b/index.html index 5eb4adc..13b2a97 100644 --- a/index.html +++ b/index.html @@ -6,32 +6,32 @@ Simple Math Game - +

What Game would you like to play?

Level 1

- +

The computer will generate two numbers for you to add together, you have 10 seconds to hit a new highscore

Level 2

- +

The computer will generate two numbers for you to subtract, you have 10 seconds to hit a new highscore

Level 3

- +

The computer will generate two numbers for you to multiply, you have 10 seconds to hit a new highscore

- \ No newline at end of file + diff --git a/stylesheets/indexstyle.css b/indexstyle.css similarity index 98% rename from stylesheets/indexstyle.css rename to indexstyle.css index e68d517..defff1b 100644 --- a/stylesheets/indexstyle.css +++ b/indexstyle.css @@ -49,7 +49,7 @@ body{ position: fixed; margin: auto; padding-top: 50px; - background: linear-gradient(rgba(4,9,30,0.7), rgba(4,9,30,0.2)), url(/files/26293.jpg); + background: linear-gradient(rgba(4,9,30,0.7), rgba(4,9,30,0.2)), url(26293.jpg); } button { diff --git a/multiplicationgame.html b/multiplicationgame.html index c05cd73..88c5899 100644 --- a/multiplicationgame.html +++ b/multiplicationgame.html @@ -4,7 +4,7 @@ - + Multiplication Game @@ -17,9 +17,6 @@
Current Score: 0

What is the Answer?

0 × 0
- @@ -35,16 +32,16 @@

What is the Answer?

- - W3Schools.com + + homeicon
- + diff --git a/scripts/multiply.js b/multiply.js similarity index 99% rename from scripts/multiply.js rename to multiply.js index 73b7b67..3c938e3 100644 --- a/scripts/multiply.js +++ b/multiply.js @@ -1,5 +1,5 @@ var x = document.getElementById("myAudio"); -let timeLeft = 10; +let timeLeft = 15; let timerinterval; highscore = 0; score = 0; diff --git a/scripts/new.js b/new.js similarity index 100% rename from scripts/new.js rename to new.js diff --git a/stylesheets/style.css b/style.css similarity index 97% rename from stylesheets/style.css rename to style.css index f7e2bf4..29570ef 100644 --- a/stylesheets/style.css +++ b/style.css @@ -1,5 +1,5 @@ -/*::::::::::::::HOMEPAGE STYLING:::::::::::::::*/ +/*:::::::::::HOMEPAGE STYLING::::::::::::*/ body{ min-height: 100vh; width: 100%; @@ -7,7 +7,7 @@ body{ position: fixed; margin: auto; padding-top: 50px; - background-image: linear-gradient(rgba(4,9,30,0.7), rgba(4,9,30,0.2)), url(/files/26293.jpg); + background-image: linear-gradient(rgba(4,9,30,0.7), rgba(4,9,30,0.2)), url(26293.jpg); } #computerguess{ font-size: 20px; @@ -178,4 +178,4 @@ button:after { z-index: 3; position: relative; margin: auto; -} \ No newline at end of file +} diff --git a/scripts/sub.js b/sub.js similarity index 99% rename from scripts/sub.js rename to sub.js index b13b5f3..1418db7 100644 --- a/scripts/sub.js +++ b/sub.js @@ -1,5 +1,5 @@ var x = document.getElementById("myAudio"); -let timeLeft = 10; +let timeLeft = 15; let timerinterval; highscore = 0; score = 0; diff --git a/subtractgame.html b/subtractgame.html index 0e26878..8fae8ab 100644 --- a/subtractgame.html +++ b/subtractgame.html @@ -4,8 +4,8 @@ - - Subtract + + Subtract Game
@@ -17,9 +17,6 @@
Current Score: 0

What is the Answer?

0 - 0
- @@ -28,23 +25,19 @@

What is the Answer?

-
- - W3Schools.com + + homeicon
- +