diff --git a/index.html b/index.html index 4f78f6d..af78935 100644 --- a/index.html +++ b/index.html @@ -6,16 +6,24 @@ Document + + + + +
Call Codes Checker
- +
- +
+

Note

+

Get the country or state from the dialing code

+
diff --git a/script.js b/script.js index 8e870cf..77603b8 100644 --- a/script.js +++ b/script.js @@ -16,7 +16,7 @@ function submitOnEnter(e) { } function getQuery(e) { query = e.target.value; - input.value = ""; + // input.value = ""; return query; } @@ -31,8 +31,8 @@ function res2Html(result) { result = result[0]; return `
- country flag

${result.name}

+
`; } @@ -47,4 +47,16 @@ async function response(e) { input.addEventListener("enter", response); input.addEventListener("keydown", submitOnEnter); -submitButton.addEventListener("click",response); \ No newline at end of file +submitButton.addEventListener("click",response); + +function tests(){ + const randomCountry = () => { + countries = ["+255","+241","+239","+237"]; + i = Math.floor(Math.random() * countries.length); + return countries[i]; + } + const fake = { + target: {value: randomCountry()} + } + response(fake); +} \ No newline at end of file diff --git a/style.css b/style.css index 561b11d..9c267ca 100644 --- a/style.css +++ b/style.css @@ -1,55 +1,86 @@ -*, -*::before, -*::after{ - margin:0; - padding:0; +* { + margin: 0; + padding: 0; box-sizing: border-box; position: relative; - font-family:Verdana, Geneva, Tahoma, sans-serif + font-family: Roboto, Verdana, Geneva, Tahoma, sans-serif; } -*::before, -*::after{ - content:''; - position: absolute; -} -:root{ +:root { --black: #111; --red: #f2023f; - --belly: #e4c5a8; - --beak: #fab92b; - --info: #a8afaf; + --green: #66a583; + --unset: #fafafa; + --info: #d9f3e4; + --header: #5c6263; --dev-outline: solid lime 2px; } -body{ +body { width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: space-evenly; - background-color: rgb(255, 255, 255); + background-color: #ffffff; flex-flow: column nowrap; + background: var(--unset); } -/* .input{ +/* body > * { + border: var(--dev-outline); } */ -.input_box{ - width: 50vmin; +.header { + position: absolute; + top: 0; + padding: 0.8rem; + width: 100%; + text-align: center; + color: white; + background: var(--header); +} +.input { + width: 85vmin; + display: flex; +} +.input_box { + width: 70%; height: 2.8rem; font-size: 1.2rem; } -.input_submit{ +.input_submit { + width: 30%; padding: 0.7rem 1.6rem; border-radius: 0.3rem; border: none; font-size: 1.14rem; } -.country_flag{ - width: 40vmin; +.country { + display: flex; + /* justify-content: center; + align-items: center; */ + gap: .8rem; + flex-direction: column; +} +.display{ + width: 85vmin; +} +.country_flag { height: 25vmin; - border-radius: 0.4rem; + overflow: hidden; +} +.country_flag_img { + object-fit: contain; + width: auto; + height: 100%; + border-radius: 0.3rem; } -.country_name{ +.country_name { font-size: 1.3rem; } -.info{ +.info { background: var(--info); -} \ No newline at end of file + width: 85vmin; + border-radius: 0.5rem; + padding: 1rem; +} +.info-icon { + color: var(--green); +}