Coder Social home page Coder Social logo

es-rene99 / google-homepage Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 65 KB

Google homepage clone, with only HTML and CSS, part of The Odin Project.

Home Page: https://es-rene99.github.io/google-homepage/

HTML 46.53% CSS 53.47%
html5 css javascript the-odin-project

google-homepage's Introduction

Google clone for the Odin project

First exercise of the Foundations course from the Odin Project.

Cool things I learned

Notes from Responsive design

From Jharteaga dev.to article

  • No use of inches, points, cms and mms unless is printing physical
  • Px = thin lines on borders for example, or the exact size of an image so it doesn't get scaled(although for that is better physical units for printing) since they aren't responsive and consistent and sometimes interfere with Zoom functionality.
    • But they're a must on media queries.
  • Viewport should be used sparingly for things like overlays that need to scale based on size of the display, large containers are ideal, never use as font sizes, and they're tricky to get right.
  • Percentages for elements which logically scale for their parents, for example how big sidebars are in text, or helping set some default number of elements per row/column in a flexbox layout.
  • Ems mostly for tweaking the font-size of small sections of text, since it scales a property off the font of the size of the element, or the parent, it has inheritance.
    • But there's an advantage to em that em's are great because you set paddings, margins, borders, whatever to em, and then they all scale uniformly just by changing the font size of the item. This is great for buttons or headings where you don't want to redefine all the values every time you change a font size.
  • REms for everything else, paddings, font-sizes.

SVG Study

From w3schools

  • The value of the viewBox attribute for SVG elements, is a list of four numbers: min-x, min-y, width and height.
  • SVG defines the graphics in XML format
  • Example of SVG and explanation by
    • The <circle> element is used to draw a circle
    • The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are not set, the circle's center is set to (0, 0)
    • The r attribute defines the radius of the circle
    • The stroke and stroke-width attributes control how the outline of a shape appears. We set the outline of the circle to a 4px green "border"
    • The fill attribute refers to the color inside the circle. We set the fill color to yellow
<svg width="100" height="100">
  <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
  • Predefined SVG shapes

    • Rectangle <rect>
    • Circle <circle>
    • Ellipse <ellipse>
    • Line <line>
    • Polyline <polyline>
    • Polygon <polygon>
    • Path <path>
  • The following commands are available for path data:

    • M = moveto
    • L = lineto
    • H = horizontal lineto
    • V = vertical lineto
    • C = curveto
    • S = smooth curveto
    • Q = quadratic Bézier curve
    • T = smooth quadratic Bézier curveto
    • A = elliptical Arc
    • Z = closepath

Info from CSS Tricks

  • In HTML SVG is treated like a document, just like:
<object>
  <img>
  <iframe>
  • The default size for this elements is 300x15, but can vary between different browsers.

  • The ways you will need scale a SVG is:

    • Scaling to fit a certain size, without distorting the image.
    • Scaling to fit a certain size, stretching or compressing the graphic as necessary.
    • Scaling to fit the available width, while maintaining the width-to-height aspect ratio.
    • Scaling in non-uniform ways, so that some parts of the graphic scale differently from others.
  • You should use a combination of height and width with viewBox attr:

    • it defines the aspect ratio of the image.
    • it defines how all the values on the SVG should be scaled to fit the total space available.
    • it defines the origin of the SVG coordinate.

google-homepage's People

Contributors

es-rene99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.