Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <!--
- AGNES
- Page #19 by silbrigthemes
- This is a responsive portfolio designed for @codingcabin‘s page craft challenge, which is part of the on-going coding awards series.
- The inspiration for this page came with the attributes I associate with the name Agnes – winter, elegance, and a hint of melancholy.
- ––––––––––
- Rules:
- 1) Do not steal (parts of) the code.
- 2) Do not redistribute on other websites.
- 3) Do not claim as your own.
- 4) Do not edit beyond recognition.
- 5) Do not alter or delete the credit.
- 6) Do not use as a base code.
- Useful annotations to this code have been made.
- If you need any help with the customization, feel free to send me a message via silbrigthemes.tumblr.com/ask or send a message to my official support blog, silbrigsupport.tumblr.com.
- ––––––––––
- Note:
- This work is protected by a creative commons
- Attribution-NonCommercial-NoDerivatives 4.0 International
- (CC BY-NC-ND 4.0)
- license.
- -->
- <head>
- <meta charset="utf-16">
- <title>Portfolio | {Title}</title> <!-- Change title here. -->
- <link rel="shortcut icon" href="{Favicon}"/>
- <link rel="alternate" type="application/rss+xml" href="{RSS}"/>
- <link rel="apple-touch-icon-precomposed" href="{PortraitURL-128}">
- <!-- Necessary for the icon font to work. -->
- <script src="https://kit.fontawesome.com/57a35dd361.js"></script>
- <!-- Necessary for the page to be responsive. -->
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Necessary for the scripts to work. -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <!-- Changes the toolbar color on mobile. -->
- <meta name="theme-color" content="#c2c9d1"/>
- <!-- Tooltip Script -->
- <script src="https://static.tumblr.com/rzl30kg/eAxm7a751/jquery.style-my-tooltips.js"></script>
- <script>
- (function($){
- $(document).ready(function(){
- $("[title]").style_my_tooltips({
- tip_follows_cursor:true,
- tip_delay_time:200,
- tip_fade_speed:300
- }
- );
- });
- })(jQuery);
- </script>
- <!-- Custom font. | Open Sans -->
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
- <!-- Other fonts. -->
- <!-- Cormorant Garamond -->
- <link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond:300,400,700&subset=cyrillic,cyrillic-ext,latin-ext,vietnamese" rel="stylesheet">
- <!-- Dancing Script -->
- <link href="https://fonts.googleapis.com/css?family=Dancing+Script:400,700&subset=latin-ext,vietnamese" rel="stylesheet">
- <!-- Roboto Mono -->
- <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:300,400,700&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
- <style>
- body{
- margin:0;
- top:0;
- left:0;
- background-color:#dcdee2; /* background color */
- background:url("https://images.unsplash.com/photo-1509227035009-4bef0b738dd3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1566&q=80"); /* background image */
- /* For a background image that is a pattern, change the
- content of the lines below to
- background-size: [any value in px];
- background-repeat:repeat;
- */
- background-size:cover;
- background-attachment:fixed;
- background-position:top center;
- background-repeat:no-repeat;
- color:#30363b; /* text color */
- font-size:1em; /* font-size | 1em = 16px */
- font-family:"Open Sans", Verdana; /* font-family */
- text-align:justify;
- scroll-behavior:smooth;
- }
- /* Custom Scrollbar */
- ::-webkit-scrollbar{
- width:10px;
- background-color:white; /* background color */
- border-radius:5px;
- }
- ::-webkit-scrollbar-thumb{
- width:10px;
- border:2px solid white; /* border color */
- background-color:#c2c9d1; /* background color */
- border-radius:5px;
- }
- /* Custom Text Selection */
- ::selection{
- background-color:#f2f3f4; /* background color */
- color:#30363b; /* text color */
- text-shadow:none;
- }
- ::-moz-selection{
- background-color:#f2f3f4; /* background color */
- color:#30363b; /* text color */
- text-shadow:none;
- }
- ::-o-selection{
- background-color:#f2f3f4; /* background color */
- color:#30363b; /* text color */
- text-shadow:none;
- }
- ::-webkit-selection{
- background-color:#f2f3f4; /* background color */
- color:#30363b; /* text color */
- text-shadow:none;
- }
- /* Custom Tooltips */
- #s-m-t-tooltip{
- max-width:300px;
- margin:15px;
- padding:0.5em;
- background-color:white; /* background color */
- color:#527caf; /* text color */
- z-index:9999999999999;
- font-size:12px; /* font-size: 16px (body) - 4px = 12px */
- text-transform:uppercase; /* alt.: normal, lowercase */
- border-radius:2px; /* increase or decrease radius */
- box-shadow:0 0 2px #c2c9d1; /* box shadow, blurred, color */
- }
- /** TEXT STYLES **/
- /* Bold Text */
- b, strong{
- font-weight:bold;
- color:#525d65; /* text color */
- }
- /* Italic Text */
- i, em{
- font-weight:300; /* alt.: normal */
- font-style:italic;
- color:#191c1f; /* text color */
- }
- /* Marked Text */
- mark{
- padding:0px 4px;
- background-color:#dcdee2; /* background color */
- border-radius:2px; /* increase or decrease radius */
- }
- /* Underlined Text */
- u{
- text-decoration:none;
- border-bottom:1px solid #30363b; /* border color */
- }
- /* Preformatted Text */
- pre{
- word-wrap:break-all;
- white-space:pre-wrap;
- background-color:#f2f3f4; /* background color */
- padding:4px 8px;
- font-family:"Roboto Mono", Georgia; /* font-family */
- font-size:14px; /* font-size: 16px (body) - 2px = 14px */
- border-radius:4px; /* increase or decrease radius */
- }
- /* Small Text */
- small{
- font-size:12px; /* font-size: 16px (body) - 4px = 12px */
- }
- /* Text Line */
- hr{
- width:80%;
- height:4px;
- background-color:#c2c9d1; /* background color */
- border:none;
- border-radius:2px; /* increase or descrease radius */
- }
- /* Blockquote */
- blockquote{
- padding:2px 8px;
- border-radius:4px; /* increase or decrease radius */
- background-color:#e5f0ff; /* background color */
- }
- /* LINKS */
- /* Link */
- a{
- text-decoration:none; /* no text decoration */
- color:#527caf; /* change text color here */
- box-shadow:inset 0 -4px 0 #e5f0ff; /* change color here */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* Hover Link */
- a:hover{
- box-shadow:inset 0 -12px 0 #e5f0ff; /* change color here */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* HEADINGS */
- /* First Heading */
- h1{
- font-size:1.5em; /* 1.5em = 24px */
- font-weight:400; /* 400 = normal weight | alt.: 300, 700 */
- border-bottom:2px solid #c2c9d1; /* line width type color */
- color:#30363b; /* text color */
- }
- /* Second Heading */
- h2{
- font-size:1.25em; /* 1.25em = 20px */
- font-weight:300; /* 300 = thin | alt.: 400, 700 */
- border-bottom:1px solid #c2c9d1; /* line width type color */
- color:#30363b; /* text color */
- }
- /* COLORED TEXT */
- /* Pink Text */
- .npf_color_niles {
- color:#ff5acb; /* change text color here */
- }
- /* Red Text */
- .npf_color_joey {
- color:#ff5a77; /* change text color here */
- }
- /* Orange Text */
- .npf_color_monica {
- color:#ff915a; /* change text color here */
- }
- /* Yellow Text */
- .npf_color_phoebe {
- color:#f5cd0e; /* change text color here */
- }
- /* Green Text */
- .npf_color_ross {
- color:#31cb10; /* change text color here */
- }
- /* Blue Text */
- .npf_color_rachel {
- color:#009ce3; /* change text color here */
- }
- /* Purple Text */
- .npf_color_chandler {
- color:#9360f9; /* change text color here */
- }
- /* SPECIAL FONTS */
- /* Quirky Font */
- .npf_quirky{
- font-family: 'Dancing Script', cursive;
- font-size:1.25em; /* 1.25 x font-size under body{} */
- }
- /* Chat Font */
- .npf_chat{
- font-family:Courier;
- }
- /* Quote Font */
- .npf_quote{
- font-family:"Cormorant Garamond", "Palatino";
- font-size:1.25em; /* 1.25 x font-size under body{} */
- }
- /** --- END TEXT STYLES | START LAYOUT --- **/
- /* CONTAINER */
- #container{
- margin-top:10vh;
- margin-left:calc(20vw - (2.5 * 16px));
- width:calc(60vw + (5 * 16px));
- height:auto;
- display:grid;
- grid-template-columns:repeat(6,10vw);
- grid-column-gap:16px;
- grid-template-rows:10vh 10vw repeat(3,10vh) 1fr;
- grid-row-gap:16px;
- }
- /* TITLE */
- #title{
- background-color:white; /* background color */
- padding:4px 8px;
- font-size:2.5em; /* 2.5em = 40px */
- border-radius:0.5em; /* 8px rounded corner radius */
- box-shadow:0 0 4px #c2c9d1; /* box shadow, blur, color */
- display:flex;
- align-items:center;
- justify-content:center;
- grid-column:1/7;
- grid-row:1/2;
- }
- /* PORTRAITS */
- /* First Portrait */
- #image-one{
- grid-column:1/2;
- }
- /* Second Portrait */
- #image-two{
- grid-column:2/3;
- }
- /* First & Second Portrait */
- #image-one, #image-two{
- grid-row:2/3;
- background-color:white; /* background color */
- border-radius:1em; /* 16px rounded corner radius */
- padding:4px;
- box-shadow:0 0 4px #c2c9d1; /* box shadow, blur, color */
- display:flex;
- align-items:center;
- justify-content:center;
- }
- /* Portrait Images */
- #image-one img, #image-two img{
- width:calc(10vw - 8px);
- height:calc(10vw - 8px);
- border-radius:12px; /* 12px rounded corner radius */
- }
- /* QUICK INFO */
- /* Container */
- #quick-info{
- background-color:white; /* background color */
- border-radius:1em; /* 1em = 16px rounded corner radius */
- padding:1em;
- box-shadow:0 0 4px #c2c9d1; /* box shadow, blur, color */
- grid-column:1/3;
- grid-row:3/6;
- }
- /* Title */
- .subtitle{
- font-size:1.25em; /* 1.25em = 20px */
- text-align:center; /* alt.: left, justify, right */
- }
- /* List */
- #quick-info ul{
- list-style-type:none;
- }
- /* List Item */
- #quick-info li{
- margin-left:-2em;
- }
- /* ABOUT */
- /* Container */
- #about{
- grid-column:3/7;
- grid-row:2/6;
- background-color:white; /* background color */
- border-radius:1em; /* 16px rounded corners radius */
- padding:4px 8px;
- box-shadow:0 0 4px #c2c9d1; /* box shadow, blurred, color */
- overflow-y:scroll;
- overflow-x:hidden;
- }
- /* Paragraph */
- #about p{
- padding-right:1em;
- padding-left:0.5em;
- }
- /* NAVIGATION */
- /* Container */
- #navbar{
- grid-row:6/7;
- grid-column:1/7;
- display:flex;
- flex-wrap:wrap;
- align-items:flex-start;
- justify-content:space-between;
- }
- /* Navigation Element */
- .nav{
- background-color:white; /* background color */
- box-shadow:0 0 4px #c2c9d1; /* box shadow, blurred, color */
- color:#30363b; /* text color */
- padding:4px 8px;
- border-radius:8px; /* 8px rounded corner radius */
- margin-bottom:4px;
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* Navigation Element Icon */
- .nav span{
- font-size:14px; /* 1em (body) - 2px = 14px */
- padding-right:4px;
- color:#527caf; /* text color */
- }
- /* Navigation Element on Hover */
- .nav:hover{
- transform:scale(1.05); /* 1.05 x orignal size */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* Navigation Link */
- a.navlink{
- text-decoration:none; /* no text decoration */
- border-bottom:none; /* no bottom border */
- box-shadow:none; /* no box shadow */
- }
- /* WORKS */
- /* Container */
- #works{
- grid-column:1/7;
- display:grid;
- grid-template-columns:repeat(3,calc(20vw + 24px));
- grid-column-gap:16px;
- grid-row-gap:16px;
- margin-bottom:10vh;
- }
- /* Work */
- .work{
- width:calc(20vw + 4px);
- }
- /* Description */
- .workdesc{
- background-color:white; /* background color */
- padding:4px 8px;
- border-radius:1em; /* 16px rounded corner radius */
- box-shadow:0 0 2px #c2c9d1; /* box shadow, blurred, color */
- }
- /* Title */
- .worktitle{
- font-size:1.25em; /* 1.25em = 20px */
- text-align:center; /* alt.: left, justify, right */
- padding-top:8px;
- font-weight:300; /* 300 = thin | alt.: 400, 700 */
- }
- /* Image */
- .workimg img{
- width:20vw;
- height:auto;
- margin-top:4px;
- border-radius:1em; /* 16px rounded corner radius */
- box-shadow:0 0 2px #c2c9d1; /* box shadow, blurred, color */
- }
- /** --- END LAYOUT | START EXTRAS --- **/
- /* CUSTOM CONTROLS */
- /* Hides standard tumblr controls */
- body > iframe:first-child {
- display: none !important;
- }
- /* Container */
- #custom-controls{
- width:calc(5 * 32px + 4 * 4px);
- position:absolute;
- right:8px;
- top:8px;
- display:flex;
- align-items:center;
- justify-content:space-between;
- position:fixed;
- }
- /* Control Link */
- a.conlink{
- text-decoration:none; /* no text decoration */
- border-bottom:none; /* no bottom border */
- box-shadow:none; /* no box shadow */
- }
- /* Control */
- .cont{
- width:32px;
- height:32px;
- border-radius:50%; /* round */
- background-color:white; /* background color */
- color:#527caf; /* text color */
- font-size:14px; /* 1em (body) - 2px = 14px */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- display:flex;
- align-items:center;
- justify-content:center;
- }
- /* Control on Hover */
- .cont:hover{
- transform:scale(1.05); /* 1.05 x original size */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* TUMBLR APP BUTTON */
- /* Hides the tumblr app button, by @yeoli-thm */
- .tmblr-iframe--app-cta-button {
- display: none!important;
- }
- /* CREDIT */
- /* If you delete or alter this, you will be blocked and reported
- for theft. */
- #credit{
- position:fixed;
- bottom:1em;
- left:1em;
- }
- /* SCROLL TO TOP */
- /* To Top Button */
- .top {
- position:fixed;
- width:32px;
- height:32px;
- left:1em;
- bottom:calc(32px + 1em + 4px);
- background-color:white; /* background color */
- color:#527caf; /* text color */
- border-radius:50%;
- font-size:14px; /* 1em (body) - 2px = 14px */
- display:flex;
- align-items:center;
- justify-content:center;
- opacity: 0;
- }
- /* Top Button */
- .top.ks-appear {
- opacity: 1;
- transform: scale(1) translate3d(0, 0, 0);
- -webkit-transform: scale(1) translate3d(0, 0, 0);
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /* Top Button on Hover */
- .top.ks-appear:hover{
- transform:scale(1.05); /* 1.05 x original size */
- transition:0.5s;
- -moz-transition:0.5s;
- -o-transition:0.5s;
- -webkit-transition:0.5s;
- }
- /** --- END EXTRAS | START RESPONSIVE LAYOUT --- **/
- /** RESPONSIVE FOR TABLETS **/
- @media only screen and (max-width:800px){
- /* CONTAINER */
- #container{
- margin-left:calc(10vw - (2.5 * 16px));
- width:calc(80vw + (5 * 16px));
- grid-template-columns:repeat(6,13.3vw);
- grid-template-rows:10vh 13.3vw repeat(3,10vh) 1fr;
- }
- /* WORKS */
- #works{
- grid-column:1/7;
- display:grid;
- grid-template-columns:repeat(3,calc(26.6vw + 20px));
- grid-column-gap:16px;
- grid-row-gap:16px;
- margin-bottom:10vh;
- }
- /* PORTRAITS */
- #image-one img, #image-two img{
- width:calc(13.3vw - 8px);
- height:calc(13.3vw - 8px);
- }
- /* WORKS */
- /* Work */
- .work{
- width:calc(26.6vw);
- }
- /* Work Image */
- .workimg img{
- width:26.6vw;
- }
- /* CONTROLS | TOP BUTTON */
- .cont, .top{
- border:1px solid #527caf; /* line width, style, color */
- }
- }
- /** RESPONSIVE FOR SMARTPHONES **/
- @media only screen and (max-width:500px){
- /* BODY */
- body{
- overflow-x:hidden;
- }
- /* CONTAINER */
- #container{
- margin-left:calc(10vw - 16px);
- grid-template-columns:10vw 70vw;
- grid-template-rows:10vh 10vw 10vw 20vh 50vh 15vh 1fr;
- }
- /* TITLE */
- #title{
- grid-column:1/3;
- grid-row:1/2;
- }
- /* PORTRAITS */
- /* First Portrait */
- #image-one{
- grid-row:2/3;
- }
- /* Second Portrait */
- #image-two{
- grid-row:3/4;
- }
- /* Portrait Images */
- #image-one, #image-two{
- grid-column:1/2;
- }
- /* QUICK INFO */
- #quick-info{
- grid-column:2/3;
- grid-row:2/5;
- }
- /* ABOUT */
- #about{
- grid-column:1/3;
- grid-row:5/6;
- }
- /* NAVIGATION */
- #navbar{
- grid-row:6/7;
- grid-column:1/3;
- }
- /* WORKS */
- /* Main Container | all works */
- #works{
- grid-column:1/3;
- grid-row:7/8;
- margin-bottom:10vh;
- display:flex;
- flex-direction:column;
- }
- /* Work Container | per each work */
- .work{
- width:calc(80vw + 16px);
- }
- /* Image */
- .workimg img{
- width:calc(80vw + 12px);
- }
- /* Description */
- .workdesc{
- margin-bottom:8px;
- }
- /* CONTROLS | TOP BUTTON */
- .cont, .top{
- border:1px solid #527caf; /* line width, style, color */
- }
- }
- </style>
- </head>
- <body>
- <!-- CUSTOM CONTROLS -->
- <div id="custom-controls">
- <!-- Dashboard Link -->
- <a href="https://www.tumblr.com/dashboard" title="go to dashboard" class="conlink">
- <div class="cont">
- <span class="fab fa-tumblr" aria-hidden="true"></span>
- </div>
- </a>
- <!-- Message -->
- <!-- Takes people to dashboard to send you a message. -->
- <a href="https://www.tumblr.com/message/{Name}" title="send a message to {Name}" class="conlink">
- <div class="cont">
- <span class="fas fa-comment-dots" aria-hidden="true"></span>
- </div>
- </a>
- <!-- Customize -->
- <!-- Takes you, the blog owner, to the customization. -->
- <a href="https://www.tumblr.com/customize/{Name}?redirect_to=https%3A%2F%2F{Name}.tumblr.com" title="customize page" class="conlink">
- <div class="cont">
- <span class="fas fa-palette" aria-hidden="true"></span>
- </div>
- </a>
- <!-- Settings -->
- <!-- Takes you to your blog's settings. -->
- <a href="https://www.tumblr.com/settings/blog/{Name}" title="change settings" class="conlink">
- <div class="cont">
- <span class="fas fa-cog" aria-hidden="true"></span>
- </div>
- </a>
- <!-- Follow -->
- <!-- Takes people to a page so that they can follow you. -->
- <a href="https://www.tumblr.com/follow/{Name}" title="follow {Name}" class="conlink">
- <div class="cont">
- <span class="fas fa-plus" aria-hidden="true"></span>
- </div>
- </a>
- </div> <!-- // end custom controls -->
- <!-- CONTAINER -->
- <div id="container">
- <!-- TITLE -->
- <div id="title">[Title here]</div>
- <!-- PORTRAITS -->
- <!-- First Image -->
- <div id="image-one">
- <img src="[Portrait Image URL here]" alt="protrait one"/>
- </div>
- <!-- Second Image -->
- <div id="image-two">
- <img src="[Portrait Image URL here]" alt="portrait two"/>
- </div> <!-- // end portraits -->
- <!-- QUICK INFO -->
- <div id="quick-info">
- <!-- Title -->
- <div class="subtitle">Quick Info</div>
- <!-- Keep it nice and short! -->
- <ul>
- <li><b>Name:</b> [Your Name]</li>
- <li><b>Age:</b> [Your Age]</li>
- <li><b>Location:</b> [Your Location]</li>
- <li><b>Interests:</b> [Your Interests]</li>
- <li><b>Languages:</b> [Your Languages]</li>
- <!-- You can put in something entirely else too if you want to. It's your choice! -->
- </ul>
- </div> <!-- // end quick info -->
- <!-- NAVBAR -->
- <div id="navbar">
- <!-- Home Link -->
- <a href="/" title="home" class="navlink">
- <div class="nav">
- <span class="fas fa-home" aria-hidden="true"></span>
- Home
- </div>
- </a>
- <!-- Ask Link -->
- <a href="/ask" title="{AskLabel}" class="navlink">
- <div class="nav">
- <span class="fas fa-envelope" aria-hidden="true"></span>
- Message
- </div>
- </a>
- <!-- First Custom Link -->
- <a href="[Link URL]" title="[Link Title]" class="navlink">
- <div class="nav">
- <span class="fas fa-link" aria-hidden="true"></span>
- [Link Title]
- </div>
- </a>
- <!-- Second Custom Link -->
- <a href="[Link URL]" title="[Link Title]" class="navlink">
- <div class="nav">
- <span class="fas fa-link" aria-hidden="true"></span>
- [Link Title]
- </div>
- </a>
- <!-- Third Custom Link -->
- <a href="[Link URL]" title="[Link Title]" class="navlink">
- <div class="nav">
- <span class="fas fa-link" aria-hidden="true"></span>
- [Link Title]
- </div>
- </a>
- <!-- Fourth Custom Link -->
- <a href="[Link URL]" title="[Link Title]" class="navlink">
- <div class="nav">
- <span class="fas fa-link" aria-hidden="true"></span>
- [Link Title]
- </div>
- </a>
- <!-- Fifth Custom Link -->
- <a href="[Link URL]" title="[Link Title]" class="navlink">
- <div class="nav">
- <span class="fas fa-link" aria-hidden="true"></span>
- [Link Title]
- </div>
- </a>
- <!-- CREDIT -->
- <!-- Do not delete or alter this. Otherwise you will be
- blocked and reported for theft. -->
- <a href="https://silbrigthemes.tumblr.com/" title="page by silbrigthemes" class="navlink">
- <div class="nav">
- <span class="fas fa-code" aria-hidden="true"></span>
- Page Credit
- </div>
- </a>
- </div> <!-- // end navbar -->
- <!-- ABOUT -->
- <div id="about">
- <!-- Don't worry about length here.
- You can write a novel if you want to. -->
- [Desciption goes here!]
- </div> <!-- // end about -->
- <!-- WORKS -->
- <div id="works">
- <!-- Work -->
- <div class="work">
- <!-- Image -->
- <div class="workimg">
- <img src="[image url goes here]">
- </div>
- <!-- Description -->
- <div class="workdesc">
- <!-- Title -->
- <div class="worktitle">Work Title</div>
- Description goes here.
- </div> <!-- // end description -->
- </div> <!-- // end work -->
- </div> <!-- // end works -->
- </div> <!-- // end container -->
- <!-- SCROLL TO TOP BUTTON -->
- <div id="top" class="top">
- <span class="fas fa-chevron-up" aria-hidden="true"></span>
- </div>
- <!-- CREDIT -->
- <!-- Do not delete or alter this. Otherwise you will be blocked and
- reported for theft. -->
- <a href="https://silbrigthemes.tumblr.com/" title="page credit" class="conlink">
- <div class="cont" id="credit">
- <span class="fas fa-code" aria-hidden="true"></span>
- </div>
- </a>
- <!-- SCROLL TO TOP BUTTON -->
- <!-- Script by Keenan Staffieri on codepen. -->
- <script>
- class KS_ToTop {
- constructor(selector, appearPx, scrollSpd = 50) {
- this.$selector = document.querySelector(selector);
- this.appearPx = appearPx;
- this.scrollSpd = scrollSpd;
- this.timeOut = null;
- this.isAutoScrolling = false;
- this.init();
- }
- init() {
- // Add event listeners for page scrolling
- document.addEventListener('mousewheel', e => this.scrollHandler(e), false);
- document.addEventListener('DOMMouseScroll', e => this.scrollHandler(e), false);
- // Add event listener for click
- this.$selector.addEventListener('click', () => {
- this.$selector.classList.remove('ks-appear');
- this.scrollToTop();
- });
- }
- scrollHandler(e) {
- var offsetY = window.pageYOffset;
- if (!this.isAutoScrolling) {
- if (offsetY >= this.appearPx) {
- this.$selector.classList.add('ks-appear');
- } else
- {
- this.$selector.classList.remove('ks-appear');
- }
- }
- }
- scrollToTop() {
- this.isAutoScrolling = true;
- if (document.body.scrollTop !== 0 || document.documentElement.scrollTop !== 0) {
- window.scrollBy(0, -this.scrollSpd);
- this.timeOut = setTimeout(() => {this.scrollToTop();}, 30);
- } else
- {
- clearTimeout(this.timeOut);
- this.isAutoScrolling = false;
- }
- }}
- document.addEventListener('DOMContentLoaded', function () {
- var toTop = new KS_ToTop('#top', 200);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement