Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <!-- favicon & page title -->
- <link rel="icon" type="image/gif" href="https://file.garden/ZRgh3nzfnhFDJvPp/cd.gif" />
- <title>Vinyl template by ángel</title>
- <!-- opengraph (discord embed) stuff, optional -->
- <meta content="https://bundlrs.cc/yava" property="og:url" />
- <meta content="vinyl template" property="og:title" />
- <meta content="by @shellfie on disc" property="og:description" />
- <meta content="#CCBB6A" name="theme-color" />
- <style>
- /* ---- !!! template by @shellfie on disc ---- */
- /* fonts */
- /* header font */
- @font-face {
- font-family: "Rameyon";
- src: url("https://file.garden/ZRgh3nzfnhFDJvPp/Rameyon.otf")
- format("opentype");
- }
- /* variables */
- /* feel free to change what any of these affect by scrolling down to them and putting in your own value! */
- :root {
- /* main colors */
- --bg-color: hsla(0, 0%, 83%, 1); /* main background color for page */
- --shadow: hsla(0, 0%, 0%, 0.6); /* color of the shadow for everything */
- --accent: hsla(50, 49%, 61%, 1); /* top half of header text, first color of labels, color of links */
- --accent2: hsla(44, 39%, 47%, 1); /* bottom half of header text, second color of labels, color of inner circle in CD */
- /* sizing */
- --size: 700px; /* width of container on wide screens, height on small screens */
- --gap: -25%; /* gap between vinyl and cover */
- /* header & label colors */
- --outline: hsla(0, 0, 0%, 1); /* color of header & label outline */
- --drop-shadow: hsla(0, 0, 100%, 1); /* color of header & label drop shadow */
- /* CD colors */
- --highlight: hsla(0, 0%, 100%, 1); /* lightest color */
- --color1: hsla(0, 0%, 29%, 1); /* 2nd lightest */
- --color2: hsla(0, 0%, 0%, 1); /* darkest */
- }
- /* box sizing */
- * {
- padding: 0;
- margin: 0;
- box-sizing: border-box;
- }
- /* body styles */
- body {
- background: radial-gradient(
- 100% 100% at center,
- var(--bg-color) 20%,
- black 100%
- );
- font-family: Trebuchet MS; /* font */
- /* center page */
- min-height: 100dvh;
- width: 100vw;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- /* link styles */
- a,
- a:visited {
- color: var(--accent);
- text-decoration-style: double;
- text-decoration-thickness: 1px;
- }
- /* utilities */
- .full {
- height: 100%;
- width: 100%;
- }
- /* container for everything */
- .container {
- max-width: var(--size);
- height: calc(var(--size) / 2); /* make height exactly half of width */
- filter: drop-shadow(5px 5px 15px var(--shadow));
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- }
- /* container for cover and vinyl */
- .cover-container,
- .vinyl-container {
- height: 100%;
- width: 50%; /* make both half of the container */
- background: transparent;
- }
- /* cover styling */
- .cover-container {
- perspective: 1000px; /* gives the flip a 3d effect */
- z-index: 90; /* put cover over CD */
- }
- .cover-inner {
- position: relative;
- box-shadow: 8px 0 15px -1px var(--shadow);
- transform: rotateY(0deg);
- transform-style: preserve-3d;
- transition: all 0.6s;
- }
- .cover-front,
- .cover-back {
- position: absolute;
- backface-visibility: hidden;
- -webkit-backface-visibility: hidden;
- }
- .cover-front img {
- object-fit: cover; /* make sure image covers entire container */
- }
- .cover-back {
- transform: rotateY(180deg); /* make back automatically rotated 180deg */
- padding: 1.75em; /* space between border and content */
- background: hsla(0, 0%, 3%, 1); /* background color for back */
- color: hsla(0, 0%, 100%, 1); /* text color */
- box-shadow: inset 0 -3px 30px 0 hsla(0, 0%, 100%, 0.4);
- display: flex;
- flex-direction: column;
- gap: 0.1rem; /* space between header and scroll area */
- }
- .cover-back header {
- display: block;
- width: 100%;
- }
- /* header text */
- .cover-back header span {
- --outline-width: 1px; /* width of text outline (technically 2x this amount, since I doubled the drop shadow) */
- font-family: "Rameyon";
- font-size: 3em;
- filter: drop-shadow(var(--outline-width) 0 0 var(--outline))
- drop-shadow(0 var(--outline-width) 0 var(--outline))
- drop-shadow(calc(var(--outline-width) * -1) 0 0 var(--outline))
- drop-shadow(0 calc(var(--outline-width) * -1) 0 var(--outline))
- drop-shadow(var(--outline-width) 0 0 var(--outline))
- drop-shadow(0 var(--outline-width) 0 var(--outline))
- drop-shadow(calc(var(--outline-width) * -1) 0 0 var(--outline))
- drop-shadow(0 calc(var(--outline-width) * -1) 0 var(--outline))
- drop-shadow(3px 2px 0 hsla(0, 0%, 100%, 1));
- /* text color */
- color: transparent;
- background: linear-gradient(
- to bottom,
- var(--accent) 0% 45%,
- var(--accent2) 45% 100%
- );
- background-clip: text;
- /* fix text outline getting cut off */
- padding: 20px;
- margin: -20px;
- }
- /* scroll area */
- .cover-back main {
- overflow: auto;
- margin: 0 auto;
- padding: 5% 0; /* top and bottom padding so that text doesn't get completely covered by the fade effect */
- line-height: 1.5em; /* line spacing */
- mask-image: linear-gradient(
- to bottom,
- transparent 0% 30%,
- white 30% 90%,
- transparent 100%
- ),
- linear-gradient(
- to top,
- transparent 0% 30%,
- white 30% 90%,
- transparent 100%
- ); /* fade effect on text */
- }
- /* "labels" */
- .cover-back main p mark {
- padding: 0 0.75em;
- width: max-content;
- display: inline-block;
- background: linear-gradient(
- to bottom,
- var(--accent) 0% 33%,
- var(--accent2) 33% 45%,
- var(--accent) 45% 60%,
- var(--accent2) 60% 100%
- ); /* background for labels */
- border-radius: 100px;
- border: 2px solid var(--outline);
- filter: drop-shadow(1px 1px 0 var(--drop-shadow));
- font-weight: bold;
- }
- /* flip animation class */
- .flip {
- transform: rotateY(180deg);
- box-shadow: -8px 0 15px -1px var(--shadow);
- }
- /* CD styling */
- .vinyl-container {
- margin-left: var(--gap);
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .vinyl {
- height: 95%;
- width: 95%;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 100%;
- animation: spin 3s linear infinite;
- animation-play-state: paused; /* make animation paused by default */
- /* cd background effect */
- background-size: 100% 100%;
- background-position: 0% 0px;
- background: var(--color2);
- background-image: conic-gradient(
- from 0deg at 50% 50%,
- var(--color2) 0%,
- var(--color1) 19%,
- var(--highlight) 25%,
- var(--color1) 31%,
- var(--color2) 51%,
- var(--color1) 69%,
- var(--highlight) 75%,
- var(--color1) 81%,
- var(--color2) 100%
- );
- }
- /* yellow circle at center of CD */
- .inner-circle {
- height: 20%;
- width: 20%; /* you can make this bigger/smaller, just make sure the height and width are the same size! */
- background: linear-gradient(
- -25deg,
- hsla(0, 0%, 100%, 1) 0%,
- var(--accent2) 70%
- );
- border-radius: inherit;
- position: relative;
- z-index: 20;
- box-shadow: 0 0 10px 0 var(--shadow);
- }
- /* gap inside of inner circle */
- .inner-circle::after {
- content: "";
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background: var(--bg-color);
- height: 35%;
- width: 35%;
- border-radius: inherit;
- box-shadow: inset 5px 5px 15px -2px var(--shadow);
- }
- /* animations */
- @keyframes spin {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
- /* responsiveness */
- @media screen and (max-width: 600px) {
- .container {
- width: calc(var(--size) / 2);
- height: var(--size); /* switch width and height on mobile */
- flex-direction: column; /* change direction of everything */
- }
- .cover-container,
- .vinyl-container {
- width: 100%;
- height: 50%; /* swap width and height on mobile */
- }
- .cover-front img,
- .flip {
- box-shadow: 0 8px 15px -1px var(--shadow); /* change position of box shadow */
- }
- .vinyl-container {
- margin-left: 0;
- margin-top: calc(var(--gap) * 2); /* change margin to fit mobile layout */
- }
- }
- </style>
- </head>
- <body>
- <!-- start main container -->
- <div class="container full">
- <!-- start cover -->
- <div class="cover-container" onclick="flipCard()">
- <div class="cover-inner full">
- <!-- start cover image - replace src with your own image URL (preferrably a square) -->
- <div class="cover-front full">
- <img
- class="full"
- src="https://file.garden/ZRgh3nzfnhFDJvPp/IMG_8467.jpeg"
- alt="The album cover for BABYMETAL's album, METAL RESISTANCE."
- />
- </div>
- <!-- end cover image -->
- <!-- start back of cover -->
- <div class="cover-back full">
- <header>
- <span>Name</span>
- </header>
- <main class="full">
- <p>
- <mark>about</mark> <a href="#">link</a> <strong>bold</strong> <em>italic</em> ; f2u atomic vinyl themed template by @shellfie on disc! Most attributes are changeable through variables, some are global, some are local. You need at least a <em>little</em> bit of CSS knowledge to use this. Edits are ok! <a href="https://pastebin.com/0A8EE9fM">pastebin with code</a>
- <br />
- <mark>rules</mark> the only rules are: dont gatekeep the code (its not yours anyways), dont remove the credits in the code, don't use this if you're on my <a href="https://bundlrs.cc/smiski#dni">dni</a>, and thats it!
- </p>
- </main>
- </div>
- <!-- end back of cover -->
- </div>
- </div>
- <!-- end cover -->
- <!-- start vinyl cd -->
- <div class="vinyl-container">
- <div class="vinyl" onclick="playMusic()">
- <div class="inner-circle"></div>
- </div>
- </div>
- <!-- end vinyl cd -->
- </div>
- <!-- end main container -->
- <script>
- // get elements for flip and spin effect
- var inner = document.querySelector(".cover-inner");
- var vinyl = document.querySelector(".vinyl");
- // replace URL with your own audio URL
- const audio = new Audio("https://file.garden/ZRgh3nzfnhFDJvPp/yava.mp3");
- let playing = false;
- // alert users about how to use page
- window.alert(
- "click the cover to see info, and click the CD to play a song!",
- );
- // flip cover function
- function flipCard() {
- inner.classList.toggle("flip");
- }
- function playMusic() {
- // change value of playing
- playing = !playing;
- // change animation play state
- if (playing) {
- vinyl.style.animationPlayState = "running";
- } else {
- vinyl.style.animationPlayState = "paused";
- }
- // play/pause audio
- if (playing) audio.play();
- else audio.pause();
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement