Advertisement
southcodes

icons page #1: swim [UPDATED]

Sep 24th, 2017
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 9.33 KB | None | 0 0
  1. <!--
  2.     - icons page #1 'swim' by sur southcodes.tumblr.com
  3.     - modify as you please but please do not touch the credit
  4.     - any errors? need help? have questions? let me know!
  5.     southcodes.tumblr.com/ask
  6. -->
  7.  
  8. <!DOCtype html>
  9. <html>
  10. <head>
  11.  
  12.     <title>{Title}</title>
  13.  
  14.     <link rel="shortcut icon" href="{favicon}">
  15.     <link rel="alternate" type="application/rss+xml" href="{RSS}">
  16.  
  17.     <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
  18.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  19.     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.2.2/isotope.pkgd.min.js"></script>
  20.  
  21. <style type="text/css">
  22. ::-webkit-scrollbar-thumb:vertical {
  23.     height:0px;
  24.     background-color: #888;
  25.     border-right:3px solid #fff;
  26.     border-top:4px solid #fff;
  27.     border-bottom:4px solid #fff;}
  28. ::-webkit-scrollbar {
  29.     background-color: inherit;
  30.     width:4px;
  31.     height:0px;}
  32. * {padding:0px;margin:0px;}
  33. .tmblr-iframe {margin:10px;opacity:.7;}
  34.  
  35. body {
  36.     font-family:'Open Sans', sans-serif;
  37.     font-size:13px;
  38.     color:#444;         /*text color*/
  39.     background:#fff;
  40.     font-weight: 400}
  41. a {color:#8e1f1f;         /*links color*/
  42. text-decoration:none;}
  43. a:hover {
  44.     color:#000;         /*links on hover color*/
  45. }
  46.  
  47.             /*          header        */
  48.  
  49. header {
  50.     width:100%;
  51.     height:130px;
  52.     background:#e2cec9;          /* header background color */
  53.     position:relative;}
  54. .info {position:absolute;bottom:-30px;left:200px;}
  55.  
  56. .simg{width:70px;
  57.     height:70px;
  58.     padding:0px;margin:0px;border-radius:4px;}
  59. .about{display:inline-block;vertical-align: top;margin:0px 0 0 15px;}
  60.  
  61. .title {
  62.     font-size:15px;
  63.     font-weight:normal;
  64.     text-transform:uppercase;
  65.     font-weight: 700;
  66.     color:#fff;         /*page title color*/
  67.     text-shadow:1px 1px 3px #8e1f1f;         /*page title shadow color*/
  68.     letter-spacing:1.2px;
  69. }
  70. nav {margin-top:2px;}
  71. nav a {padding-right:15px;font-weight: 400;font-size:12px;letter-spacing: .5px;}
  72. .desc {font-size: 13.4px;letter-spacing: .3px;margin-top:9px;}
  73.  
  74.  
  75.  
  76.             /*      filters      */
  77.  
  78. .filters {
  79.     vertical-align: top;
  80.     max-height:120px;
  81.     overflow:scroll;
  82.     line-height:26px;
  83.     z-index:2;
  84.     padding: 13px 7px 5px;
  85.     background: rgba(255,255,255, .95); /*background color of filters bar*/
  86.     position: -webkit-sticky;position: sticky;top: 0;}
  87. .filtert {
  88.     background:#e0d0d0;   /*background color of filters titles*/
  89.     padding:2px 4px;
  90.     margin-right:6px;
  91.     font-weight: 600;
  92.     color:#fff;     /*text color of filters titles*/
  93.     text-transform: uppercase;
  94.     letter-spacing:.5px;}
  95.  
  96.             /*      buttons     */
  97.  
  98. button {border:0px;background: transparent;font-size: inherit;margin: 0px 2px;padding:0px 3px 3px;}
  99. button:focus {outline:0;}
  100. .is-checked {
  101.     border-bottom: 2px solid #e0d0d0;  /*underline in checked filter color*/
  102. }
  103. .button-group {margin-bottom: 13px;}
  104.  
  105.             /*      grid      */
  106.  
  107. .container {
  108.     width:calc(115px * 6);    /* change the last number for the number of rows you want */
  109.     margin: 100px 0 50px 200px;}
  110.  
  111. .grid {margin-top: 60px}
  112. .grid-item {height:95px;width:95px;margin:10px;}
  113. .grid-item img{height:95px;width:95px;}
  114.  
  115. </style>
  116. </head>
  117. <body>
  118.  
  119. <header>
  120.  
  121.     <aside class="info">    
  122.  
  123.         <a href="/"><img class="simg" src="HEADER_IMAGE_URL"/></a>
  124.  
  125.         <div class="about">
  126.             <h1 class="title">icons page</h1>
  127.        
  128.             <nav>
  129.                 <a href="/">home</a>
  130.                 <a href="/ask">inbox</a>
  131.                 <a href="http://tumblr.com/dashboard">dash</a>
  132.             </nav>
  133.            
  134.             <div class="desc">description</div>
  135.         </div>
  136.  
  137.     </aside>    <!--info-->
  138.    
  139. </header>    <!--header-->
  140.  
  141.  
  142. <section class="container">
  143.  
  144.  
  145. <!--
  146.  
  147. PART 1: HOW TO CUSTOMIZE FILTERS:
  148.  
  149. 1) copy the group template and paste it right under     <div class="filters">   :
  150.  
  151.     <div class="button-group" data-filter-group="UNIQUE NAME HERE">
  152.         <span class="filtert">FILTER TITLE</span>
  153.    
  154.         <button class="button is-checked" data-filter="">ALL OPTIONS</button>
  155.         <button class="button" data-filter=".UNIQUE FILTER NAME">OPTION 1</button>
  156.     </div>
  157.  
  158. 2) change the 'UNIQUE NAME HERE' for whatever you want. only letters and no spaces (if you add more groups always choose different names). DO NOT delete the dot at the start of the word or the filters wont work
  159.  
  160. 3) change the 'FILTER TITLE' and 'ALL OPTIONS' for whatever you want them to say
  161.  
  162. 4) change the OPTION 1 for the name of the filter you want, then change the 'UNIQUE FILTER NAME' for a single word (no spaces) with a dot  which you will use to link each icon to each filter. repeat this step and copy paste for multiple options
  163.  
  164. should look something like this:
  165.  
  166.     <div class="button-group" data-filter-group="colors">
  167.         <span class="filtert">filter by color</span>
  168.    
  169.         <button class="button is-checked" data-filter="">all colors</button>
  170.         <button class="button" data-filter=".red">red hair</button>
  171.         <button class="button" data-filter=".blue">blue hair</button>
  172.         <button class="button" data-filter=".green">green hair</button>
  173.     </div>
  174.  
  175.  
  176. keep scrolling for the second part
  177.  
  178. -->
  179.  
  180.  
  181.  
  182.  
  183.                     <!--    FILTERS     -->
  184.  
  185. <div class="filters">
  186.  
  187.  
  188.    
  189.     <div class="button-group" data-filter-group="a">
  190.         <span class="filtert">filter title</span>
  191.    
  192.         <button class="button is-checked" data-filter="">all options</button>
  193.         <button class="button" data-filter=".">option 1</button>
  194.     </div>
  195.        
  196.    
  197.     <div class="button-group" data-filter-group="b">
  198.         <span class="filtert">filter title</span>
  199.    
  200.         <button class="button is-checked" data-filter="">all options</button>
  201.         <button class="button" data-filter=".">option 1</button>
  202.     </div>
  203.        
  204.    
  205.     <div class="button-group" data-filter-group="c">
  206.         <span class="filtert">filter title</span>
  207.    
  208.         <button class="button is-checked" data-filter="">all options</button>
  209.         <button class="button" data-filter=".">option 1</button>
  210.     </div>
  211.        
  212.    
  213.    
  214. </div><!--filters end-->
  215.  
  216.  
  217. <!--
  218.  
  219. PART 2: HOW TO CUSTOMIZE ICONS
  220.  
  221. 1)      TEMPLATES:
  222.  
  223. template with link
  224.  
  225. <figure class="grid-item FILTER1 FILTER2">
  226.     <a href="LINK"><img src="IMAGE_URL"/></a>
  227. </figure>
  228.  
  229. ____________
  230.  
  231. template without link
  232.  
  233. <figure class="grid-item FILTER1 FILTER2">
  234.     <img src="IMAGE_URL"/>
  235. </figure>
  236.  
  237.  
  238. ^ choose the template you need and paste it right after     <main class="grid">    
  239. then change the 'FILTER1' to the same filter name you wrote previously (eg. 'blue' or 'green'), and the FILTER2 for whatever other filter you want that icon to have, delete it if not, remember they need to be separated with a space. change the image url and link accordingly: should look like this at the end
  240.  
  241. <figure class="grid-item blue long">
  242.     <a href="LINK"><img src="IMAGE_URL"/></a>
  243. </figure>
  244.  
  245.  
  246. that's it! it can be quite hard to understand, so shoot me an ask if you have any issues: http://southcodes.tumblr.com/ask
  247.  
  248. -->
  249.  
  250.                    <!--    ICONS     -->
  251.  
  252. <main class="grid">
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260. <!--template with link-->
  261. <figure class="grid-item FILTER1 FILTER2">
  262.    <a href="LINK"><img src="IMAGE_URL"/></a>
  263. </figure>
  264.  
  265.  
  266.  
  267. <!--template without link-->
  268. <figure class="grid-item FILTER1 FILTER2">
  269.    <img src="IMAGE_URL"/>
  270. </figure>
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277. </main> <!--grid-->    <!--        END ICONS       -->
  278.  
  279. </section> <!-- container -->
  280. <script type="text/javascript">
  281. $(document).ready( function() {
  282. // init Isotope
  283. var $grid = $('.grid').isotope({
  284.  itemSelector: '.grid-item'
  285. });
  286. // store filter for each group
  287. var filters = {};
  288. $('.filters').on( 'click', '.button', function() {
  289.  var $this = $(this);
  290.  // get group key
  291.  var $buttonGroup = $this.parents('.button-group');
  292.  var filterGroup = $buttonGroup.attr('data-filter-group');
  293.  // set filter for group
  294.  filters[ filterGroup ] = $this.attr('data-filter');
  295.  // combine filters
  296.  var filterValue = concatValues( filters );
  297.  // set filter for Isotope
  298.  $grid.isotope({ filter: filterValue });
  299. });
  300. // change is-checked class on buttons
  301. $('.button-group').each( function( i, buttonGroup ) {
  302.  var $buttonGroup = $( buttonGroup );
  303.  $buttonGroup.on( 'click', 'button', function() {
  304.     $buttonGroup.find('.is-checked').removeClass('is-checked');
  305.     $( this ).addClass('is-checked');
  306.  });
  307. });
  308. });
  309. // flatten object by concatting values
  310. function concatValues( obj ) {
  311. var value = '';
  312. for ( var prop in obj ) {
  313.  value += obj[ prop ];
  314. }
  315. return value;
  316. }
  317. </script>
  318.  
  319. <script>
  320.    $(".filters").hover(function() {
  321.  var oldScrollPos = $(window).scrollTop();
  322.  
  323.  $(window).on('scroll.scrolldisabler', function(event) {
  324.    $(window).scrollTop(oldScrollPos);
  325.    event.preventDefault();
  326.  });
  327. }, function() {
  328.  $(window).off('scroll.scrolldisabler');
  329. });
  330. </script>
  331.  
  332. <div style="position:fixed;bottom:18px;right:18px;font-family:calibri;font-size:14.5px;line-height:18px;height:20px;text-align:center;width:20px;color:#777;letter-spacing:.7px;background:white"><a style="color:#555" href="http://southcodes.tumblr.com" title="southcodes">sc</a></div>
  333. </body>
  334. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement