├── .gitattributes ├── .gitignore ├── .htaccess ├── README.md ├── assets ├── css │ ├── main.css │ └── main.min.css ├── img │ ├── dribbble.png │ ├── github.png │ └── practice.png ├── instructions.txt └── js │ ├── main.js │ └── main.min.js ├── dev ├── css │ └── main.css ├── img │ ├── dribbble.png │ ├── github.png │ └── practice.png ├── js │ └── main.js └── scss │ ├── main.scss │ ├── modules │ ├── _blocks.scss │ └── _suggestionApp.scss │ └── partials │ ├── _buttons.scss │ ├── _colors.scss │ ├── _globals.scss │ ├── _hljs.scss │ ├── _mixins.scss │ ├── _normalize.scss │ ├── _pages.scss │ └── _scrollbar.scss ├── dribbble.html ├── favicon.ico ├── github.html ├── gulpfile.js ├── index.html ├── package.json ├── random.html └── random.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | .sass-cache/ 19 | node_modules 20 | caddyfile 21 | 22 | 23 | # External tool builders 24 | .externalToolBuilders/ 25 | 26 | # Locally stored "Eclipse launch configurations" 27 | *.launch 28 | 29 | # CDT-specific 30 | .cproject 31 | 32 | # PDT-specific 33 | .buildpath 34 | 35 | 36 | ################# 37 | ## Visual Studio 38 | ################# 39 | 40 | ## Ignore Visual Studio temporary files, build results, and 41 | ## files generated by popular Visual Studio add-ons. 42 | 43 | # User-specific files 44 | *.suo 45 | *.user 46 | *.sln.docstates 47 | 48 | # Build results 49 | 50 | [Dd]ebug/ 51 | [Rr]elease/ 52 | x64/ 53 | build/ 54 | [Bb]in/ 55 | [Oo]bj/ 56 | 57 | # MSTest test Results 58 | [Tt]est[Rr]esult*/ 59 | [Bb]uild[Ll]og.* 60 | 61 | *_i.c 62 | *_p.c 63 | *.ilk 64 | *.meta 65 | *.obj 66 | *.pch 67 | *.pdb 68 | *.pgc 69 | *.pgd 70 | *.rsp 71 | *.sbr 72 | *.tlb 73 | *.tli 74 | *.tlh 75 | *.tmp 76 | *.tmp_proj 77 | *.log 78 | *.vspscc 79 | *.vssscc 80 | .builds 81 | *.pidb 82 | *.log 83 | *.scc 84 | 85 | # Visual C++ cache files 86 | ipch/ 87 | *.aps 88 | *.ncb 89 | *.opensdf 90 | *.sdf 91 | *.cachefile 92 | 93 | # Visual Studio profiler 94 | *.psess 95 | *.vsp 96 | *.vspx 97 | 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | 101 | # ReSharper is a .NET coding add-in 102 | _ReSharper*/ 103 | *.[Rr]e[Ss]harper 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | *.ncrunch* 113 | .*crunch*.local.xml 114 | 115 | # Installshield output folder 116 | [Ee]xpress/ 117 | 118 | # DocProject is a documentation generator add-in 119 | DocProject/buildhelp/ 120 | DocProject/Help/*.HxT 121 | DocProject/Help/*.HxC 122 | DocProject/Help/*.hhc 123 | DocProject/Help/*.hhk 124 | DocProject/Help/*.hhp 125 | DocProject/Help/Html2 126 | DocProject/Help/html 127 | 128 | # Click-Once directory 129 | publish/ 130 | 131 | # Publish Web Output 132 | *.Publish.xml 133 | *.pubxml 134 | 135 | # NuGet Packages Directory 136 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 137 | #packages/ 138 | 139 | # Windows Azure Build Output 140 | csx 141 | *.build.csdef 142 | 143 | # Windows Store app package directory 144 | AppPackages/ 145 | 146 | # Others 147 | sql/ 148 | *.Cache 149 | ClientBin/ 150 | [Ss]tyle[Cc]op.* 151 | ~$* 152 | *~ 153 | *.dbmdl 154 | *.[Pp]ublish.xml 155 | *.pfx 156 | *.publishsettings 157 | 158 | # RIA/Silverlight projects 159 | Generated_Code/ 160 | 161 | # Backup & report files from converting an old project file to a newer 162 | # Visual Studio version. Backup files are not needed, because we have git ;-) 163 | _UpgradeReport_Files/ 164 | Backup*/ 165 | UpgradeLog*.XML 166 | UpgradeLog*.htm 167 | 168 | # SQL Server files 169 | App_Data/*.mdf 170 | App_Data/*.ldf 171 | 172 | ############# 173 | ## Windows detritus 174 | ############# 175 | 176 | # Windows image file caches 177 | Thumbs.db 178 | ehthumbs.db 179 | 180 | # Folder config file 181 | Desktop.ini 182 | 183 | # Recycle Bin used on file shares 184 | $RECYCLE.BIN/ 185 | 186 | # Mac crap 187 | .DS_Store 188 | 189 | 190 | ############# 191 | ## Python 192 | ############# 193 | 194 | *.py[co] 195 | 196 | # Packages 197 | *.egg 198 | *.egg-info 199 | dist/ 200 | build/ 201 | eggs/ 202 | parts/ 203 | var/ 204 | sdist/ 205 | develop-eggs/ 206 | .installed.cfg 207 | 208 | # Installer logs 209 | pip-log.txt 210 | 211 | # Unit test / coverage reports 212 | .coverage 213 | .tox 214 | 215 | #Translations 216 | *.mo 217 | 218 | #Mr Developer 219 | .mr.developer.cfg 220 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteCond %{REQUEST_FILENAME} !-f 3 | RewriteRule ^([^\.]+)$ $1.html [NC,L] 4 | 5 | 6 | mod_gzip_on Yes 7 | mod_gzip_dechunk Yes 8 | mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ 9 | mod_gzip_item_include handler ^cgi-script$ 10 | mod_gzip_item_include mime ^text/.* 11 | mod_gzip_item_include mime ^application/x-javascript.* 12 | mod_gzip_item_exclude mime ^image/.* 13 | mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Practice App 2 | ======== 3 | 4 | Get inspiration, build something on codepen 5 | 6 | [Random](http://tevko.github.io/practice/random.html) - the latest in web technologies, 20 new items every week 7 | 8 | [Dribbble](http://tevko.github.io/practice/dribbble.html) - See a random dribbble shot, go to codepen, convert it to code 9 | 10 | [Github](http://tevko.github.io/practice/github.html) - Solve a random open Github issue 11 | 12 | ## Changelog 13 | 14 | **V 2.1.0** 15 | 16 | Syntax highlighting added with highlight.js using the solarized dark theme 17 | 18 | ## Contributing 19 | 20 | Clone repo, NPM install, then run [Gulp](http://gulpjs.com/). Super simple if you use Gulp. Also SASS. 21 | -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: sans-serif; 3 | /* 1 */ 4 | -ms-text-size-adjust: 100%; 5 | /* 2 */ 6 | -webkit-text-size-adjust: 100%; 7 | /* 2 */ } 8 | 9 | body { 10 | margin: 0; } 11 | 12 | article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { 13 | display: block; } 14 | 15 | audio, canvas, progress, video { 16 | display: inline-block; 17 | /* 1 */ 18 | vertical-align: baseline; 19 | /* 2 */ } 20 | 21 | audio:not([controls]) { 22 | display: none; 23 | height: 0; } 24 | 25 | [hidden], template { 26 | display: none; } 27 | 28 | a { 29 | background: transparent; } 30 | 31 | a:active, a:hover { 32 | outline: 0; } 33 | 34 | abbr[title] { 35 | border-bottom: 1px dotted; } 36 | 37 | b, strong { 38 | font-weight: bold; } 39 | 40 | dfn { 41 | font-style: italic; } 42 | 43 | h1 { 44 | font-size: 2em; 45 | margin: 0.67em 0; } 46 | 47 | mark { 48 | background: #ff0; 49 | color: #000; } 50 | 51 | small { 52 | font-size: 80%; } 53 | 54 | sub, sup { 55 | font-size: 75%; 56 | line-height: 0; 57 | position: relative; 58 | vertical-align: baseline; } 59 | 60 | sup { 61 | top: -0.5em; } 62 | 63 | sub { 64 | bottom: -0.25em; } 65 | 66 | img { 67 | border: 0; } 68 | 69 | svg:not(:root) { 70 | overflow: hidden; } 71 | 72 | figure { 73 | margin: 1em 40px; } 74 | 75 | hr { 76 | -moz-box-sizing: content-box; 77 | -webkit-box-sizing: content-box; 78 | box-sizing: content-box; 79 | height: 0; } 80 | 81 | pre { 82 | overflow: auto; } 83 | 84 | code, kbd, pre, samp { 85 | font-family: monospace, monospace; 86 | font-size: 1em; } 87 | 88 | button, input, optgroup, select, textarea { 89 | color: inherit; 90 | /* 1 */ 91 | font: inherit; 92 | /* 2 */ 93 | margin: 0; 94 | /* 3 */ } 95 | 96 | button { 97 | overflow: visible; } 98 | 99 | button, select { 100 | text-transform: none; } 101 | 102 | button, html input[type="button"], input[type="reset"], input[type="submit"] { 103 | -webkit-appearance: button; 104 | /* 2 */ 105 | cursor: pointer; 106 | /* 3 */ } 107 | 108 | button[disabled], html input[disabled] { 109 | cursor: default; } 110 | 111 | button::-moz-focus-inner, input::-moz-focus-inner { 112 | border: 0; 113 | padding: 0; } 114 | 115 | input { 116 | line-height: normal; } 117 | 118 | input[type="checkbox"], input[type="radio"] { 119 | -webkit-box-sizing: border-box; 120 | -moz-box-sizing: border-box; 121 | box-sizing: border-box; 122 | /* 1 */ 123 | padding: 0; 124 | /* 2 */ } 125 | 126 | input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { 127 | height: auto; } 128 | 129 | input[type="search"] { 130 | -webkit-appearance: textfield; 131 | /* 1 */ 132 | -moz-box-sizing: content-box; 133 | -webkit-box-sizing: content-box; 134 | /* 2 */ 135 | box-sizing: content-box; } 136 | 137 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { 138 | -webkit-appearance: none; } 139 | 140 | fieldset { 141 | border: 1px solid #c0c0c0; 142 | margin: 0 2px; 143 | padding: 0.35em 0.625em 0.75em; } 144 | 145 | legend { 146 | border: 0; 147 | /* 1 */ 148 | padding: 0; 149 | /* 2 */ } 150 | 151 | textarea { 152 | overflow: auto; } 153 | 154 | optgroup { 155 | font-weight: bold; } 156 | 157 | table { 158 | border-collapse: collapse; 159 | border-spacing: 0; } 160 | 161 | td, th { 162 | padding: 0; } 163 | 164 | *, *:before, *:after { 165 | -webkit-box-sizing: border-box; 166 | -moz-box-sizing: border-box; 167 | box-sizing: border-box; } 168 | 169 | body, html { 170 | overflow-x: hidden; 171 | height: 100%; 172 | font-family: 'Open Sans', sans-serif; } 173 | 174 | .wrap { 175 | max-width: 1200px; 176 | padding: 0 1em; } 177 | 178 | .group:after { 179 | content: ""; 180 | display: table; 181 | clear: both; } 182 | 183 | .pageContent { 184 | position: relative; 185 | word-break: break-word; } 186 | 187 | .main-header { 188 | padding: 1em; 189 | color: white; 190 | background-color: #333; 191 | position: absolute; 192 | width: 100%; 193 | z-index: 999; } 194 | .main-header p { 195 | padding-top: 10px; 196 | margin: 0; 197 | display: inline-block; } 198 | .main-header a { 199 | float: right; 200 | color: white; 201 | padding: 10px; 202 | border: solid 1px white; 203 | text-decoration: none; } 204 | .main-header a.attribution { 205 | float: none; 206 | padding: 0; 207 | border: none; } 208 | .main-header a:nth-of-type(1) { 209 | margin-left: 1em; } 210 | .main-header.home { 211 | position: relative; } 212 | 213 | .items-notice { 214 | width: 100%; 215 | background-color: orange; 216 | color: white; 217 | text-align: center; 218 | font-size: 0em; 219 | padding: 1em; 220 | position: absolute; 221 | z-index: 5; 222 | opacity: 0; 223 | -webkit-transition: .25s ease opacity; 224 | transition: .25s ease opacity; } 225 | 226 | .items-notice_show { 227 | display: block; 228 | font-size: 2em; 229 | margin-top: 76px; 230 | opacity: 1; } 231 | 232 | .btn { 233 | font-size: .5em; 234 | text-decoration: none; 235 | color: white; 236 | padding: 1em; 237 | border: solid white; 238 | background-color: transparent; 239 | outline: none; 240 | display: inline-block; } 241 | 242 | article a { 243 | color: white; 244 | text-decoration: none; 245 | font-style: italic; } 246 | article a:hover { 247 | text-decoration: underline; } 248 | 249 | form { 250 | display: inline-block; 251 | margin-left: 1em; } 252 | form input { 253 | background-color: transparent; 254 | padding: 0; 255 | outline: none; 256 | border: none; } 257 | 258 | .ps-container .ps-scrollbar-x-rail { 259 | position: absolute; 260 | /* please don't change 'position' */ 261 | bottom: 3px; 262 | /* there must be 'bottom' for ps-scrollbar-x-rail */ 263 | height: 8px; 264 | border-radius: 4px; 265 | opacity: 0; 266 | filter: alpha(opacity=0); 267 | -webkit-transition: background-color .2s linear, opacity .2s linear; 268 | transition: background-color .2s linear, opacity .2s linear; } 269 | 270 | .ps-container:hover .ps-scrollbar-x-rail, .ps-container.hover .ps-scrollbar-x-rail { 271 | opacity: 0.6; 272 | filter: alpha(opacity=60); } 273 | 274 | .ps-container .ps-scrollbar-x-rail:hover, .ps-container .ps-scrollbar-x-rail.hover { 275 | background-color: #eee; 276 | opacity: 0.9; 277 | filter: alpha(opacity=90); } 278 | 279 | .ps-container .ps-scrollbar-x-rail.in-scrolling { 280 | background-color: #eee; 281 | opacity: 0.9; 282 | filter: alpha(opacity=90); } 283 | 284 | .ps-container .ps-scrollbar-y-rail { 285 | position: absolute; 286 | /* please don't change 'position' */ 287 | right: 3px; 288 | /* there must be 'right' for ps-scrollbar-y-rail */ 289 | width: 8px; 290 | border-radius: 4px; 291 | opacity: 0; 292 | filter: alpha(opacity=0); 293 | -webkit-transition: background-color .2s linear, opacity .2s linear; 294 | transition: background-color .2s linear, opacity .2s linear; } 295 | 296 | .ps-container:hover .ps-scrollbar-y-rail, .ps-container.hover .ps-scrollbar-y-rail { 297 | opacity: 0.6; 298 | filter: alpha(opacity=60); } 299 | 300 | .ps-container .ps-scrollbar-y-rail:hover, .ps-container .ps-scrollbar-y-rail.hover { 301 | background-color: #eee; 302 | opacity: 0.9; 303 | filter: alpha(opacity=90); } 304 | 305 | .ps-container .ps-scrollbar-y-rail.in-scrolling { 306 | background-color: #eee; 307 | opacity: 0.9; 308 | filter: alpha(opacity=90); } 309 | 310 | .ps-container .ps-scrollbar-x { 311 | position: absolute; 312 | /* please don't change 'position' */ 313 | bottom: 0; 314 | /* there must be 'bottom' for ps-scrollbar-x */ 315 | height: 8px; 316 | background-color: #aaa; 317 | border-radius: 4px; 318 | -webkit-transition: background-color .2s linear; 319 | transition: background-color .2s linear; } 320 | 321 | .ps-container.ie6 .ps-scrollbar-x { 322 | font-size: 0; 323 | /* fixed scrollbar height in xp sp3 ie6 */ } 324 | 325 | .ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x, .ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x { 326 | background-color: #999; } 327 | 328 | .ps-container .ps-scrollbar-y { 329 | position: absolute; 330 | /* please don't change 'position' */ 331 | right: 0; 332 | /* there must be 'right' for ps-scrollbar-y */ 333 | width: 8px; 334 | background-color: #aaa; 335 | border-radius: 4px; 336 | -webkit-transition: background-color .2s linear; 337 | transition: background-color .2s linear; } 338 | 339 | .ps-container.ie6 .ps-scrollbar-y { 340 | font-size: 0; 341 | /* fixed scrollbar height in xp sp3 ie6 */ } 342 | 343 | .ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y, .ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y { 344 | background-color: #999; } 345 | 346 | .ps-container.ie .ps-scrollbar-x, .ps-container.ie .ps-scrollbar-y { 347 | visibility: hidden; } 348 | 349 | .ps-container.ie:hover .ps-scrollbar-x, .ps-container.ie:hover .ps-scrollbar-y, .ps-container.ie.hover .ps-scrollbar-x, .ps-container.ie.hover .ps-scrollbar-y { 350 | visibility: visible; } 351 | 352 | /* 353 | 354 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 355 | 356 | */ 357 | .hljs { 358 | display: block; 359 | overflow-x: auto; 360 | padding: 0.5em; 361 | background: #002b36; 362 | color: #839496; 363 | -webkit-text-size-adjust: none; } 364 | 365 | .hljs-comment, .hljs-template_comment, .diff .hljs-header, .hljs-doctype, .hljs-pi, .lisp .hljs-string, .hljs-javadoc { 366 | color: #586e75; } 367 | 368 | /* Solarized Green */ 369 | .hljs-keyword, .hljs-winutils, .method, .hljs-addition, .css .hljs-tag, .hljs-request, .hljs-status, .nginx .hljs-title { 370 | color: #859900; } 371 | 372 | /* Solarized Cyan */ 373 | .hljs-number, .hljs-command, .hljs-string, .hljs-tag .hljs-value, .hljs-rules .hljs-value, .hljs-phpdoc, .hljs-dartdoc, .tex .hljs-formula, .hljs-regexp, .hljs-hexcolor, .hljs-link_url { 374 | color: #2aa198; } 375 | 376 | /* Solarized Blue */ 377 | .hljs-title, .hljs-localvars, .hljs-chunk, .hljs-decorator, .hljs-built_in, .hljs-identifier, .vhdl .hljs-literal, .hljs-id, .css .hljs-function { 378 | color: #268bd2; } 379 | 380 | /* Solarized Yellow */ 381 | .hljs-attribute, .hljs-variable, .lisp .hljs-body, .smalltalk .hljs-number, .hljs-constant, .hljs-class .hljs-title, .hljs-parent, .hljs-type, .hljs-link_reference { 382 | color: #b58900; } 383 | 384 | /* Solarized Orange */ 385 | .hljs-preprocessor, .hljs-preprocessor .hljs-keyword, .hljs-pragma, .hljs-shebang, .hljs-symbol, .hljs-symbol .hljs-string, .diff .hljs-change, .hljs-special, .hljs-attr_selector, .hljs-subst, .hljs-cdata, .css .hljs-pseudo, .hljs-header { 386 | color: #cb4b16; } 387 | 388 | /* Solarized Red */ 389 | .hljs-deletion, .hljs-important { 390 | color: #dc322f; } 391 | 392 | /* Solarized Violet */ 393 | .hljs-link_label { 394 | color: #6c71c4; } 395 | 396 | .tex .hljs-formula { 397 | background: #073642; } 398 | 399 | .block-container { 400 | height: 100%; 401 | width: 100%; } 402 | .block-container.home { 403 | height: 93.7%; } 404 | .block-container.home a { 405 | text-decoration: none; } 406 | 407 | .block-random, .block-dribbble, .block-github { 408 | height: 33.33%; 409 | display: table; 410 | width: 100%; 411 | color: white; } 412 | .block-random:hover, .block-dribbble:hover, .block-github:hover { 413 | background-repeat: no-repeat; } 414 | .block-random .btn, .block-dribbble .btn, .block-github .btn { 415 | -webkit-transition: .2s ease; 416 | transition: .2s ease; } 417 | .block-random .btn:hover, .block-dribbble .btn:hover, .block-github .btn:hover { 418 | background-color: #c7c7c7; } 419 | 420 | .block-content { 421 | display: table-cell; 422 | vertical-align: middle; 423 | text-align: center; 424 | font-size: 2em; 425 | -webkit-transition: .25s linear; 426 | transition: .25s linear; 427 | font-family: 'Open Sans', sans-serif; } 428 | .block-content:hover { 429 | cursor: pointer; 430 | background-color: rgba(0, 0, 0, 0.44); 431 | -webkit-transform: translateX(20%); 432 | -ms-transform: translateX(20%); 433 | transform: translateX(20%); } 434 | 435 | .block-random { 436 | background-color: #262642; } 437 | .block-random:hover { 438 | background-image: url("../../assets/img/practice.png"); } 439 | .block-random .progress { 440 | background-color: #F89406; 441 | height: 5px; 442 | -webkit-transition: .5s ease; 443 | transition: .5s ease; 444 | position: fixed; 445 | top: 75px; 446 | left: 0; } 447 | .block-random .suggestionApp-level { 448 | display: block; 449 | margin: 0 auto; 450 | max-width: 220px; 451 | margin-top: 1.5em; 452 | padding: 10px; } 453 | 454 | .block-dribbble { 455 | background-color: #de467f; } 456 | .block-dribbble:hover { 457 | background-image: url("../../assets/img/dribbble.png"); } 458 | 459 | .block-github { 460 | background-color: #4183c4; } 461 | .block-github:hover { 462 | background-image: url("../../assets/img/github.png"); } 463 | 464 | .block-container-single { 465 | height: 100%; } 466 | .block-container-single .block-content:hover { 467 | cursor: inherit; 468 | background-color: transparent; 469 | -webkit-transform: translateX(0); 470 | -ms-transform: translateX(0); 471 | transform: translateX(0); } 472 | .block-container-single .block-random:hover, .block-container-single .block-dribbble:hover, .block-container-single .block-github:hover { 473 | background-image: none; } 474 | .block-container-single .block-random, .block-container-single .block-dribbble, .block-container-single .block-github { 475 | height: 100%; } 476 | 477 | .block-dribbble .suggestionApp { 478 | background-color: transparent; } 479 | .block-dribbble .suggestionApp-prompts { 480 | margin-top: 1em; } 481 | .block-dribbble img { 482 | max-width: 100%; } 483 | 484 | .suggestionApp-languages { 485 | color: gray; 486 | margin: 1em 0; } 487 | 488 | .block-github code { 489 | width: 95%; } 490 | .block-github pre { 491 | overflow: visible; } 492 | .block-github .suggestionApp { 493 | background-color: transparent; 494 | padding-top: 3em; } 495 | .block-github .suggestionApp-content { 496 | font-size: .75em; 497 | text-align: left; 498 | max-width: 1200px; 499 | word-break: break-word; } 500 | .block-github .suggestionApp-content img { 501 | max-width: 100%; } 502 | .block-github .suggestionApp-prompts { 503 | margin-bottom: 1em; } 504 | 505 | .content-holder { 506 | position: relative; 507 | overflow: hidden; 508 | max-height: 600px; } 509 | 510 | .suggestionApp { 511 | max-width: 75%; 512 | margin: 0 auto; } 513 | -------------------------------------------------------------------------------- /assets/css/main.min.css: -------------------------------------------------------------------------------- 1 | html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body,html{overflow-x:hidden;height:100%;font-family:'Open Sans',sans-serif}.wrap{max-width:1200px;padding:0 1em}.group:after{content:"";display:table;clear:both}.pageContent{position:relative;word-break:break-word}.main-header{padding:1em;color:#fff;background-color:#333;position:absolute;width:100%;z-index:999}.main-header p{padding-top:10px;margin:0;display:inline-block}.main-header a{float:right;color:#fff;padding:10px;border:1px solid #fff;text-decoration:none}.main-header a.attribution{float:none;padding:0;border:none}.main-header a:nth-of-type(1){margin-left:1em}.main-header.home{position:relative}.items-notice{width:100%;background-color:orange;color:#fff;text-align:center;font-size:0;padding:1em;position:absolute;z-index:5;opacity:0;-webkit-transition:.25s ease opacity;transition:.25s ease opacity}.items-notice_show{display:block;font-size:2em;margin-top:76px;opacity:1}.btn{font-size:.5em;text-decoration:none;color:#fff;padding:1em;border:solid #fff;background-color:transparent;outline:0;display:inline-block}article a{color:#fff;text-decoration:none;font-style:italic}article a:hover{text-decoration:underline}form{display:inline-block;margin-left:1em}form input{background-color:transparent;padding:0;outline:0;border:none}.ps-container .ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-webkit-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container.hover .ps-scrollbar-x-rail,.ps-container:hover .ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-x-rail.hover,.ps-container .ps-scrollbar-x-rail.in-scrolling,.ps-container .ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-y-rail{position:absolute;right:3px;width:8px;border-radius:4px;opacity:0;filter:alpha(opacity=0);-webkit-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container.hover .ps-scrollbar-y-rail,.ps-container:hover .ps-scrollbar-y-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-y-rail.hover,.ps-container .ps-scrollbar-y-rail.in-scrolling,.ps-container .ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x{position:absolute;bottom:0;height:8px;background-color:#aaa;border-radius:4px;-webkit-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-x{font-size:0}.ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x,.ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x{background-color:#999}.ps-container .ps-scrollbar-y{position:absolute;right:0;width:8px;background-color:#aaa;border-radius:4px;-webkit-transition:background-color .2s linear;transition:background-color .2s linear}.ps-container.ie6 .ps-scrollbar-y{font-size:0}.ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y,.ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y{background-color:#999}.ps-container.ie .ps-scrollbar-x,.ps-container.ie .ps-scrollbar-y{visibility:hidden}.ps-container.ie.hover .ps-scrollbar-x,.ps-container.ie.hover .ps-scrollbar-y,.ps-container.ie:hover .ps-scrollbar-x,.ps-container.ie:hover .ps-scrollbar-y{visibility:visible}.hljs{display:block;overflow-x:auto;padding:.5em;background:#002b36;color:#839496;-webkit-text-size-adjust:none}.diff .hljs-header,.hljs-comment,.hljs-doctype,.hljs-javadoc,.hljs-pi,.hljs-template_comment,.lisp .hljs-string{color:#586e75}.css .hljs-tag,.hljs-addition,.hljs-keyword,.hljs-request,.hljs-status,.hljs-winutils,.method,.nginx .hljs-title{color:#859900}.hljs-command,.hljs-dartdoc,.hljs-hexcolor,.hljs-link_url,.hljs-number,.hljs-phpdoc,.hljs-regexp,.hljs-rules .hljs-value,.hljs-string,.hljs-tag .hljs-value,.tex .hljs-formula{color:#2aa198}.css .hljs-function,.hljs-built_in,.hljs-chunk,.hljs-decorator,.hljs-id,.hljs-identifier,.hljs-localvars,.hljs-title,.vhdl .hljs-literal{color:#268bd2}.hljs-attribute,.hljs-class .hljs-title,.hljs-constant,.hljs-link_reference,.hljs-parent,.hljs-type,.hljs-variable,.lisp .hljs-body,.smalltalk .hljs-number{color:#b58900}.css .hljs-pseudo,.diff .hljs-change,.hljs-attr_selector,.hljs-cdata,.hljs-header,.hljs-pragma,.hljs-preprocessor,.hljs-preprocessor .hljs-keyword,.hljs-shebang,.hljs-special,.hljs-subst,.hljs-symbol,.hljs-symbol .hljs-string{color:#cb4b16}.hljs-deletion,.hljs-important{color:#dc322f}.hljs-link_label{color:#6c71c4}.tex .hljs-formula{background:#073642}.block-container{height:100%;width:100%}.block-container.home{height:93.7%}.block-container.home a{text-decoration:none}.block-dribbble,.block-github,.block-random{height:33.33%;display:table;width:100%;color:#fff}.block-dribbble:hover,.block-github:hover,.block-random:hover{background-repeat:no-repeat}.block-dribbble .btn,.block-github .btn,.block-random .btn{-webkit-transition:.2s ease;transition:.2s ease}.block-dribbble .btn:hover,.block-github .btn:hover,.block-random .btn:hover{background-color:#c7c7c7}.block-content{display:table-cell;vertical-align:middle;text-align:center;font-size:2em;-webkit-transition:.25s linear;transition:.25s linear;font-family:'Open Sans',sans-serif}.block-content:hover{cursor:pointer;background-color:rgba(0,0,0,.44);-webkit-transform:translateX(20%);-ms-transform:translateX(20%);transform:translateX(20%)}.block-random{background-color:#262642}.block-random:hover{background-image:url(../../assets/img/practice.png)}.block-random .progress{background-color:#F89406;height:5px;-webkit-transition:.5s ease;transition:.5s ease;position:fixed;top:75px;left:0}.block-random .suggestionApp-level{display:block;margin:1.5em auto 0;max-width:220px;padding:10px}.block-dribbble{background-color:#de467f}.block-dribbble:hover{background-image:url(../../assets/img/dribbble.png)}.block-github{background-color:#4183c4}.block-github:hover{background-image:url(../../assets/img/github.png)}.block-container-single{height:100%}.block-container-single .block-content:hover{cursor:inherit;background-color:transparent;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.block-container-single .block-dribbble:hover,.block-container-single .block-github:hover,.block-container-single .block-random:hover{background-image:none}.block-container-single .block-dribbble,.block-container-single .block-github,.block-container-single .block-random{height:100%}.block-dribbble .suggestionApp{background-color:transparent}.block-dribbble .suggestionApp-prompts{margin-top:1em}.block-dribbble img{max-width:100%}.suggestionApp-languages{color:gray;margin:1em 0}.block-github code{width:95%}.block-github pre{overflow:visible}.block-github .suggestionApp{background-color:transparent;padding-top:3em}.block-github .suggestionApp-content{font-size:.75em;text-align:left;max-width:1200px;word-break:break-word}.block-github .suggestionApp-content img{max-width:100%}.block-github .suggestionApp-prompts{margin-bottom:1em}.content-holder{position:relative;overflow:hidden;max-height:600px}.suggestionApp{max-width:75%;margin:0 auto} -------------------------------------------------------------------------------- /assets/img/dribbble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/assets/img/dribbble.png -------------------------------------------------------------------------------- /assets/img/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/assets/img/github.png -------------------------------------------------------------------------------- /assets/img/practice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/assets/img/practice.png -------------------------------------------------------------------------------- /assets/instructions.txt: -------------------------------------------------------------------------------- 1 | add css, img, and js folders -------------------------------------------------------------------------------- /assets/js/main.js: -------------------------------------------------------------------------------- 1 | var ACTION_SELECTOR = '.suggestionApp-action'; 2 | var CONTENT_WRAPPER_SELECTOR = '.suggestionApp-content'; 3 | var FORM_SELECTOR = '.suggestionApp-prompts form'; 4 | var NOTICE_SELECTOR = '.items-notice'; 5 | var HIDDEN_INPUT_SELECTOR = '.hiddenInput'; 6 | 7 | var utils = (function () { 8 | 'use strict'; 9 | 10 | var random_number = function (min, max) { 11 | return Math.floor(Math.random() * (max - min + 1)) + min; 12 | }; 13 | 14 | var range = function (begin, end) { 15 | var range = []; 16 | var delta = begin < end ? 1 : -1; 17 | for (var index = begin; index <= end; index += delta) { 18 | range.push(index); 19 | } 20 | return range; 21 | }; 22 | 23 | var display_message = function (message) { 24 | var show_class = 'items-notice_show'; 25 | 26 | $(NOTICE_SELECTOR).html(message); 27 | $(NOTICE_SELECTOR).removeClass(show_class); 28 | $(NOTICE_SELECTOR).addClass(show_class); 29 | setTimeout(function () { 30 | $(NOTICE_SELECTOR).removeClass(show_class); 31 | }, 4000); 32 | }; 33 | 34 | var get_value = function (parent, child) { 35 | return ((parent && parent[child]) || ''); 36 | }; 37 | 38 | var get_json = function (url, params) { 39 | return JSON.parse( 40 | $.ajax({ 41 | type: 'GET', 42 | url: url, 43 | dataType: 'json', 44 | global: false, 45 | async: false, 46 | data: params, 47 | success: function (data) { 48 | return data; 49 | } 50 | }).responseText 51 | ); 52 | }; 53 | 54 | return { 55 | random_number: random_number, 56 | range: range, 57 | display_message: display_message, 58 | get_json: get_json, 59 | get_value: get_value 60 | }; 61 | }()); 62 | 63 | var random = (function () { 64 | 'use strict'; 65 | 66 | var data = {}; 67 | var counter = 0; 68 | var $notice = $(NOTICE_SELECTOR); 69 | var total = $notice.data('total'); 70 | var message = $notice.data('message') || ''; 71 | message = message.replace(/\#\{total\}/g, total); 72 | var LEVEL_SELECTOR = '.suggestionApp-level'; 73 | var LEVELS = { 74 | 'Advanced': 'rgb(138, 44, 44)', 75 | 'Intermediate': 'rgb(170, 170, 28)', 76 | 'Easy': 'rgb(31, 145, 36)' 77 | }; 78 | 79 | var get_data = function () { 80 | var jsonUrl = 'random.json'; 81 | data = utils.get_json(jsonUrl, {}); 82 | }; 83 | 84 | var render_item = function () { 85 | var item = data[counter]; 86 | var $text = $('

', { 87 | text: item.value 88 | }); 89 | $(CONTENT_WRAPPER_SELECTOR).html($text); 90 | $(LEVEL_SELECTOR).text(item.Difficulty); 91 | 92 | if (counter === (total - 1)) { 93 | utils.display_message(message); 94 | } 95 | $.each(LEVELS, function (level, color) { 96 | if (level === $(LEVEL_SELECTOR).text()) { 97 | $(LEVEL_SELECTOR).css('background-color', color); 98 | } 99 | }); 100 | 101 | $(HIDDEN_INPUT_SELECTOR).attr('value', '{ 102 | "title": "New Pen from The Practice App!", 103 | "html": "" 104 | }'); 105 | var progress_percentage = ((100 / total) * counter) + '%'; 106 | $('.progress').css('width', progress_percentage); 107 | }; 108 | 109 | var setup_bindings = function () { 110 | $(ACTION_SELECTOR).on('click', function () { 111 | counter = (counter + 1) % total; 112 | render_item(); 113 | }); 114 | Mousetrap.bind('right', function () { 115 | $(ACTION_SELECTOR).trigger('click'); 116 | }); 117 | Mousetrap.bind('enter', function () { 118 | $(FORM_SELECTOR).trigger('submit'); 119 | }); 120 | }; 121 | 122 | var init = function () { 123 | get_data(); 124 | render_item(); 125 | setup_bindings(); 126 | }; 127 | 128 | return { 129 | init: init 130 | }; 131 | }()); 132 | 133 | var dribbble = (function () { 134 | 'use strict'; 135 | 136 | var data = {}; 137 | var counter = 0; 138 | var total = 11; 139 | 140 | var get_data = function () { 141 | var jsonUrl = 'https://api.dribbble.com/v1/shots/'; 142 | var randomPage = utils.random_number(1, 29); 143 | data = utils.get_json(jsonUrl, { 144 | page: randomPage, 145 | access_token: '6ed972085fecb7078ef53a3056562c05de38514ebd7d095b6a84f6dba7743031' 146 | }); 147 | }; 148 | 149 | var render_shot = function () { 150 | if (counter > (total - 1) || (counter === 0)) { 151 | get_data(); 152 | } 153 | $(CONTENT_WRAPPER_SELECTOR).empty(); 154 | var shot = data[counter]; 155 | 156 | var $image = $('', { 157 | src: shot.images.normal 158 | }); 159 | var $br = $('
'); 160 | var $link = $('', { 161 | href: shot.html_url, 162 | text: shot.user.name, 163 | target: '_blank' 164 | }); 165 | var $name = $('

', { 166 | text: shot.title + ' by ' 167 | }); 168 | $name.append($link); 169 | 170 | $(CONTENT_WRAPPER_SELECTOR).append($image, $br, $name); 171 | 172 | $(HIDDEN_INPUT_SELECTOR).attr('value', '{ 173 | "title": "New Pen from The Practice App!", 174 | "html": "" 175 | }'); 176 | }; 177 | 178 | var setup_bindings = function () { 179 | $(ACTION_SELECTOR).on('click', function () { 180 | counter = (counter + 1) % total; 181 | render_shot(); 182 | }); 183 | 184 | Mousetrap.bind('right', function () { 185 | counter = (counter + 1) % total; 186 | render_shot(); 187 | }); 188 | 189 | Mousetrap.bind('enter', function () { 190 | $(FORM_SELECTOR).trigger('submit'); 191 | }); 192 | }; 193 | 194 | var init = function () { 195 | render_shot(); 196 | setup_bindings(); 197 | }; 198 | 199 | return { 200 | init: init 201 | }; 202 | }()); 203 | 204 | 205 | var github = (function () { 206 | 'use strict'; 207 | 208 | var data = {}; 209 | var LANGUAGE_SELECTOR = '#language-select'; 210 | var CONTENT_HOLDER_SELECTOR = '.content-holder'; 211 | var counter = 0; 212 | var total = $(NOTICE_SELECTOR).data('total'); 213 | var randomPages = utils.range(0, total).sort(function () { return Math.random() - 0.5 }); 214 | var pageCounter = 0; 215 | var message = $(NOTICE_SELECTOR).data('message'); 216 | 217 | var get_data = function () { 218 | var language = $(LANGUAGE_SELECTOR).val(); 219 | var jsonUrl = 'https://api.github.com/search/issues?q=language:' + encodeURIComponent(language) + '+state:open&page=' + randomPages[pageCounter]; 220 | pageCounter = (pageCounter + 1) % total; 221 | data = utils.get_json(jsonUrl, {}); 222 | data.items.sort(function () { return Math.random() - 0.5 }); 223 | }; 224 | 225 | var render_issue = function () { 226 | if ((counter > (total - 1)) || (counter === 0)) { 227 | get_data(); 228 | } 229 | var issue = data.items[counter]; 230 | var $title = $('

', { 231 | text: utils.get_value(issue, 'title') 232 | }); 233 | var $body = $(marked(utils.get_value(issue, 'body'))); 234 | var $timestamp = $('

', { 235 | text: utils.get_value(issue, 'created_at') 236 | }); 237 | 238 | $(CONTENT_WRAPPER_SELECTOR) 239 | .html($body) 240 | .prepend($title) 241 | .append($timestamp); 242 | 243 | if (utils.get_value(issue, 'pull_request') !== '') { 244 | var $pull_request = $('

', { 245 | html: marked('Current pull request: ' + issue.pull_request.html_url) 246 | }); 247 | $(CONTENT_WRAPPER_SELECTOR).append($pull_request); 248 | } 249 | $('#solve').attr('href', utils.get_value(issue, 'html_url')); 250 | 251 | $(CONTENT_HOLDER_SELECTOR) 252 | .scrollTop(0) 253 | .perfectScrollbar('update'); 254 | 255 | $(CONTENT_WRAPPER_SELECTOR).find('code').each(function (i, el) { 256 | hljs.highlightBlock(el); 257 | }); 258 | }; 259 | 260 | var setup_bindings = function () { 261 | $(LANGUAGE_SELECTOR).on('change', function () { 262 | get_data(); 263 | render_issue(); 264 | }); 265 | 266 | $(ACTION_SELECTOR).on('click', function () { 267 | counter = (counter + 1) % total; 268 | render_issue(); 269 | }); 270 | 271 | Mousetrap.bind('right', function () { 272 | $(ACTION_SELECTOR).trigger('click'); 273 | }); 274 | 275 | Mousetrap.bind('enter', function () { 276 | $('#solve').trigger('click'); 277 | }); 278 | }; 279 | 280 | var init = function () { 281 | utils.display_message(message); 282 | render_issue(); 283 | setup_bindings(); 284 | }; 285 | 286 | return { 287 | init: init 288 | }; 289 | }()); 290 | 291 | var core = (function () { 292 | 'use strict'; 293 | 294 | var init = function () { 295 | $(ACTION_SELECTOR).on('click', function (event) { 296 | event.preventDefault(); 297 | }); 298 | 299 | switch ($('article').attr('class')) { 300 | case 'block-random': 301 | random.init(); 302 | break; 303 | case 'block-dribbble': 304 | dribbble.init(); 305 | break; 306 | case 'block-github': 307 | github.init(); 308 | break; 309 | } 310 | }; 311 | 312 | return { 313 | init: init 314 | }; 315 | }()); 316 | 317 | core.init(); 318 | -------------------------------------------------------------------------------- /assets/js/main.min.js: -------------------------------------------------------------------------------- 1 | var ACTION_SELECTOR=".suggestionApp-action",CONTENT_WRAPPER_SELECTOR=".suggestionApp-content",FORM_SELECTOR=".suggestionApp-prompts form",NOTICE_SELECTOR=".items-notice",HIDDEN_INPUT_SELECTOR=".hiddenInput",utils=function(){"use strict";var t=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},e=function(t,e){for(var n=[],r=e>t?1:-1,i=t;e>=i;i+=r)n.push(i);return n},n=function(t){var e="items-notice_show";$(NOTICE_SELECTOR).html(t),$(NOTICE_SELECTOR).removeClass(e),$(NOTICE_SELECTOR).addClass(e),setTimeout(function(){$(NOTICE_SELECTOR).removeClass(e)},4e3)},r=function(t,e){return t&&t[e]||""},i=function(t,e){return JSON.parse($.ajax({type:"GET",url:t,dataType:"json",global:!1,async:!1,data:e,success:function(t){return t}}).responseText)};return{random_number:t,range:e,display_message:n,get_json:i,get_value:r}}(),random=function(){"use strict";var t={},e=0,n=$(NOTICE_SELECTOR),r=n.data("total"),i=n.data("message")||"";i=i.replace(/\#\{total\}/g,r);var a=".suggestionApp-level",o={Advanced:"rgb(138, 44, 44)",Intermediate:"rgb(170, 170, 28)",Easy:"rgb(31, 145, 36)"},u=function(){var e="random.json";t=utils.get_json(e,{})},s=function(){var n=t[e],u=$("

",{text:n.value});$(CONTENT_WRAPPER_SELECTOR).html(u),$(a).text(n.Difficulty),e===r-1&&utils.display_message(i),$.each(o,function(t,e){t===$(a).text()&&$(a).css("background-color",e)}),$(HIDDEN_INPUT_SELECTOR).attr("value",'{\r\n "title": "New Pen from The Practice App!",\r\n "html": ""\r\n }');var s=100/r*e+"%";$(".progress").css("width",s)},c=function(){$(ACTION_SELECTOR).on("click",function(){e=(e+1)%r,s()}),Mousetrap.bind("right",function(){$(ACTION_SELECTOR).trigger("click")}),Mousetrap.bind("enter",function(){$(FORM_SELECTOR).trigger("submit")})},l=function(){u(),s(),c()};return{init:l}}(),dribbble=function(){"use strict";var t={},e=0,n=11,r=function(){var e="https://api.dribbble.com/v1/shots/",n=utils.random_number(1,29);t=utils.get_json(e,{page:n,access_token:"6ed972085fecb7078ef53a3056562c05de38514ebd7d095b6a84f6dba7743031"})},i=function(){(e>n-1||0===e)&&r(),$(CONTENT_WRAPPER_SELECTOR).empty();var i=t[e],a=$("",{src:i.images.normal}),o=$("
"),u=$("
",{href:i.html_url,text:i.user.name,target:"_blank"}),s=$("

",{text:i.title+" by "});s.append(u),$(CONTENT_WRAPPER_SELECTOR).append(a,o,s),$(HIDDEN_INPUT_SELECTOR).attr("value",'{\r\n "title": "New Pen from The Practice App!",\r\n "html": "\"\r\n }")},a=function(){$(ACTION_SELECTOR).on("click",function(){e=(e+1)%n,i()}),Mousetrap.bind("right",function(){e=(e+1)%n,i()}),Mousetrap.bind("enter",function(){$(FORM_SELECTOR).trigger("submit")})},o=function(){i(),a()};return{init:o}}(),github=function(){"use strict";var t={},e="#language-select",n=".content-holder",r=0,i=$(NOTICE_SELECTOR).data("total"),a=utils.range(0,i).sort(function(){return Math.random()-.5}),o=0,u=$(NOTICE_SELECTOR).data("message"),s=function(){var n=$(e).val(),r="https://api.github.com/search/issues?q=language:"+encodeURIComponent(n)+"+state:open&page="+a[o];o=(o+1)%i,t=utils.get_json(r,{}),t.items.sort(function(){return Math.random()-.5})},c=function(){(r>i-1||0===r)&&s();var e=t.items[r],a=$("

",{text:utils.get_value(e,"title")}),o=$(marked(utils.get_value(e,"body"))),u=$("

",{text:utils.get_value(e,"created_at")});if($(CONTENT_WRAPPER_SELECTOR).html(o).prepend(a).append(u),""!==utils.get_value(e,"pull_request")){var c=$("

",{html:marked("Current pull request: "+e.pull_request.html_url)});$(CONTENT_WRAPPER_SELECTOR).append(c)}$("#solve").attr("href",utils.get_value(e,"html_url")),$(n).scrollTop(0).perfectScrollbar("update"),$(CONTENT_WRAPPER_SELECTOR).find("code").each(function(t,e){hljs.highlightBlock(e)})},l=function(){$(e).on("change",function(){s(),c()}),$(ACTION_SELECTOR).on("click",function(){r=(r+1)%i,c()}),Mousetrap.bind("right",function(){$(ACTION_SELECTOR).trigger("click")}),Mousetrap.bind("enter",function(){$("#solve").trigger("click")})},E=function(){utils.display_message(u),c(),l()};return{init:E}}(),core=function(){"use strict";var t=function(){switch($(ACTION_SELECTOR).on("click",function(t){t.preventDefault()}),$("article").attr("class")){case"block-random":random.init();break;case"block-dribbble":dribbble.init();break;case"block-github":github.init()}};return{init:t}}();core.init(); -------------------------------------------------------------------------------- /dev/css/main.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: sans-serif; 3 | /* 1 */ 4 | -ms-text-size-adjust: 100%; 5 | /* 2 */ 6 | -webkit-text-size-adjust: 100%; 7 | /* 2 */ } 8 | 9 | body { 10 | margin: 0; } 11 | 12 | article, 13 | aside, 14 | details, 15 | figcaption, 16 | figure, 17 | footer, 18 | header, 19 | hgroup, 20 | main, 21 | nav, 22 | section, 23 | summary { 24 | display: block; } 25 | 26 | audio, 27 | canvas, 28 | progress, 29 | video { 30 | display: inline-block; 31 | /* 1 */ 32 | vertical-align: baseline; 33 | /* 2 */ } 34 | 35 | audio:not([controls]) { 36 | display: none; 37 | height: 0; } 38 | 39 | [hidden], 40 | template { 41 | display: none; } 42 | 43 | a { 44 | background: transparent; } 45 | 46 | a:active, 47 | a:hover { 48 | outline: 0; } 49 | 50 | abbr[title] { 51 | border-bottom: 1px dotted; } 52 | 53 | b, 54 | strong { 55 | font-weight: bold; } 56 | 57 | dfn { 58 | font-style: italic; } 59 | 60 | h1 { 61 | font-size: 2em; 62 | margin: 0.67em 0; } 63 | 64 | mark { 65 | background: #ff0; 66 | color: #000; } 67 | 68 | small { 69 | font-size: 80%; } 70 | 71 | sub, 72 | sup { 73 | font-size: 75%; 74 | line-height: 0; 75 | position: relative; 76 | vertical-align: baseline; } 77 | 78 | sup { 79 | top: -0.5em; } 80 | 81 | sub { 82 | bottom: -0.25em; } 83 | 84 | img { 85 | border: 0; } 86 | 87 | svg:not(:root) { 88 | overflow: hidden; } 89 | 90 | figure { 91 | margin: 1em 40px; } 92 | 93 | hr { 94 | -moz-box-sizing: content-box; 95 | box-sizing: content-box; 96 | height: 0; } 97 | 98 | pre { 99 | overflow: auto; } 100 | 101 | code, 102 | kbd, 103 | pre, 104 | samp { 105 | font-family: monospace, monospace; 106 | font-size: 1em; } 107 | 108 | button, 109 | input, 110 | optgroup, 111 | select, 112 | textarea { 113 | color: inherit; 114 | /* 1 */ 115 | font: inherit; 116 | /* 2 */ 117 | margin: 0; 118 | /* 3 */ } 119 | 120 | button { 121 | overflow: visible; } 122 | 123 | button, 124 | select { 125 | text-transform: none; } 126 | 127 | button, 128 | html input[type="button"], input[type="reset"], 129 | input[type="submit"] { 130 | -webkit-appearance: button; 131 | /* 2 */ 132 | cursor: pointer; 133 | /* 3 */ } 134 | 135 | button[disabled], 136 | html input[disabled] { 137 | cursor: default; } 138 | 139 | button::-moz-focus-inner, 140 | input::-moz-focus-inner { 141 | border: 0; 142 | padding: 0; } 143 | 144 | input { 145 | line-height: normal; } 146 | 147 | input[type="checkbox"], 148 | input[type="radio"] { 149 | box-sizing: border-box; 150 | /* 1 */ 151 | padding: 0; 152 | /* 2 */ } 153 | 154 | input[type="number"]::-webkit-inner-spin-button, 155 | input[type="number"]::-webkit-outer-spin-button { 156 | height: auto; } 157 | 158 | input[type="search"] { 159 | -webkit-appearance: textfield; 160 | /* 1 */ 161 | -moz-box-sizing: content-box; 162 | -webkit-box-sizing: content-box; 163 | /* 2 */ 164 | box-sizing: content-box; } 165 | 166 | input[type="search"]::-webkit-search-cancel-button, 167 | input[type="search"]::-webkit-search-decoration { 168 | -webkit-appearance: none; } 169 | 170 | fieldset { 171 | border: 1px solid #c0c0c0; 172 | margin: 0 2px; 173 | padding: 0.35em 0.625em 0.75em; } 174 | 175 | legend { 176 | border: 0; 177 | /* 1 */ 178 | padding: 0; 179 | /* 2 */ } 180 | 181 | textarea { 182 | overflow: auto; } 183 | 184 | optgroup { 185 | font-weight: bold; } 186 | 187 | table { 188 | border-collapse: collapse; 189 | border-spacing: 0; } 190 | 191 | td, 192 | th { 193 | padding: 0; } 194 | 195 | *, *:before, *:after { 196 | box-sizing: border-box; } 197 | 198 | body, html { 199 | overflow-x: hidden; 200 | height: 100%; 201 | font-family: 'Open Sans', sans-serif; } 202 | 203 | .wrap { 204 | max-width: 1200px; 205 | padding: 0 1em; } 206 | 207 | .group:after { 208 | content: ""; 209 | display: table; 210 | clear: both; } 211 | 212 | .pageContent { 213 | position: relative; 214 | word-break: break-word; } 215 | 216 | .main-header { 217 | padding: 1em; 218 | color: white; 219 | background-color: #333; 220 | position: absolute; 221 | width: 100%; 222 | z-index: 999; } 223 | .main-header p { 224 | padding-top: 10px; 225 | margin: 0; 226 | display: inline-block; } 227 | .main-header a { 228 | float: right; 229 | color: white; 230 | padding: 10px; 231 | border: solid 1px white; 232 | text-decoration: none; } 233 | .main-header a.attribution { 234 | float: none; 235 | padding: 0; 236 | border: none; } 237 | .main-header a:nth-of-type(1) { 238 | margin-left: 1em; } 239 | .main-header.home { 240 | position: relative; } 241 | 242 | .items-notice { 243 | width: 100%; 244 | background-color: orange; 245 | color: white; 246 | text-align: center; 247 | font-size: 0em; 248 | padding: 1em; 249 | position: absolute; 250 | z-index: 5; 251 | opacity: 0; 252 | transition: .25s ease opacity; } 253 | 254 | .items-notice_show { 255 | display: block; 256 | font-size: 2em; 257 | margin-top: 76px; 258 | opacity: 1; } 259 | 260 | .btn { 261 | font-size: .5em; 262 | text-decoration: none; 263 | color: white; 264 | padding: 1em; 265 | border: solid white; 266 | background-color: transparent; 267 | outline: none; 268 | display: inline-block; } 269 | 270 | article a { 271 | color: white; 272 | text-decoration: none; 273 | font-style: italic; } 274 | article a:hover { 275 | text-decoration: underline; } 276 | 277 | form { 278 | display: inline-block; 279 | margin-left: 1em; } 280 | form input { 281 | background-color: transparent; 282 | padding: 0; 283 | outline: none; 284 | border: none; } 285 | 286 | .ps-container .ps-scrollbar-x-rail { 287 | position: absolute; 288 | /* please don't change 'position' */ 289 | bottom: 3px; 290 | /* there must be 'bottom' for ps-scrollbar-x-rail */ 291 | height: 8px; 292 | -webkit-border-radius: 4px; 293 | -moz-border-radius: 4px; 294 | border-radius: 4px; 295 | opacity: 0; 296 | filter: alpha(opacity=0); 297 | -o-transition: background-color 0.2s linear, opacity 0.2s linear; 298 | -webkit-transition: background-color 0.2s linear, opacity 0.2s linear; 299 | -moz-transition: background-color 0.2s linear, opacity 0.2s linear; 300 | transition: background-color 0.2s linear, opacity 0.2s linear; } 301 | 302 | .ps-container:hover .ps-scrollbar-x-rail, 303 | .ps-container.hover .ps-scrollbar-x-rail { 304 | opacity: 0.6; 305 | filter: alpha(opacity=60); } 306 | 307 | .ps-container .ps-scrollbar-x-rail:hover, 308 | .ps-container .ps-scrollbar-x-rail.hover { 309 | background-color: #eee; 310 | opacity: 0.9; 311 | filter: alpha(opacity=90); } 312 | 313 | .ps-container .ps-scrollbar-x-rail.in-scrolling { 314 | background-color: #eee; 315 | opacity: 0.9; 316 | filter: alpha(opacity=90); } 317 | 318 | .ps-container .ps-scrollbar-y-rail { 319 | position: absolute; 320 | /* please don't change 'position' */ 321 | right: 3px; 322 | /* there must be 'right' for ps-scrollbar-y-rail */ 323 | width: 8px; 324 | -webkit-border-radius: 4px; 325 | -moz-border-radius: 4px; 326 | border-radius: 4px; 327 | opacity: 0; 328 | filter: alpha(opacity=0); 329 | -o-transition: background-color 0.2s linear, opacity 0.2s linear; 330 | -webkit-transition: background-color 0.2s linear, opacity 0.2s linear; 331 | -moz-transition: background-color 0.2s linear, opacity 0.2s linear; 332 | transition: background-color 0.2s linear, opacity 0.2s linear; } 333 | 334 | .ps-container:hover .ps-scrollbar-y-rail, 335 | .ps-container.hover .ps-scrollbar-y-rail { 336 | opacity: 0.6; 337 | filter: alpha(opacity=60); } 338 | 339 | .ps-container .ps-scrollbar-y-rail:hover, 340 | .ps-container .ps-scrollbar-y-rail.hover { 341 | background-color: #eee; 342 | opacity: 0.9; 343 | filter: alpha(opacity=90); } 344 | 345 | .ps-container .ps-scrollbar-y-rail.in-scrolling { 346 | background-color: #eee; 347 | opacity: 0.9; 348 | filter: alpha(opacity=90); } 349 | 350 | .ps-container .ps-scrollbar-x { 351 | position: absolute; 352 | /* please don't change 'position' */ 353 | bottom: 0; 354 | /* there must be 'bottom' for ps-scrollbar-x */ 355 | height: 8px; 356 | background-color: #aaa; 357 | -webkit-border-radius: 4px; 358 | -moz-border-radius: 4px; 359 | border-radius: 4px; 360 | -o-transition: background-color 0.2s linear; 361 | -webkit-transition: background-color 0.2s linear; 362 | -moz-transition: background-color 0.2s linear; 363 | transition: background-color 0.2s linear; } 364 | 365 | .ps-container.ie6 .ps-scrollbar-x { 366 | font-size: 0; 367 | /* fixed scrollbar height in xp sp3 ie6 */ } 368 | 369 | .ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x, 370 | .ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x { 371 | background-color: #999; } 372 | 373 | .ps-container .ps-scrollbar-y { 374 | position: absolute; 375 | /* please don't change 'position' */ 376 | right: 0; 377 | /* there must be 'right' for ps-scrollbar-y */ 378 | width: 8px; 379 | background-color: #aaa; 380 | -webkit-border-radius: 4px; 381 | -moz-border-radius: 4px; 382 | border-radius: 4px; 383 | -o-transition: background-color 0.2s linear; 384 | -webkit-transition: background-color 0.2s linear; 385 | -moz-transition: background-color 0.2s linear; 386 | transition: background-color 0.2s linear; } 387 | 388 | .ps-container.ie6 .ps-scrollbar-y { 389 | font-size: 0; 390 | /* fixed scrollbar height in xp sp3 ie6 */ } 391 | 392 | .ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y, 393 | .ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y { 394 | background-color: #999; } 395 | 396 | .ps-container.ie .ps-scrollbar-x, 397 | .ps-container.ie .ps-scrollbar-y { 398 | visibility: hidden; } 399 | 400 | .ps-container.ie:hover .ps-scrollbar-x, 401 | .ps-container.ie:hover .ps-scrollbar-y, 402 | .ps-container.ie.hover .ps-scrollbar-x, 403 | .ps-container.ie.hover .ps-scrollbar-y { 404 | visibility: visible; } 405 | 406 | /* 407 | 408 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 409 | 410 | */ 411 | .hljs { 412 | display: block; 413 | overflow-x: auto; 414 | padding: 0.5em; 415 | background: #002b36; 416 | color: #839496; 417 | -webkit-text-size-adjust: none; } 418 | 419 | .hljs-comment, 420 | .hljs-template_comment, 421 | .diff .hljs-header, 422 | .hljs-doctype, 423 | .hljs-pi, 424 | .lisp .hljs-string, 425 | .hljs-javadoc { 426 | color: #586e75; } 427 | 428 | /* Solarized Green */ 429 | .hljs-keyword, 430 | .hljs-winutils, 431 | .method, 432 | .hljs-addition, 433 | .css .hljs-tag, 434 | .hljs-request, 435 | .hljs-status, 436 | .nginx .hljs-title { 437 | color: #859900; } 438 | 439 | /* Solarized Cyan */ 440 | .hljs-number, 441 | .hljs-command, 442 | .hljs-string, 443 | .hljs-tag .hljs-value, 444 | .hljs-rules .hljs-value, 445 | .hljs-phpdoc, 446 | .hljs-dartdoc, 447 | .tex .hljs-formula, 448 | .hljs-regexp, 449 | .hljs-hexcolor, 450 | .hljs-link_url { 451 | color: #2aa198; } 452 | 453 | /* Solarized Blue */ 454 | .hljs-title, 455 | .hljs-localvars, 456 | .hljs-chunk, 457 | .hljs-decorator, 458 | .hljs-built_in, 459 | .hljs-identifier, 460 | .vhdl .hljs-literal, 461 | .hljs-id, 462 | .css .hljs-function { 463 | color: #268bd2; } 464 | 465 | /* Solarized Yellow */ 466 | .hljs-attribute, 467 | .hljs-variable, 468 | .lisp .hljs-body, 469 | .smalltalk .hljs-number, 470 | .hljs-constant, 471 | .hljs-class .hljs-title, 472 | .hljs-parent, 473 | .hljs-type, 474 | .hljs-link_reference { 475 | color: #b58900; } 476 | 477 | /* Solarized Orange */ 478 | .hljs-preprocessor, 479 | .hljs-preprocessor .hljs-keyword, 480 | .hljs-pragma, 481 | .hljs-shebang, 482 | .hljs-symbol, 483 | .hljs-symbol .hljs-string, 484 | .diff .hljs-change, 485 | .hljs-special, 486 | .hljs-attr_selector, 487 | .hljs-subst, 488 | .hljs-cdata, 489 | .css .hljs-pseudo, 490 | .hljs-header { 491 | color: #cb4b16; } 492 | 493 | /* Solarized Red */ 494 | .hljs-deletion, 495 | .hljs-important { 496 | color: #dc322f; } 497 | 498 | /* Solarized Violet */ 499 | .hljs-link_label { 500 | color: #6c71c4; } 501 | 502 | .tex .hljs-formula { 503 | background: #073642; } 504 | 505 | .block-container { 506 | height: 100%; 507 | width: 100%; } 508 | .block-container.home { 509 | height: 93.7%; } 510 | .block-container.home a { 511 | text-decoration: none; } 512 | 513 | .block-random, .block-dribbble, .block-github { 514 | height: 33.33%; 515 | display: table; 516 | width: 100%; 517 | color: white; } 518 | .block-random:hover, .block-dribbble:hover, .block-github:hover { 519 | background-repeat: no-repeat; } 520 | .block-random .btn, .block-dribbble .btn, .block-github .btn { 521 | transition: .2s ease; } 522 | .block-random .btn:hover, .block-dribbble .btn:hover, .block-github .btn:hover { 523 | background-color: #c7c7c7; } 524 | 525 | .block-content { 526 | display: table-cell; 527 | vertical-align: middle; 528 | text-align: center; 529 | font-size: 2em; 530 | transition: .25s linear; 531 | font-family: 'Open Sans', sans-serif; } 532 | .block-content:hover { 533 | cursor: pointer; 534 | background-color: rgba(0, 0, 0, 0.44); 535 | transform: translateX(20%); } 536 | 537 | .block-random { 538 | background-color: #262642; } 539 | .block-random:hover { 540 | background-image: url("../../assets/img/practice.png"); } 541 | .block-random .progress { 542 | background-color: #F89406; 543 | height: 5px; 544 | transition: .5s ease; 545 | position: fixed; 546 | top: 75px; 547 | left: 0; } 548 | .block-random .suggestionApp-level { 549 | display: block; 550 | margin: 0 auto; 551 | max-width: 220px; 552 | margin-top: 1.5em; 553 | padding: 10px; } 554 | 555 | .block-dribbble { 556 | background-color: #de467f; } 557 | .block-dribbble:hover { 558 | background-image: url("../../assets/img/dribbble.png"); } 559 | 560 | .block-github { 561 | background-color: #4183c4; } 562 | .block-github:hover { 563 | background-image: url("../../assets/img/github.png"); } 564 | 565 | .block-container-single { 566 | height: 100%; } 567 | .block-container-single .block-content:hover { 568 | cursor: inherit; 569 | background-color: transparent; 570 | transform: translateX(0); } 571 | .block-container-single .block-random:hover, .block-container-single .block-dribbble:hover, .block-container-single .block-github:hover { 572 | background-image: none; } 573 | .block-container-single .block-random, .block-container-single .block-dribbble, .block-container-single .block-github { 574 | height: 100%; } 575 | 576 | .block-dribbble .suggestionApp { 577 | background-color: transparent; } 578 | 579 | .block-dribbble .suggestionApp-prompts { 580 | margin-top: 1em; } 581 | 582 | .block-dribbble img { 583 | max-width: 100%; } 584 | 585 | .suggestionApp-languages { 586 | color: gray; 587 | margin: 1em 0; } 588 | 589 | .block-github code { 590 | width: 95%; } 591 | 592 | .block-github pre { 593 | overflow: visible; } 594 | 595 | .block-github .suggestionApp { 596 | background-color: transparent; 597 | padding-top: 3em; } 598 | 599 | .block-github .suggestionApp-content { 600 | font-size: .75em; 601 | text-align: left; 602 | max-width: 1200px; 603 | word-break: break-word; } 604 | .block-github .suggestionApp-content img { 605 | max-width: 100%; } 606 | 607 | .block-github .suggestionApp-prompts { 608 | margin-bottom: 1em; } 609 | 610 | .content-holder { 611 | position: relative; 612 | overflow: hidden; 613 | max-height: 600px; } 614 | 615 | .suggestionApp { 616 | max-width: 75%; 617 | margin: 0 auto; } 618 | -------------------------------------------------------------------------------- /dev/img/dribbble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/dev/img/dribbble.png -------------------------------------------------------------------------------- /dev/img/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/dev/img/github.png -------------------------------------------------------------------------------- /dev/img/practice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/dev/img/practice.png -------------------------------------------------------------------------------- /dev/js/main.js: -------------------------------------------------------------------------------- 1 | var ACTION_SELECTOR = '.suggestionApp-action'; 2 | var CONTENT_WRAPPER_SELECTOR = '.suggestionApp-content'; 3 | var FORM_SELECTOR = '.suggestionApp-prompts form'; 4 | var NOTICE_SELECTOR = '.items-notice'; 5 | var HIDDEN_INPUT_SELECTOR = '.hiddenInput'; 6 | 7 | var utils = (function () { 8 | 'use strict'; 9 | 10 | var random_number = function (min, max) { 11 | return Math.floor(Math.random() * (max - min + 1)) + min; 12 | }; 13 | 14 | var range = function (begin, end) { 15 | var range = []; 16 | var delta = begin < end ? 1 : -1; 17 | for (var index = begin; index <= end; index += delta) { 18 | range.push(index); 19 | } 20 | return range; 21 | }; 22 | 23 | var display_message = function (message) { 24 | var show_class = 'items-notice_show'; 25 | 26 | $(NOTICE_SELECTOR).html(message); 27 | $(NOTICE_SELECTOR).removeClass(show_class); 28 | $(NOTICE_SELECTOR).addClass(show_class); 29 | setTimeout(function () { 30 | $(NOTICE_SELECTOR).removeClass(show_class); 31 | }, 4000); 32 | }; 33 | 34 | var get_value = function (parent, child) { 35 | return ((parent && parent[child]) || ''); 36 | }; 37 | 38 | var get_json = function (url, params) { 39 | return JSON.parse( 40 | $.ajax({ 41 | type: 'GET', 42 | url: url, 43 | dataType: 'json', 44 | global: false, 45 | async: false, 46 | data: params, 47 | success: function (data) { 48 | return data; 49 | } 50 | }).responseText 51 | ); 52 | }; 53 | 54 | return { 55 | random_number: random_number, 56 | range: range, 57 | display_message: display_message, 58 | get_json: get_json, 59 | get_value: get_value 60 | }; 61 | }()); 62 | 63 | var random = (function () { 64 | 'use strict'; 65 | 66 | var data = {}; 67 | var counter = 0; 68 | var $notice = $(NOTICE_SELECTOR); 69 | var total = $notice.data('total'); 70 | var message = $notice.data('message') || ''; 71 | message = message.replace(/\#\{total\}/g, total); 72 | var LEVEL_SELECTOR = '.suggestionApp-level'; 73 | var LEVELS = { 74 | 'Advanced': 'rgb(138, 44, 44)', 75 | 'Intermediate': 'rgb(170, 170, 28)', 76 | 'Easy': 'rgb(31, 145, 36)' 77 | }; 78 | 79 | var get_data = function () { 80 | var jsonUrl = 'random.json'; 81 | data = utils.get_json(jsonUrl, {}); 82 | }; 83 | 84 | var render_item = function () { 85 | var item = data[counter]; 86 | var $text = $('

', { 87 | text: item.value 88 | }); 89 | $(CONTENT_WRAPPER_SELECTOR).html($text); 90 | $(LEVEL_SELECTOR).text(item.Difficulty); 91 | 92 | if (counter === (total - 1)) { 93 | utils.display_message(message); 94 | } 95 | $.each(LEVELS, function (level, color) { 96 | if (level === $(LEVEL_SELECTOR).text()) { 97 | $(LEVEL_SELECTOR).css('background-color', color); 98 | } 99 | }); 100 | 101 | $(HIDDEN_INPUT_SELECTOR).attr('value', '{ 102 | "title": "New Pen from The Practice App!", 103 | "html": "" 104 | }'); 105 | var progress_percentage = ((100 / total) * counter) + '%'; 106 | $('.progress').css('width', progress_percentage); 107 | }; 108 | 109 | var setup_bindings = function () { 110 | $(ACTION_SELECTOR).on('click', function () { 111 | counter = (counter + 1) % total; 112 | render_item(); 113 | }); 114 | Mousetrap.bind('right', function () { 115 | $(ACTION_SELECTOR).trigger('click'); 116 | }); 117 | Mousetrap.bind('enter', function () { 118 | $(FORM_SELECTOR).trigger('submit'); 119 | }); 120 | }; 121 | 122 | var init = function () { 123 | get_data(); 124 | render_item(); 125 | setup_bindings(); 126 | }; 127 | 128 | return { 129 | init: init 130 | }; 131 | }()); 132 | 133 | var dribbble = (function () { 134 | 'use strict'; 135 | 136 | var data = {}; 137 | var counter = 0; 138 | var total = 11; 139 | 140 | var get_data = function () { 141 | var jsonUrl = 'https://api.dribbble.com/v1/shots/'; 142 | var randomPage = utils.random_number(1, 29); 143 | data = utils.get_json(jsonUrl, { 144 | page: randomPage, 145 | access_token: '6ed972085fecb7078ef53a3056562c05de38514ebd7d095b6a84f6dba7743031' 146 | }); 147 | }; 148 | 149 | var render_shot = function () { 150 | if (counter > (total - 1) || (counter === 0)) { 151 | get_data(); 152 | } 153 | $(CONTENT_WRAPPER_SELECTOR).empty(); 154 | var shot = data[counter]; 155 | 156 | var $image = $('', { 157 | src: shot.images.normal 158 | }); 159 | var $br = $('
'); 160 | var $link = $('
', { 161 | href: shot.html_url, 162 | text: shot.user.name, 163 | target: '_blank' 164 | }); 165 | var $name = $('

', { 166 | text: shot.title + ' by ' 167 | }); 168 | $name.append($link); 169 | 170 | $(CONTENT_WRAPPER_SELECTOR).append($image, $br, $name); 171 | 172 | $(HIDDEN_INPUT_SELECTOR).attr('value', '{ 173 | "title": "New Pen from The Practice App!", 174 | "html": "" 175 | }'); 176 | }; 177 | 178 | var setup_bindings = function () { 179 | $(ACTION_SELECTOR).on('click', function () { 180 | counter = (counter + 1) % total; 181 | render_shot(); 182 | }); 183 | 184 | Mousetrap.bind('right', function () { 185 | counter = (counter + 1) % total; 186 | render_shot(); 187 | }); 188 | 189 | Mousetrap.bind('enter', function () { 190 | $(FORM_SELECTOR).trigger('submit'); 191 | }); 192 | }; 193 | 194 | var init = function () { 195 | render_shot(); 196 | setup_bindings(); 197 | }; 198 | 199 | return { 200 | init: init 201 | }; 202 | }()); 203 | 204 | 205 | var github = (function () { 206 | 'use strict'; 207 | 208 | var data = {}; 209 | var LANGUAGE_SELECTOR = '#language-select'; 210 | var CONTENT_HOLDER_SELECTOR = '.content-holder'; 211 | var counter = 0; 212 | var total = $(NOTICE_SELECTOR).data('total'); 213 | var randomPages = utils.range(0, total).sort(function () { return Math.random() - 0.5 }); 214 | var pageCounter = 0; 215 | var message = $(NOTICE_SELECTOR).data('message'); 216 | 217 | var get_data = function () { 218 | var language = $(LANGUAGE_SELECTOR).val(); 219 | var jsonUrl = 'https://api.github.com/search/issues?q=language:' + encodeURIComponent(language) + '+state:open&page=' + randomPages[pageCounter]; 220 | pageCounter = (pageCounter + 1) % total; 221 | data = utils.get_json(jsonUrl, {}); 222 | data.items.sort(function () { return Math.random() - 0.5 }); 223 | }; 224 | 225 | var render_issue = function () { 226 | if ((counter > (total - 1)) || (counter === 0)) { 227 | get_data(); 228 | } 229 | var issue = data.items[counter]; 230 | var $title = $('

', { 231 | text: utils.get_value(issue, 'title') 232 | }); 233 | var $body = $(marked(utils.get_value(issue, 'body'))); 234 | var $timestamp = $('

', { 235 | text: utils.get_value(issue, 'created_at') 236 | }); 237 | 238 | $(CONTENT_WRAPPER_SELECTOR) 239 | .html($body) 240 | .prepend($title) 241 | .append($timestamp); 242 | 243 | if (utils.get_value(issue, 'pull_request') !== '') { 244 | var $pull_request = $('

', { 245 | html: marked('Current pull request: ' + issue.pull_request.html_url) 246 | }); 247 | $(CONTENT_WRAPPER_SELECTOR).append($pull_request); 248 | } 249 | $('#solve').attr('href', utils.get_value(issue, 'html_url')); 250 | 251 | $(CONTENT_HOLDER_SELECTOR) 252 | .scrollTop(0) 253 | .perfectScrollbar('update'); 254 | 255 | $(CONTENT_WRAPPER_SELECTOR).find('code').each(function (i, el) { 256 | hljs.highlightBlock(el); 257 | }); 258 | }; 259 | 260 | var setup_bindings = function () { 261 | $(LANGUAGE_SELECTOR).on('change', function () { 262 | get_data(); 263 | render_issue(); 264 | }); 265 | 266 | $(ACTION_SELECTOR).on('click', function () { 267 | counter = (counter + 1) % total; 268 | render_issue(); 269 | }); 270 | 271 | Mousetrap.bind('right', function () { 272 | $(ACTION_SELECTOR).trigger('click'); 273 | }); 274 | 275 | Mousetrap.bind('enter', function () { 276 | $('#solve').trigger('click'); 277 | }); 278 | }; 279 | 280 | var init = function () { 281 | utils.display_message(message); 282 | render_issue(); 283 | setup_bindings(); 284 | }; 285 | 286 | return { 287 | init: init 288 | }; 289 | }()); 290 | 291 | var core = (function () { 292 | 'use strict'; 293 | 294 | var init = function () { 295 | $(ACTION_SELECTOR).on('click', function (event) { 296 | event.preventDefault(); 297 | }); 298 | 299 | switch ($('article').attr('class')) { 300 | case 'block-random': 301 | random.init(); 302 | break; 303 | case 'block-dribbble': 304 | dribbble.init(); 305 | break; 306 | case 'block-github': 307 | github.init(); 308 | break; 309 | } 310 | }; 311 | 312 | return { 313 | init: init 314 | }; 315 | }()); 316 | 317 | core.init(); 318 | -------------------------------------------------------------------------------- /dev/scss/main.scss: -------------------------------------------------------------------------------- 1 | @import "partials/normalize"; 2 | @import "partials/globals"; 3 | @import "partials/pages"; 4 | @import "partials/colors"; 5 | @import "partials/buttons"; 6 | @import "partials/scrollbar"; 7 | @import "partials/hljs"; 8 | @import "modules/blocks"; 9 | @import "modules/suggestionApp"; 10 | -------------------------------------------------------------------------------- /dev/scss/modules/_blocks.scss: -------------------------------------------------------------------------------- 1 | .block-container { 2 | height: 100%; 3 | width: 100%; 4 | 5 | &.home { 6 | height: 93.7%; 7 | 8 | a { 9 | text-decoration: none; 10 | } 11 | } 12 | } 13 | 14 | %block { 15 | height: 33.33%; 16 | display: table; 17 | width: 100%; 18 | color: white; 19 | 20 | &:hover { 21 | background-repeat: no-repeat; 22 | } 23 | 24 | .btn { 25 | transition: .2s ease; 26 | 27 | &:hover { 28 | background-color: $btn_hover; 29 | } 30 | } 31 | } 32 | 33 | .block-content { 34 | display: table-cell; 35 | vertical-align: middle; 36 | text-align: center; 37 | font-size: 2em; 38 | transition: .25s linear; 39 | font-family: 'Open Sans', sans-serif; 40 | 41 | &:hover { 42 | cursor: pointer; 43 | background-color: $block_hover; 44 | transform: translateX(20%); 45 | } 46 | } 47 | 48 | .block-random, .block-dribbble, .block-github { 49 | @extend %block; 50 | } 51 | 52 | .block-random { 53 | background-color: $random; 54 | 55 | &:hover { 56 | background-image: url("../../assets/img/practice.png"); 57 | } 58 | 59 | .progress { 60 | background-color: $orange; 61 | height: 5px; 62 | transition: .5s ease; 63 | position: fixed; 64 | top: 75px; 65 | left: 0; 66 | } 67 | 68 | .suggestionApp-level { 69 | display: block; 70 | margin: 0 auto; 71 | max-width: 220px; 72 | margin-top: 1.5em; 73 | padding: 10px; 74 | } 75 | } 76 | 77 | .block-dribbble { 78 | background-color: $dribbble; 79 | 80 | &:hover { 81 | background-image: url("../../assets/img/dribbble.png"); 82 | } 83 | } 84 | 85 | .block-github { 86 | background-color: $github; 87 | 88 | &:hover { 89 | background-image: url("../../assets/img/github.png"); 90 | } 91 | } 92 | 93 | //inner blocks 94 | 95 | .block-container-single { 96 | height: 100%; 97 | 98 | .block-content { 99 | &:hover { 100 | cursor: inherit; 101 | background-color: transparent; 102 | transform: translateX(0); 103 | } 104 | } 105 | 106 | .block-random, .block-dribbble, .block-github { 107 | &:hover { 108 | background-image: none; 109 | } 110 | } 111 | 112 | .block-random, .block-dribbble, .block-github { 113 | height: 100%; 114 | } 115 | } 116 | 117 | //inner dribbble 118 | 119 | .block-dribbble { 120 | .suggestionApp { 121 | background-color: transparent; 122 | } 123 | 124 | .suggestionApp-prompts { 125 | margin-top: 1em; 126 | } 127 | 128 | img { 129 | max-width: 100%; 130 | } 131 | } 132 | 133 | //inner github 134 | 135 | .suggestionApp-languages { 136 | color: gray; 137 | margin: 1em 0; 138 | } 139 | 140 | .block-github { 141 | code { 142 | width: 95%; 143 | } 144 | 145 | pre { 146 | overflow: visible; 147 | } 148 | 149 | .suggestionApp { 150 | background-color: transparent; 151 | padding-top: 3em; 152 | } 153 | 154 | .suggestionApp-content { 155 | font-size: .75em; 156 | text-align: left; 157 | max-width: 1200px; 158 | word-break: break-word; 159 | 160 | img { 161 | max-width: 100%; 162 | } 163 | } 164 | 165 | .suggestionApp-prompts { 166 | margin-bottom: 1em; 167 | } 168 | } 169 | 170 | .content-holder { 171 | position: relative; 172 | overflow: hidden; 173 | max-height: 600px; 174 | } 175 | -------------------------------------------------------------------------------- /dev/scss/modules/_suggestionApp.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | .suggestionApp { 4 | max-width: 75%; 5 | margin: 0 auto; 6 | } -------------------------------------------------------------------------------- /dev/scss/partials/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | font-size: .5em; 3 | text-decoration: none; 4 | color: white; 5 | padding: 1em; 6 | border: solid white; 7 | background-color: transparent; 8 | outline: none; 9 | display: inline-block; 10 | } 11 | 12 | article { 13 | a { 14 | color: white; 15 | text-decoration: none; 16 | font-style: italic; 17 | 18 | &:hover { 19 | text-decoration: underline; 20 | } 21 | } 22 | } 23 | 24 | form { 25 | display: inline-block; 26 | margin-left: 1em; 27 | 28 | input { 29 | background-color: transparent; 30 | padding: 0; 31 | outline: none; 32 | border: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /dev/scss/partials/_colors.scss: -------------------------------------------------------------------------------- 1 | //colors 2 | 3 | $random: rgb(38, 38, 66); 4 | $github: #4183c4; 5 | $dribbble: #de467f; 6 | 7 | $orange: #F89406; 8 | $btn_hover: rgb(199, 199, 199); 9 | $block_hover: rgba(0, 0, 0, 0.44); 10 | -------------------------------------------------------------------------------- /dev/scss/partials/_globals.scss: -------------------------------------------------------------------------------- 1 | //global things like wrappers and stuff 2 | 3 | *, *:before, *:after { 4 | box-sizing: border-box; 5 | } 6 | 7 | body, html { 8 | overflow-x: hidden; 9 | height: 100%; 10 | font-family: 'Open Sans', sans-serif; 11 | } 12 | 13 | 14 | 15 | .wrap { 16 | max-width: 1200px; 17 | padding: 0 1em; 18 | } 19 | 20 | //clearin floats 21 | 22 | .group:after { 23 | content: ""; 24 | display: table; 25 | clear: both; 26 | } 27 | 28 | .pageContent { 29 | position:relative; 30 | word-break: break-word; 31 | } 32 | 33 | .main-header { 34 | padding: 1em; 35 | color: white; 36 | background-color: #333; 37 | position: absolute; 38 | width: 100%; 39 | z-index: 999; 40 | p { 41 | padding-top:10px; 42 | margin:0; 43 | display:inline-block; 44 | } 45 | a { 46 | float:right; 47 | color:white; 48 | padding:10px; 49 | border: solid 1px white; 50 | text-decoration:none; 51 | &.attribution { 52 | float: none; 53 | padding: 0; 54 | border: none; 55 | } 56 | &:nth-of-type(1) { 57 | margin-left: 1em; 58 | } 59 | } 60 | &.home { 61 | position:relative; 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /dev/scss/partials/_hljs.scss: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #002b36; 12 | color: #839496; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .hljs-template_comment, 18 | .diff .hljs-header, 19 | .hljs-doctype, 20 | .hljs-pi, 21 | .lisp .hljs-string, 22 | .hljs-javadoc { 23 | color: #586e75; 24 | } 25 | 26 | /* Solarized Green */ 27 | .hljs-keyword, 28 | .hljs-winutils, 29 | .method, 30 | .hljs-addition, 31 | .css .hljs-tag, 32 | .hljs-request, 33 | .hljs-status, 34 | .nginx .hljs-title { 35 | color: #859900; 36 | } 37 | 38 | /* Solarized Cyan */ 39 | .hljs-number, 40 | .hljs-command, 41 | .hljs-string, 42 | .hljs-tag .hljs-value, 43 | .hljs-rules .hljs-value, 44 | .hljs-phpdoc, 45 | .hljs-dartdoc, 46 | .tex .hljs-formula, 47 | .hljs-regexp, 48 | .hljs-hexcolor, 49 | .hljs-link_url { 50 | color: #2aa198; 51 | } 52 | 53 | /* Solarized Blue */ 54 | .hljs-title, 55 | .hljs-localvars, 56 | .hljs-chunk, 57 | .hljs-decorator, 58 | .hljs-built_in, 59 | .hljs-identifier, 60 | .vhdl .hljs-literal, 61 | .hljs-id, 62 | .css .hljs-function { 63 | color: #268bd2; 64 | } 65 | 66 | /* Solarized Yellow */ 67 | .hljs-attribute, 68 | .hljs-variable, 69 | .lisp .hljs-body, 70 | .smalltalk .hljs-number, 71 | .hljs-constant, 72 | .hljs-class .hljs-title, 73 | .hljs-parent, 74 | .hljs-type, 75 | .hljs-link_reference { 76 | color: #b58900; 77 | } 78 | 79 | /* Solarized Orange */ 80 | .hljs-preprocessor, 81 | .hljs-preprocessor .hljs-keyword, 82 | .hljs-pragma, 83 | .hljs-shebang, 84 | .hljs-symbol, 85 | .hljs-symbol .hljs-string, 86 | .diff .hljs-change, 87 | .hljs-special, 88 | .hljs-attr_selector, 89 | .hljs-subst, 90 | .hljs-cdata, 91 | .css .hljs-pseudo, 92 | .hljs-header { 93 | color: #cb4b16; 94 | } 95 | 96 | /* Solarized Red */ 97 | .hljs-deletion, 98 | .hljs-important { 99 | color: #dc322f; 100 | } 101 | 102 | /* Solarized Violet */ 103 | .hljs-link_label { 104 | color: #6c71c4; 105 | } 106 | 107 | .tex .hljs-formula { 108 | background: #073642; 109 | } -------------------------------------------------------------------------------- /dev/scss/partials/_mixins.scss: -------------------------------------------------------------------------------- 1 | //Mixins 2 | 3 | /* media query mixin - 4 | 5 | @mixin bp($point) { 6 | @if $point == papa-bear { 7 | @media (max-width: 1600px) { @content; } 8 | } 9 | @else if $point == mama-bear { 10 | @media (max-width: 1250px) { @content; } 11 | } 12 | @else if $point == baby-bear { 13 | @media (max-width: 600px) { @content; } 14 | } 15 | } 16 | 17 | to use - 18 | 19 | .sidebar { 20 | width: 33.33%; 21 | @include bp(baby-bear) { 22 | width: 100%; 23 | } 24 | } 25 | 26 | */ 27 | 28 | -------------------------------------------------------------------------------- /dev/scss/partials/_normalize.scss: -------------------------------------------------------------------------------- 1 | 2 | html { 3 | font-family: sans-serif; /* 1 */ 4 | -ms-text-size-adjust: 100%; /* 2 */ 5 | -webkit-text-size-adjust: 100%; /* 2 */ 6 | } 7 | 8 | 9 | body { 10 | margin: 0; 11 | } 12 | 13 | 14 | 15 | article, 16 | aside, 17 | details, 18 | figcaption, 19 | figure, 20 | footer, 21 | header, 22 | hgroup, 23 | main, 24 | nav, 25 | section, 26 | summary { 27 | display: block; 28 | } 29 | 30 | 31 | 32 | audio, 33 | canvas, 34 | progress, 35 | video { 36 | display: inline-block; /* 1 */ 37 | vertical-align: baseline; /* 2 */ 38 | } 39 | 40 | 41 | 42 | audio:not([controls]) { 43 | display: none; 44 | height: 0; 45 | } 46 | 47 | 48 | 49 | [hidden], 50 | template { 51 | display: none; 52 | } 53 | 54 | 55 | 56 | 57 | a { 58 | background: transparent; 59 | } 60 | 61 | 62 | 63 | a:active, 64 | a:hover { 65 | outline: 0; 66 | } 67 | 68 | 69 | 70 | abbr[title] { 71 | border-bottom: 1px dotted; 72 | } 73 | 74 | 75 | b, 76 | strong { 77 | font-weight: bold; 78 | } 79 | 80 | 81 | 82 | dfn { 83 | font-style: italic; 84 | } 85 | 86 | 87 | h1 { 88 | font-size: 2em; 89 | margin: 0.67em 0; 90 | } 91 | 92 | 93 | 94 | mark { 95 | background: #ff0; 96 | color: #000; 97 | } 98 | 99 | 100 | 101 | small { 102 | font-size: 80%; 103 | } 104 | 105 | 106 | sub, 107 | sup { 108 | font-size: 75%; 109 | line-height: 0; 110 | position: relative; 111 | vertical-align: baseline; 112 | } 113 | 114 | sup { 115 | top: -0.5em; 116 | } 117 | 118 | sub { 119 | bottom: -0.25em; 120 | } 121 | 122 | 123 | 124 | img { 125 | border: 0; 126 | } 127 | 128 | 129 | svg:not(:root) { 130 | overflow: hidden; 131 | } 132 | 133 | 134 | 135 | figure { 136 | margin: 1em 40px; 137 | } 138 | 139 | 140 | 141 | hr { 142 | -moz-box-sizing: content-box; 143 | box-sizing: content-box; 144 | height: 0; 145 | } 146 | 147 | 148 | 149 | pre { 150 | overflow: auto; 151 | } 152 | 153 | 154 | 155 | code, 156 | kbd, 157 | pre, 158 | samp { 159 | font-family: monospace, monospace; 160 | font-size: 1em; 161 | } 162 | 163 | 164 | 165 | button, 166 | input, 167 | optgroup, 168 | select, 169 | textarea { 170 | color: inherit; /* 1 */ 171 | font: inherit; /* 2 */ 172 | margin: 0; /* 3 */ 173 | } 174 | 175 | 176 | button { 177 | overflow: visible; 178 | } 179 | 180 | 181 | 182 | button, 183 | select { 184 | text-transform: none; 185 | } 186 | 187 | 188 | 189 | button, 190 | html input[type="button"], /* 1 */ 191 | input[type="reset"], 192 | input[type="submit"] { 193 | -webkit-appearance: button; /* 2 */ 194 | cursor: pointer; /* 3 */ 195 | } 196 | 197 | 198 | 199 | button[disabled], 200 | html input[disabled] { 201 | cursor: default; 202 | } 203 | 204 | 205 | 206 | button::-moz-focus-inner, 207 | input::-moz-focus-inner { 208 | border: 0; 209 | padding: 0; 210 | } 211 | 212 | 213 | 214 | input { 215 | line-height: normal; 216 | } 217 | 218 | 219 | 220 | input[type="checkbox"], 221 | input[type="radio"] { 222 | box-sizing: border-box; /* 1 */ 223 | padding: 0; /* 2 */ 224 | } 225 | 226 | 227 | 228 | input[type="number"]::-webkit-inner-spin-button, 229 | input[type="number"]::-webkit-outer-spin-button { 230 | height: auto; 231 | } 232 | 233 | 234 | 235 | input[type="search"] { 236 | -webkit-appearance: textfield; /* 1 */ 237 | -moz-box-sizing: content-box; 238 | -webkit-box-sizing: content-box; /* 2 */ 239 | box-sizing: content-box; 240 | } 241 | 242 | 243 | 244 | input[type="search"]::-webkit-search-cancel-button, 245 | input[type="search"]::-webkit-search-decoration { 246 | -webkit-appearance: none; 247 | } 248 | 249 | 250 | 251 | fieldset { 252 | border: 1px solid #c0c0c0; 253 | margin: 0 2px; 254 | padding: 0.35em 0.625em 0.75em; 255 | } 256 | 257 | 258 | 259 | legend { 260 | border: 0; /* 1 */ 261 | padding: 0; /* 2 */ 262 | } 263 | 264 | 265 | 266 | textarea { 267 | overflow: auto; 268 | } 269 | 270 | 271 | optgroup { 272 | font-weight: bold; 273 | } 274 | 275 | table { 276 | border-collapse: collapse; 277 | border-spacing: 0; 278 | } 279 | 280 | td, 281 | th { 282 | padding: 0; 283 | } -------------------------------------------------------------------------------- /dev/scss/partials/_pages.scss: -------------------------------------------------------------------------------- 1 | //Pages 2 | 3 | .items-notice { 4 | width: 100%; 5 | background-color: orange; 6 | color: white; 7 | text-align: center; 8 | font-size: 0em; 9 | padding: 1em; 10 | position: absolute; 11 | z-index: 5; 12 | opacity: 0; 13 | transition: .25s ease opacity; 14 | } 15 | 16 | .items-notice_show { 17 | display: block; 18 | font-size: 2em; 19 | margin-top: 76px; 20 | opacity: 1; 21 | } 22 | -------------------------------------------------------------------------------- /dev/scss/partials/_scrollbar.scss: -------------------------------------------------------------------------------- 1 | .ps-container .ps-scrollbar-x-rail { 2 | position: absolute; /* please don't change 'position' */ 3 | bottom: 3px; /* there must be 'bottom' for ps-scrollbar-x-rail */ 4 | height: 8px; 5 | -webkit-border-radius: 4px; 6 | -moz-border-radius: 4px; 7 | border-radius: 4px; 8 | opacity: 0; 9 | filter: alpha(opacity = 0); 10 | -o-transition: background-color .2s linear, opacity .2s linear; 11 | -webkit-transition: background-color .2s linear, opacity .2s linear; 12 | -moz-transition: background-color .2s linear, opacity .2s linear; 13 | transition: background-color .2s linear, opacity .2s linear; 14 | } 15 | 16 | .ps-container:hover .ps-scrollbar-x-rail, 17 | .ps-container.hover .ps-scrollbar-x-rail { 18 | opacity: 0.6; 19 | filter: alpha(opacity = 60); 20 | } 21 | 22 | .ps-container .ps-scrollbar-x-rail:hover, 23 | .ps-container .ps-scrollbar-x-rail.hover { 24 | background-color: #eee; 25 | opacity: 0.9; 26 | filter: alpha(opacity = 90); 27 | } 28 | 29 | .ps-container .ps-scrollbar-x-rail.in-scrolling { 30 | background-color: #eee; 31 | opacity: 0.9; 32 | filter: alpha(opacity = 90); 33 | } 34 | 35 | .ps-container .ps-scrollbar-y-rail { 36 | position: absolute; /* please don't change 'position' */ 37 | right: 3px; /* there must be 'right' for ps-scrollbar-y-rail */ 38 | width: 8px; 39 | -webkit-border-radius: 4px; 40 | -moz-border-radius: 4px; 41 | border-radius: 4px; 42 | opacity: 0; 43 | filter: alpha(opacity = 0); 44 | -o-transition: background-color .2s linear, opacity .2s linear; 45 | -webkit-transition: background-color .2s linear, opacity .2s linear; 46 | -moz-transition: background-color .2s linear, opacity .2s linear; 47 | transition: background-color .2s linear, opacity .2s linear; 48 | } 49 | 50 | .ps-container:hover .ps-scrollbar-y-rail, 51 | .ps-container.hover .ps-scrollbar-y-rail { 52 | opacity: 0.6; 53 | filter: alpha(opacity = 60); 54 | } 55 | 56 | .ps-container .ps-scrollbar-y-rail:hover, 57 | .ps-container .ps-scrollbar-y-rail.hover { 58 | background-color: #eee; 59 | opacity: 0.9; 60 | filter: alpha(opacity = 90); 61 | } 62 | 63 | .ps-container .ps-scrollbar-y-rail.in-scrolling { 64 | background-color: #eee; 65 | opacity: 0.9; 66 | filter: alpha(opacity = 90); 67 | } 68 | 69 | .ps-container .ps-scrollbar-x { 70 | position: absolute; /* please don't change 'position' */ 71 | bottom: 0; /* there must be 'bottom' for ps-scrollbar-x */ 72 | height: 8px; 73 | background-color: #aaa; 74 | -webkit-border-radius: 4px; 75 | -moz-border-radius: 4px; 76 | border-radius: 4px; 77 | -o-transition: background-color .2s linear; 78 | -webkit-transition: background-color.2s linear; 79 | -moz-transition: background-color .2s linear; 80 | transition: background-color .2s linear; 81 | } 82 | 83 | .ps-container.ie6 .ps-scrollbar-x { 84 | font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */ 85 | } 86 | 87 | .ps-container .ps-scrollbar-x-rail:hover .ps-scrollbar-x, 88 | .ps-container .ps-scrollbar-x-rail.hover .ps-scrollbar-x { 89 | background-color: #999; 90 | } 91 | 92 | .ps-container .ps-scrollbar-y { 93 | position: absolute; /* please don't change 'position' */ 94 | right: 0; /* there must be 'right' for ps-scrollbar-y */ 95 | width: 8px; 96 | background-color: #aaa; 97 | -webkit-border-radius: 4px; 98 | -moz-border-radius: 4px; 99 | border-radius: 4px; 100 | -o-transition: background-color .2s linear; 101 | -webkit-transition: background-color.2s linear; 102 | -moz-transition: background-color .2s linear; 103 | transition: background-color .2s linear; 104 | } 105 | 106 | .ps-container.ie6 .ps-scrollbar-y { 107 | font-size: 0; /* fixed scrollbar height in xp sp3 ie6 */ 108 | } 109 | 110 | .ps-container .ps-scrollbar-y-rail:hover .ps-scrollbar-y, 111 | .ps-container .ps-scrollbar-y-rail.hover .ps-scrollbar-y { 112 | background-color: #999; 113 | } 114 | 115 | .ps-container.ie .ps-scrollbar-x, 116 | .ps-container.ie .ps-scrollbar-y { 117 | visibility: hidden; 118 | } 119 | 120 | .ps-container.ie:hover .ps-scrollbar-x, 121 | .ps-container.ie:hover .ps-scrollbar-y, 122 | .ps-container.ie.hover .ps-scrollbar-x, 123 | .ps-container.ie.hover .ps-scrollbar-y { 124 | visibility: visible; 125 | } -------------------------------------------------------------------------------- /dribbble.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Practice Your Skills! 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 29 |

30 |
31 |

Build Something Inspired by a Dribbble Shot!

32 |
Github 33 | Home 34 |
35 |
36 |
37 |
38 |

39 | 40 | 41 |

42 |
43 | No thanks. 44 |
45 | 50 | 51 |
52 |
53 |
54 |
55 |
56 |
57 | 58 | 59 | 60 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tevko/practice/6c5eac1c15b5a6520410da7a86cc7a9a814edb19/favicon.ico -------------------------------------------------------------------------------- /github.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Practice Your Skills! 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 29 |
30 |
31 |

Solve This Random Github Issue!

32 | Github 33 | Home 34 |
35 |
40 |
41 |
42 |
43 |
44 |

45 |

46 |
47 |
48 |
49 | 344 |
345 | No thanks. 346 | Let's Solve It! 347 |
348 |
349 |
350 |
351 |
352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 368 | 371 | 372 | 373 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | // Include gulp and plugins 2 | var gulp = require('gulp'), 3 | autoprefixer = require('gulp-autoprefixer'), 4 | minifycss = require('gulp-minify-css'), 5 | uglify = require('gulp-uglify'), 6 | imagemin = require('gulp-imagemin'), 7 | clean = require('gulp-clean'), 8 | concat = require('gulp-concat'), 9 | browserSync = require('browser-sync').create(), 10 | cache = require('gulp-cache'), 11 | rename = require('gulp-rename'), 12 | sass = require('gulp-sass'); 13 | // then come the individual functions 14 | 15 | //sass 16 | 17 | gulp.task('sass', function () { 18 | gulp.src('dev/scss/*.scss') 19 | .pipe(sass()) 20 | .pipe(gulp.dest('dev/css')); 21 | }); 22 | 23 | //css 24 | gulp.task('styles', function() { 25 | return gulp.src('dev/css/main.css') 26 | .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) 27 | .pipe(gulp.dest('assets/css')) 28 | .pipe(rename({suffix: '.min'})) 29 | .pipe(minifycss()) 30 | .pipe(gulp.dest('assets/css')); 31 | }); 32 | 33 | //js 34 | gulp.task('scripts', function() { 35 | return gulp.src('dev/js/*.js') 36 | .pipe(concat('main.js')) 37 | .pipe(gulp.dest('assets/js')) 38 | .pipe(rename({suffix: '.min'})) 39 | .pipe(uglify()) 40 | .pipe(gulp.dest('assets/js')); 41 | }); 42 | 43 | //image compression 44 | gulp.task('images', function() { 45 | return gulp.src('dev/img/*') 46 | .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })) 47 | .pipe(gulp.dest('assets/img')); 48 | }); 49 | 50 | //browser-sync stuff 51 | gulp.task('browserSync', function() { 52 | browserSync.init({ 53 | files: ['assets/css/*', '*.php','assets/js/*.js'] 54 | }); 55 | }); 56 | 57 | //cleanup time 58 | gulp.task('clean', function() { 59 | return gulp.src(['assets/css/*', 'assets/js/*', 'assets/img/*'], {read: false}) 60 | .pipe(clean()); 61 | }); 62 | 63 | //watch all the things 64 | gulp.task('watch', function () { 65 | //Sass stuff 66 | gulp.watch('dev/scss/**/*', ['sass']); 67 | // Watch the css folder for changes 68 | gulp.watch('dev/css/*.css', ['styles']); 69 | // Watch the js folder for changes 70 | gulp.watch('dev/js/*.js', ['scripts']); 71 | // Watch the img folder for changes 72 | gulp.watch('dev/img/*', ['images']); 73 | }); 74 | 75 | gulp.task('default', ['browserSync','watch','scripts','images','sass','styles']); -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Practice Your Skills! 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 26 | 27 | 28 | 29 | 30 | 33 |
34 |

Practice your skills by getting random suggestions or creative inspiration!

35 | Follow me on Twitter 36 |
37 |
38 | 39 |
40 |
41 |

Receive a Random Coding Challenge

42 |
43 |
44 |
45 | 46 |
47 |
48 |

Turn a Dribbble Shot into Code

49 |
50 |
51 |
52 | 53 |
54 |
55 |

Solve a random Github issue

56 |
57 |
58 |
59 |
60 | 61 | 62 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "the-practice-app", 3 | "preferGlobal": true, 4 | "version": "2.1.0", 5 | "description": "Generate Random Items to build on the Front End", 6 | "devDependencies": { 7 | "browser-sync": "^2.7.12", 8 | "gulp": "^3.5.6", 9 | "gulp-autoprefixer": "0.0.6", 10 | "gulp-cache": "^0.1.11", 11 | "gulp-clean": "^0.2.4", 12 | "gulp-concat": "^2.1.7", 13 | "gulp-imagemin": "^0.1.5", 14 | "gulp-minify-css": "^0.3.7", 15 | "gulp-rename": "^1.1.0", 16 | "gulp-sass": "^0.7.3", 17 | "gulp-uglify": "^0.2.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /random.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Practice Your Skills! 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 27 | 30 |
31 |
32 |

Build Something Random!

33 | Github 34 | Home 35 |
36 |
41 |
42 |
43 |
44 |

45 | 46 | 47 |

48 |
49 | No thanks. 50 |
51 | 56 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | 66 | 67 | 68 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /random.json: -------------------------------------------------------------------------------- 1 | [{"item":1,"value":"Use the HTML5 canvas API to build a chess game","Difficulty":"Advanced"}, 2 | {"item":2,"value":"Build a polyfill for the CSS position: sticky value","Difficulty":"Intermediate"}, 3 | {"item":3,"value":"Change the color of an SVG Icon when a user hovers over it","Difficulty":"Easy"}, 4 | {"item":4,"value":"Change the path of an SVG Icon when a user hovers over it","Difficulty":"Intermediate"}, 5 | {"item":5,"value":"Write a javascript function that adds multiple event listeners to the window, and then removes them individualy once a condition evaluates to true","Difficulty":"Advanced"}, 6 | {"item":6,"value":"Complete the Fizz-Buzz challenge ","Difficulty":"Easy"}, 7 | {"item":7,"value":"Write a javascript function that lazyloads images","Difficulty":"Intermediate"}, 8 | {"item":8,"value":"Write some custom CSS for your codepen profile!","Difficulty":"Easy"}, 9 | {"item":9,"value":"Make a 60fps custom CSS only loading animation","Difficulty":"Intermediate"}, 10 | {"item":10,"value":"Draw the google logo with CSS","Difficulty":"Intermediate"}, 11 | {"item":11,"value":"Build restaurant menu generator","Difficulty":"Intermediate"}, 12 | {"item":12,"value":"Make a demo using the CSS Calc() function","Difficulty":"Easy"}, 13 | {"item":13,"value":"Build a copy to clipboard function with Javascript","Difficulty":"Intermediate"}, 14 | {"item":14,"value":"Write a vanilla javascript version of jQuery's $.on function","Difficulty":"Intermediate"}, 15 | {"item":15,"value":"Build a pull to refresh library that allows a user to pull down on the screen and fully refresh the current page","Difficulty":"Advanced"}, 16 | {"item":16,"value":"Create a demo explaining the new Array methods in ES2015","Difficulty":"Intermediate"}, 17 | {"item":17,"value":"Write a javascript function that returns the dominant colors found in an image","Difficulty":"Advanced"}, 18 | {"item":18,"value":"Build a game","Difficulty":"Advanced"}, 19 | {"item":19,"value":"Loop through an array and print all of the elements to the console","Difficulty":"Easy"}, 20 | {"item":20,"value":"Build a slideshow application","Difficulty":"Intermediate"}] 21 | --------------------------------------------------------------------------------