Coder Social home page Coder Social logo

ninjanas / news-homepage-main Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.38 MB

News Homepage - TailwindCSS Grid & Flexbox Sample using SolidJS+Vite

Home Page: https://news-homepage-main-neon-pi.vercel.app

HTML 3.86% JavaScript 7.25% CSS 8.93% TypeScript 79.24% Dockerfile 0.73%
css html js solidjs tailwindcss docker docker-compose typescript

news-homepage-main's Introduction

Frontend Mentor - News homepage solution

This is a solution to the News homepage challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Screenshot

image

Links

My process

Built with

  • Solid JS
  • Solid JS Router
  • Tailwind
  • CSS custom properties
  • Flexbox/Grid
  • Docker
    • Docker Hub (optional)
      • docker pull ninjanas/news-homepage-main:dev
    • Build Locally
      • Build image: docker build -t ninjanas/news-homepage-main:dev .
      • Build image in docker-compose: docker-compose build
    • Start container
      • docker-compose up

Process and What I learned

I had some fun learning SolidJS and TailwindCSS. I learned a lot about how CSS Grid and Flexbox work and learned how to create responsive designs for different screens. I also went the extra step and adding some basic routing with SolidJS Router. I worked to create a simple and scalable workflow in case you needed to add more articles to the news site.

I learned and compared the differences between SolidJS and NextJS/React. For example, in SolidJS you should not destructure props because they would lose reactivity. Also, SolidJS is complied and has no virtual DOM unlike React. It does its rerenders by looking at what state has changed and surgically inserting it in the correct location in the DOM. This means the components do not have to fully rerender all of their code, only the state that changes need to rerender. This means you can have setInterval and setTimeout at the top of the component and have no unwanted side effect unlike React which would rerender them and cause an infinite loop.

I also containerized the development server for practice with Docker. I used docker-compose with volumes to able to hot-reload my docker container when I update my files locally. The local image is also on DockerHub.

Continued development

I would add more detail to the other navbar tabs and the article pages.

Author

news-homepage-main's People

Contributors

ninjanas avatar

Stargazers

 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.