|
| 1 | +<div id='sepiaFW-frame-carousel' class="sepiaFW-inner-container sepiaFW-carousel"> |
| 2 | +<style> |
| 3 | + #sepiaFW-frame-page-1 { |
| 4 | + background-color: #00a99e; |
| 5 | + } |
| 6 | + .clock-widget { |
| 7 | + position: relative; |
| 8 | + height: 200px; |
| 9 | + width: 200px; |
| 10 | + background: white; |
| 11 | + box-sizing: border-box; |
| 12 | + border-radius: 100%; |
| 13 | + border: 10px solid #67d2c8; |
| 14 | + position: absolute; |
| 15 | + top: 0; |
| 16 | + left: 0; |
| 17 | + right: 0; |
| 18 | + bottom: 0; |
| 19 | + margin: auto; |
| 20 | + cursor: pointer; |
| 21 | + } |
| 22 | + .clock-widget .clock-tick-top, |
| 23 | + .clock-widget .clock-tick-right, |
| 24 | + .clock-widget .clock-tick-bottom, |
| 25 | + .clock-widget .clock-tick-left { |
| 26 | + position: absolute; |
| 27 | + background: #262626; |
| 28 | + margin: auto; |
| 29 | + } |
| 30 | + .clock-widget .clock-tick-top { |
| 31 | + width: 3px; |
| 32 | + height: 8px; |
| 33 | + top: 0; |
| 34 | + left: 0; |
| 35 | + right: 0; |
| 36 | + } |
| 37 | + .clock-widget .clock-tick-right { |
| 38 | + width: 8px; |
| 39 | + height: 3px; |
| 40 | + top: 0; |
| 41 | + bottom: 0; |
| 42 | + right: 0; |
| 43 | + } |
| 44 | + .clock-widget .clock-tick-bottom { |
| 45 | + width: 3px; |
| 46 | + height: 8px; |
| 47 | + left: 0; |
| 48 | + right: 0; |
| 49 | + bottom: 0; |
| 50 | + } |
| 51 | + .clock-widget .clock-tick-left { |
| 52 | + width: 8px; |
| 53 | + height: 3px; |
| 54 | + top: 0; |
| 55 | + bottom: 0; |
| 56 | + left: 0; |
| 57 | + } |
| 58 | + .clock-widget .clock-face { |
| 59 | + height: 6px; |
| 60 | + width: 6px; |
| 61 | + position: absolute; |
| 62 | + left: 0; |
| 63 | + right: 0; |
| 64 | + top: 0; |
| 65 | + bottom: 0; |
| 66 | + margin: auto; |
| 67 | + background: #262626; |
| 68 | + border-radius: 100%; |
| 69 | + } |
| 70 | + .clock-widget .clock-shadow { |
| 71 | + height: 200px; |
| 72 | + width: 200px; |
| 73 | + position: absolute; |
| 74 | + left: 60px; |
| 75 | + top: 60px; |
| 76 | + transform: rotate(135deg); |
| 77 | + background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1)); |
| 78 | + } |
| 79 | + .clock-widget .clock-digital, |
| 80 | + .clock-widget .clock-date { |
| 81 | + position: absolute; |
| 82 | + bottom: 32px; |
| 83 | + left: 0; |
| 84 | + width: 100%; |
| 85 | + text-align: center; |
| 86 | + font-weight: bold; |
| 87 | + opacity: 0; |
| 88 | + transition: opacity 2s; |
| 89 | + } |
| 90 | + .clock-widget .clock-date { |
| 91 | + top: 32px; |
| 92 | + bottom: unset; |
| 93 | + } |
| 94 | + .clock-widget .clock-digital.visible, |
| 95 | + .clock-widget .clock-date.visible { |
| 96 | + opacity: 1; |
| 97 | + } |
| 98 | + .clock-widget .clock-hour { |
| 99 | + width: 3px; |
| 100 | + height: 100%; |
| 101 | + position: absolute; |
| 102 | + left: 0; |
| 103 | + right: 0; |
| 104 | + margin: 0 auto; |
| 105 | + transition: transform .75s; |
| 106 | + } |
| 107 | + .clock-widget .clock-hour:before { |
| 108 | + position: absolute; |
| 109 | + content: ""; |
| 110 | + background: #262626; |
| 111 | + height: 40px; |
| 112 | + width: 3px; |
| 113 | + top: 50px; |
| 114 | + } |
| 115 | + .clock-widget .clock-minute { |
| 116 | + width: 2px; |
| 117 | + height: 100%; |
| 118 | + position: absolute; |
| 119 | + left: 0; |
| 120 | + right: 0; |
| 121 | + margin: 0 auto; |
| 122 | + transition: transform .75s; |
| 123 | + } |
| 124 | + .clock-widget .clock-minute:before { |
| 125 | + position: absolute; |
| 126 | + content: ""; |
| 127 | + background: #262626; |
| 128 | + height: 60px; |
| 129 | + width: 2px; |
| 130 | + top: 30px; |
| 131 | + } |
| 132 | + .clock-widget .clock-second { |
| 133 | + width: 2px; |
| 134 | + height: 100%; |
| 135 | + position: absolute; |
| 136 | + left: 0; |
| 137 | + right: 0; |
| 138 | + margin: 0 auto; |
| 139 | + /*animation: time 60s infinite linear;*/ |
| 140 | + transition: transform .75s; |
| 141 | + } |
| 142 | + .clock-widget .clock-second:before { |
| 143 | + position: absolute; |
| 144 | + content: ""; |
| 145 | + background: #fd1111; |
| 146 | + height: 45px; |
| 147 | + width: 2px; |
| 148 | + top: 45px; |
| 149 | + } |
| 150 | + /*@keyframes time { |
| 151 | + to { transform: rotate(360deg); } |
| 152 | + }*/ |
| 153 | +</style> |
| 154 | + <div class='sepiaFW-carousel-pane-container'> |
| 155 | + <!-- Page 1 --> |
| 156 | + <div id="sepiaFW-frame-page-1" class='sepiaFW-frames-page sepiaFW-carousel-pane'> |
| 157 | + <div class="clock-widget"> |
| 158 | + <div class="clock-tick-top"></div> |
| 159 | + <div class="clock-tick-right"></div> |
| 160 | + <div class="clock-tick-bottom"></div> |
| 161 | + <div class="clock-tick-left"></div> |
| 162 | + <div class="clock-face"></div> |
| 163 | + <div class="clock-shadow"></div> |
| 164 | + <div class="clock-date"></div> |
| 165 | + <div class="clock-digital"></div> |
| 166 | + <div class="clock-hour"></div> |
| 167 | + <div class="clock-minute"></div> |
| 168 | + <div class="clock-second"></div> |
| 169 | + </div> |
| 170 | + </div> |
| 171 | + </div> |
| 172 | +</div> |
| 173 | +<div id="sepiaFW-frames-nav-bar" class='sepiaFW-layer-header'> |
| 174 | + <button id="sepiaFW-frames-close" class="entry icon-button"> |
| 175 | + <i class="material-icons md-btn2">close</i> |
| 176 | + </button> |
| 177 | + <button id="sepiaFW-frames-mic" class="entry icon-button"> |
| 178 | + <i class="material-icons md-btn2">mic</i> |
| 179 | + </button> |
| 180 | + <!--<button id="sepiaFW-frames-show-prev-page" class='entry'> |
| 181 | + <i class="material-icons md-btn2">keyboard_arrow_left</i><span data-localize="back">back</span> |
| 182 | + </button> |
| 183 | + <button id="sepiaFW-frames-show-next-page" class='entry'> |
| 184 | + <span data-localize="next">next</span><i class="material-icons md-btn2">keyboard_arrow_right</i> |
| 185 | + </button>--> |
| 186 | + <div id="sepiaFW-frames-nav-bar-page-indicator"><div> </div></div> |
| 187 | +</div> |
| 188 | +<script> |
| 189 | + //INFO: This is a very simple custom view. To learn more visit: |
| 190 | + //https://github.com/SEPIA-Framework/sepia-extensions |
| 191 | + |
| 192 | + $('#sepiaFW-frame-carousel').find('[data-localize]').each(function(){ |
| 193 | + $(this).html(SepiaFW.local.g(this.dataset.localize)); |
| 194 | + }); |
| 195 | + //Define scope |
| 196 | + SepiaFW.frames.currentScope = { |
| 197 | + //Theme |
| 198 | + theme: "dark flat", |
| 199 | + |
| 200 | + //Load scope (default method, kind of like a 'onDocumentReady') |
| 201 | + load: function(){ |
| 202 | + $('#sepiaFW-frames-mic').attr('class', 'entry icon-button'); //start clean |
| 203 | + |
| 204 | + //Code Pen: https://codepen.io/MyXoToD/pen/psLen |
| 205 | + //Code Pen Ref.: http://dribbble.com/shots/1015985-Clock |
| 206 | + //Tweaks and Javascript: FQ / bytemind.de |
| 207 | + |
| 208 | + var $container = $('#sepiaFW-frame-page-1').find(".clock-widget").first(); |
| 209 | + var hour = $container.find(".clock-hour")[0]; |
| 210 | + var minute = $container.find(".clock-minute")[0]; |
| 211 | + var second = $container.find(".clock-second")[0]; |
| 212 | + |
| 213 | + var digital = $container.find(".clock-digital")[0]; |
| 214 | + var date = $container.find(".clock-date")[0]; |
| 215 | + var dateTimer; |
| 216 | + |
| 217 | + $container.on("click", function(){ |
| 218 | + clearTimeout(dateTimer); |
| 219 | + date.classList.add("visible"); |
| 220 | + digital.classList.add("visible"); |
| 221 | + dateTimer = setTimeout(function(){ |
| 222 | + date.classList.remove("visible"); |
| 223 | + digital.classList.remove("visible"); |
| 224 | + }, 5000); |
| 225 | + }); |
| 226 | + |
| 227 | + setInterval(function(){ |
| 228 | + var d = new Date(); |
| 229 | + var s = d.getSeconds(); |
| 230 | + var m = d.getMinutes(); |
| 231 | + var h = d.getHours(); |
| 232 | + hour.style.transform = "rotate(" + Math.floor(360/12 * h) + "deg)"; |
| 233 | + minute.style.transform = "rotate(" + Math.floor((h * 360) + (360/60 * m)) + "deg)"; |
| 234 | + second.style.transform = "rotate(" + Math.floor((m * 360) + (360/60 * s)) + "deg)"; |
| 235 | + date.textContent = d.toLocaleDateString(); |
| 236 | + digital.textContent = d.toLocaleTimeString(); |
| 237 | + }, 1000); |
| 238 | + }, |
| 239 | + onOpen: function(){ |
| 240 | + |
| 241 | + }, |
| 242 | + |
| 243 | + //Animation state "listener" (listening, speaking, loading, idle, etc.) |
| 244 | + onAnimationStateChange: function(animState){ |
| 245 | + $('#sepiaFW-frames-mic').attr('class', 'entry icon-button state-' + animState); |
| 246 | + }, |
| 247 | + //Custom actions |
| 248 | + actionHandler: function(action){ |
| 249 | + console.error(action); |
| 250 | + } |
| 251 | + } |
| 252 | + SepiaFW.frames.currentScope.load(); |
| 253 | +</script> |
0 commit comments