├── src └── assets │ ├── styles │ ├── mixins.scss │ ├── variables.scss │ └── general.scss │ ├── images │ ├── image-victor.jpg │ ├── favicon-32x32.png │ ├── bg-pattern-top.svg │ ├── bg-pattern-bottom.svg │ └── bg-pattern-card.svg │ └── design │ ├── desktop-design.jpg │ ├── mobile-design.jpg │ └── desktop-preview.jpg ├── dist ├── images │ ├── favicon-32x32.png │ ├── image-victor.jpg │ ├── bg-pattern-top.svg │ ├── bg-pattern-bottom.svg │ └── bg-pattern-card.svg ├── index.html └── main.min.css ├── style-guide.md ├── .gitignore ├── package.json ├── LICENSE ├── index.html ├── gulpfile.js └── README.md /src/assets/styles/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin transform($x: 110%, $y: -150%) { 2 | transform: translate($x, $y); 3 | } -------------------------------------------------------------------------------- /dist/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/dist/images/favicon-32x32.png -------------------------------------------------------------------------------- /dist/images/image-victor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/dist/images/image-victor.jpg -------------------------------------------------------------------------------- /src/assets/images/image-victor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/src/assets/images/image-victor.jpg -------------------------------------------------------------------------------- /src/assets/design/desktop-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/src/assets/design/desktop-design.jpg -------------------------------------------------------------------------------- /src/assets/design/mobile-design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/src/assets/design/mobile-design.jpg -------------------------------------------------------------------------------- /src/assets/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/src/assets/images/favicon-32x32.png -------------------------------------------------------------------------------- /src/assets/design/desktop-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vicckm/profile-card-component/main/src/assets/design/desktop-preview.jpg -------------------------------------------------------------------------------- /src/assets/styles/variables.scss: -------------------------------------------------------------------------------- 1 | // colors 2 | $blue-100: hsl(185, 75%, 39%); 3 | $blue-900: hsl(229, 23%, 23%); 4 | $gray-100: hsl(0, 0%, 59%); 5 | $gray-200: hsl(227, 10%, 46%); 6 | $white: #fff; 7 | $black: #000; 8 | 9 | // breakpoints 10 | $bk-ssm: 621px; 11 | $bk-sm: 767px; 12 | $bk-md: 991px; 13 | $bk-lg: 1024px; 14 | $bk-xl: 1366px; 15 | $bk-xxl: 1450px; -------------------------------------------------------------------------------- /dist/images/bg-pattern-top.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/bg-pattern-top.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/images/bg-pattern-bottom.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/bg-pattern-bottom.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /style-guide.md: -------------------------------------------------------------------------------- 1 | # Front-end Style Guide 2 | 3 | ## Layout 4 | 5 | The designs were created to the following widths: 6 | 7 | - Mobile: 375px 8 | - Desktop: 1440px 9 | 10 | ## Colors 11 | 12 | ### Primary 13 | 14 | Dark cyan: hsl(185, 75%, 39%) 15 | Very dark desaturated blue: hsl(229, 23%, 23%) 16 | Dark grayish blue: hsl(227, 10%, 46%) 17 | 18 | ### Neutral 19 | 20 | Dark gray: hsl(0, 0%, 59%) 21 | 22 | ## Typography 23 | 24 | ### Body Copy 25 | 26 | - Font size (name and stats): 18px 27 | 28 | ### Font 29 | 30 | - Family: [Kumbh Sans](https://fonts.google.com/specimen/Kumbh+Sans) 31 | - Weights: 400, 700 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Avoid accidental upload of the Sketch and Figma design files 2 | ##################################################### 3 | ## Please do not remove lines 5 and 6 - thanks! 🙂 ## 4 | ##################################################### 5 | *.sketch 6 | *.fig 7 | 8 | # Avoid accidental XD upload if you convert the design file 9 | ############################################### 10 | ## Please do not remove line 12 - thanks! 🙂 ## 11 | ############################################### 12 | *.xd 13 | 14 | # Avoid your project being littered with annoying .DS_Store files! 15 | .DS_Store 16 | 17 | .prettierignore 18 | node_modules 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "profile-card-component-main", 3 | "version": "1.0.0", 4 | "description": "![Design preview for the Profile card component coding challenge](./design/desktop-preview.jpg)", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "gulp build && gulp server" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "devDependencies": { 14 | "browser-sync": "^2.26.13", 15 | "compression": "^1.7.4", 16 | "del": "^6.0.0", 17 | "gulp": "^4.0.2", 18 | "gulp-babel": "^8.0.0", 19 | "gulp-clean-css": "^4.3.0", 20 | "gulp-concat": "^2.6.1", 21 | "gulp-htmlmin": "^5.0.1", 22 | "gulp-sass": "^4.1.0", 23 | "node-sass": "^5.0.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Victoria Marques 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | Frontend Mentor | Profile card component
Victor Crest 26

London

  • 80K

    Followers
  • 803K

    Likes
  • 1.4K

    Photos
-------------------------------------------------------------------------------- /dist/main.min.css: -------------------------------------------------------------------------------- 1 | *{box-sizing:border-box;margin:0;padding:0}.attribution{font-size:11px;text-align:center}.attribution a{color:#3e52a3}body{background-color:#19a2ae;background-image:url(images/bg-pattern-top.svg),url(images/bg-pattern-bottom.svg);background-position:right 50vw bottom 30vh,left 50vw top 40vh;background-repeat:no-repeat;font-family:"Kumbh Sans",sans-serif}.container{align-items:center;display:flex;justify-content:center;height:85vh}img{border-top-left-radius:20px;border-top-right-radius:20px}@media (max-width:621px){img{background:#19a2ae;width:300px}}.card{background:#fff;border-radius:20px;height:350px;position:relative;text-align:center;width:350px}@media (max-width:621px){.card{height:350px;width:300px}}.card-body img{background:#fff;border:5px solid #fff;border-radius:100%;bottom:0;display:flex;position:absolute;transform:translate(110%,-150%)}@media (max-width:621px){.card-body img{height:100px;width:100px;transform:translate(100%,-180%)}}.card-body span{color:#2d3248;display:inline-block;font-size:18px;font-weight:700;margin-top:60px}.card-body span:nth-child(3){color:#969696;font-weight:lighter;margin-left:5px}.card-body p{border-bottom:1px solid #969696;color:#969696;padding:10px 0 20px 0}.card-body ul{display:flex;justify-content:space-around}.card-body ul li{align-items:center;list-style-type:none}.card-body ul li p{border:none;color:#2d3248;font-size:18px;font-weight:700;margin-top:25px;padding:0}@media (max-width:621px){.card-body ul li p{margin-top:35px}}.card-body ul li small{color:#969696}.footer .attribution{position:relative;bottom:0} 2 | 3 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Frontend Mentor | Profile card component 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 | 23 |
24 |
25 | 26 | Victor Crest 27 | 26 28 |

London

29 |
    30 |
  • 31 |

    80K

    32 | Followers 33 |
  • 34 |
  • 35 |

    803K

    36 | Likes 37 |
  • 38 |
  • 39 |

    1.4K

    40 | Photos 41 |
  • 42 |
43 |
44 |
45 |
46 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const { src, dest, series, parallel, watch } = require('gulp'); 2 | const sass = require('gulp-sass') 3 | const cleanCSS = require('gulp-clean-css'); 4 | const concat = require('gulp-concat'); 5 | const del = require('del'); 6 | const htmlmin = require('gulp-htmlmin'); 7 | const browserSync = require('browser-sync').create(); 8 | const compress = require('compression'); 9 | 10 | const paths = { 11 | styles: { 12 | src: './src/assets/styles/*.scss', 13 | dest: './dist/' 14 | }, 15 | html: { 16 | src: './*.html', 17 | dest: './dist/' 18 | }, 19 | images: { 20 | src: './src/assets/images/*', 21 | dest: './dist/images' 22 | } 23 | } 24 | 25 | function styles() { 26 | return src(paths.styles.src) 27 | .pipe(sass()) 28 | .pipe(cleanCSS()) 29 | .pipe(concat('main.min.css')) 30 | .pipe(dest(paths.styles.dest)) 31 | .pipe(browserSync.stream()); 32 | } 33 | 34 | function html() { 35 | return src(paths.html.src) 36 | .pipe(htmlmin({ collapseWhitespace: true })) 37 | .pipe(dest(paths.html.dest)) 38 | .pipe(browserSync.stream()); 39 | } 40 | 41 | function img() { 42 | return src(paths.images.src) 43 | .pipe(dest(paths.images.dest)); 44 | } 45 | 46 | function clean() { 47 | return del(['dist']) 48 | } 49 | 50 | const build = series(clean, parallel(html, styles, img)); 51 | 52 | const reload = browserSync.reload; 53 | function server() { 54 | browserSync.init({ 55 | server: { 56 | baseDir: './dist/', 57 | index: 'index.html', 58 | middleware: [compress()] 59 | } 60 | }); 61 | 62 | parallel(html, styles) 63 | watch('*.html').on('change', reload); 64 | watch(paths.styles.src, styles).on('change', reload); 65 | } 66 | 67 | exports.styles = styles; 68 | exports.html = html; 69 | exports.clean = clean; 70 | exports.build = build; 71 | exports.server = server; 72 | 73 | exports.default = build; -------------------------------------------------------------------------------- /src/assets/styles/general.scss: -------------------------------------------------------------------------------- 1 | @import "./variables.scss"; 2 | @import "./mixins.scss"; 3 | 4 | * { 5 | box-sizing: border-box; 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | .attribution { 11 | font-size: 11px; 12 | text-align: center; 13 | & a { 14 | color: hsl(228, 45%, 44%); 15 | } 16 | } 17 | 18 | body { 19 | background-color: $blue-100; 20 | background-image: url("./images/bg-pattern-top.svg"), url("./images/bg-pattern-bottom.svg"); 21 | background-position: right 50vw bottom 30vh, left 50vw top 40vh; 22 | background-repeat: no-repeat; 23 | font-family: "Kumbh Sans", sans-serif; 24 | } 25 | 26 | .container { 27 | align-items: center; 28 | display: flex; 29 | justify-content: center; 30 | height: 85vh; 31 | } 32 | 33 | img { 34 | border-top-left-radius: 20px; 35 | border-top-right-radius: 20px; 36 | @media (max-width: $bk-ssm) { 37 | background: $blue-100; 38 | width: 300px; 39 | } 40 | } 41 | 42 | .card { 43 | background: $white; 44 | border-radius: 20px; 45 | height: 350px; 46 | position: relative; 47 | text-align: center; 48 | width: 350px; 49 | 50 | @media (max-width: $bk-ssm) { 51 | height: 350px; 52 | width: 300px; 53 | } 54 | } 55 | 56 | .card-body { 57 | img { 58 | background: $white; 59 | border: 5px solid $white; 60 | border-radius: 100%; 61 | bottom: 0; 62 | display: flex; 63 | position: absolute; 64 | @include transform(); 65 | 66 | @media (max-width: $bk-ssm) { 67 | height: 100px; 68 | width: 100px; 69 | @include transform(100%, -180%); 70 | } 71 | } 72 | 73 | span { 74 | color: $blue-900; 75 | display: inline-block; 76 | font-size: 18px; 77 | font-weight: bold; 78 | margin-top: 60px; 79 | &:nth-child(3) { 80 | color: $gray-100; 81 | font-weight: lighter; 82 | margin-left: 5px; 83 | } 84 | } 85 | 86 | p { 87 | border-bottom: 1px solid $gray-100; 88 | color: $gray-100; 89 | padding: 10px 0 20px 0; 90 | } 91 | 92 | ul { 93 | display: flex; 94 | justify-content: space-around; 95 | 96 | li { 97 | align-items: center; 98 | list-style-type: none; 99 | p { 100 | border: none; 101 | color: $blue-900; 102 | font-size: 18px; 103 | font-weight: bold; 104 | margin-top: 25px; 105 | padding: 0; 106 | @media (max-width: $bk-ssm) { 107 | margin-top: 35px; 108 | } 109 | } 110 | 111 | small { 112 | color: $gray-100; 113 | } 114 | } 115 | } 116 | } 117 | .footer { 118 | & .attribution { 119 | position: relative; 120 | bottom: 0; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /dist/images/bg-pattern-card.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/bg-pattern-card.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Frontend Mentor - Profile card component 2 | 3 | ![Design preview for the Profile card component coding challenge](https://i.imgur.com/pp9wgIh.jpg) 4 | 5 | ## Welcome! 👋 6 | 7 | Thanks for checking out this front-end coding challenge. 8 | 9 | [Frontend Mentor](https://www.frontendmentor.io) challenges allow you to improve your skills in a real-life workflow. 10 | 11 | **To do this challenge, you need a basic understanding of HTML and CSS.** 12 | 13 | ## Demo 14 | 15 | [Click here to see my challenge done](https://profile-card-component-amber.vercel.app/) 16 | 17 | ## The challenge 18 | 19 | Your challenge is to build out this profile card component and get it looking as close to the design as possible. 20 | 21 | 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. 22 | 23 | Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel. 24 | 25 | ## Where to find everything 26 | 27 | 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. 28 | 29 | 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. 30 | 31 | If you would like the Sketch file in order to inspect the design in more detail you can [subscribe as a PRO member](https://www.frontendmentor.io/pro). 32 | 33 | You will find all the required assets in the `/images` folder. The assets are already optimized. 34 | 35 | There is also a `style-guide.md` file, which contains the information you'll need, such as color palette and fonts. 36 | 37 | ## Building your project 38 | 39 | 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: 40 | 41 | 1. Initialize your project as a public repository on [GitHub](https://github.com/). Use the command `npm install` in terminal to download the dependencies this project, next, use `npm start`. 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/). 42 | 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. 43 | 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. 44 | 4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content. 45 | 5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`. 46 | 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. 47 | 48 | ## Deploying your project 49 | 50 | 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: 51 | 52 | 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. 53 | 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. 54 | 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. 55 | 56 | ## Sharing your solution 57 | 58 | There are multiple places you can share your solution: 59 | 60 | 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. 61 | 2. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack). 62 | 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. 63 | 64 | ## Giving feedback 65 | 66 | Feedback is always welcome, so if you have any to give on this challenge please email hi[at]frontendmentor[dot]io. 67 | 68 | This challenge is completely free. Please share it with anyone who will find it useful for practice. 69 | 70 | **Have fun building!** 🚀 71 | 72 | ## Community Sponsors 73 | 74 | A massive thank you to our community sponsors! 75 | 76 | - [Zero to Mastery](https://bit.ly/fem-ztm) is an incredible learning resource for all things web development. Led by Andrei Neagoie, the courses are really high-quality content and cover a wide range of in-demand skills. 77 | - [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! 78 | - [Triplebyte](http://bit.ly/fem-triplebyte) is a really nice offering if you're looking for a new role. It's a free service that lets you take a confidential quiz. Based on your results companies will pitch you for their vacant roles! 79 | --------------------------------------------------------------------------------