Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="theme-color" content="black"/>
- <meta name="msapplication-TileColor" content="#da532c"/>
- <meta name="msapplication-navbutton-color" content="black"/>
- <meta name="apple-mobile-web-app-capable" content="yes"/>
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <title></title>
- <style>
- *{
- box-sizing: border-box;
- margin:0; padding:0;
- outline: none;
- }
- :root {
- --black: black;
- }
- body{
- background: rgb(251,244,234) url("");
- min-width: 100vw; min-height: 100vh;
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-start;
- }
- #container{
- border: 1px solid red;
- margin-top: 20px;
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-start;
- }
- .kdplayer{
- border:1px solid black;
- display: flex;
- align-items: center;
- padding: 5px;
- background: white;
- }
- .kdcontrols{
- font-size: 20px;
- display: flex;
- align-items: center;
- margin-right:5px;
- }
- .stop{
- border-left: 5px solid black;
- border-right: 5px solid black;
- height: 15px;
- width: 15px;
- }
- .play{
- width: 0;
- height: 0;
- border-top: 7.5px solid transparent;
- border-left: 15px solid black;
- border-bottom: 7.5px solid transparent;
- }
- .kdprogress{
- -webkit-appearance: none;
- height: 5px;
- background: #d3d3d3;
- outline: none;
- margin-right:5px;
- }
- /*
- .kdduration{
- font-weight: bold;
- }*/
- .kdtotaltime{
- height: 15px;
- width: 15px;
- }
- .kdprogress::-webkit-slider-thumb{
- -webkit-appearance: none; appearance: none;
- -webkit-tap-highlight-color: transparent;
- width: 10px; height: 10px;
- border: 0px solid white;
- border-radius:50%;
- background: var(--black);
- cursor: pointer;
- }
- .kdprogress::-moz-range-thumb{
- -webkit-tap-highlight-color: transparent;
- width: 10px; height: 10px;
- border: 0px solid white;
- border-radius:50%;
- background: var(--black);
- cursor: pointer;
- }
- @media (orientation:portrait){
- #container{
- width: 95%; height: auto;
- }
- body{background-size: 35%}
- }
- @media (orientation:landscape){
- #container{
- width: 75%; height: auto;
- }
- body{background-size: 50%}
- }
- </style>
- </head>
- <body>
- <div id="container">
- TEST CONTENT
- </div>
- <script>
- let create= (x)=> document.createElement(x),
- select= (x,y=document)=> y.querySelector(x),
- selectAll= (x,y=document)=> y.querySelectorAll(x);
- //Display---Time------
- function audioTime(x){
- let a= new Date(x * 1000).toISOString().substr(11,8);
- let b= a.split(":");
- let h= b[0], m= b[1], s= b[2];
- return (h>0) ? (h+":"+m+":"+s) : (m+":"+s);
- }
- function createPlayer(x,y=document.body){
- let a= create("div"),
- b= create("div"),
- c= create("input"),
- d= create("div"),
- e= create("div"),
- f= create("audio");
- a.className= "kdplayer";
- b.className= "kdcontrols play";
- c.className= "kdprogress"; c.type= "range";
- d.className= "kdduration";
- e.className= "kdtotaltime";
- f.className= "kdaudio"; f.src= x;
- a.append(b,c,d,e,f);
- y.append(a);
- //Play--Pause
- b.onclick= function(){
- if(f.paused){
- b.className= "kdcontrols stop"
- f.play();
- }
- else{
- b.className= "kdcontrols play"
- f.pause();
- }
- };
- //When----Playing-------
- f.ontimeupdate= function (){
- if(this.duration==Infinity){
- c.disabled= true;
- document.documentElement.style.setProperty('--black', 'transparent');
- d.innerHTML= audioTime(this.currentTime) + " / ";
- e.innerHTML= infinityicon;
- }
- else{
- c.disabled= false;
- document.documentElement.style.setProperty('--black', 'black');
- c.min= "0";
- c.max= this.duration;
- c.value= this.currentTime;
- d.innerHTML= audioTime(this.currentTime) + " / ";
- e.innerHTML= audioTime(this.duration);
- }
- };
- //When----Stopped-----
- f.onended= function(){
- b.className= "kdcontrols play";
- c.value= "0";
- d.innerHTML= "00:00 / ";
- };
- //When----Seeking------
- c.oninput= function(){
- f.currentTime= this.value;
- };
- }
- let src1= "http://168.195.218.193:8000/radio1-1";
- let src= "/storage/emulated/0/Music/Yahan-Per-Sab-Shanti (SongsMp3.Com).mp3";
- let playicon= "c";
- let pauseicon= "d";
- let infinityicon= `<svg aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M252 128a60 60 0 0 1-102.426 42.426q-.257-.257-.498-.529l-59.86-67.59a36 36 0 1 0 0 51.387l3.085-3.484a12 12 0 0 1 17.967 15.912l-3.344 3.775q-.24.272-.498.53a60 60 0 1 1 0-84.853q.257.257.498.53l59.86 67.59a36 36 0 1 0 0-51.388l-3.085 3.484a12 12 0 0 1-17.967-15.912l3.344-3.775q.24-.272.498-.53A60 60 0 0 1 252 128z" fill="currentColor"/>∞</svg>`;
- //usage: createPlayer(src1,location where player will be added. default is document body end);
- createPlayer(src1);
- </script>
- </body>
- </html>
- //--------
- function seekable(a){
- let sheet = document.styleSheets[0];
- let rules = sheet.cssRules || sheet.rules;
- if(rules[8].height) rules[8].style.height= a;
- if(rules[9].height) rules[9].style.height= a;
- }
- //---
- <style>
- .main{
- width:215px;
- padding:5px;
- display: grid;
- grid-gap: 5px;
- grid-template-columns: repeat(4,50px);
- grid-template-rows: 80px;
- grid-auto-rows: 50px;
- border: 2px solid black;
- box-shadow: black 3px 5px 5px;
- background: rgb(0,0,0,0.1);
- }
- .btn{
- /*width:20px;
- height:20px;*/
- border:1px solid black;
- text-align: center;
- display: flex;
- justify-content: center;
- align-items: center;
- outline: 1px solid blue;
- outline-offset: -4px;
- }
- textarea{
- grid-column: 1/-1;
- display: flex;
- justify-content: flex-end;
- align-items: flex-end;
- border: 5px;
- border-style: ridge;
- }
- .mu,.di,.ad,.mi{background: rgb(255,255,200);}
- .eq{background: rgb(0,255,0,0.2);}
- .cl,.de{background: rgb(255,0,0,0.2);}
- .bo,.bc,.po{background: rgb(0,0,0,0.1);}
- </style>
- <div class="main">
- <textarea>Calculation</textarea>
- <div class="btn cl">CL</div>
- <div class="btn bo">(</div>
- <div class="btn bc">)</div>
- <div class="btn mu">×</div>
- <div class="btn nr">1</div>
- <div class="btn nr">2</div>
- <div class="btn nr">3</div>
- <div class="btn di">÷</div>
- <div class="btn nr">4</div>
- <div class="btn nr">5</div>
- <div class="btn nr">6</div>
- <div class="btn ad">+</div>
- <div class="btn nr">7</div>
- <div class="btn nr">8</div>
- <div class="btn nr">9</div>
- <div class="btn mi">-</div>
- <div class="btn po">.</div>
- <div class="btn nr">0</div>
- <div class="btn de">Del</div>
- <div class="btn eq">=</div>
- </div>
- /-----
- <style>
- #wrapper{
- width: 500px;
- display: grid;
- grid-row-gap: 5px;
- grid-column-gap: 5px;
- grid-template-columns: 3fr 1fr;
- grid-auto-rows: 1fr 10fr 3fr 1fr;
- grid-template-areas:
- "nav nav"
- "content col"
- "content abt"
- "foot foot";
- }
- #wrapper>*{
- display: flex;
- align-items: center;
- justify-content: center;
- }
- #navbar{
- grid-area: nav;
- background: pink;
- }
- #content{
- grid-area: content;
- background: green;
- }
- #col{
- grid-area: col;
- background:gray;
- }
- #abt{
- grid-area: abt;
- background: yellow;
- }
- #footer{
- grid-area: foot;
- background: gold;
- }
- </style>
- <div id="wrapper">
- <div id="navbar">Nav</div>
- <div id="content">content</div>
- <div id="col">col</div>
- <div id="abt">about</div>
- <div id="footer">foot</div>
- </div>
Add Comment
Please, Sign In to add comment