Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7974123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:17:05+00:00 2026-06-04T08:17:05+00:00

the first two keys are operational (leftmost key, and the black key right next

  • 0

the first two keys are operational (leftmost key, and the black key right next to it). here it is hosted so you can see

http://23.23.184.26/miller/keyboardanimation/main.html

I have to redraw the WHOLE keyboard because the 3d nature of each key does not leave a square profile that I can replace with a square image. I don’t see support anywhere for trapezoidal elements…

Should I be doing this in SVG or canvas or something? I feel like the way I’m doing this is really dumb.

And, I’m getting a wierd white flash between transitions sometimes (on IE9 only tho I think)

<!DOCTYPE HTML>
<html>
<head>
    <style type="text/css">
        a{
            color:white;
        }
        #main{
            background:white url('0.gif') no-repeat 0 0;
            position:relative;
            z-index:0;
            width:506px;
            height:319px;
        }

        #key1{
            position:absolute;
            width:50px;
            height:75px;
            top:175px;
            left:55px; 
        }
        #key2{
            position:absolute;
            width:50px;
            height:75px;
            top:100px;
            left:85px;
        }
        /*uncomment this to show button zones*/
        /*#key1:hover, #key2:hover{
            border:1px solid red;
        }*/
    </style>
</head>

<body>
    <div id="main">
        <div id="key1" onMouseDown="document.getElementById('main').style.background = 'url(1.gif)'" onMouseUp="document.getElementById('main').style.background = 'url(0.gif)'"></div>
        <div id="key2" onMouseDown="document.getElementById('main').style.background = 'url(2.gif)'" onMouseUp="document.getElementById('main').style.background = 'url(0.gif)'"></div>
    </div>
</body>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:17:07+00:00Added an answer on June 4, 2026 at 8:17 am

    You are not using CSS animation :-/, you are making simple background transition using Javascript.

    That said there is also another small detail, if you use canvas to draw and animate the piano, you will need to “re-draw” the piano that doesn’t change and every part of the piano that changes.

    I would suggest that you do this in SVG and animate that, as you will have less parts to animate :-).

    Greetings!
    Gonzalo G.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here it is hosted so you can see the behavior. (first two keys only,
I have two arrays the first one has this structure Parameter Keys array array
The first two paragraphs of this page explain that generic views are supposed to
freeze the first two column but if I want to freeze the column dynamically
Is it possible to take only the first two lines from a wrapped text
How do I select all but the first two rows from e.g. the mtcars
What will be the regular expression to accept 'CP123' First two letters CP and
I'm running a query that is timing out for first two times and returning
I'm trying to use Unix cut to remove the first two fields per line.
I want to do a functional like pattern match to get the first two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.