Skip to content

timfoley/whoswho

Repository files navigation

How it Came to Be

I started this project when a coworker, Jon Rojas, asked if I could help him style a back-end app he created for GA's Back-End Web Development Course. His goal was to automate the process of creating a student orientation guide. In the past, he had put them all together manually using Keynote. Here's the comp he gave me to work with:

student profile page made in keynote

Here's the Sample Student Page I made based on this layout. Check it out! I still need to add that footer, but that'll be pretty simple.

After that, I created a Gallery View, but it's still not actually connected to anything just yet. I'm really proud of the fact that I was able to get the profile-cards to grow and snap with flex, but keep the "spillover" cards from growing to fill all the space. I didn't want to set a static width, so instead I used some javascript to keep the profile card width equal to the first card:

$(document).ready(resizeCard);

$(window).resize(resizeCard);


function resizeCard() {
  $('.profile-card + .profile-card').css({
    'max-width': $('.profile-card:first-child').width()
    });
}

It's still kinda janky, but it does the trick! Not to mention I felt super clever for solving my own problem using just a little javascript.

#Libraries/Plugins Used

#Javascript Pseudocode

DOM

  • divs with ID='student-name' for each student
  • start button
  • reset button
  • (skip button)
  • score panel

Setup

  1. Instantiate an array with names of all students

Start Game

  1. When user clicks 'start', reset score to 0
  2. Shuffle name array

First student

  1. pop a student name off array
  2. display student name to user
  3. prompt user to click on the right student
  4. if correct, add name under profile pic, move to bottom, and add 10 points
  • if incorrect, subtract 5 points
  • if skipped, subtract 1 point and move to next name

Next students

  1. While there are more students, repeat steps 4-7

Out of students

  1. When there are no more students, switch to End Game function

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published