silbrigthemes

Sweetheart (Page #6)

Feb 13th, 2018
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.26 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <!--
  5.  
  6. SWEETHEART (Page #6) by @silbrigthemes
  7.  
  8. A simple bias / family / network page with filtering.
  9.  
  10. RULES:
  11. 1) Don't use this code as base.
  12. 2) Dont't steal (parts of) this code.
  13. 3) Don't claim this code as your own.
  14. 4) Don't edit beyond recognition.
  15. 5) Don't delete or alter the credit.
  16.  
  17. Annotations have been made to simpify customization.
  18.  
  19. Have fun with this page and don't be afraid to send a message if there is problem that you cannot solve.
  20.  
  21. -->
  22.  
  23. <head>
  24.  
  25. <!-- Tab title; can be changed here. -->
  26. <title>Sweetheart</title>
  27.  
  28. <!-- Custom google fonts; Lato and Playfair Display. -->
  29. <link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,700&amp;subset=cyrillic,latin-ext,vietnamese" rel="stylesheet">
  30. <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&amp;subset=latin-ext" rel="stylesheet">
  31.  
  32. <!-- Necessary for the icon font to work. -->
  33. <link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
  34.  
  35. <meta name="viewport" content="width=device-width, initial-scale=1">
  36.  
  37. <style>
  38.  
  39. body{
  40. background-color:#f7cac9; /* body background color */
  41. margin:0;
  42. font-family:"Lato", Verdana; /* global font family */
  43. font-size:1em; /* globale font-size (16px) */
  44. color:#43090c; /* global text color */
  45. overflow:hidden;
  46. }
  47.  
  48. /** CUSTOM SELECTION **/
  49. ::selection{
  50. background-color:#ce1c25; /* selection bg color */
  51. color:#fff; /* selection text color */
  52. }
  53.  
  54. ::-webkit-selection{
  55. background-color:#ce1c25;
  56. color:#fff;
  57. }
  58.  
  59. ::-moz-selection{
  60. background-color:#ce1c25;
  61. color:#fff;
  62. }
  63.  
  64. ::-o-selection{
  65. background-color:#ce1c25;
  66. color:#fff;
  67. }
  68.  
  69. /** CUSTOM SCROLLBAR **/
  70. ::-webkit-scrollbar{
  71. width:4px;
  72. background-color:#ce1c25; /* scrollbar bg color */
  73. border:1.5px solid #f3a5a9; /* scrollbar border color */
  74. }
  75.  
  76. ::-webkit-scrollbar-thumb{
  77. background-color:#ce1c25; /* scrollbar thumb bg color */
  78. width:2px;
  79. border:1px solid #f3a5a9; /* scrollbar thumbr border color */
  80. }
  81.  
  82.  
  83. /** GENERAL TEXT STYLING **/
  84. b, strong{
  85. font-weight:bold;
  86. color:#e74b53; /* text color of bold text */
  87. }
  88.  
  89. i, em{
  90. font-style:italic;
  91. color:#b41820; /* text color of italic text */
  92. }
  93.  
  94. a{
  95. color:#ce1c25; /* text color of links */
  96. text-decoration:none;
  97. transition:0.5s;
  98. -moz-transition:0.5s;
  99. -o-transition:0.5s;
  100. -webkit-transition:0.5s;
  101. }
  102.  
  103.  
  104. /** CONTAINER **/
  105. #container{
  106. width:80vw;
  107. height:102vh;
  108. max-height:100vh;
  109. background-color:#f6bcbf; /* container bg color */
  110. display:flex;
  111. align-items:flex-start;
  112. justify-content:flex-start;
  113. flex-direction:row;
  114. flex-wrap:wrap;
  115. overflow-y:scroll;
  116. }
  117.  
  118. /* CARD */
  119. .card{
  120. width:20vw;
  121. height:50vh;
  122. background-color:#fce9ea; /* bg color of the cards */
  123. border:5px solid #ce1c25; /* border color around cards */
  124. border-radius:5px;
  125. margin:2.5vw;
  126. }
  127.  
  128. /* CARD ICON */
  129. .card-image{
  130. width:100%;
  131. height:30%;
  132. }
  133.  
  134. .card-image img{
  135. width:100px;
  136. height:100px;
  137. border-radius:50%;
  138. border:5px solid #ce1c25; /* border color around icons */
  139. margin-left:calc(50% - 50px);
  140. margin-top:10px;
  141. }
  142.  
  143. /* CARD TEXT */
  144. .card-text{
  145. width:100%;
  146. height:70%;
  147. }
  148.  
  149. /* NAME */
  150. .card-text h2{
  151. font-family:"Playfair Display", "Times New Roman"; /* name font family */
  152. font-size:1.5em; /* font size = 24px */
  153. color:#e74b53; /* text color of names */
  154. text-shadow:1px 1px 2px #f3a5a9; /* text shadow on names */
  155. text-align:center;
  156. }
  157.  
  158. /* URL */
  159. .card-text h3 {
  160. font-size:1em; /* font size = 16px */
  161. text-align:center;
  162. }
  163.  
  164. .card-text a{
  165. text-decoration:none;
  166. line-height:0.25em;
  167. transition:0.5s;
  168. -moz-transition:0.5s;
  169. -o-transition:0.5s;
  170. -webkit-transition:0.5s;
  171. }
  172.  
  173. .card-text mark{
  174. background-color:#ce1c25; /* background color of URLs */
  175. color:#fff; /* text color of URLs */
  176. padding:0.25em;
  177. border-radius:5px;
  178. text-decoration:none;
  179. transition:0.5s;
  180. -moz-transition:0.5s;
  181. -o-transition:0.5s;
  182. -webkit-transition:0.5s;
  183. }
  184.  
  185. .card-text mark:hover{
  186. background-color:#f3a5a9; /* background color of URLs on hover */
  187. color:#ce1c25; /* text color of URLs on hover */
  188. text-decoration:none;
  189. transition:0.5s;
  190. -moz-transition:0.5s;
  191. -o-transition:0.5s;
  192. -webkit-transition:0.5s;
  193. }
  194.  
  195. /* DESCRIPTION */
  196. .card-text p{
  197. padding:0.5em;
  198. padding-top:0.75em;
  199. overflow-y:scroll;
  200. max-height:50%;
  201. text-align:justify;
  202. }
  203.  
  204.  
  205. /** SIDEBAR **/
  206. #sidebar{
  207. width:20vw;
  208. height:100vh;
  209. background-color:#f3a5a9; /* sidebar bg color */
  210. margin-left:80vw;
  211. margin-top:-100vh;
  212. display:flex;
  213. align-items:center;
  214. justify-content:center;
  215. flex-direction:column;
  216. }
  217.  
  218. #side-image{
  219. width:128px;
  220. height:128px;
  221. border-radius:50%;
  222. /* your blog icon is the bg image */
  223. background-image:url("{PortraitURL-128}");
  224. border:5px solid #ce1c25; /* border around the image */
  225. display:flex;
  226. align-items:center;
  227. justify-content:center;
  228. }
  229.  
  230. #side-circle{
  231. width:5em;
  232. height:5em;
  233. background-color:#ce1c25; /* background color of the circle */
  234. border-radius:50%;
  235. display:flex;
  236. align-items:center;
  237. justify-content:center;
  238. }
  239.  
  240. #side-circle i{
  241. color:#f6bcbf; /* icon color */
  242. font-size:1.5em;
  243. transition:0.5s;
  244. -moz-transition:0.5s;
  245. -o-transition:0.5s;
  246. -webkit-transition:0.5s;
  247. }
  248.  
  249. #side-circle i:hover{
  250. color:#f3a5a9; /* icon color on hover */
  251. font-size:1.75em;
  252. transition:0.5s;
  253. -moz-transition:0.5s;
  254. -o-transition:0.5s;
  255. -webkit-transition:0.5s;
  256. }
  257.  
  258. #side-image a{
  259. text-decoration:none;
  260. }
  261.  
  262. #side-title{
  263. font-size:2em;
  264. /* side title font-family */
  265. font-family:"Playfair Display", "Times New Roman";
  266. color:#fff; /* text color */
  267. width:15vw;
  268. font-style:italic;
  269. text-shadow:1px 1px 2px #ce1c25; /* text-shadow */
  270. text-align:center;
  271. }
  272.  
  273. #side-desc{
  274. width:15vw;
  275. padding-top:0.5em;
  276. padding-bottom:0.5em;
  277. text-align:center;
  278. }
  279.  
  280. .behaelter {
  281. overflow: hidden;
  282. display:flex;
  283. align-items:center;
  284. justify-content:center;
  285. flex-direction:row;
  286. margin-top:1em;
  287. }
  288.  
  289. .filterDiv {
  290. display: none; /* Hidden by default */
  291. }
  292.  
  293. /* The "show" class is added to the filtered elements */
  294. .show {
  295. display: block;
  296. }
  297.  
  298. /* Style the buttons */
  299. .btn {
  300. font-size:0.75em;
  301. padding: 12px 16px;
  302. background-color: #f6bcbf; /* button bg color */
  303. border:1px solid rgba(255,255,255,0);
  304. color:#ce1c25; /* button text color */
  305. width:15vw;
  306. cursor: pointer;
  307. border-radius:5px;
  308. margin-left:2.5vw;
  309. margin-top:0.5em;
  310. outline:none;
  311. text-transform:lowercase;
  312. font-weight:bold;
  313. font-family:"Lato"; /* button font-family */
  314. transition:0.5s;
  315. -moz-transition:0.5s;
  316. -o-transition:0.5s;
  317. -webkit-transition:0.5s;
  318. }
  319.  
  320. /* Add a coral background on mouse-over */
  321. .btn:hover {
  322. background-color: #e74b53; /* button bg color on hover */
  323. color:#fff; /* button text color on hover */
  324. transition:0.5s;
  325. -moz-transition:0.5s;
  326. -o-transition:0.5s;
  327. -webkit-transition:0.5s;
  328. }
  329.  
  330. /* Add a red background to the active button */
  331. .btn.active {
  332. background-color: #ce1c25; /* active button bg color */
  333. color: #fff; /* active button text color */
  334. border:1px solid rgba(255,255,255,0);
  335. }
  336.  
  337.  
  338. /*
  339. Don't delete or alter the credit!
  340. Taking the credit off free things is rude;
  341. I have spent much time on this.
  342. */
  343. #credit img{
  344. height:50px;
  345. right:50px;
  346. bottom:5px;
  347. position:absolute;
  348. }
  349.  
  350. </style>
  351. </head>
  352. <body>
  353. <!-- START CONTAINER -->
  354. <div id="container">
  355.  
  356. <!-- FIRST CARD -->
  357. <div class="card filterDiv all filter1">
  358. <div class="card-image">
  359. <img src="https://78.media.tumblr.com/fd0e8fb766e63e53065b51d204675a82/tumblr_p3jmkwDy4c1wsskx3o2_r1_1280.jpg" alt="red gradient">
  360. </div>
  361. <div class="card-text">
  362. <h2>Name</h2>
  363. <a href="URL" title="username">
  364. <h3>
  365. <mark>@URL</mark>
  366. </h3>
  367. </a>
  368. <p>
  369. Description goes here.
  370. </p>
  371. </div>
  372. </div>
  373.  
  374. <!-- FIRST CARD -->
  375. <div class="card filterDiv all filter1">
  376. <div class="card-image">
  377. <img src="https://78.media.tumblr.com/fd0e8fb766e63e53065b51d204675a82/tumblr_p3jmkwDy4c1wsskx3o2_r1_1280.jpg" alt="red gradient">
  378. </div>
  379. <div class="card-text">
  380. <h2>Name</h2>
  381. <a href="URL" title="username">
  382. <h3>
  383. <mark>@URL</mark>
  384. </h3>
  385. </a>
  386. <p>
  387. Description goes here.
  388. </p>
  389. </div>
  390. </div>
  391.  
  392. <!-- FIRST CARD -->
  393. <div class="card filterDiv all filter1">
  394. <div class="card-image">
  395. <img src="https://78.media.tumblr.com/fd0e8fb766e63e53065b51d204675a82/tumblr_p3jmkwDy4c1wsskx3o2_r1_1280.jpg" alt="red gradient">
  396. </div>
  397. <div class="card-text">
  398. <h2>Name</h2>
  399. <a href="URL" title="username">
  400. <h3>
  401. <mark>@URL</mark>
  402. </h3>
  403. </a>
  404. <p>
  405. Description goes here.
  406. </p>
  407. </div>
  408. </div>
  409.  
  410.  
  411. <!--
  412.  
  413. Copy and paste the following lines to add more cards.
  414.  
  415. <div class="card filterDiv all filtername">
  416. <div class="card-image">
  417. <img src="image url" alt="image title">
  418. </div>
  419. <div class="card-text">
  420. <h2>Name</h2>
  421. <a href="URL" title="username">
  422. <h3>
  423. <mark>@URL</mark>
  424. </h3>
  425. </a>
  426. <p>
  427. Description goes here.
  428. </p>
  429. </div>
  430. </div>
  431.  
  432. -->
  433.  
  434. <!-- This is the closing </div> of the container! -->
  435. </div>
  436. <!-- END CONTAINER -->
  437.  
  438.  
  439. <!-- SIDEBAR -->
  440. <div id="sidebar">
  441. <div id="side-image">
  442. <a href="/">
  443. <div id="side-circle">
  444. <i class="fa fa-heart"></i>
  445. </div>
  446. </a>
  447. </div>
  448. <div id="side-title">Title</div>
  449. <div id="side-desc">
  450. Short description.
  451. </div>
  452.  
  453. <!-- Control buttons -->
  454. <div id="behaelter">
  455. <button class="btn active" onclick="filterSelection('all')">
  456. Show All
  457. </button>
  458. <button class="btn" onclick="filterSelection('filter1')">
  459. Filter 1
  460. </button>
  461. <button class="btn" onclick="filterSelection('filter2')">
  462. Filter 2
  463. </button>
  464. <button class="btn" onclick="filterSelection('filter3')">
  465. Filter 3
  466. </button>
  467. <button class="btn" onclick="filterSelection('filter4')">
  468. Filter 4
  469. </button>
  470. </div>
  471.  
  472.  
  473. <!--
  474. Don't delete or alter the credit!
  475. Taking the credit off free things is rude;
  476. I have spent much time on this.
  477. -->
  478. <div id="credit">
  479. <a href="https://silbrigthemes.tumblr.com/">
  480. <img src="https://78.media.tumblr.com/7854d98ef9b778a43fc9dd83b828ab02/tumblr_p3jmkwDy4c1wsskx3o1_1280.png" alt="credit: @silbrigthemes">
  481. </a>
  482.  
  483. </div>
  484.  
  485. </div>
  486.  
  487.  
  488.  
  489. <!-- This script is necessary for the filtering to work! -->
  490. <script>
  491. filterSelection("all")
  492. function filterSelection(c) {
  493. var x, i;
  494. x = document.getElementsByClassName("filterDiv");
  495. if (c == "all") c = "";
  496. // Add the "show" class (display:block) to the filtered elements, and remove the "show" class from the elements that are not selected
  497. for (i = 0; i < x.length; i++) {
  498. w3RemoveClass(x[i], "show");
  499. if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
  500. }
  501. }
  502.  
  503. // Show filtered elements
  504. function w3AddClass(element, name) {
  505. var i, arr1, arr2;
  506. arr1 = element.className.split(" ");
  507. arr2 = name.split(" ");
  508. for (i = 0; i < arr2.length; i++) {
  509. if (arr1.indexOf(arr2[i]) == -1) {
  510. element.className += " " + arr2[i];
  511. }
  512. }
  513. }
  514.  
  515. // Hide elements that are not selected
  516. function w3RemoveClass(element, name) {
  517. var i, arr1, arr2;
  518. arr1 = element.className.split(" ");
  519. arr2 = name.split(" ");
  520. for (i = 0; i < arr2.length; i++) {
  521. while (arr1.indexOf(arr2[i]) > -1) {
  522. arr1.splice(arr1.indexOf(arr2[i]), 1);
  523. }
  524. }
  525. element.className = arr1.join(" ");
  526. }
  527.  
  528. // Add active class to the current control button (highlight it)
  529. var btnContainer = document.getElementById("myBtnContainer");
  530. var btns = btnContainer.getElementsByClassName("btn");
  531. for (var i = 0; i < btns.length; i++) {
  532. btns[i].addEventListener("click", function() {
  533. var current = document.getElementsByClassName("active");
  534. current[0].className = current[0].className.replace(" active", "");
  535. this.className += " active";
  536. });
  537. }
  538. </script>
  539.  
  540.  
  541. </body>
  542. </html>
Advertisement
Add Comment
Please, Sign In to add comment