style.scss 13 KB

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