diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index dc2beda..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,32 +0,0 @@ -## CSOC Task 1 Submission - - -### Track - -- [ ] Android -- [ ] Flutter -- [ ] Web Devlopment - -### Task Completed - -#### Hangman - -- [ ] **Task 1**: Implement a hangman game. Create a word generator and generate random words in every game. -- [ ] **Task 2**: Add a high score page to view the previous scores. -- [ ] **Task 3**: Giving hints to users, by showing a few letters when the user needs them. Also, you could give signs when the entered letters are wrong. -- [ ] **Task 4:** Make hard and easy mode with say, 5 lives in easy and 3 in hard mode. Also, word length and difficulty could be changed with respective levels. Easy words could have till 5 letters while difficult ones with longer words. -- [ ] **Extras:** Adding a timer for making it more interactive and competitive. - -#### Calculator - -- [ ] **Task 1**: Create a simple calculator with basic mathematical operations. -- [ ] **Task 2**: Add complex operations including exponentiation, logarithms, trigonometry, etc. -- [ ] **Task 3:** Add an option to change settings, say from radians to degrees and vice versa, and an option to change the theme of the app. -- [ ] **Task 4:** Feature to show a history of previous calculations. -- [ ] **Extras:** Add feature for matrix calculations and plotting of simple basic graphs using equations. - -### Submission - - -[Repo](link) -[APK|Web Site](link) diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 714b6e5..0000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,8 +0,0 @@ -android: -- any: ['Android.md'] - -flutter: -- any: ['Flutter.md'] - -web: -- any: ['WebDev.md'] diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 331ddc9..0000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: "Pull Request Labeler" -on: -- pull_request_target - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v3 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/Android.md b/Android.md deleted file mode 100644 index d532893..0000000 --- a/Android.md +++ /dev/null @@ -1,59 +0,0 @@ -# CSOC Week1 Android - -## Introduction -The most apt definition for android is - "Android is a mobile operating system based on a modified version of the Linux kernel and other open-source software, designed primarily for touchscreen mobile devices such as smartphones and tablets." -In short, we can say that it is an Operating system for touchscreen devices, and any device that runs on this Operating System is known as an Android Device. Now for every operating system, some applications can run on it to perform specific tasks. Similarly, for Android Devices, we have Android Apps that can run on them to perform specific tasks. - -Evident enough that the software engineering field for developing such apps is known as Android App Development. -The official language for Android development is Kotlin, but Java is still used in many famous courses and many projects, so you are free to use any of them. - -## Installation - -### Android Studio - -Android Studio is the official Integrated Development Environment (IDE) for Android app development. This software is a bit heavy on normal systems (8 GB Ram & 1 TB HDD) and can be quite laggy for any systems below this configuration. - -[](https://developer.android.com/studio/install) - -While developing an android app you will need to test it on a device. You can test it in two ways - - -- [Real Device (Preferred for slower systems)](https://developer.android.com/studio/debug/dev-options) -For testing you apps on a real device you will need to have a USB cable and an Android device. Follow this tutorial to enable USB debugging in order to run your app in the device. - -- [Emulator](https://developer.android.com/studio/run/emulator) -An Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. It provides almost all of the capabilities of a real Android device. - - -## How to get started - -If you haven't had any chance to develop android apps earlier then don't worry it's not too late to start now. Here are few resources to start with android development. - -- Video Tutorial - - [Android development tutorial 1](https://www.youtube.com/playlist?list=PLUcsbZa0qzu3Mri2tL1FzZy-5SX75UJfb) - - [Android development tutorial 2](https://www.youtube.com/playlist?list=PLgCYzUzKIBE8TUoCyjomGFqzTFcJ05OaC) -- Written Tutorials - - [Create a project](https://developer.android.com/training/basics/firstapp/creating-project) - - [Run your app](https://developer.android.com/training/basics/firstapp/running-app) - - [Include new UI](https://developer.android.com/training/basics/firstapp/building-ui) - - [Make it functional](https://developer.android.com/training/basics/firstapp/starting-activity) - -## Submission Guidelines : - -Submission has to be done by sharing your github repo link and the .apk file of your android app - -- Fork and then Clone your repository -- Make a new entry into submissions as explained in comments -- Commit and Push the changes -- Make a Pull request - -## Submissions - - - - diff --git a/Flutter.md b/Flutter.md deleted file mode 100644 index f0a98c4..0000000 --- a/Flutter.md +++ /dev/null @@ -1,73 +0,0 @@ -# CSoC Week-1 Flutter - -# Introduction - -Flutter - promises cross platform, natively compiled apps, with slick smooth UIs. Developed by Google, the framework is gaining in popularity, especially amongst new startups. - -## Single Codebase…like Java? - -Flutter’s major selling point is that it allows developers to create mobile apps for Android and iOS using a single codebase. It’s possible to build a Flutter app targeting Android and build the same project on a Mac for iOS devices without changing a single line of code. - -Unlike most other mobile app frameworks Flutter does not use WebView nor OEM widgets. Instead, Flutter uses its own rendering engine to draw widgets. - -Apps are natively compiled too, so you’ll need a machine with Android SDK installed for targetting Android and you’ll need to be running XCode to build for iOS devices. - -# Getting Started - -## Installation - -Here is how you can install Flutter. Do not install Android Studio right now, this week you do not require it. Read until writing your first flutter app. - -[Install](https://flutter.dev/docs/get-started/install) - -To use flutter consistently between different terminal sessions, go through this - -[Linux install](https://flutter.dev/docs/get-started/install/linux#update-your-path) - -Install a suitable IDE. VS Code (compared to Android Studio) is good choice for a light and better experience. - -# For Basic Understanding - -- [Flutter Widgets - Javatpoint](https://www.javatpoint.com/flutter-widgets) -- [Flutter - Container Cheat Sheet](https://medium.com/jlouage/container-de5b0d3ad184) -- [Flutter Tutorial for Beginners - Build iOS and Android Apps with Google's Flutter & Dart](https://www.youtube.com/watch?v=x0uinJvhNxI) -- [The Flutter Series: Exploring a Flutter project and building your first Flutter app](https://medium.com/@dev.n/the-complete-flutter-series-article-1-exploring-a-flutter-project-and-building-your-first-flutter-e438ea941d70) - -- [The Flutter Series: Basic Widgets and Layout](https://medium.com/@dev.n/the-complete-flutter-series-article-2-basic-widgets-and-layout-in-flutter-92a4fbd4a3e1) - -Don't forget to switch on USB Debugging on your mobile. (In case you are not using an emulator) - -For reference, keep this handy - -[Flutter - Dart API docs](https://api.flutter.dev/) - -# Challenge - -As an aspiring developer, you'd need to keep building things to keep your knowledge on tips. Now that you are good to go with the basics of native Android Development, we want you to build **one of the apps** from the following list on your own. - -1. Calculator app -2. Hangman game - -You have to provide your Repo and APK File as part of submission - -### **Judging** - -The evaluation would be done mainly on the following basis: - -1. User Interface and User Experience -2. Authenticity and readability of the code -3. Completion of mentioned tasks -4. Bonus Points for implementing extra features depending on your creativity😉 - -Remember, the deadline for this week's task is **June 10th, 2022, 23:59**. - -## Submission Guidelines : - -Submission has to be done by sharing your github repo link and the .apk file of your application - -- Fork and then Clone your repository -- Make a new entry into submissions as explained in comments -- Commit and Push the changes -- Make a Pull request - -## Submissions diff --git a/README.md b/README.md new file mode 100644 index 0000000..52b8417 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# CSOC22-Week1 + +A responsive scientific calculator that works on phones, tablets as well as PC screen with dark and light themes. + diff --git a/WebDev.md b/WebDev.md deleted file mode 100644 index cb78c5f..0000000 --- a/WebDev.md +++ /dev/null @@ -1,55 +0,0 @@ -# CSOC'22 Week1 Web Development - -## Introduction - -Web development is a basic skill that is often said as a good start to the development field. This week you will learn the basics of web development. You will get familiar with HTML, CSS, and JavaScript. On completion, you will be able to make simple static websites for both desktop and mobile. - -## Responsive UI - -One major thing to ensure while working on Web Apps is to ensure that most people will open your websites on mobile first based on that we develop our site on Mobile First approach and then make changes to scale with increasing screen size - -### Native CSS Tools - -These are vanilla CSS Tools that will allow you to make your UI respond to changes in the screen size. - -- Flexbox - -- Grid - -- Float - -- Media Queries - -### CSS Frameworks - -They provide you with a set of classes and components that scale with the screen size. Although its only recommended to use them when you understand native CSS properly. - -- [Bootstrap 5](https://getbootstrap.com/) - -- [TailwindCSS 2](https://tailwindcss.com/) - -- [Bulma](https://bulma.io/) - -- [Materialize](https://materializecss.com/) - -## Submission Guidelines : - -Submission has to be done by sharing your github repo link and deployment link of site - -- Fork and then Clone your repository - -- Make a new entry into submissions as explained in comments - -- Commit and Push the changes - -- Make a Pull request - -Remember, the deadline for this week's task is June 7th, 2022, at 23:59. - -## Submissions - - - - - - diff --git a/console.js b/console.js new file mode 100644 index 0000000..0bb369e --- /dev/null +++ b/console.js @@ -0,0 +1,190 @@ +// darkmode +var darkmode = document.getElementById("darkmode-icon"); + +darkmode.onclick = function(){ + document.body.classList.toggle("light-mode"); + if(document.body.classList.contains("light-mode")) + darkmode.src= "moon.png" + else + darkmode.src= "sun.png" +} + + +let inv = document.getElementsByClassName("sci"); + +let display = document.getElementById('display-input'); + +let buttons = Array.from(document.getElementsByClassName('button')); + +let expression = ''; + +let history = ''; + +let x; + +let i = 0; + + +linebreak = document.createElement("br"); +hist = document.getElementById("history"); + +buttons.map(button => { + button.addEventListener('click', (e) => { + switch (e.target.innerText) { + + // for clearing text + case 'C': + display.innerText = ''; + expression = ''; + addToHistory(''); + i++; + history = ''; + console.log(expression);//test + break; + + // when = is pressed + case '=': + try { + display.innerText = eval(expression); + addToHistory(expression + '=' + display.innerText); + expression = display.innerText; + console.log(expression);//test + i++; + history = ''; + } catch { + display.innerText = "Error" + expression = ''; + } + break; + + + // backspace + case '←': + if (display.innerText) { + display.innerText = display.innerText.slice(0, -1); + expression = display.innerText; + console.log(expression);//test + } + break; + + + case 'π': + display.innerText += 'π'; + expression += Math.PI; + console.log(expression);//test + break; + case 'e': + display.innerText += 'e'; + expression += Math.E; + console.log(expression);//test + break; + case 'ln': + display.innerText = "log(" + display.innerText + ")"; + expression = eval(expression); + expression = Math.log(expression); + console.log(expression);//test + break; + case '%': + display.innerText += '%'; + expression = eval(expression); + expression = (expression) / 100; + break; + case '√': + display.innerText = '√' + display.innerText; + expression = Math.sqrt(expression); + break; + case '!': + display.innerText += '!'; + expression = factorial(expression); + break; + case 'sci': + for (let j = 0; j < 7; j++) { + inv[j].classList.toggle("invisible"); + } + + break; + case '^': + display.innerText += '^'; + expression += '^'; + switch (e.target.innerText) { + case '=': + expression = power(expression); + try { + display.innerText = eval(expression); + console.log(expression);//test + } catch { + display.innerText = "Error" + expression = ''; + } + } + + break; + default: + display.innerText += e.target.innerText; + expression += e.target.innerText; + console.log(expression);//test + } + }); +}); + +function addToHistory(value) { + let hist = document.getElementsByClassName('history'); + + var el = document.createElement('div'); + el.setAttribute("id", `Div${i}`); + hist[0].appendChild(el); + + + if (i<1) { + let newElement= document.getElementById(`Div${i}`); + newElement.classList.add("new-element"); + newElement.scrollIntoView({behavior:"smooth"}); + } + else { + let newElement= document.getElementById(`Div${i}`); + newElement.classList.add("new-element"); + let oldElement= document.getElementById(`Div${i-1}`); + oldElement.classList.remove("new-element"); + newElement.scrollIntoView({behavior:"smooth"}); + } + + + + history += value; + + console.log(history); + + if (history === '=undefined') { + history = ''; + expression = ''; + display.innerText = ''; + } + else + { + document.getElementById(`Div${i}`).innerHTML = history; + } + + + +} + +factorial = (n) => { + let answer = 1; + if (n == 0 || n == 1) { + return answer; + } else { + for (var i = n; i >= 1; i--) { + answer = answer * i; + } + return answer; + } +} + +power = (n) => { + var textinside = n; + var a = textinside.slice(0, textinside.indexOf('^')); + var b = textinside.slice(-1, textinside.indexOf('^')); + console.log(a, b); + ans = Math.pow(a, b); + return (ans); +} diff --git a/home.html b/home.html new file mode 100644 index 0000000..a461c72 --- /dev/null +++ b/home.html @@ -0,0 +1,78 @@ + + + +
+ + + + + + + + + +