File: position-css-classes.html

package info (click to toggle)
node-pikaday 1.8.2%2B~1.7.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 484 kB
  • sloc: javascript: 1,226; makefile: 8
file content (124 lines) | stat: -rw-r--r-- 4,380 bytes parent folder | download | duplicates (3)
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
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    <title>Pikaday alignment CSS-classes example</title>
    <meta name="author" content="Maxime Thirouin">
    <link rel="stylesheet" href="../css/pikaday.css">
    <link rel="stylesheet" href="../css/site.css">
</head>
<body>
    <a href="https://github.com/Pikaday/Pikaday">Pikaday source on GitHub</a>

    <h1>Pikaday alignment CSS-classes example</h1>

    <p class="large">A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS.</p>

    <label for="datepicker">Dates:</label>

    <input type="text" id="datepicker-topleft"     value=".left-aligned & .top-aligned"     style="display: block; margin: 20px; position: absolute;">
    <input type="text" id="datepicker-topright"    value=".right-aligned & .bottom-aligned" style="display: block; margin: 20px; position: absolute; right: 20px;">
    <input type="text" id="datepicker-bottomleft"  value=".left-aligned & .top-aligned"     style="display: block; margin: 20px; position: fixed; bottom: 150px;">
    <input type="text" id="datepicker-bottomright" value=".right-aligned & .top-aligned"    style="display: block; margin: 20px; position: fixed; bottom: 150px; right: 20px">

    <h2 style="margin-top: calc( 100vh - 275px )">What is this?</h2>

    <p>Since version 1.0 Pikaday is a stable and battle tested date-picker. Feel free to use it however you like but please report any bugs or feature requests to the <a href="https://github.com/Pikaday/Pikaday/issues">GitHub issue tracker</a>, thanks!</p>

    <p class="small">Copyright © 2014 <a href="https://dbushell.com/">David Bushell</a> | BSD &amp; MIT license | Example by <a href="https://github.com/rubenswieringa">Ruben Swieringa</a></p>


    <script src="../pikaday.js"></script>
    <script>
        new Pikaday({ field: document.getElementById( 'datepicker-topleft' )});
        new Pikaday({ field: document.getElementById( 'datepicker-topright' )});
        new Pikaday({ field: document.getElementById( 'datepicker-bottomleft' )});
        new Pikaday({ field: document.getElementById( 'datepicker-bottomright' )});
    </script>

    <style>

        input[type=text] {
          width: 166px;
          border: 1px solid #ccc;
          box-shadow: 0px 3px 7px 0 rgba(0,0,0,0.15);
        }

        .pika-single.top-aligned {
          transform: translateY( -22px );
        }

        .pika-single.bottom-aligned {
          transform: translateY( 22px );
        }

        .pika-single:before,
        .pika-single:after {
          content: '';
          display: block;
          position: absolute;
          border-color: transparent;
          border-style: solid;
          border-width: 18px 22px;
          width: 0;
          height: 0;
          animation-duration: 1200ms;
          animation-direction: alternate;
          animation-iteration-count: infinite;
          animation-timing-function: ease-in-out;
        }

        .pika-single:after {
          border-width: 16px 19px;
          margin: 0 1px;
        }

        .pika-single.top-aligned:before,
        .pika-single.top-aligned:after {
          top: 100%;
          border-bottom: none;
          animation-name: pulsate-top-border;
        }

        .pika-single.top-aligned:before {
          border-top-color: inherit;
        }

        .pika-single.top-aligned:after {
          border-top-color: white;
        }

        .pika-single.bottom-aligned:before,
        .pika-single.bottom-aligned:after {
          bottom: 100%;
          border-top: none;
          animation-name: pulsate-bottom-border;
        }

        .pika-single.bottom-aligned:before {
          border-bottom-color: inherit;
        }

        .pika-single.bottom-aligned:after {
          border-bottom-color: white;
        }

        .pika-single.left-aligned:before,
        .pika-single.left-aligned:after {
          border-left: none;
          left: 18px;
        }

        .pika-single.right-aligned:before,
        .pika-single.right-aligned:after {
          border-right: none;
          right: 18px;
        }

        @keyframes pulsate-top-border    { to { border-top-color: #e33; }}
        @keyframes pulsate-bottom-border { to { border-bottom-color: #e33; }}

    </style>
</body>
</html>