diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..694587b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Open currency_converter.html", + "file": "/home/odoo/odoo/Javascript-training/Currency Converter/currency_converter.html" + } + ] +} \ No newline at end of file diff --git a/Rock Paper & Scissor Game/task1.css b/Rock Paper & Scissor Game/task1.css new file mode 100644 index 0000000..1923b07 --- /dev/null +++ b/Rock Paper & Scissor Game/task1.css @@ -0,0 +1,96 @@ +*, +*:Before, +*:After{ + Padding: 0; + Margin: 0; + Box-Sizing: Border-Box; +} +Body{ + Height: 100vh; + Background: Linear-Gradient( + 135deg, + #1bcaff, + #231bff + ); +} +.Container{ + Width: 45%; + Min-Width: 500px; + Background-Color: #Ffffff; + Padding: 40px 30px; + Position: Absolute; + Transform: Translate(-50%,-50%); + Top: 50%; + Left: 50%; + Border-Radius: 10px; + Box-Shadow: 0 15px 25px Rgba(0,0,0,0.15); +} +.Scores{ + Margin-Bottom: 50px; + Text-Align: Right; +} +.Details{ + Margin-Top: 30px; + Text-Align: Center; +} +.Scores,.Details{ + Font-Family: 'Poppins',Sans-Serif; + Font-Weight: 400; + Font-Size: 15px; +} + +#User_choice, +#Computer_choice{ + Font-Weight: 400; + Margin-Bottom: 10px; +} +Span{ + Font-Weight: 600; +} + + + + +.btn { + border: 2px solid black; + background-color: white; + color: black; + padding: 14px 28px; + font-size: 16px; + cursor: pointer; + } + + .success { + border-color: #04AA6D; + color: green; + } + + .success:hover { + background-color: #04AA6D; + color: white; + } + /* Orange */ + .warning { + border-color: #ff9800; + color: orange; + } + + .warning:hover { + background: #ff9800; + color: white; + } + + /* Red */ + .danger { + border-color: #f44336; + color: red; + } + + .danger:hover { + background: #f44336; + color: white; + } + .center { + text-align: center; + padding: 10px; + } \ No newline at end of file diff --git a/Rock Paper & Scissor Game/task1.html b/Rock Paper & Scissor Game/task1.html new file mode 100644 index 0000000..dfb6ae6 --- /dev/null +++ b/Rock Paper & Scissor Game/task1.html @@ -0,0 +1,32 @@ + + + + Rock Paper Scissor Game + + + + +
+

Rock Paper & Scissor Game

+
+

Computer : + 0 +

+

+ You : + 0 +

+
+
+

+
+
+ + + +
+
+ + + + \ No newline at end of file diff --git a/Rock Paper & Scissor Game/task1.js b/Rock Paper & Scissor Game/task1.js new file mode 100644 index 0000000..be8619b --- /dev/null +++ b/Rock Paper & Scissor Game/task1.js @@ -0,0 +1,24 @@ +const choices = ['Rock','Paper','Scissor']; +var user_scores = 0,computer_score = 0; +function playgame(a) +{ + const choices=['Rock','Paper','Scissor']; + let user_choice=choices[a]; + let computer_choice=Math.floor(Math.random() * choices.length); + if(choices[computer_choice]=='Rock' && user_choice=="Rock" || choices[computer_choice]=='Paper' && user_choice=="Paper" || choices[computer_choice]=='Scissor' && user_choice=="Scissor" ) + { + document.getElementById("status").textContent="Draw"; + } + else if (choices[computer_choice]=='Paper' && user_choice=="Rock" || choices[computer_choice]=='Rock' && user_choice=="Scissor" || choices[computer_choice]=='Scissor' && user_choice=="Paper") + { + document.getElementById('status').textContent="Computer Wins"; + computer_score += 1; + document.getElementById('computer_score').textContent=computer_score; + } + else + { + document.getElementById("status").textContent="You Win"; + user_scores +=1; + document.getElementById('user_scores').textContent=user_scores; + } +} \ No newline at end of file