1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
| <style> .wrapper { margin: 0 auto; padding:0; width: 700px; min-width: 100px; } .tagbubble { position: relative; margin-top: 300px; } .tagbubble a { display: block; border-radius: 50%; color: #fff; font-weight: bold; font-size: 14px; text-decoration: none; text-align: center; }
.b0{ width: 95px; height: 90px; line-height: 90px; } .b1{ width: 70px; height: 70px; line-height: 55px; } .b2{ width: 60px; height: 60px; line-height: 60px; } .b3{ width: 45px; height: 45px; line-height: 40px; }
.c0{ background: -moz-linear-gradient(top, #d1e5fd 0%, #3d86f4 100%); background: -webkit-linear-gradient(top, #d1e5fd 0%,#3d86f4 100%); background: -o-linear-gradient(top, #d1e5fd 0%,#3d86f4 100%); background: -ms-linear-gradient(top, #d1e5fd 0%,#3d86f4 100%); background: linear-gradient(to bottom, #d1e5fd 0%,#3d86f4 100%); } .c1{ background: -moz-linear-gradient(top, #b9f8ff 0%, #1de7ff 100%); background: -webkit-linear-gradient(top, #b9f8ff 0%,#1de7ff 100%); background: -o-linear-gradient(top, #b9f8ff 0%,#1de7ff 100%); background: -ms-linear-gradient(top, #b9f8ff 0%,#1de7ff 100%); background: linear-gradient(to bottom, #b9f8ff 0%,#1de7ff 100%); } .c2{ background: -moz-linear-gradient(top, #fff4e2 0%, #ffd79c 100%); background: -webkit-linear-gradient(top, #fff4e2 0%,#ffd79c 100%); background: -o-linear-gradient(top, #fff4e2 0%,#ffd79c 100%); background: -ms-linear-gradient(top, #fff4e2 0%,#ffd79c 100%); background: linear-gradient(to bottom, #fff4e2 0%,#ffd79c 100%); } .c3{ background: -moz-linear-gradient(top, #fef4fa 0%, #fbbae0 100%); background: -webkit-linear-gradient(top, #fef4fa 0%,#fbbae0 100%); background: -o-linear-gradient(top, #fef4fa 0%,#fbbae0 100%); background: -ms-linear-gradient(top, #fef4fa 0%,#fbbae0 100%); background: linear-gradient(to bottom, #fef4fa 0%,#fbbae0 100%); } .c4{ background: -moz-linear-gradient(top, #fedc90 0%, #ffb515 100%); background: -webkit-linear-gradient(top, #fedc90 0%,#ffb515 100%); background: -o-linear-gradient(top, #fedc90 0%,#ffb515 100%); background: -ms-linear-gradient(top, #fedc90 0%,#ffb515 100%); background: linear-gradient(to bottom, #fedc90 0%,#ffb515 100%); } .c5{ background: -moz-linear-gradient(top, #bcf7ca 0%, #1fda4b 100%); background: -webkit-linear-gradient(top, #bcf7ca 0%,#1fda4b 100%); background: -o-linear-gradient(top, #bcf7ca 0%,#1fda4b 100%); background: -ms-linear-gradient(top, #bcf7ca 0%,#1fda4b 100%); background: linear-gradient(to bottom, #bcf7ca 0%,#1fda4b 100%); } .c6{ background: -moz-linear-gradient(top, #f7cdf8 0%, #db43e7 100%); background: -webkit-linear-gradient(top, #f7cdf8 0%,#db43e7 100%); background: -o-linear-gradient(top, #f7cdf8 0%,#db43e7 100%); background: -ms-linear-gradient(top, #f7cdf8 0%,#db43e7 100%); background: linear-gradient(to bottom, #f7cdf8 0%,#db43e7 100%); }
@media (max-width: 767px){ .wrapper { width: 10px; margin-left:20px; min-width: 0px; } .tagbubble{ width: 300px; min-width: 0px; margin-top: 200px; margin-left: 10px; } .tagbubble a { font-size: 13px; } .b0{ width: 65px; height: 65px; line-height: 60px; } .b1{ width: 50px; height: 50px; line-height: 45px; } .b2{ width: 40px; height: 40px; line-height: 40px; } .b3{ width: 35px; height: 35px; line-height: 35px; } }
</style>
<div class="wrapper"> <div class="tagbubble">
</div> </div> <script type="text/javascript">
var alltags = document.getElementsByClassName('tag-cloud-tags'); var tags = alltags[0].getElementsByTagName('a');
var bo = new Array(); var co = new Array(); for(var i=0;i<4;i++){ bo.push("b" + i); } for(var i=0;i<7;i++){ co.push("c" + i); }
var divDom = document.querySelector('.tagbubble') for(var i=0;i<tags.length;i++){ var atag = document.createElement('a'); var boStyle = bo[Math.floor(Math.random()*4)]; var coStyle = co[Math.floor(Math.random()*7)]; if(tags[i].innerText.length > 10){ boStyle = "b0"; }else if(tags[i].innerText.length > 5 && tags[i].innerText.length < 10){ boStyle = "b1"; } atag.setAttribute("class", boStyle+" "+coStyle); atag.setAttribute("href", tags[i].href); atag.innerText = tags[i].innerText; divDom.appendChild(atag); }
function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsAndroid = sUserAgent.match(/android/i) == "android"; var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { return 80; } else { return 150; } }
var tagRadius = browserRedirect();
tagcloud({ selector: ".tagbubble", fontsize: 14, radius: tagRadius, mspeed: "slow", ispeed: "slow", direction: 135, keep: false }); </script>
|