style.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. $dark-purple: #423443;
  2. $blue: #2eafc2;
  3. $red: #d12521;
  4. $grey: #dad7d2;
  5. $dark-grey: #261e26;
  6. @mixin all-transition{
  7. -moz-transition: all 0.2s ease-in-out;
  8. -webkit-transition: all 0.2s ease-in-out;
  9. -o-transition: all 0.2s ease-in-out;
  10. -ms-transition: all 0.2s ease-in-out;
  11. transition: all 0.2s ease-in-out;
  12. }
  13. * {
  14. margin: 0;
  15. padding: 0;
  16. -moz-box-sizing: border-box;
  17. -webkit-box-sizing: border-box;
  18. box-sizing: border-box;
  19. }
  20. html { font-size: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
  21. ::-moz-selection { background: darken($dark-purple, 10%); color: #fefefe; text-shadow: none; }
  22. ::selection { background: darken($dark-purple, 10%); color: #fefefe; text-shadow: none; }
  23. .clearfix:before,
  24. .clearfix:after {
  25. content: " ";
  26. display: table;
  27. }
  28. .clearfix:after {
  29. clear: both;
  30. }
  31. .clearfix {
  32. zoom:1;
  33. }
  34. footer, header, section {
  35. display: block;
  36. }
  37. body, html {
  38. color: #424242;
  39. font-family: 'Open Sans', sans-serif;
  40. background: #fefefe;
  41. font-size: 16px;
  42. line-height: 1.5;
  43. font-weight: 400;
  44. }
  45. a {
  46. font-size: 1rem;
  47. color: darken($blue, 5%);
  48. text-decoration: underline; }
  49. a:hover {
  50. color: $blue;
  51. text-decoration: none;
  52. @include all-transition }
  53. p {
  54. text-align: left;
  55. margin-bottom: 1em;
  56. font-size: 1rem;
  57. }
  58. h1.knight {
  59. height: 122px;
  60. width: 122px;
  61. background: url('../images/knight.png') no-repeat;
  62. margin: 2em auto 0.5em auto;
  63. }
  64. h2 {
  65. font-family: 'Cherry Swash';
  66. font-weight: 400;
  67. font-size: 2rem;
  68. text-align: center;
  69. color: $dark-purple;
  70. margin-bottom: 0.5em;
  71. }
  72. h3 {
  73. font-weight: 600;
  74. font-size: 1.5rem;
  75. margin: 1em 0 0.5em 0;
  76. color: lighten($dark-purple, 5%);
  77. }
  78. .alpha {
  79. font-size: 1.125rem;
  80. }
  81. .center {
  82. text-align: center !important;
  83. }
  84. .margin-fifty{
  85. margin: 50px 0;
  86. }
  87. .last-origin{
  88. background: lighten($blue, 25%) !important;
  89. }
  90. .last-target{
  91. background: lighten($blue, 20%) !important;
  92. }
  93. .chat{
  94. text-decoration: none;
  95. color: darken($blue, 10%);
  96. margin-right: 1em;
  97. line-height: 50px;
  98. float: right !important;
  99. cursor: pointer;
  100. font-weight: 600;
  101. &:hover{
  102. color: darken($blue, 5%);
  103. .new-message{
  104. color: $red;
  105. }
  106. }
  107. img{
  108. vertical-align: middle;
  109. }
  110. .new-message{
  111. color: $red;
  112. padding-right: 1em;
  113. }
  114. }
  115. header {
  116. margin: 0 auto;
  117. max-width: 800px;
  118. width: 100%;
  119. height: 50px;
  120. }
  121. #clock{
  122. width: 148px;
  123. height: 50px;
  124. position: absolute;
  125. text-align: center;
  126. border: 4px solid lighten($grey, 5%);
  127. li{
  128. width: 70px;
  129. display: inline-block;
  130. line-height: 42px;
  131. opacity: .9;
  132. position: absolute;
  133. }
  134. li.white{
  135. left: 0;
  136. color: #424242;
  137. background: #fff;
  138. }
  139. li.black{
  140. right: 0;
  141. color: #fff;
  142. background: #424242;
  143. }
  144. li.ticking{
  145. z-index: 1;
  146. font-size: 1.125rem;
  147. opacity: 1;
  148. box-shadow: 0 0 5px lighten($grey, 5%);
  149. -webkit-transform: scale(1.2);
  150. -moz-transform: scale(1.2);
  151. -o-transform: scale(1.2);
  152. -ms-transform: scale(1.2);
  153. transform: scale(1.2);
  154. @include all-transition;
  155. }
  156. }
  157. span#game-type{
  158. position: absolute;
  159. line-height: 50px;
  160. margin-left: 175px;
  161. opacity: 0.9;
  162. }
  163. #container_wrapper {
  164. max-width: 960px;
  165. width: 100%;
  166. height: auto;
  167. padding: 1em 2em;
  168. margin: 0 auto;
  169. clear: both;
  170. }
  171. #container {
  172. width: 100%;
  173. min-height: 600px;
  174. margin: 0px 0px 20px 0px;
  175. float: left;
  176. }
  177. #form{
  178. width: 100%;
  179. height: 200px;
  180. margin: 0 auto;
  181. fieldset{
  182. border: 0;
  183. text-align: right;
  184. margin-bottom: 1em;
  185. width: 80%;
  186. input{
  187. margin-left: 1em;
  188. width: 100px;
  189. outline: none;
  190. height: 40px;
  191. line-height: 30px;
  192. padding-left: 1em;
  193. font-size: 1.125rem;
  194. color: #424242;
  195. border: 2px solid #2b222c;
  196. border-left: 4px solid #2eafc2;
  197. }
  198. label{
  199. position: relative;
  200. &:before{
  201. position: absolute;
  202. content: 'Up to 50';
  203. top: 0;
  204. right: 2em;
  205. margin-top: -2.5em;
  206. font-size: 0.75rem;
  207. }
  208. }
  209. }
  210. }
  211. input, button{
  212. font-family: 'Open Sans';
  213. }
  214. input.game_link {
  215. width: 80%;
  216. height: 50px;
  217. line-height: 50px;
  218. font-size: 1.125rem;
  219. color: #fff;
  220. border: 0;
  221. border-bottom: 2px solid darken($dark-purple, 8%);
  222. border-left: 4px solid $blue;
  223. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  224. background: $dark-purple;
  225. padding: 0 1em;
  226. float: left;
  227. border-radius: 2px;
  228. box-shadow: inset 0 -2px darken($dark-purple, 8%);
  229. }
  230. .game_link:hover {
  231. background: lighten($dark-purple, 3%);
  232. border-bottom: 2px solid darken($dark-purple, 3%);;
  233. box-shadow: inset 0 -2px darken($dark-purple, 3%);
  234. @include all-transition;
  235. }
  236. .game_link:focus {
  237. color: #eee;
  238. }
  239. .button {
  240. width: 15%;
  241. height: 50px;
  242. display: block;
  243. font-size: 1.125rem;
  244. border-radius: 2px;
  245. border: 0;
  246. border-bottom: 2px solid darken($blue, 5%);
  247. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  248. background: $blue;
  249. color: white;
  250. cursor: pointer;
  251. float: right;
  252. box-shadow: inset 0 -2px darken($blue, 5%);
  253. position: relative;
  254. }
  255. .button:hover{
  256. background: lighten($blue, 5%);
  257. border-bottom: 2px solid darken($blue, 2%);
  258. box-shadow: inset 0 -2px darken($blue, 2%);
  259. @include all-transition;
  260. }
  261. .button:active{
  262. top: 1px;
  263. }
  264. .button:focus{
  265. outline: none;
  266. }
  267. a.button{
  268. width: 120px;
  269. line-height: 46px;
  270. text-align: center;
  271. text-decoration: none;
  272. }
  273. a.button:hover{
  274. color: white;
  275. }
  276. .resign {
  277. background: $red;
  278. border-color: darken($red, 5%);
  279. box-shadow: inset 0 -2px darken($red, 5%);
  280. margin-right: 10px;
  281. }
  282. .resign:hover {
  283. background: lighten($red, 5%);
  284. border-bottom: 2px solid darken($red, 2%);
  285. box-shadow: inset 0 -2px darken($red, 2%);
  286. @include all-transition;
  287. }
  288. p#waiting {
  289. font-family: 'Cherry Swash';
  290. font-size: 1.275rem;
  291. color: darken($red, 5%);
  292. width: 100%;
  293. text-align: center;
  294. margin: 15px 0px 0px 0px;
  295. display: none;
  296. float: left;
  297. }
  298. footer {
  299. font-size: 1rem;
  300. width: 100%;
  301. line-height: 2em;
  302. text-align: center;
  303. background: $grey;
  304. border-bottom: 4px solid darken($grey, 10%);
  305. box-shadow: inset 0 -4px darken($grey, 10%);
  306. a{
  307. color: darken($grey, 45%);
  308. }
  309. a:hover{
  310. color: darken($grey, 40%);
  311. }
  312. }
  313. #footer{
  314. margin: 0 auto;
  315. max-width: 960px;
  316. padding: 3em 2em 1em 2em;
  317. }
  318. #sounds_label {
  319. width: 800px;
  320. height: 30px;
  321. line-height: 30px;
  322. display: block;
  323. margin: 0px 0px 5px 0px;
  324. float: left;
  325. }
  326. /* Chat */
  327. #chat-wrapper{
  328. display: none;
  329. position: absolute;
  330. width: 270px;
  331. right: 10px;
  332. top: 99px;
  333. border: 4px solid #fff;
  334. background: lighten($grey, 5%);
  335. h4{
  336. font-family: 'Cherry Swash';
  337. font-size: 1.225rem;
  338. height: 3em;
  339. line-height: 3em;
  340. margin: 5px 5%;
  341. text-align: center;
  342. color: $dark-purple;
  343. }
  344. a.close{
  345. position: absolute;
  346. top: 0;
  347. right: 0;
  348. background: $dark-purple;
  349. color: #fff;
  350. font-size: 1.125rem;
  351. padding: 0 7px;
  352. text-decoration: none;
  353. font-weight: 600;
  354. margin: 1em 5%;
  355. cursor: pointer;
  356. &:hover{
  357. text-decoration: none;
  358. background: lighten($dark-purple, 5%);
  359. }
  360. }
  361. > span{
  362. font-size: .9rem;
  363. margin: 5px 5%;
  364. display: block;
  365. }
  366. }
  367. ul#chat{
  368. position: relative;
  369. top: 0;
  370. max-height: 300px;
  371. width: 100%;
  372. overflow-y: scroll;
  373. list-style-type: none;
  374. li{
  375. font-size: .9rem;
  376. padding: 10px;
  377. margin: 5px auto;
  378. width: 90%;
  379. border-radius: 5px;
  380. position: relative;
  381. &:before{
  382. position: absolute;
  383. content: '';
  384. top: 10px;
  385. }
  386. }
  387. li.black{
  388. background: #424242;
  389. color: #fff;
  390. }
  391. li.white{
  392. background: #fff;
  393. color: #444;
  394. }
  395. li.left:before{
  396. left: 0;
  397. margin-left: -7px;
  398. border-bottom: 7px solid transparent;
  399. border-top: 7px solid transparent;
  400. }
  401. li.black.left:before{
  402. border-right: 7px solid #424242;
  403. }
  404. li.white.left:before{
  405. border-right: 7px solid #fff;
  406. }
  407. li.right:before{
  408. right: 0;
  409. margin-right: -7px;
  410. border-bottom: 7px solid transparent;
  411. border-top: 7px solid transparent;
  412. }
  413. li.black.right:before{
  414. border-left: 7px solid #424242;
  415. }
  416. li.white.right:before{
  417. border-left: 7px solid #fff;
  418. }
  419. }
  420. #sendMessage{
  421. input{
  422. width: 100%;
  423. padding: 15px 10px;
  424. border: none;
  425. outline: none;
  426. font-size: .9rem;
  427. border: 4px solid lighten($grey, 5%);
  428. }
  429. input.black{
  430. background: #444;
  431. color: #fff;
  432. }
  433. input.white{
  434. background: #fff;
  435. color: #444;
  436. }
  437. }
  438. /* Captured pieces */
  439. #captured-pieces{
  440. position: absolute;
  441. width: 100px;
  442. margin-left: -100px;
  443. font-size: 2rem;
  444. line-height: 2rem;
  445. height: 517px;
  446. overflow-y: auto;
  447. ul{
  448. width: 50px;
  449. min-height: 5px;
  450. float: left;
  451. display: block;
  452. text-align: center;
  453. li{
  454. list-style-type: none;
  455. }
  456. }
  457. }
  458. /* Chessboard */
  459. #board_moves_wrapper {
  460. width: 100%;
  461. max-width: 800px;
  462. min-height: 600px;
  463. margin: 0 auto;
  464. }
  465. table#moves {
  466. overflow-x: hidden;
  467. overflow-y: auto;
  468. width: 270px;
  469. height: 518px;
  470. background: lighten($grey, 5%);
  471. box-shadow: inset 0 -4px $grey;
  472. margin-left: 10px;
  473. border-radius: 2px;
  474. border-bottom: 4px solid $grey;
  475. display: block;
  476. float: left;
  477. }
  478. #moves thead {
  479. font-family: 'Cherry Swash';
  480. width: 270px;
  481. height: 3em;
  482. line-height: 3em;
  483. font-size: 1.225rem;
  484. color: $dark-purple;
  485. float: left;
  486. text-align: center;
  487. }
  488. #moves thead th, #moves thead tr {
  489. width: 100%;
  490. text-align: center;
  491. float: left;
  492. }
  493. #moves tbody tr {
  494. width: 270px;
  495. float: left;
  496. }
  497. #moves tbody tr td {
  498. width: 105px;
  499. text-align: left;
  500. line-height: 20px;
  501. margin: 0 15px;
  502. float: left;
  503. }
  504. #board_wrapper {
  505. float: left;
  506. }
  507. .chess_board {
  508. border: 8px solid lighten($dark-purple, 10%);
  509. border-radius: 2px;
  510. width: 500px;
  511. height: 500px;
  512. float: left;
  513. tr {
  514. width: 500px;
  515. height: 62.5px;
  516. float: left;
  517. display: block;
  518. td {
  519. width: 62.5px;
  520. height: 62.5px;
  521. line-height: 62.5px;
  522. text-align: center;
  523. background: #fefefe;
  524. display: block;
  525. float: left;
  526. a {
  527. width: 62.5px;
  528. height: 62.5px;
  529. font-size: 3.5rem;
  530. color: #424242;
  531. text-decoration: none;
  532. display: block;
  533. }
  534. }
  535. }
  536. }
  537. .chess_board tr:nth-child(odd) td:nth-child(even),
  538. .chess_board tr:nth-child(even) td:nth-child(odd) {
  539. background: $grey; }
  540. span.feedback {
  541. color: #424242;
  542. line-height: 28px;
  543. text-indent: 28px;
  544. margin-top: 1em;
  545. display: block;
  546. clear: left;
  547. float: left;
  548. }
  549. .feedback-status {
  550. font-weight: bold;
  551. }
  552. span.whitefeedback {
  553. background: url('../images/whiteking.png') 0% 50% no-repeat;
  554. }
  555. span.blackfeedback {
  556. background: url('../images/blackking.png') 0% 50% no-repeat;
  557. }
  558. span.promotion{
  559. line-height: 28px;
  560. text-indent: 28px;
  561. margin-top: 1em;
  562. display: block;
  563. float: right;
  564. }
  565. .chess_board td.selected {
  566. background: lighten($red, 30%) !important;
  567. }
  568. /* Media queries */
  569. @media only screen and (min-width: 760px) and (max-width: 900px) {
  570. header, #board_moves_wrapper{
  571. max-width: 760px;
  572. }
  573. #sounds_label{
  574. max-width: 530px;
  575. }
  576. #container_wrapper{
  577. max-width: 900px;
  578. padding: 1em 10px;
  579. }
  580. table#moves{
  581. margin-left: 0;
  582. float: right;
  583. height: 516px;
  584. }
  585. table#moves, #moves thead, #moves tbody tr{
  586. width: 200px;
  587. }
  588. #moves tbody tr td {
  589. width: 90px;
  590. margin: 0 5px;
  591. }
  592. }
  593. @media only screen and (min-width: 1400px) {
  594. #chat-wrapper{
  595. display: block;
  596. }
  597. }
  598. @media only screen and (max-width: 999px) {
  599. #captured-pieces{
  600. display: none;
  601. }
  602. }
  603. @media only screen and (min-width: 530px) and (max-width: 759px) {
  604. header, #board_moves_wrapper, #sounds_label{
  605. max-width: 530px;
  606. }
  607. }
  608. @media only screen and (max-width: 759px){
  609. html{
  610. font-size: 14px;
  611. }
  612. #form{
  613. fieldset{
  614. width: 100%;
  615. text-align: center;
  616. label{
  617. display: block;
  618. line-height: 45px;
  619. padding-left: 0;
  620. &:before {
  621. margin-left: -7em;
  622. margin-top: 0;
  623. right: auto;
  624. }
  625. }
  626. }
  627. }
  628. span#game-type{ display: none; }
  629. #container_wrapper{
  630. max-width: 759px;
  631. padding: 1em 5px;
  632. }
  633. span.feedback{
  634. float: right;
  635. clear: none;
  636. }
  637. table#moves{
  638. margin-left: 0;
  639. margin-top: 0.5em;
  640. height: 258px;
  641. }
  642. }
  643. @media only screen and (max-width: 529px){
  644. header, #board_moves_wrapper, #sounds_label{
  645. max-width: 470px;
  646. }
  647. input.game_link{
  648. font-size: 1rem;
  649. }
  650. ul#clock{
  651. width: 118px;
  652. li{
  653. width: 55px;
  654. }
  655. }
  656. #container_wrapper{
  657. max-width: 529px;
  658. padding: 1em 5px;
  659. }
  660. .chess_board {
  661. border: 4px solid lighten($dark-purple, 10%);
  662. width: 456px;
  663. height: 456px;
  664. tr {
  665. width: 456px;
  666. height: 57px;
  667. td {
  668. width: 57px;
  669. height: 57px;
  670. line-height: 57px;
  671. a {
  672. width: 57px;
  673. height: 57px;
  674. font-size: 3.5rem;
  675. }
  676. }
  677. }
  678. }
  679. }