├── replit.nix
├── index.html
├── style.css
├── script.js
└── .replit
/replit.nix:
--------------------------------------------------------------------------------
1 | { pkgs }: {
2 | deps = [
3 | pkgs.nodePackages.vscode-langservers-extracted
4 | pkgs.nodePackages.typescript-language-server
5 | ];
6 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Word Guessing Game
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Word Guessing Game
15 | IENMGTE
16 | HINT :- EVENT IN WHICH PEOPLE COME TOGETHER
17 | TIME LEFT: 30s
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | padding: 0;
3 | margin: 0;
4 | display: flex;
5 | justify-content: center;
6 | align-items: center;
7 | min-height: 100vh;
8 | background: linear-gradient(315deg, rgb(177, 74, 168) 3%, rgb(81, 142, 203) 38%, rgb(200, 211, 133) 68%, rgb(82, 180, 176) 98%);
9 | animation: gradient 16s ease infinite;
10 | background-size: 400% 400%;
11 | overflow: hidden;
12 | }
13 | @keyframes gradient {
14 | 0% {
15 | background-position: 0% 0%;
16 | }
17 | 50% {
18 | background-position: 100% 100%;
19 | }
20 | 100% {
21 | background-position: 0% 0%;
22 | }
23 | }
24 | .page{
25 | background-color: #aafdfb;
26 | padding: 20px;
27 | border-radius: 20px;
28 | box-shadow: 12px 12px 14px rgb(92, 237, 240, 0.64);
29 | }
30 | .page h1{
31 | text-align: center;
32 | font-size: 35px;
33 | font-family: sans-serif;
34 | border-bottom: 1px solid #ccc;
35 | padding: 10px;
36 | color: #570a8a;
37 | font-weight: bold;
38 | }
39 | .page h2{
40 | text-align: center;
41 | font-size: 27px;
42 | font-family: sans-serif;
43 | border-bottom: 1px solid #ccc;
44 | padding: 10px;
45 | letter-spacing: 3.6px;
46 | }
47 | .page h4{
48 | text-align: center;
49 | font-family: sans-serif;
50 | padding: 10px;
51 | color: #f42b15;
52 | }
53 | .page input{
54 | border: 2px solid #ddf3fc;
55 | border-radius: 4px;
56 | display: block;
57 | font-size: 19px;
58 | padding: 10px;
59 | width: 90%;
60 | cursor: pointer;
61 | }
62 | .page input:focus{
63 | outline: none;
64 | }
65 | .page input:hover{
66 | box-shadow: 0px 5px 12px #68def0;
67 | font-size: 20px;
68 | letter-spacing: 1.2px;
69 | }
70 | .page button{
71 | padding: 10px;
72 | width: 48%;
73 | font-family: 'Nunito', sans-serif;
74 | font-size: 22px;
75 | letter-spacing: 1.1px;
76 | font-weight: bolder;
77 | border: none;
78 | border-radius: 10px;
79 | box-shadow: 12px 12px 24px rgba(251, 244, 252, 0.64);
80 | transition: all 0.3s ease-in-out 0s;
81 | cursor: pointer;
82 | outline: none;
83 | }
84 | #refresh-btn{
85 | background: linear-gradient( #4dc8f5, #c9ecfd, #e6e8e3);
86 | }
87 | #check-btn{
88 | background: linear-gradient( #6bc9eb, #dcf4ee, #e6e8e3);
89 | }
90 | #refresh-btn:hover{
91 | color: #055f66;
92 | transform: translateY(-9px);
93 | box-shadow: 0px 1px 12px #dd3ffd;
94 | background: linear-gradient( #e664f7, #e6e8e3);
95 | font-size: 24px;
96 | letter-spacing: 1.2px;
97 | }
98 | #check-btn:hover{
99 | color: #5b0872;
100 | transform: translateY(-9px);
101 | box-shadow: 0px 1px 12px #66f58c;
102 | background: linear-gradient( #4cf6d9, #e6e8e3);
103 | font-size: 24px;
104 | letter-spacing: 1.2px;
105 | }
--------------------------------------------------------------------------------
/script.js:
--------------------------------------------------------------------------------
1 | let words = [
2 | {
3 | word: "comfort",
4 | hint: "A pleasant feeling of relaxation"
5 | },
6 | {
7 | word: "tongue",
8 | hint: "The muscular organ of mouth"
9 | },
10 | {
11 | word: "expansion",
12 | hint: "The process of increase or grow"
13 | },
14 | {
15 | word: "country",
16 | hint: "A politically identified region"
17 | },
18 | {
19 | word: "statement",
20 | hint: "A declaration of something"
21 | },
22 | {
23 | word: "second",
24 | hint: "One-sixtieth of a minute"
25 | },
26 | {
27 | word: "library",
28 | hint: "Place containing collection of books"
29 | },
30 | {
31 | word: "group",
32 | hint: "A number of objects or persons"
33 | },
34 | {
35 | word: "taste",
36 | hint: "Ability of tongue to detect flavour"
37 | },
38 | {
39 | word: "store",
40 | hint: "Large shop where goods are traded"
41 | },
42 | {
43 | word: "field",
44 | hint: "Area of land for farming activities"
45 | },
46 | {
47 | word: "friend",
48 | hint: "Person other than a family member"
49 | },
50 | {
51 | word: "pocket",
52 | hint: "A bag for carrying small items"
53 | },
54 | {
55 | word: "addition",
56 | hint: "The process of adding numbers"
57 | },
58 | {
59 | word: "meeting",
60 | hint: "Event in which people come together"
61 | },
62 | {
63 | word: "number",
64 | hint: "Math symbol used for counting"
65 | },
66 | {
67 | word: "exchange",
68 | hint: "The act of trading"
69 | },
70 | {
71 | word: "canvas",
72 | hint: "Piece of fabric for oil painting"
73 | },
74 | {
75 | word: "garden",
76 | hint: "Space for planting flower and plant"
77 | },
78 | {
79 | word: "position",
80 | hint: "Location of someone or something"
81 | },
82 | {
83 | word: "feather",
84 | hint: "Hair like outer covering of bird"
85 | },
86 |
87 | {
88 | word: "needle",
89 | hint: "A thin and sharp metal pin"
90 | },
91 | {
92 | word: "expert",
93 | hint: "Person with extensive knowledge"
94 | },
95 | {
96 | word: "book",
97 | hint: "People read for knowledge"
98 | },
99 | ];
100 | let display_text = document.getElementById("display-text");
101 | let word_hint = document.getElementById("word-hint");
102 | let refresh_btn = document.getElementById("refresh-btn");
103 | let check_btn = document.getElementById("check-btn");
104 | let user_input = document.getElementById("user-input");
105 | let time = document.getElementById("timer");
106 | let correct_word;
107 | let timer;
108 |
109 | function timer_func(maxTime){
110 | clearInterval(timer);
111 | timer = setInterval(function(){
112 | if(maxTime > 0)
113 | {
114 | maxTime--;
115 | return time.innerText = maxTime;
116 | }
117 | clearInterval(timer);
118 | swal("Sorry!", "Your Time is Off !", "error");
119 | user_input.value = "";
120 | game();
121 | },1000)
122 | }
123 |
124 | function game() {
125 | timer_func(30);
126 | let word_obj = words[Math.floor(Math.random() * words.length)];
127 | let word_array = word_obj.word.split("");
128 | let i, j;
129 | for (i = word_array.length - 1; i > 0; i--) {
130 |
131 | j = Math.floor(Math.random() * (i + 1));
132 | [word_array[i], word_array[j]] = [word_array[j], word_array[i]];//
133 |
134 | }
135 | display_text.innerText = word_array.join("");
136 | word_hint.innerText = word_obj.hint;
137 | user_input.setAttribute("maxlength", word_array.length);
138 | correct_word = word_obj.word;
139 | }
140 | game();
141 |
142 | const check_word = () =>{
143 | let user_word = user_input.value.toLowerCase();
144 | if(user_word != ""){
145 | if(user_word == correct_word){
146 | swal("Congrats!", "You Entered a Correct Word !", "success");
147 | game();
148 | user_input.value = "";
149 | user_input.reset();
150 | }else{
151 | swal("Try Again!", "You Entered a Wrong Word !", "error");
152 | }
153 | }else{
154 | swal("Input Field Empty!", "Please Fill The Input Field !", "warning");
155 | }
156 | }
157 | //REFRESH BUTTON
158 | refresh_btn.addEventListener('click', () => {
159 | game();
160 | });
161 | check_btn.addEventListener('click', () => {
162 | check_word();
163 | });
--------------------------------------------------------------------------------
/.replit:
--------------------------------------------------------------------------------
1 | hidden=[".config"]
2 |
3 | # hosting is currently hardcoded for this language
4 | # [hosting]
5 | # route = "/"
6 | # directory= "/"
7 |
8 | [nix]
9 | channel = "stable-21_11"
10 |
11 | [languages.html]
12 | pattern = "**/*.html"
13 | [languages.html.languageServer]
14 | start = "vscode-html-language-server --stdio"
15 | [languages.html.languageServer.initializationOptions]
16 | provideFormatter = true
17 | [languages.html.languageServer.configuration.html]
18 | customData = [ ]
19 | autoCreateQuotes = true
20 | autoClosingTags = true
21 | mirrorCursorOnMatchingTag = false
22 |
23 | [languages.html.languageServer.configuration.html.completion]
24 | attributeDefaultValue = "doublequotes"
25 |
26 | [languages.html.languageServer.configuration.html.format]
27 | enable = true
28 | wrapLineLength = 120
29 | unformatted = "wbr"
30 | contentUnformatted = "pre,code,textarea"
31 | indentInnerHtml = false
32 | preserveNewLines = true
33 | indentHandlebars = false
34 | endWithNewline = false
35 | extraLiners = "head, body, /html"
36 | wrapAttributes = "auto"
37 | templating = false
38 | unformattedContentDelimiter = ""
39 |
40 | [languages.html.languageServer.configuration.html.suggest]
41 | html5 = true
42 |
43 | [languages.html.languageServer.configuration.html.validate]
44 | scripts = true
45 | styles = true
46 |
47 | [languages.html.languageServer.configuration.html.hover]
48 | documentation = true
49 | references = true
50 |
51 | [languages.html.languageServer.configuration.html.trace]
52 | server = "off"
53 |
54 | [languages.javascript]
55 | pattern = "**/{*.js,*.jsx,*.ts,*.tsx,*.mjs,*.cjs}"
56 | [languages.javascript.languageServer]
57 | start = "typescript-language-server --stdio"
58 |
59 | [languages.css]
60 | pattern = "**/{*.less,*.scss,*.css}"
61 | [languages.css.languageServer]
62 | start = "vscode-css-language-server --stdio"
63 | [languages.css.languageServer.configuration.css]
64 | customData = [ ]
65 | validate = true
66 |
67 | [languages.css.languageServer.configuration.css.completion]
68 | triggerPropertyValueCompletion = true
69 | completePropertyWithSemicolon = true
70 |
71 | [languages.css.languageServer.configuration.css.hover]
72 | documentation = true
73 | references = true
74 |
75 | [languages.css.languageServer.configuration.css.lint]
76 | # Configure linting
77 | # ignore = don't show any warning or error
78 | # warning = show yellow underline
79 | # error = show red underline
80 | argumentsInColorFunction = "error" # Invalid number of parameters
81 | boxModel = "ignore" # Do not use width or height when using padding or border
82 | compatibleVendorPrefixes = "ignore" # When using a vendor-specific prefix make sure to also include all other vendor-specific properties"
83 | duplicateProperties = "warning" # Do not use duplicate style definitions
84 | emptyRules = "warning" # Do not use empty rulesets
85 | float = "ignore" # Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.
86 | fontFaceProperties = "warning" # @font-face rule must define 'src' and 'font-family' properties
87 | hexColorLength = "error" # Hex colors must consist of three, four, six or eight hex numbers
88 | idSelector = "ignore" # Selectors should not contain IDs because these rules are too tightly coupled with the HTML.
89 | ieHack = "ignore" # IE hacks are only necessary when supporting IE7 and older
90 | important = "ignore" # Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.
91 | importStatement = "ignore" # Import statements do not load in parallel
92 | propertyIgnoredDueToDisplay = "warning" # Property is ignored due to the display
93 | universalSelector = "ignore" # The universal selector (*) is known to be slow
94 | unknownAtRules = "warning" # Unknown at-rule
95 | unknownProperties = "warning" # Unknown property.
96 | validProperties = [ ] # add some properties that the linter doesn't know about
97 | unknownVendorSpecificProperties = "ignore" # Unknown vendor specific property.
98 | vendorPrefix = "warning" # When using a vendor-specific prefix also include the standard property
99 | zeroUnits = "ignore" # No unit for zero needed
100 |
101 | [languages.css.languageServer.configuration.css.trace]
102 | server = "off"
103 |
104 | [languages.css.languageServer.configuration.scss]
105 | validate = true
106 |
107 | [languages.css.languageServer.configuration.scss.completion]
108 | triggerPropertyValueCompletion = true
109 | completePropertyWithSemicolon = true
110 |
111 | [languages.css.languageServer.configuration.scss.hover]
112 | documentation = true
113 | references = true
114 |
115 | [languages.css.languageServer.configuration.scss.lint]
116 | # Configure linting
117 | # ignore = don't show any warning or error
118 | # warning = show yellow underline
119 | # error = show red underline
120 | argumentsInColorFunction = "error" # Invalid number of parameters
121 | boxModel = "ignore" # Do not use width or height when using padding or border
122 | compatibleVendorPrefixes = "ignore" # When using a vendor-specific prefix make sure to also include all other vendor-specific properties"
123 | duplicateProperties = "warning" # Do not use duplicate style definitions
124 | emptyRules = "warning" # Do not use empty rulesets
125 | float = "ignore" # Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.
126 | fontFaceProperties = "warning" # @font-face rule must define 'src' and 'font-family' properties
127 | hexColorLength = "error" # Hex colors must consist of three, four, six or eight hex numbers
128 | idSelector = "ignore" # Selectors should not contain IDs because these rules are too tightly coupled with the HTML.
129 | ieHack = "ignore" # IE hacks are only necessary when supporting IE7 and older
130 | important = "ignore" # Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.
131 | importStatement = "ignore" # Import statements do not load in parallel
132 | propertyIgnoredDueToDisplay = "warning" # Property is ignored due to the display
133 | universalSelector = "ignore" # The universal selector (*) is known to be slow
134 | unknownAtRules = "warning" # Unknown at-rule
135 | unknownProperties = "warning" # Unknown property.
136 | validProperties = [ ] # add some properties that the linter doesn't know about
137 | unknownVendorSpecificProperties = "ignore" # Unknown vendor specific property.
138 | vendorPrefix = "warning" # When using a vendor-specific prefix also include the standard property
139 | zeroUnits = "ignore" # No unit for zero needed"
140 |
141 | [languages.css.languageServer.configuration.less]
142 | validate = true
143 |
144 | [languages.css.languageServer.configuration.less.completion]
145 | triggerPropertyValueCompletion = true
146 | completePropertyWithSemicolon = true
147 |
148 | [languages.css.languageServer.configuration.less.hover]
149 | documentation = true
150 | references = true
151 |
152 | [languages.css.languageServer.configuration.less.lint]
153 | # Configure linting
154 | # ignore = don't show any warning or error
155 | # warning = show yellow underline
156 | # error = show red underline
157 | argumentsInColorFunction = "error" # Invalid number of parameters
158 | boxModel = "ignore" # Do not use width or height when using padding or border
159 | compatibleVendorPrefixes = "ignore" # When using a vendor-specific prefix make sure to also include all other vendor-specific properties"
160 | duplicateProperties = "warning" # Do not use duplicate style definitions
161 | emptyRules = "warning" # Do not use empty rulesets
162 | float = "ignore" # Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes.
163 | fontFaceProperties = "warning" # @font-face rule must define 'src' and 'font-family' properties
164 | hexColorLength = "error" # Hex colors must consist of three, four, six or eight hex numbers
165 | idSelector = "ignore" # Selectors should not contain IDs because these rules are too tightly coupled with the HTML.
166 | ieHack = "ignore" # IE hacks are only necessary when supporting IE7 and older
167 | important = "ignore" # Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored.
168 | importStatement = "ignore" # Import statements do not load in parallel
169 | propertyIgnoredDueToDisplay = "warning" # Property is ignored due to the display
170 | universalSelector = "ignore" # The universal selector (*) is known to be slow
171 | unknownAtRules = "warning" # Unknown at-rule
172 | unknownProperties = "warning" # Unknown property.
173 | validProperties = [ ] # add some properties that the linter doesn't know about
174 | unknownVendorSpecificProperties = "ignore" # Unknown vendor specific property.
175 | vendorPrefix = "warning" # When using a vendor-specific prefix also include the standard property
176 | zeroUnits = "ignore" # No unit for zero needed"
177 |
178 | [gitHubImport]
179 | requiredFiles = [".replit", "replit.nix", ".config"]
--------------------------------------------------------------------------------