diff --git a/FrontendMentor/ping-coming-soon-page-master/.gitignore b/FrontendMentor/ping-coming-soon-page-master/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/.jshintrc b/FrontendMentor/ping-coming-soon-page-master/.jshintrc new file mode 100644 index 0000000..6d41a78 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/.jshintrc @@ -0,0 +1,5 @@ +{ + "esversion": 6, + "browser": true, + "strict": "global" +} \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/README.md b/FrontendMentor/ping-coming-soon-page-master/README.md new file mode 100644 index 0000000..a20346a --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/README.md @@ -0,0 +1,84 @@ +# Frontend Mentor - Ping coming soon page + +![Design preview for the Ping coming soon page coding challenge](./design/desktop-preview.jpg) + +## Welcome! 👋 + +Thanks for checking out this front-end coding challenge. + +[Frontend Mentor](https://www.frontendmentor.io) challenges allow you to improve your skills in a real-life workflow. + +**To do this challenge, you need a basic understanding of HTML, CSS and JavaScript.** + +## The challenge + +Your challenge is to build out this Coming Soon page and get it looking as close to the design as possible. + +You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go. + +Your users should be able to: + +- View the optimal layout for the site depending on their device's screen size ✅ +- See hover states for all interactive elements on the page ✅ +- Submit their email address using an `input` field ✅ +- Receive an error message when the `form` is submitted if: ✅ + - The `input` field is empty. The message for this error should say *"Whoops! It looks like you forgot to add your email"* ✅ + - The email address is not formatted correctly (i.e. a correct email address should have this structure: `name@host.tld`). The message for this error should say *"Please provide a valid email address"* ✅ + +Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel. + +## Where to find everything + +Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design to work to. + +The designs are in JPG static format. This will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`. This should help train your eye to perceive differences in spacings and sizes. + +If you would like the Sketch file in order to see sizes etc, it is available to download from the challenge page. + +You will find all the required assets in the `/images` folder. The assets are already optimized. + +There is also a `style-guide.md` file, which contains the information you'll need, such as color palette and fonts. + +## Building your project + +Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps: + +1. Initialize your project as a public repository on [GitHub](https://github.com/). This will make it easier to share your code with the community if you need some help. If you're not sure how to do this, [have a read through of this Try Git resource](https://try.github.io/). +2. Configure your repository to publish your code to a URL. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, but we recommend using [Vercel](https://bit.ly/fem-vercel). We've got more information about deploying your project with Vercel below. +3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes that you could create to make reusable styles. +4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content. +5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`. +6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on. +7. If you'd like to try making your project fully responsive, we'd recommend checking out [Sizzy](https://bit.ly/fm-sizzy). It's a great browser that makes it easy to view your site across multiple devices. + +## Deploying your project + +As mentioned above, there are a number of ways to host your project for free. We recommend using [Vercel](https://bit.ly/fem-vercel) as it's an amazing service and extremely simple to get set up with. If you'd like to use Vercel, here are some steps to follow to get started: + +1. [Sign up to Vercel](https://bit.ly/fem-vercel-signup) and go through the onboarding flow, ensuring your GitHub account is connected by using their [Vercel for GitHub](https://vercel.com/docs/v2/git-integrations/vercel-for-github) integration. +2. Connect your project to Vercel from the ["Import project" page](https://vercel.com/import), using the "From Git Repository" button and selecting the project you want to deploy. +3. Once connected, every time you `git push`, Vercel will create a new [deployment](https://vercel.com/docs/v2/platform/deployments) and the deployment URL will be shown on your [Dashboard](https://vercel.com/dashboard). You will also receive an email for each deployment with the URL. + +## Sharing your solution + +There are multiple places you can share your solution: + +1. Submit it on the platform so that other users will see your solution on the site. Here's our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) to help you do that. +2. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack). +3. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor** including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around. + +## Giving feedback + +Feedback is always welcome, so if you have any to give on this challenge please email hi[at]frontendmentor[dot]io. + +This challenge is completely free. Please share it with anyone who will find it useful for practice. + +**Have fun building!** 🚀 + +## Community Sponsors + +A massive thank you to our community sponsors! + +- [Sizzy](https://bit.ly/fm-sizzy) is an extremely useful browser designed specifically to improve a developer's workflow when building websites. You can fire up multiple device emulators and run them all in sync while building out your web pages. Perfect for helping build fully responsive websites! +- [Diversify Tech](https://bit.ly/fem-diversify-tech) is an amazing resource for underrepresented people in tech. The site features job listings for anyone seeking new opportunities. The resource section is also full of useful links to dive into! +- [Dracula PRO](https://bit.ly/fem-dracula) is a beautiful dark theme to help keep you focused and productive while you code. The theme isn't just for your editor either. You can also apply it to your most-used apps like your terminal and even Slack! diff --git a/FrontendMentor/ping-coming-soon-page-master/css/style.css b/FrontendMentor/ping-coming-soon-page-master/css/style.css new file mode 100644 index 0000000..9049219 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/css/style.css @@ -0,0 +1,321 @@ +@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;600;700&display=swap'); + +:root { + /* primary */ + font-size: 20px; + --site-blue: hsl(223, 87%, 63%); + /* secondary */ + --site-paleBlue: hsl(223, 100%, 88%); + --site-lightRed: hsl(354, 100%, 66%); + /* neutral */ + --site-gray: hsl(0, 0%, 59%); + --site-veryDarkBlue: hsl(209, 33%, 12%); +} + +* { + margin: 0 auto; + padding: 0; +} + +body { + font-family: 'Libre Franklin', sans-serif; + min-width: 375px; +} + +.flexContainer { + display: flex; + flex-direction: column; + align-items: center; + align-content: center; + + height:100vh; +} + +.logoSection { + margin-top: 4.2rem; + + display: flex; + justify-content: center; +} + +.logoSection img { + width: 66%; +} + +.titleSection { + margin-top: 1.95rem; +} + +.titleSection p { + text-align: center; +} + +.titleSection .line1 { + font-size: 1.1rem; + font-weight: 300; + color: var(--site-gray); +} + +.line1 b { + color: black; + font-weight: 600; +} + +.titleSection .line2 { + margin-top: 0.9rem; + font-size: 12px; + color: var(--site-gray); +} + +.formSection { + margin: 1.6rem 0 0 0; + text-align: center; +} + +.formSection form { + display: flex; + flex-direction: column; + width: 83%; +} + +.formSection input[type=text] { + font-family: 'Libre Franklin', sans-serif; + width: calc(100% - 47px); /* shrink width by padding left+right + border */ + + color: black; + font-size: 12px; + font-weight: 300; + border: 1px solid var(--site-paleBlue); + padding-top: 0.55rem; + padding-bottom: 0.55rem; + padding-left: 25px; + padding-right: 20px; + text-align: justify; + text-decoration: none; + border-radius: 32px; +} + +input[type="text"].errorBorder { + border-color: var(--site-lightRed); +} + +.formSection input::placeholder{ + padding-left: 8px; + color: var(--site-paleBlue);; +} + +.formSection button { + font-family: 'Libre Franklin', sans-serif; + width: 100%; + background-color: var(--site-blue); + color: white; + font-size: 12px; + font-weight: 300; + border: none; + padding: 0.625rem 0; + text-align: center; + text-decoration: none; + cursor: pointer; + border-radius: 32px; + box-shadow: 0px 3px 10px 1px var(--site-paleBlue); +} + +.notifyButton.notifyError { + transform: translate(0, 1.6rem); +} + +.errorSection { + height: 0; + padding: 0; + transform: translate(0, 0.35rem); +} + +.errorMessage { + font-style: italic; + font-size: 10px; + opacity: 0; + color: var(--site-lightRed); +} + +.errorMessage.visible { + opacity: 1; +} + +.imageSection { + margin-top: 3.4rem; + text-align: center; + width: 95%; +} + +.imageSection img { + width: 100%; +} + +footer { + margin-top: auto; + text-align: center; + /* width: 100vw; */ +} +.socialButtonsSection { + margin-bottom: 1.25rem; + font-size: 14px; + display: flex; + justify-content: space-between; + width: 45%; +} + +.socialButtonsSection a { + color: var(--site-blue); + width: 100%; + height: 100%; +} + +.socialButtonsSection .icon-background { + color: var(--site-blue); + padding:8px; + border-radius: 50%; + + width: 15px; + height: 15px; + text-align: center; + line-height: 15px; + vertical-align: middle; + + border: 1px solid rgba(0, 0, 0, 0.1); +} + +.icon-background:hover { + color: white; + background-color: var(--site-blue); +} + +.copyright { + color: var(--site-gray); + font-size: 10px; + text-align: center; + margin-bottom: 1.15rem; +} + +/* Feel free to remove these styles or customise in your own stylesheet 👍 */ +.attribution { font-size: 11px; text-align: center; } +.attribution a i { color: hsl(228, 45%, 44%); } + +@media screen and (max-width: 600px) { + .flexContainer { + width: 90vw; + } + + .formSection button { + margin-top: 0.55rem; + } +} + +@media screen and (min-width: 600px) and (max-width: 1050px) { + .flexContainer { + width: 75vw; + } + + .formSection button { + margin-top: 0.55rem; + } +} + + +@media screen and (min-width: 1050px) { + .flexContainer { + width: 50vw; + } + + .logoSection { + margin-top: 4.3rem; + } + + .logoSection img { + width: 100%; + } + + .titleSection { + margin-top: 2.5rem; + } + + .titleSection .line1 { + font-weight: 300; + letter-spacing: 1.3px; + font-size: 45px; + } + + .line1 b { + font-weight: 700; + } + + .titleSection .line2 { + margin-top: 0.95rem; + font-size: 20px; + font-weight: 600; + } + + + .formSection { + margin: 2rem 0 0 0; + } + + .formSection form { + flex-direction: row; + width: 88%; + } + + .formSection input[type=text] { + flex-basis: 66%; + + font-size: 17px; + font-weight: 300; + padding-top: 0.85rem; + padding-bottom: 0.85rem; + order: 2; + } + + .formSection button { + margin-left: 1rem; + flex-basis: 34%; + + font-size: 17px; + font-weight: 300; + + padding: 0.85rem 0; + box-shadow: 0px 3px 10px 1px var(--site-paleBlue); + order: 3; + } + + .notifyButton.notifyError { + transform: none; + } + + .errorSection { + order: 1; + height: 0; + width: 0; + padding: 0; + margin: 0; + transform: translate(0, 3.2rem); + } + + .errorMessage { + font-size: 13px; + width: 16rem; + height: 2rem; + overflow: auto; + text-align: left; + padding-left: 1.25rem; + } + + + .imageSection { + margin-top: 4.3rem; + width: 89%; + } + + .copyright { + font-size: 12px; + margin-bottom: 1.75rem; + } +} \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/design/desktop-design.jpg b/FrontendMentor/ping-coming-soon-page-master/design/desktop-design.jpg new file mode 100644 index 0000000..d4d79d2 Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/desktop-design.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/design/desktop-hover-error-states.jpg b/FrontendMentor/ping-coming-soon-page-master/design/desktop-hover-error-states.jpg new file mode 100644 index 0000000..44f18b4 Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/desktop-hover-error-states.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/design/desktop-preview.jpg b/FrontendMentor/ping-coming-soon-page-master/design/desktop-preview.jpg new file mode 100644 index 0000000..a44be2a Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/desktop-preview.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/design/mobile-design-375x812.jpg b/FrontendMentor/ping-coming-soon-page-master/design/mobile-design-375x812.jpg new file mode 100644 index 0000000..ade809b Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/mobile-design-375x812.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/design/mobile-design.jpg b/FrontendMentor/ping-coming-soon-page-master/design/mobile-design.jpg new file mode 100644 index 0000000..ade809b Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/mobile-design.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/design/mobile-error-state.jpg b/FrontendMentor/ping-coming-soon-page-master/design/mobile-error-state.jpg new file mode 100644 index 0000000..b075941 Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/design/mobile-error-state.jpg differ diff --git a/FrontendMentor/ping-coming-soon-page-master/images/favicon-32x32.png b/FrontendMentor/ping-coming-soon-page-master/images/favicon-32x32.png new file mode 100644 index 0000000..1e2df7f Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/images/favicon-32x32.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/images/illustration-dashboard.png b/FrontendMentor/ping-coming-soon-page-master/images/illustration-dashboard.png new file mode 100644 index 0000000..8bea4fb Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/images/illustration-dashboard.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/images/logo.svg b/FrontendMentor/ping-coming-soon-page-master/images/logo.svg new file mode 100644 index 0000000..d3455a8 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/images/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/index.html b/FrontendMentor/ping-coming-soon-page-master/index.html new file mode 100644 index 0000000..fb51989 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/index.html @@ -0,0 +1,57 @@ + + + + + + + + + + + Frontend Mentor | Ping coming soon page + + + +
+
+
+ +
+
+
+
+

We are launching soon!

+

Subscribe and get notified

+
+
+
+ + +
+

Placeholder Text

+
+ +
+
+
+ Illustration of the dashboard +
+
+ +
+ + + \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/js/script.js b/FrontendMentor/ping-coming-soon-page-master/js/script.js new file mode 100644 index 0000000..61bdd37 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/js/script.js @@ -0,0 +1,105 @@ +"use strict"; + +const console = window.console; +const emailInput = document.getElementById("emailInput"); +const errorMessage = document.getElementById("errorMessage"); +const errorSection = document.getElementById("errorSection"); +const notifyButton = document.getElementById("notifyButton"); + +const errorMessageForgotAddress = "Whoops! It looks like you forgot to add your email"; +const errorMessageInvalidAddress = "Please provide a valid email address"; + +/* +* this is my "simple" regex for email addresses. It does not cover all the possibilities that are allowed +* for the local and domain parts. For a more "correct" / comprehensive regex, there is one at +* https://stackoverflow.com/questions/3844431/are-email-addresses-allowed-to-contain-non-alphanumeric-characters +* +* For local part you can use ASCII: +* Latin letters A - Z a - z +* digits 0 - 9 +* special characters !#$%&'*+-/=?^_`{|}~ +* dot ., that it is not first or last, and not in sequence +* space and "(),:;<>@[] characters are allowed with restrictions (they are only allowed inside a quoted string, a backslash or double-quote must be preceded by a backslash) +* Plus since 2012 you can use international characters above U+007F, encoded as UTF-8. +* +* Domain part is more restricted: +* Latin letters A - Z a - z +* digits 0 - 9 +* hyphen -, that is not first or last, multiple hyphens in sequence are allowed. +* +* Recommended regex is: ^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,}) +*/ +const validEmailFormat = /^[A-Za-z0-9][\w\+]*@[A-Za-z0-9]{3,}\.[A-Za-z]{2,}$/i; + + +/* +* Don't quite see the point in this, setting "type=email" does some validation +* Setting the input to "required" prevents submitting an empty field +* +* Only benefit I see is the being able to set an error message +* Maybe one form of solution is doing exactly that. Use onclick event on the button +* if the field is empty, unhide the error field +*/ +function validateEmailAddress() { + const submittedEmailAddress = document.forms.emailForm.emailInput.value; + // test email is valid via regex + const isValidEmailAddress = validEmailFormat.test(submittedEmailAddress); + + if (submittedEmailAddress.length === 0) { + showError(errorMessageForgotAddress); + return false; + } else if (!isValidEmailAddress) { + showError(errorMessageInvalidAddress); + return false; + } else { + return true; + } +} + +function showError(message) { + errorMessage.innerText = message; + errorMessage.classList.add("visible"); + emailInput.classList.add("errorBorder"); + notifyButton.classList.add("notifyError"); + // errorSection.hidden = false; +} + +/* +* (Possibly) To be called as user types in the email field. If an error message has been shown, +* then hide the message and return the fields to normal +*/ +function clearError() { + errorMessage.classList.remove("visible"); + emailInput.classList.remove("errorBorder"); + notifyButton.classList.remove("notifyError"); + // errorSection.hidden = true; +} + +function testRegex() { + console.log("Should all be false"); + console.log(validEmailFormat.test("submittedEmailAddress")); + console.log(validEmailFormat.test("s@.NET")); + console.log(validEmailFormat.test("@")); + console.log(validEmailFormat.test("@.")); + console.log(validEmailFormat.test("@.net")); + console.log(validEmailFormat.test("@tarasis.net")); + console.log(validEmailFormat.test("adsadasds@")); + console.log(validEmailFormat.test("__submittedEmailAddress")); + console.log(validEmailFormat.test("spam@tarasis.99")); + console.log(validEmailFormat.test("rob@.net")); + console.log(validEmailFormat.test("spam@tarasis")); + console.log(validEmailFormat.test("spam@tarasis.a")); + console.log(validEmailFormat.test("s@ta.net")); + console.log(validEmailFormat.test("_@tarasis.net")); + console.log(validEmailFormat.test("_3@tarasis.net")); + + console.log("\n Should all be true"); + console.log(validEmailFormat.test("spam@tarasis.net")); + console.log(validEmailFormat.test("rob@tad.io")); + console.log(validEmailFormat.test("s@tarasis.net")); + console.log(validEmailFormat.test("s@tarasis.net")); + console.log(validEmailFormat.test("s_@tarasis.net")); + console.log(validEmailFormat.test("s+blah@tarasis.net")); // this can be true, some servers use this for filtering +} + +// testRegex(); \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/style-guide.md b/FrontendMentor/ping-coming-soon-page-master/style-guide.md new file mode 100644 index 0000000..36bf5c5 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/style-guide.md @@ -0,0 +1,43 @@ +# Front-end Style Guide + +## Layout + +The designs were created to the following widths: + +- Mobile: 375px x 812px (design file is 750x1624) +- Desktop: 1440px x 1024px + +## Colors + +### Primary + +- Blue: hsl(223, 87%, 63%) + +### Secondary + +- Pale Blue: hsl(223, 100%, 88%) +- Light Red: hsl(354, 100%, 66%) + +### Neutral + +- Gray: hsl(0, 0%, 59%) +- Very Dark Blue: hsl(209, 33%, 12%) + +## Typography + +### Body Copy + +- Font size: 20px + +### Fonts + +- Family: [Libre Franklin](https://fonts.google.com/specimen/Libre+Franklin) +- Weights: 300, 600, 700 + +## Icons + +For the social icons, you can use a font icon library. Some suggestions can be found below: + +- [Font Awesome](https://fontawesome.com) +- [IcoMoon](https://icomoon.io) +- [Ionicons](https://ionicons.com) \ No newline at end of file diff --git a/FrontendMentor/ping-coming-soon-page-master/work-through/awful-transition.png b/FrontendMentor/ping-coming-soon-page-master/work-through/awful-transition.png new file mode 100644 index 0000000..888799a Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/work-through/awful-transition.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/work-through/desktop-diff.png b/FrontendMentor/ping-coming-soon-page-master/work-through/desktop-diff.png new file mode 100644 index 0000000..e35b121 Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/work-through/desktop-diff.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-diff.png b/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-diff.png new file mode 100644 index 0000000..352f57a Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-diff.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-error-diff.png b/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-error-diff.png new file mode 100644 index 0000000..f5e52c8 Binary files /dev/null and b/FrontendMentor/ping-coming-soon-page-master/work-through/mobile-error-diff.png differ diff --git a/FrontendMentor/ping-coming-soon-page-master/work-through/myProcess.md b/FrontendMentor/ping-coming-soon-page-master/work-through/myProcess.md new file mode 100644 index 0000000..d37d9f6 --- /dev/null +++ b/FrontendMentor/ping-coming-soon-page-master/work-through/myProcess.md @@ -0,0 +1,105 @@ +6th Sept 2020 + +Next project, decided to go for something slightly different with a little JavaScript required. +Added basic files for css and javascript, including a .jshintrc file + +``` +{ + "esversion": 6, + "browser": true, + "strict": "global" +} +``` + +Set up basic styling into the CSS from the style doc. Add colors, font + sizes. + +Add font awesome to index.html + setup attribution + +Add basic tags to index.html for header/main/footer, then in main splitting into 3, text headings, form and dashboard illustration. + +__Q should the copyright be added to the footer or the bottom of the main????__ + +Started mostly with mobile + +spent the morning struggling to get flex to work the way I wanted. Got there but also realised that I didn't need to use it the way I did. *facepalm* + +Continue to play with positioning rather than focusing on main styling + +Nudge screenshot nudge screenshot nudge screenshot *sigh* +I'm not OCD I swear ... + +Realised better to social icons into footer and move the footer out of the flex container, and clamp it to the bottom. + +So mobile is virtually there. The Ping! logo is slightly off, as is the "We are launching soon!" +So close *sigh* + +Day break + +Spent 20 minutes playing with mobile positioning. Crazy I know, but its like __near__ spot on. + +![mobile difference](mobile-diff.png) + +Worked on the desktop matching. Went much quicker, and getting faster at eyeballing sizes/size differences +Was easier working on mobile first, and then adjusted for desktop on this one. + +![desktop difference](desktop-diff.png) + +Now to remove extra adjustments that aren't needed (because they are duplicates of further up the page.) + +Final steps: +Add JS error checking on submit button (valid email address, and error on submit on an empty field (although my preference really is disable the button if nothing is in the field)) + An error will trigger a text line to appear in red + And change the border color of the input email field to red. +Hover States for Social Buttons (flip colors) + +Attempted to use hover state to change the background of the fa-stack but it wasn't triggering. Could only change the color of the item at the top of the stack (i.e the social icon) +Learnt you can change css of other elemnts when hovering over a different one ... sorta. Has to be a child you are changing, https://stackoverflow.com/questions/19121223/css-change-an-element-content-on-hover-from-different-element + +Next Day: + +Realised I had to change a few things. Change the input field from `type="email"` to `type="text"` so that I can do the field validation. + +Added a div that starts as hidden and has no text + +Added some css styling for the text color, and added an error class for changing the input fields border + +In JavaScript created a couple of functions, the first that has to return true/false when the user presses "Notify Me" (basically onsubmit event), does some validation of address length, and address structure. + +The other method reveals the hidden div and sets the input fields border to red. + +There is a third method that I couldn't decide about using. It will clear the error message. The idea being that as soon as the user starts typing again in the field that the error is cleared. (or better yet, when the field gets focus again. I can check for that? ) + +Created a simplistic regex for email address validation, with some test cases to check my logic. I'm still learning regex, and I don't want to spend the time learning all the combinations for email addresses. + +I did research and find a more "correct" regex that I could use, but I will stick with my for this sample. + +Played with alignment so mobile & mobile error are close. + +![mobile difference](mobile-error-diff.png) + +Swapped method of doing the circles around the social icons. I would have preferred the stacks but I couldn't figure out how to put a thin border around a fa-circle + +BUGS: +* ~~when screen not tall enough social buttons and copyright pushed up the page because I clamped them to the bottom of the browser window, rather than the page.~~ +* ~~because I used attacked circles I can't just change the background to blue for hover. Need to either sub in a filled circle on hover OR swap to manually creating the circle~~ +* ~~transitions sizes between 600 and about 800 look wrong / bad / odd~~ (improved but thats it) + +The transition thing is really bad + +![transition between mobile and desktop sizes](awful-transition) + +How to better handle this?????? Should be dynamic font sizing & padding I guess? +I have a working solution the error message on the 1440x1024 resolution but it doesn't look good/work on the in between resolutions. Positioning should be calculated, based on resolution + +To Research: +* Dynamic font sizing to look nicer transitioning up. + +Found a formula to scale the fonts, tried to use it to work with the view port width scaling but it wouldn't work. + +Fixed positioning of the footer section and social buttons. Needed it back in the flexbox, and set the margin-top to auto to fill up the space + +Last thing is my hack for the error when email field and button are in a row. How to position the text relative to the input field? Can I hide it behind it and move it down? If its in the same row, then it takes up space which we don't want, hence the 0 width (zero height for when in column) + +Ergh. Want to be done with this. Frustrating myself. + +MY GAWD. Eureka, just realised that what I want to use is Flexbox ordering. By doing this, the error message is first, and all I need to do is shift it downwards, no horizontal translation needed. PERFECT. \ No newline at end of file diff --git a/index.html b/index.html index fccd9a2..e5c50e7 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,7 @@
  • Frontend Mentor
    1. Huddle Landing Page with a Single Introductory Section
    2. +
    3. Ping Coming-Soon page
  • FreecodeCamp
  • Complete Web Development 2020
  • diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..e82187e --- /dev/null +++ b/notes.md @@ -0,0 +1,49 @@ +# Notes + +## Overview +--- + +Aim of this document is to make notes of various things as I encounter them. Consider it learning from working through specific challenges or other exercises. Probably should be in a note app, or a wiki, or something, but for now they are here. + +Think of it as a combination of learning, and tips and tricks. They will start unorganised, and then should be put into some semblance of order; where that is possible. + +## The Notes Themselves (unorganised) +--- + +* Now little difference between `` and `