Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS][HTML] działa, ale czy można prościej
MeWash73
post 21.11.2015, 00:54:45
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 21.11.2014

Ostrzeżenie: (0%)
-----


Witajcie,

Po parogodzinnej walce zrobiłem wykres słupkowy w którym wyświetlane są wartości i po najechaniu myszą obracają się i powiększają.
Część 'słupkowa' będzie w pętli, wartości będą pobierane z bazy.
Czy nie przekombinowałem i czy nie można było tego osiągnąć prościej?
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3.  
  4.  
  5. <meta charset="UTF-8">
  6.  
  7. <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,200,300,600&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
  8. *,
  9. *:before,
  10. *:after {
  11. padding: 0px;
  12. margin: 0px;
  13. color: #FFF;
  14.  
  15. font-family: 'Source Sans Pro';
  16. font-weight: 300;
  17. font-style: normal;
  18.  
  19. transition-timing-function:ease-in;
  20. -webkit-transition-timing-function:ease-in;
  21. -o-transition-timing-function:ease-in;
  22. transform-origin:50% 50%;
  23. -webkit-transform-origin:50% 50%;
  24. -o-transform-origin:50% 50%;
  25. }
  26.  
  27. .slupek {
  28. background: #34495e;
  29. width: 14px;
  30. margin: 1px;
  31. float: left;
  32. overflow:hidden;
  33. transition-duration: 0.5s;
  34. -webkit-transition-duration: 0.5s;
  35. -o-transition-duration: 0.5s;
  36.  
  37. }
  38.  
  39. .slupek:hover {
  40. width:30px;
  41. }
  42.  
  43. .dane {
  44. background: transparent;
  45. font-size:10px;
  46.  
  47. transform:translateX(-50%) rotate(-90deg);
  48. -webkit-transform:translateX(-50%) rotate(-90deg) ;
  49. -o-transform:translateX(-50%) rotate(-90deg) ;
  50.  
  51. transition-duration: 0.1s;
  52. -webkit-transition-duration: 0.1s;
  53. -o-transition-duration: 0.1s;
  54. }
  55.  
  56. .dane:hover {
  57. font-size:20px;
  58.  
  59. transform:translateX(-50%) rotate(0deg) ;
  60. -webkit-transform:translateX(-50%) rotate(0deg) ;
  61. -o-transform:translateX(-50%) rotate(0deg) ;
  62. }
  63.  
  64. .va {
  65. padding-top:50%;
  66. text-align: right;
  67. background:transparent;
  68.  
  69. transition-duration: 0.1s;
  70. -webkit-transition-duration: 0.1s;
  71. -o-transition-duration: 0.1s;
  72. }
  73.  
  74. .va:hover{
  75. padding-top:0px;
  76. text-align: center;
  77. margin-left:14px;
  78. font-weight: 600;
  79. }
  80.  
  81.  
  82. </head>
  83.  
  84.  
  85.  
  86. <div style="margin:20px; height:420px; width:400px; border:solid 1px #34495e;;">
  87.  
  88. <div class="slupek" style="height:200px; transform:translateY(200px);">
  89. <div class="dane" style="height:200px; width:200px; ">
  90. <p class="va" style="height:200px; width:200px; ">200</p>
  91. </div>
  92. </div>
  93.  
  94. <div class="slupek" style="height:300px; transform:translateY(100px);">
  95. <div class="dane" style="height:300px; width:300px; ">
  96. <p class="va" style="height:300px; width:300px; ">300</p>
  97. </div>
  98. </div>
  99.  
  100. <div class="slupek" style="height:400px; transform:translateY(0px);">
  101. <div class="dane" style="height:400px; width:400px; ">
  102. <p class="va" style="height:400px; width:400px; ">400</p>
  103. </div>
  104. </div>
  105.  
  106. </div>
  107. </body>
  108. </html>


Ten post edytował MeWash73 21.11.2015, 10:30:03
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 16.06.2025 - 21:57