diff --git a/docs/mini/flavor.scss b/docs/mini/flavor.scss index ad5296d12..6014a8318 100644 --- a/docs/mini/flavor.scss +++ b/docs/mini/flavor.scss @@ -545,7 +545,7 @@ button#disclaimer-close{ } } -h2.index-section { +h2 { border-left: 0.3125rem solid #de4a6d; padding-left: 0.625rem; margin-top: 2rem; @@ -575,18 +575,38 @@ h2.index-section { #in-numbers { background: #111; //#3f88c5; //#e15554; - padding-top: 1.25rem; - @media screen and (max-width: 767px){ - padding-bottom: 1rem; - } + padding-top: 0.75rem; + padding-bottom: 0.75rem; color: #fff; svg { fill: #fff; + @media screen and (min-width: 768px){ + position: relative; + top: 20px; + left: -34px; + width: 32px; + height: 32px; + } + } + p { + overflow-wrap: break-word; + @media screen and (min-width: 768px){ + position: relative; + top: -24px; + left: 22px; + font-size: 0.75rem; + } + margin-top: 0; + font-size: 0.625rem; + margin-bottom: 0; } } #snippet-count, #contrib-count, #commit-count, #test-count { - font-size: 1.5rem; + font-size: 1rem; + @media screen and (min-width: 768px){ + font-size: 1.25rem; + } } ul#links { @@ -658,3 +678,47 @@ ul#links { } } } + +.card.fluid.contribution-guideline { + overflow: visible; + margin-top: 3rem; + padding-bottom: 0.25rem; + h3 { + padding-top: 0.5rem; + text-align: center; + } +} + +.contribution-guideline + .contribution-guideline { + &:before, &:after { + content: ''; + position: relative; + top: -2.75rem; + width: 0.375rem; + height: 0.375rem; + background: #ddd; + border: 0.03125rem solid #d0d0d0; + border-radius: 100%; + left: calc(50% - 0.1875rem); + box-shadow: inset -0.03125rem -0.03125rem 0.03125rem rgba(0,0,0,0.05); + } + &:after { + position: absolute; + top: - 1.875rem; + } +} + +.contribution-number { + position: absolute; + top: -1.125rem; + left: calc(50% - 1.125rem); + font-size: 1.5rem; + background: linear-gradient(135deg, rgba(255,174,39,1) 0%,rgba(222,73,109,1) 100%); + border: 0.03125 solid #ddd; + width: 2.25rem; + text-align: center; + height: 2.25rem; + border-radius: 100%; + font-weight: 700; + color: #fff; +} diff --git a/static-parts/index.html b/static-parts/index.html index 781f74a69..c26ecdbe5 100644 --- a/static-parts/index.html +++ b/static-parts/index.html @@ -14,154 +14,185 @@
-Curated collection of useful JavaScript snippets
that you can understand in 30 seconds or less.
The core goal of 30 seconds of code is to provide a quality resource for beginner and advanced JavaScript developers alike. We want to help improve the JavaScript ecosystem, by lowering the barrier of entry for newcomers and help seasoned veterans pick up new tricks and remember old ones. In order to achieve this, we have collected hundreds of snippets that can be of use in a wide range of situations. We welcome new contributors and we like fresh ideas, as long as the code is short and easy to grasp in about 30 seconds. The only catch, if you may, is that many of our snippets are not perfectly suited for large, enterprise applications and they might not be deemed production-ready.
Curated collection of useful JavaScript snippets
that you can understand in 30 seconds or less.
295
snippets
114
contributors
3028
commits
999
tests
In order for 30 seconds of code to be as accessible and useful as possible, all of the snippets in the collection are licensed under the CC0-1.0 License, meaning they are absolutely free to use in any project you like. If you like what we do, you can always credit us, but that is not mandatory.
Returns true if the bottom of the page is visible, false otherwise.
Use scrollY, scrollHeight and clientHeight to determine if the bottom of the page is visible.
const bottomVisible = () => - document.documentElement.clientHeight + window.scrollY >= - (document.documentElement.scrollHeight || document.documentElement.clientHeight); -
bottomVisible(); // true -
Creates a function that accepts up to n arguments, ignoring any additional arguments.
Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).
const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); -
const firstTwoMax = ary(Math.max, 2); -[[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10] -
295
snippets
114
contributors
3028
commits
999
tests
The idea behind 30 seconds of code has inspired some people to create similar collections in other programming languages and environments. Here are the ones we like the most:
-
- Angelos Chalaris
- The core goal of 30 seconds of code is to provide a quality resource for beginner and advanced JavaScript developers alike. We want to help improve the JavaScript ecosystem, by lowering the barrier of entry for newcomers and help seasoned veterans pick up new tricks and remember old ones. In order to achieve this, we have collected hundreds of snippets that can be of use in a wide range of situations. We welcome new contributors and we like fresh ideas, as long as the code is short and easy to grasp in about 30 seconds. The only catch, if you may, is that many of our snippets are not perfectly suited for large, enterprise applications and they might not be deemed production-ready.
- Stefan Feješ
-
- Felix Wu
-
- atomiks
-
- King David Martins
-
- Rohit Tanwar
-
- Soorena Soleimani
-
- Robert Mennell
- In order for 30 seconds of code to be as accessible and useful as possible, all of the snippets in the collection are licensed under the CC0-1.0 License, meaning they are absolutely free to use in any project you like. If you like what we do, you can always credit us, but that is not mandatory.
Returns true if the bottom of the page is visible, false otherwise.
Use scrollY, scrollHeight and clientHeight to determine if the bottom of the page is visible.
const bottomVisible = () => + document.documentElement.clientHeight + window.scrollY >= + (document.documentElement.scrollHeight || document.documentElement.clientHeight); +
bottomVisible(); // true +
Creates a function that accepts up to n arguments, ignoring any additional arguments.
Call the provided function, fn, with up to n arguments, using Array.slice(0,n) and the spread operator (...).
const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); +
const firstTwoMax = ary(Math.max, 2); + [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10] +
TODO
The idea behind 30 seconds of code has inspired some people to create similar collections in other programming languages and environments. Here are the ones we like the most:
+
+ Angelos Chalaris
+
+ Stefan Feješ
+
+ Felix Wu
+
+ atomiks
+
+ King David Martins
+
+ Rohit Tanwar
+
+ Soorena Soleimani
+
+ Robert Mennell
+ Do you have a cool idea for a new snippet? Maybe some code you use often and is not part of our collection? Contributing to 30 seconds of code is as simple as 1,2,3,4!
+Start by creating a snippet, according to the snippet template. Make sure to follow these simple guidelines:
+Run npm run tagger from your terminal, then open the tag_database file and tag your snippet appropriately. Multitagging is also supported, just make sure the first tag you specify is on of the major tags and the one that is most relevant to the implemneted function.
You can optionally test your snippet to make our job easier. Simply run npm run tester to generate the test files for your snippet. Find the related folder for you snippet under the test directory and write some tests. Remember to run npm run tester again to make sure your tests are passing.
If you have done everything mentioned above, you should now have an awesome snippet to add to our collection. Simply start a pull request and follow the guidelines provided. Remember to only submit one snippet per pull request, so that we can quickly evaluate and merge your code into the collection.
+If you need additional pointers about writing a snippet, be sure to read the complete contribution guidelines.
+