Skip to content

Instantly share code, notes, and snippets.

@JoeVan21
Created January 22, 2023 20:27
Show Gist options
  • Select an option

  • Save JoeVan21/44ed59ef9a30e838c684e75bd6a14c4c to your computer and use it in GitHub Desktop.

Select an option

Save JoeVan21/44ed59ef9a30e838c684e75bd6a14c4c to your computer and use it in GitHub Desktop.

Homework 2

Joseph Vanacore

Link to Part 1 of W2 Homework

Can you change the font color? If not, where do you think it is that being set?

  • Inside the coding systems of HTML and CSS I cannot edit or change the font color with the code lines and examples we have provided. However, we can change the font color settings when coding in java script, Within the example provided, line 50 within the java script lanugage is what would be used to edit the font color.

Look at the constructor() what does this do?

  • Contructors in java script identify a certain object that is going to be built within the system. In this example the constructor is building the diffrent font styles used for the meme such as the width, boldness, padding, and color.

Look at @media in styles() what does this do?

  • The media code in the case described in lines 61-73 in java script developes where the text is going to be placed on the media file/link that we assigned in HTML. It also develops a font size so that the text can be fitted on the media file properly.

Look at the render method, is this convention "vanilla" (built in) or do you think a library is delivering this

  • I beilive that the render method stays as vanilla since all the code is getting passed through java script and not including any other sources. Since the render is taking code information from the html and css and apllying that knowledge into JS, shows the process is being shown within a built in render rather than some random one from a library.

Part 2 link

Sources

@ehteshamulhaque71
Copy link
Copy Markdown

  • I think you got the constructor part wrong! It is a function that is executed by default when an object of a class is made to initialize certain properties of that object.
  • The example constructor sets the alt property to a null string. alt (alternative text) is a property used for accessibility purposes (e.g., for users with vision impairments to provide a written description of the meme).
  • Also, the constructor has one more statement: super(). This is important - the super method calls the constructor of the class from which the current class inherits. See the statement: class MemeMaker extends LitElement. In this case, the super method in the MemeMaker class calls the constructor of the LitElement class.
  • Media query helps make web design responsive depending on the screen size of the device.
  • The rendering is not vanilla. The vanilla way is to get an element using a querySelector and then modify the properties with JavaScript. But in the code, HTML and CSS are being imported from a link (line 5) and used in the code to render HTML and CSS directly without modifying properties.
  • The card looks very clean! Good job!
  • Media query could have been better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment