Coder Social home page Coder Social logo

aiman99aleryany / pancakeswap Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 1.3 MB

Clone of PanCakeSwap Website

Home Page: https://aiman99aleryany.github.io/pancakeswap/

HTML 56.29% SCSS 23.85% JavaScript 2.67% CSS 17.19%
css html5 sass scss styleguide

pancakeswap's Introduction

Project Link

https://aiman99aleryany.github.io/pancakeswap/

PancakeSwap App

Design principles

  1. Mobile First Design

  2. Atomic Design

  3. Sections:

    • header

      • position: relative
      • display: flex
      • background: background-color
    • footer

      • position: relative
      • display: flex
      • background: background-color
    • sectionN

      • position: relative
      • display: flex
  4. Wrappers:

    • flex-items

SCSS naming conventions

BEM

  • Block -> card
  • Element -> card__specs
  • Modifier -> card--light or card--dark
/* Block */
.card {
  // here are basic rule soft the card
  display: flex;

  /* Element */
  &__specs {
    // here are the rules of an element of a card
  }

  /* Modifier */
  &--light {
    // here is the color of the card
    background-color: white;
  }
}

JS naming conventions

  • coming soon...

Folder & files structure

  • icons/ Folder contains all the ICO images.
  • images/ Folder contains all the JPG/PNG/SVG images.
    • Names of images should follow SCSS classes, e.g. section1-card.png.
  • logos/ Folder contains the website logo/brand and all the other logos.
  • scripts/ Folder contains all the JS files.
  • styles/ Folder contains all the SCSS files.
    • styles/sectionN/ Folder named after a corresponding SCSS section.
      • styles/sectionN/section.scss File contains the section class.
      • styles/sectionN/section-wrapper.scss File contains the wrapper inside that section.
      • styles/sectionN/section-wrapper-media.scss File contains the desktop design.
  • atomic/ Folder contains the dynamic Modules that can be used across the website.
  • .gitignore File contains all the ignored files.
  • index.html File contains all the HTML code for the landing page.
  • other.html File contains 1 more single page besides the landing page, will be built after finishing the landing page.

Code guidelines

  • General guidelines

    1. If the code is not clear, write comments.
    2. Functions Are your Friends :)
      • Use them all the time.
      • Create functions for small processes, each function should do only 1 thing.
    3. Use class name and then Camel-Case naming convention with vars. something like this: $section-wrapperPadding.
      • check the root.scss file, you can see many examples.
    4. Atomic design vars have only Camel-Case naming convention.
    5. Colors has the snake naming convention.
    6. Use VisBug extension on the browser to see the actual paddings, widths, heights etc. from the original website.
  • HTML

<!-- Behaves like a section -->
<header>
  <!-- Behaves like a section-wrapper -->
  <nav>
    <!-- code here -->
  </nav>
</header>

<main>
  <section class="section1">
    <div class="section1-wrapper">
      <!-- code here -->
    </div>
  </section>

  <section class="...section7">
    <div class="...section7-wrapper">
      <!-- code here -->
    </div>
  </section>
</main>

<!-- Behaves as a section -->
<footer>
  <section class="footer-wrapper">
    <!-- code here -->
  </section>
</footer>

CSS/SCSS/SASS

  1. Write the code for the parent section class inside section.scss.

  2. header.scss & footer.scss are considered section.scss.

  3. Inside header/nav Folder the nav.scss is considered section-wrapper.scss.

  4. Write your code inside the section-wrapper.scss files.

  5. Nesting:

    • Maximum 2 deep layers:

      .card {
        &__specs {
          // don't go deeper than this
        }
      }
      
      // if you want to go deeper write another class:
      .card__specs {
        card__specs-button {
      
        }
      }
      
    • Clean, simple code.

  6. Put all mixins in: ./styles/atomic/root/root_mixins.scss.

  7. Put all functions in: ./styles/atomic/root/root_functions.scss.

  8. Put all variables in ./styles/atomic/root/root.scss.

    • If you add vars, make sure to state that in the description of your Pull Request.
  9. Put all resets in: ./styles/base/resets.scss.

  10. Put all type selectors in: ./styles/base.scss.

  11. Maintain the same folder structure. Don't add any new files excluding ICO/JPG/PNG/SVG.

    • If you add a new file other than images, make sure to state that in the group chat in discord, and don't forget to import it in ./styles/main/main.scss.
  12. Writing imports:

    • Write imports like this: @use "./folder/file" as f;.
    • Not like this: @use "./folder/file" as *;.
    • Call Vars like this: file.var;.
  13. Use rem over px, if you want to use px convert it using the functions inside ./styles/atomic/root_functions.scss.

  14. Use the provided atomic designs when it comes to buttons, links, or animation.

  15. Never use the keyword !important.

  16. Never use inline CSS.

  17. All wrappers has only MaxWidth of 1152px, name of the variable with the root: root.$wrappersMaxWidth

Testing Code

  • You can test your code by compiling only the ./styles/main/main.scss file.
  • You can test your code by compiling a specific file using the terminal by writing the command:
    • sass --watch ./styles/<section>/<file>.scss <file>.css.

Commits naming convention

  • e.g. Added navbar languages menu
  • e.g. Fixed navbar horizontal scrollbar bug

Team Work

  • Always check Trello and update your cards.
  • Read commits log and see what's new.

VS code instructions

  • Install these extensions and learn how to use them, (you can search by publisher filter):

    1. Banner comments. -- publisher:"HEYIMFUZZ"
    2. Better Comments. -- publisher:"Aaron Bond"
    3. Code spell checker. -- publisher:"Street Side Software"
    4. GitLens. -- publisher:"GitKraken"
    5. SCSS IntelliSense. -- publisher:"mrmlnc"
    6. Todo Tree -- publisher:"Gruntfuggly"
  • Activate the MiniMap to see the Banner comments.

pancakeswap's People

Contributors

aiman99aleryany avatar swisscodes avatar aryakrm avatar

Stargazers

Tomcyrus avatar  avatar

Watchers

 avatar  avatar

Forkers

aryakrm elyin axth2o

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.