Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element index - Ouija Board #72

Open
7 tasks
matuzo opened this issue Sep 10, 2021 · 26 comments
Open
7 tasks

Element index - Ouija Board #72

matuzo opened this issue Sep 10, 2021 · 26 comments

Comments

@matuzo
Copy link
Owner

matuzo commented Sep 10, 2021

I want to add an element index to the website. The content isn't ready yet, but I've already added quite a lot and the basic page structure is also ready.

Screenshot 2021-09-10 at 09 20 38
Screenshot 2021-09-10 at 09 20 48

You can find the WIP in this branch and file.

Here's what I need:

I want the list of of letters to look like a Ouija Board.

  • 2 rows of letters aligned along an arc.
  • the mouse pointer should change
  • No JS for the styling
  • mobile first (enough white space etc)
  • optional: additional stylistic elements that make it look more like an actual board (see image)
  • optional: JS to make the cursor snap when you're close to a letter
  • optional: make the mouse cursor always point to the top center of the board.

91wL628K5ML AC_SL1500

Ouija Board Google Images

The CSS isn't well organized, just drop it at the end of this file

@simevidas
Copy link

Letters along arc is doable with SVG https://twitter.com/argyleink/status/1410589757084667912

@ahmadalfy
Copy link

I'd give it a shot

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

I have started working on this as well.

@ahmadalfy
Copy link

This is what I am up to until now

image

This is without the outline

image

@matuzo is that the right direction 😅

@matuzo
Copy link
Owner Author

matuzo commented Sep 10, 2021

@ahmadalfy that looks fantastic! Do the links still work, even tough they're overlapping?

@ahmadalfy
Copy link

ahmadalfy commented Sep 10, 2021

Yes they work. This is how the links look like with yellow background applied to the a tag. I could add some additional width to facilitate pointing

image

@ahmadalfy
Copy link

This is starting to look hellish

image

@matuzo
Copy link
Owner Author

matuzo commented Sep 10, 2021

You're killing it @ahmadalfy, great work! @SaptakS would it make sense that the two of you get in touch and share your work to get the best out of it?

@ahmadalfy
Copy link

ahmadalfy commented Sep 10, 2021

I am up to collaboration for sure. You see, this is the CSS I am using at the moment

.ouija-letters {
    margin: 0 auto;
    padding: 0;
    list-style: none;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 400px;
    transform: rotate(-64deg);
    height: 400px;
}

.ouija-letters::before {
    content: '';
    position: absolute;
        background: url(https://img.freepik.com/free-photo/texture-old-faded-vintage-paper-beige-retro-background-grunge-paper-with-spots-streaks_213524-157.jpg?size=626&ext=jpg);
    width: 600px;
    height: 300px;
    transform: rotate(64deg);
    left: -100px;
    top: 50px;
}

.ouija-letters li a {
    display: inline-block;
}

.ouija-letters li {
  font: 26px Monaco, MonoSpace;
  height: 300px;
  position: absolute;
  left: 0;
  top: -10px;
  transform-origin: bottom center;
}

.ouija-letters li:nth-child(n + 14) {
    left: 0;
    top: 40px;
    height: 250px;
}

.ouija-letters li:nth-child(1) {
	transform: rotate(9.23077deg);
}

.ouija-letters li:nth-child(2) {
	transform: rotate(18.46154deg);
}

.ouija-letters li:nth-child(3) {
	transform: rotate(27.69231deg);
}

.ouija-letters li:nth-child(4) {
	transform: rotate(36.92308deg);
}

.ouija-letters li:nth-child(5) {
	transform: rotate(46.15385deg);
}

.ouija-letters li:nth-child(6) {
	transform: rotate(55.38462deg);
}

.ouija-letters li:nth-child(7) {
	transform: rotate(64.61538deg);
}

.ouija-letters li:nth-child(8) {
	transform: rotate(73.84615deg);
}

.ouija-letters li:nth-child(9) {
	transform: rotate(83.07692deg);
}

.ouija-letters li:nth-child(10) {
	transform: rotate(92.30769deg);
}

.ouija-letters li:nth-child(11) {
	transform: rotate(101.53846deg);
}

.ouija-letters li:nth-child(12) {
	transform: rotate(110.76923deg);
}

.ouija-letters li:nth-child(13) {
	transform: rotate(120deg);
}


.ouija-letters li:nth-child(14) {
	transform: rotate(9.23077deg);
}

.ouija-letters li:nth-child(15) {
	transform: rotate(18.46154deg);
}

.ouija-letters li:nth-child(16) {
	transform: rotate(27.69231deg);
}

.ouija-letters li:nth-child(17) {
	transform: rotate(36.92308deg);
}

.ouija-letters li:nth-child(18) {
	transform: rotate(46.15385deg);
}

.ouija-letters li:nth-child(19) {
	transform: rotate(55.38462deg);
}

.ouija-letters li:nth-child(20) {
	transform: rotate(64.61538deg);
}

.ouija-letters li:nth-child(21) {
	transform: rotate(73.84615deg);
}

.ouija-letters li:nth-child(22) {
	transform: rotate(83.07692deg);
}

.ouija-letters li:nth-child(23) {
	transform: rotate(92.30769deg);
}

.ouija-letters li:nth-child(24) {
	transform: rotate(101.53846deg);
}

.ouija-letters li:nth-child(25) {
	transform: rotate(110.76923deg);
}

.ouija-letters li:nth-child(26) {
	transform: rotate(120deg);
}

No changes to the HTML, you just have to put it in the project. The text angle rotation selectors and values are based on this mixin.

I would love to see @SaptakS work and how we can collaborate.

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

Makes sense. I see @ahmadalfy has proceeded the exact same way as I was doing by rotating each alphabet. I was taking inspiration from a similar codebase. Happy to collaborate on the next steps or review the code once you are done, whichever makes more sense.

@ahmadalfy
Copy link

What do you think about having three rows for mobile?

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

I think 3 row is a good idea for mobile. This might be too clumsy in mobile. I think we will need to have lesser alphabets in the third row though to allow for proper spacing.

@ahmadalfy
Copy link

ahmadalfy commented Sep 10, 2021

I think we will need to have lesser alphabets in the third row though to allow for proper spacing.

You mean on mobile or on desktop as well?

@matuzo pardon me, I allowed my self to go wild with this one

image

image

This is the focus style and it aligns perfectly with each anchor. Paste this code on your CSS to try it

.ouija-letters {
    margin: 0 auto;
    padding: 0;
    list-style: none;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
  position: relative;
  width: 400px;
  border-radius: 50%;
  transform: rotate(-64deg);
    height: 400px;
}

.ouija-letters::before {
    content: '';
    position: absolute;
        background: url(https://img.freepik.com/free-photo/texture-old-faded-vintage-paper-beige-retro-background-grunge-paper-with-spots-streaks_213524-157.jpg?size=626&ext=jpg);
    width: 600px;
    height: 300px;
  transform: rotate(64deg);
    left: -100px;
    top: 50px;
}

.ouija-letters li {
    z-index: 1;
}

.ouija-letters li:focus-within {
    z-index: 2;
}

.ouija-letters li a {
    display: inline-block;
    position: relative;
}

.ouija-letters li a:focus {
    outline: none;
}

.ouija-letters li a:focus::before {
    background: url(https://i.imgur.com/piBnrtK.png);
    background-size: 100% auto;
    position: absolute;
    width: 120px;
    height: 160px;
    content: '';
    background-repeat: no-repeat;
    top: -45px;
    left: -52px;
    z-index: 1;
}

.ouija-letters li {
  font: 26px Monaco, MonoSpace;
  height: 300px;
  position: absolute;
  left: 0;
  top: -10px;
  transform-origin: bottom center;
}

.ouija-letters li:nth-child(n + 14) { left: 0; top: 40px ; height: 250px }



.ouija-letters li:nth-child(1) {
	transform: rotate(9.23077deg);
}

.ouija-letters li:nth-child(2) {
	transform: rotate(18.46154deg);
}

.ouija-letters li:nth-child(3) {
	transform: rotate(27.69231deg);
}

.ouija-letters li:nth-child(4) {
	transform: rotate(36.92308deg);
}

.ouija-letters li:nth-child(5) {
	transform: rotate(46.15385deg);
}

.ouija-letters li:nth-child(6) {
	transform: rotate(55.38462deg);
}

.ouija-letters li:nth-child(7) {
	transform: rotate(64.61538deg);
}

.ouija-letters li:nth-child(8) {
	transform: rotate(73.84615deg);
}

.ouija-letters li:nth-child(9) {
	transform: rotate(83.07692deg);
}

.ouija-letters li:nth-child(10) {
	transform: rotate(92.30769deg);
}

.ouija-letters li:nth-child(11) {
	transform: rotate(101.53846deg);
}

.ouija-letters li:nth-child(12) {
	transform: rotate(110.76923deg);
}

.ouija-letters li:nth-child(13) {
	transform: rotate(120deg);
}


.ouija-letters li:nth-child(14) {
	transform: rotate(9.23077deg);
}

.ouija-letters li:nth-child(15) {
	transform: rotate(18.46154deg);
}

.ouija-letters li:nth-child(16) {
	transform: rotate(27.69231deg);
}

.ouija-letters li:nth-child(17) {
	transform: rotate(36.92308deg);
}

.ouija-letters li:nth-child(18) {
	transform: rotate(46.15385deg);
}

.ouija-letters li:nth-child(19) {
	transform: rotate(55.38462deg);
}

.ouija-letters li:nth-child(20) {
	transform: rotate(64.61538deg);
}

.ouija-letters li:nth-child(21) {
	transform: rotate(73.84615deg);
}

.ouija-letters li:nth-child(22) {
	transform: rotate(83.07692deg);
}

.ouija-letters li:nth-child(23) {
	transform: rotate(92.30769deg);
}

.ouija-letters li:nth-child(24) {
	transform: rotate(101.53846deg);
}

.ouija-letters li:nth-child(25) {
	transform: rotate(110.76923deg);
}

.ouija-letters li:nth-child(26) {
	transform: rotate(120deg);
}

Source image is here for attribution

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

This looks great!!! <3

You mean on mobile or on desktop as well?

Mean't for mobile

@ahmadalfy
Copy link

Am glad you like it. Maybe it's not aligned with the theme of the website (or maybe it's the background) ... Let's hear it from @matuzo then we proceed and implement the mobile together.

@matuzo
Copy link
Owner Author

matuzo commented Sep 10, 2021

Thank you, @ahmadalfy and @SaptakS. I love it!

By using this paper background look it doesn't align with the theme, but that's OK. Maybe adding a border and a light box-shadow will make it look more like an actual board? I think it's kinda cool that it breaks with the design and someone decided to just throw a board in there. :)

@ahmadalfy
Copy link

@matuzo

Maybe something like that would be more suitable 😅 Fresh from hell

image

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

This does look pretty cool. I am just concerned if people don't understand those are clickable links and not just a picture of a board. But given @matuzo is okay with the break of design, maybe I am just over thinking at this point.

UX wise, do we want to add a similar cursor for hover style as well? In that case, we might need to think how to point at the alphabets that are hidden behind the cursor.

@ahmadalfy
Copy link

ahmadalfy commented Sep 10, 2021

All right, I pushed my code and invited @SaptakS to the repository. Feel free to make any changes you want :)

I added drop shadow filter to that focus style to make it look more realistic.

image

I didn't add the board image to the repository yet until we figure out which image we will use.

And this is the requirements so far:

  • 2 rows of letters aligned along an arc.
  • the mouse pointer should change
  • No JS for the styling
  • mobile first (enough white space etc)
  • optional: additional stylistic elements that make it look more like an actual board (see image)
  • optional: JS to make the cursor snap when you're close to a letter
  • optional: make the mouse cursor always point to the top center of the board.

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

I have added responsiveness along with some cleaning of code and adding the cursor on hover as well in: ahmadalfy#1 . I haven't made the background board responsive yet since it's not finalized.

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 10, 2021

I took a look at the mouse cursor always pointing to the top center of the board, and it will involve a lot of hard coded positioning and rotation for desktop and mobile screen of the cursor for individual character. If we really want that, I can add it.

@bafflingscience
Copy link

this is all looking incredible!
such a cool concept, can't wait to try it out.

@ahmadalfy
Copy link

@SaptakS I will start working on the mobile, unless you made any progress on it

@SaptakS
Copy link
Collaborator

SaptakS commented Sep 12, 2021

@ahmadalfy created a PR on your repo with the mobile changes I made.

@ahmadalfy
Copy link

@SaptakS impressive, thank you.

@matuzo
Copy link
Owner Author

matuzo commented Sep 14, 2021

@SaptakS @ahmadalfy You two are amazing, thanks a lot! I'm on vacation for the next 2,5 weeks, but I will make sure to publish is as soon as possible when I'm back again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants