Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bruger_view.php
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
- <title><?=$header_title;?></title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">-->
- <link rel="stylesheet" href="css/init.css">
- <link rel="stylesheet" href="css/farver.css">
- <link rel="stylesheet" href="css/slider.css">
- <style>
- img{ width: 100%; z-index: -10;}
- .box1{width:100%;max-width:700px; margin: 0 auto;}
- .footer{margin-top:-30px;z-index: 25; color:#ffffff;}
- a{color:#ffffff;}
- </style>
- <script>
- var str = sessionStorage.getItem('soegeOrd'); <!--viser billeder i den valgte kategori-->
- var data = [];
- function showCustomer(str) {
- var xhttp;
- if (str == "") {
- document.getElementById("demo").innerHTML = "Tom";
- return;
- }
- xhttp = new XMLHttpRequest();
- console.log(str);
- xhttp.open("GET", "sql/bruger_view_sql.php?q="+str, true);
- xhttp.onreadystatechange = function()
- { if (this.readyState == 4 && this.status == 200)
- { //console.log(this.responseText);
- data = JSON.parse(this.responseText);
- //console.log(data);
- vis_1_billeder(0);
- // var x, txt='', id;
- // for (x =0, lng=data.length; x<lng; x++)
- // { txt +='gallery/'+ data[x].name + "<br>";
- // }
- // document.getElementById("demo2").innerHTML = txt;
- }
- }
- xhttp.send();
- }
- function vis_1_billeder(y){
- document.getElementById("prev").style.opacity = 1;
- document.getElementById("next").style.opacity = 1;
- document.getElementById("prev").style.color = "white";
- document.getElementById("next").style.color = "white";
- console.log(data.length);
- if(y == 0){ x = 0};
- if(y == 1){x--};
- if(y == 2){x++};
- if(x>(data.length-1))
- { x--;}
- if(x<=0)
- { document.getElementById("prev").style.opacity = 0;
- x=0;
- }
- if(x>=(data.length-1)){document.getElementById("next").style.opacity = 0;}
- console.log('X i linie 61 er = ' +x);console.log(data);
- var tekst = data[x].desc;
- var sti ='<img src="gallery/'+data[x].name+'"alt="'+data[x].alt+'"style="display:block;">';
- console.log('TEKST er = '+ tekst +' og X er '+x);
- document.getElementById("desc").innerHTML = tekst;
- document.getElementById("img").innerHTML = sti;
- }
- showCustomer(str);
- </script>
- </head>
- <body >
- <div class="box1 ">
- <h1 class="fs20 header sr"><?=$header_text;?></h1>
- <div class="slider ">
- <div class="myslide fade " id="img"></div>
- <a class="prev" id="prev" onclick="vis_1_billeder(1)">❮</a>
- <a class="next" id="next" onclick="vis_1_billeder(2)">❯</a>
- <div class="desc fs18" id="desc"></div>
- <button class="afslut fs16" onClick="window.location='index.php'">Afslut</button><!-- ↩-->
- <div class="footer center fs16">
- <a href="mailto:admin@api-it.dk">Designet af API-IT.DK</a>
- </div>
- </div>
- </div>
- </body>
- </html>
- slider.css
- *{
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-family: sans-serif;
- }
- .box1
- { width:100%;
- max-width:800px;
- margin: 0 auto;
- }
- .header
- { width: 100%;
- position: absolute;
- margin-top: 0px;
- z-index: 2;
- }
- .slider
- { position: relative;
- width: 100%;
- background: #efefef;
- }
- .myslide
- { top:0;
- height: auto;
- display: block;
- overflow: hidden;
- z-index: -1;
- }
- .prev, .next
- { position: absolute;
- top: 50%;
- transform: translate(0, +50%);
- font-size: 50px;
- padding: 0 5px;
- cursor: pointer;
- color: #fff;
- /*transition: 0.1s;*/
- user-select: none;
- background-color:transparent;
- }
- .next
- { right: 0;
- }
- .prev:hover, .next:hover
- { background-color:transparent;
- color: #000;
- font-size: 55px;
- }
- .desc
- { position: absolute;
- transform: translate(0, -50%);
- cursor: pointer;
- color: #fff;
- transition: 0.1s;
- background-color:transparent;
- bottom: 30px;
- border:none;
- width: 100%;
- text-align: center;
- margin:15px;
- }
- .afslut
- { position: absolute;
- transform: translate(0, -50%);
- font-size: 30px;
- cursor: pointer;
- color: #fff;
- transition: 0.1s;
- background-color:transparent;
- bottom: -10px;
- border:none;
- width:100%;
- margin:10px;
- }
- .afslut:hover
- { background-color: transparent;
- }
- .footer
- { color:#ffffff;
- margin-top:-30px;
- z-index: 2;
- }
- .footer a
- { color:#ffffff;
- background-color: transparent;
- }
- init.css
- body
- { width: 100%;
- max-width:700px;
- margin:0px auto;
- }
- .box1 h1
- { width:100%;
- max-width:700px;
- margin: 0 auto;
- text-align:center;
- }
- .container h1
- { width:100%;
- max-width:700px;
- margin: 0 auto;
- text-align:center;
- }
- h1
- { margin-top:5%;
- font-size:50px;
- width:100px;
- text-align:center;
- margin: 0 auto;
- }
- .h2
- { text-align:center;
- margin-top:20px;
- }
- .fs64
- { font-size: 64px;
- }
- .fs48
- { font-size: 48px;
- }
- .fs36
- { font-size: 36px;
- }
- .fs30
- { font-size: 30px;
- }
- .fs25
- { font-size: 25px;
- }
- .fs22
- { font-size: 22px;
- }
- .fs20
- { font-size: 20px;
- }
- .fs18
- { font-size: 18px;
- }
- .fs16
- { font-size: 16px;
- }
- .fs14
- { font-size: 14px;
- }
- /*////BAGGRUNDSFARVER//////////////////////////////////////*/
- .farve
- { background-color: #efefef;
- }
- .farve2
- { background-color: #dddddd;
- }
- .groen
- { background-color: #00cc33;
- }
- .graa
- { background-color:#ccc
- }
- .hvid
- { background-color:#fff
- }
- /*//////TEKST FARVE///////////////////////////////////////*/
- .roed
- { color: #ff3333
- }
- .sort
- { color:black;
- }
- .blaa
- { color:blue;
- }
- .gul
- { background-color: #ffff99
- }
- /*///RAMMER////////////////////////////////////////////////////*/
- .gr
- { border: solid 2px green;
- }
- .rr
- { border: solid 1px red
- }
- .br
- { border:1px solid blue;
- }
- .yr
- { border:1px solid yellow;
- }
- .sr
- { border:1px solid black;
- border-radius:7px;
- }
- .sr2
- { border:2px solid black;
- border-radius:7px;
- }
- .fed
- { font-weight: bold;
- }
- .line1px
- { height:1px;
- border:none;
- width:99%;
- float:left;
- }
- .line2px
- { height:2px;
- border:none;
- width:99%;
- float:left;
- }
- .line5px
- { height:5px;
- border:none;
- width:99%;
- float:left;
- }
- .line10px
- { height:10px;
- border:none;
- width:99%;
- float:left;
- }
- .top
- { margin-top: 10px;
- }
- .bund
- { margin-bottom: 10px;
- }
- .center
- { text-align:center;
- }
- a:link{color:black; text-decoration:none}
- a:visited{ color:white; text-decoration:none}
- a:hover{font-weight:bold; background-color: transparent;}
Add Comment
Please, Sign In to add comment